Browse Source

第一次提交

zhanghaoran 2 years ago
parent
commit
f041f4b134

+ 12 - 7
app.json

@@ -1,17 +1,22 @@
 {
-  "pages":[
+  "pages": [
+    "pages/ModifyProduct/ModifyProduct",
+    "pages/addProduct/addProduct",
     "pages/index/index",
     "pages/logs/logs"
   ],
-  "window":{
-    "backgroundTextStyle":"light",
+  "window": {
+    "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#fff",
     "navigationBarTitleText": "Weixin",
-    "navigationBarTextStyle":"black"
+    "navigationBarTextStyle": "black"
   },
   "usingComponents": {
-    "van-button": "@vant/weapp/button"
+    "van-button": "@vant/weapp/button",
+    "van-card": "@vant/weapp/card/index",
+    "van-image": "@vant/weapp/image/index",
+    "van-row": "@vant/weapp/row/index",
+    "van-col": "@vant/weapp/col/index"
   },
-  
   "sitemapLocation": "sitemap.json"
-}
+}

+ 66 - 0
pages/ModifyProduct/ModifyProduct.js

@@ -0,0 +1,66 @@
+// pages/ModifyProduct/ModifyProduct.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 9 - 0
pages/ModifyProduct/ModifyProduct.json

@@ -0,0 +1,9 @@
+{
+  "usingComponents": {
+    "van-card": "@vant/weapp/card/index",
+    "van-image": "@vant/weapp/image/index",
+    "van-row": "@vant/weapp/row/index",
+    "van-col": "@vant/weapp/col/index"
+  },
+  "navigationBarTitleText":"修改商品"
+}

+ 31 - 0
pages/ModifyProduct/ModifyProduct.wxml

@@ -0,0 +1,31 @@
+<!--index.wxml-->
+<view class="page">
+  <view class="card card_img">
+    <view class="tit">商品图片</view>
+    <image src="./spicyFood.png" class="food_img" mode="" />
+  </view>
+
+  <view class="card">
+    <view class="tit">商品名称</view>
+    <view class="line"></view>
+    <view class="desc">
+      麻辣烫重辣重麻
+    </view>
+  </view>
+
+  <view class="card_price">
+    <view class="tit">商品价格</view>
+    <view class="price">¥5.00</view>
+  </view>
+
+  <view class="card">
+    <view class="tit">商品内容</view>
+    <view class="line"></view>
+    <textarea value="麻辣烫中麻中辣"></textarea>
+  </view>
+
+  <view class="btn_wrap">
+    <view class="btn">保存</view>
+    <view class="btn btn2">提交</view>
+  </view>
+</view>

+ 76 - 0
pages/ModifyProduct/ModifyProduct.wxss

@@ -0,0 +1,76 @@
+/* pages/addProduct/addProduct.wxss */
+/**index.wxss**/
+.page{
+  background: #eee;
+  padding: 10px 0;
+}
+
+.card{
+  background: #fff;
+  padding: 15px;
+  margin-bottom: 10px;
+}
+.card_img{
+  display: flex;
+  justify-content: space-between;
+}
+
+.food_img{
+  width: 280px;
+  height: 100px;
+}
+
+.card .tit{
+  width: 100%;
+}
+.card .line{
+  width: 100%;
+  height: 1px;
+  background: #eee;
+  margin: 10px 0;
+}
+
+.desc{
+  color: #666;
+  font-size: 14px;
+}
+
+.card_price{
+  display: flex;
+  background: #fff;
+  padding: 15px;
+  margin-bottom: 10px;
+  justify-content: space-between;
+}
+.price{
+  color: red;
+}
+
+textarea{
+  border: 1px solid #ccc;
+  border-radius: 5px;
+  padding: 5px;
+  box-sizing: border-box;
+  width: 99%;
+  color: #666;
+  font-size: 14px;
+}
+
+.btn_wrap{
+  padding: 15px;
+  display: flex;
+  justify-content: space-between;
+}
+.btn{
+  width: 48%;
+  height: 40px;
+  line-height: 40px;
+  text-align: center;
+  background-color: #afafaf;
+  color: #fff;
+  border-radius: 30px;
+}
+
+.btn2{
+  background-color: #ff8e0a;
+}

BIN
pages/ModifyProduct/spicyFood.png


BIN
pages/addProduct/add.jpg


+ 66 - 0
pages/addProduct/addProduct.js

@@ -0,0 +1,66 @@
+// pages/addProduct/addProduct.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 4 - 0
pages/addProduct/addProduct.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"添加商品"
+}

