Browse Source

小程序:商家端-商品添加api

panyong 2 years ago
parent
commit
78618af601

+ 12 - 1
htmldev/wxMini/pages/businessGoodsEdit/businessGoodsEdit.js

@@ -30,7 +30,9 @@ Page({
     },
     product_img_url_max: 1,
     product_rotation_img_list_max: 5,
-    product_detail_img_list_max: 5
+    product_detail_img_list_max: 5,
+    show: true,
+    columns: ['杭州', '宁波', '温州', '嘉兴', '湖州']
   },
 
   /**
@@ -119,6 +121,15 @@ Page({
       this.setData(tempForm)
     }
   },
+  onClose() {
+    this.setData({
+      show: false
+    })
+  },
+  onChange(event) {
+    const { picker, value, index } = event.detail
+    console.log(`当前值:${value}, 当前索引:${index}`)
+  },
   onSubmit(e) {
     console.log(e.detail)
   }

+ 3 - 1
htmldev/wxMini/pages/businessGoodsEdit/businessGoodsEdit.json

@@ -1,6 +1,8 @@
 {
   "usingComponents": {
-    "van-uploader": "@vant/weapp/uploader/index"
+    "van-uploader": "@vant/weapp/uploader/index",
+    "van-popup": "@vant/weapp/popup/index",
+    "van-picker": "@vant/weapp/picker/index"
   },
   "navigationBarTitleText": "产品编辑"
 }

+ 14 - 0
htmldev/wxMini/pages/businessGoodsEdit/businessGoodsEdit.wxml

@@ -139,3 +139,17 @@
     </form>
   </view>
 </view>
+
+<van-popup
+  show="{{ show }}"
+  close-on-click-overlay="{{false}}"
+  round
+  position="bottom"
+  bind:click-overlay="onClose"
+  bind:close="onClose">
+  <van-picker
+    columns="{{ columns }}"
+    show-toolbar
+    default-index="{{ 2 }}"
+    bind:change="onChange"/>
+</van-popup>