+ 31 - 0
pages/addProduct/addProduct.wxml

@@ -0,0 +1,31 @@
+<!--index.wxml-->
+<view class="page">
+  <view class="card card_img">
+    <view class="tit">商品图片</view>
+    <image src="./add.jpg" class="food_img" mode="" />
+  </view>
+
+  <view class="card">
+    <view class="tit">商品名称</view>
+    <view class="line"></view>
+    <view class="desc">
+      请输入商品名称(1-10字符)
+    </view>
+  </view>
+
+  <view class="card_price">
+    <view class="tit">商品价格</view>
+    <view class="price">请输入商品价格</view>
+  </view>
+
+  <view class="card">
+    <view class="tit">商品内容</view>
+    <view class="line"></view>
+    <textarea value="麻辣烫中麻中辣"></textarea>
+  </view>
+
+  <view class="btn_wrap">
+    <view class="btn">保存</view>
+    <view class="btn btn2">提交</view>
+  </view>
+</view>

+ 77 - 0
pages/addProduct/addProduct.wxss

@@ -0,0 +1,77 @@
+/* pages/addProduct/addProduct.wxss */
+/**index.wxss**/
+.page{
+  background: #eee;
+  padding: 10px 0;
+}
+
+.card{
+  background: #fff;
+  padding: 15px;
+  margin-bottom: 10px;
+}
+.card_img{
+  display: flex;
+  justify-content: space-between;
+}
+
+.food_img{
+  width: 280px;
+  height: 100px;
+}
+
+.card .tit{
+  width: 100%;
+}
+.card .line{
+  width: 100%;
+  height: 1px;
+  background: #eee;
+  margin: 10px 0;
+}
+
+.desc{
+  color: #666;
+  font-size: 14px;
+}
+
+.card_price{
+  display: flex;
+  background: #fff;
+  padding: 15px;
+  margin-bottom: 10px;
+  justify-content: space-between;
+}
+.price{
+  color: #666;
+  font-size: 14px;
+}
+
+textarea{
+  border: 1px solid #ccc;
+  border-radius: 5px;
+  padding: 5px;
+  box-sizing: border-box;
+  width: 99%;
+  color: #666;
+  font-size: 14px;
+}
+
+.btn_wrap{
+  padding: 15px;
+  display: flex;
+  justify-content: space-between;
+}
+.btn{
+  width: 48%;
+  height: 40px;
+  line-height: 40px;
+  text-align: center;
+  background-color: #afafaf;
+  color: #fff;
+  border-radius: 30px;
+}
+
+.btn2{
+  background-color: #ff8e0a;
+}

+ 6 - 1
pages/index/index.wxml

@@ -21,5 +21,10 @@
     <text class="user-motto">{{motto}}</text>
   </view>
   <van-button type="primary">按钮</van-button>
+  <van-button type="default">默认按钮</van-button>
+  <van-button type="primary">主要按钮</van-button>
+  <van-button type="info">信息按钮</van-button>
+  <van-button type="warning">警告按钮</van-button>
+  <van-button type="danger">危险按钮</van-button>
 
-</view>
+</view>

+ 1 - 1
project.config.json

@@ -47,7 +47,7 @@
   },
   "compileType": "miniprogram",
   "libVersion": "2.19.4",
-  "appid": "wxf2ccb10daea97192",
+  "appid": "wxa4d74978f7ec4e2d",
   "projectname": "miniprogram-92",
   "condition": {},
   "editorSetting": {

+ 1 - 1
project.private.config.json

@@ -2,6 +2,6 @@
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
   "projectname": "miniprogram-business",
   "setting": {
-    "compileHotReLoad": false
+    "compileHotReLoad": true
   }
 }