zzv123 2 éve
szülő
commit
6244521f1e

+ 17 - 0
pages/addtogood/addtogood.js

@@ -422,6 +422,16 @@ Page({
   },
   // 输入售价
   inputPrice(e) {
+    if(this.data.specifications[0].title == '统一规格') {
+      let specifications = this.data.specifications;
+      specifications[0].price = e.detail.value;
+      this.setData({
+        specifications,
+      })
+      this.setData({
+        specificationText: this.data.specifications[0].title + '/' + this.data.specifications[0].price + '加币',
+      })
+    }
     this.setData({
       price: e.detail.value
     })
@@ -906,6 +916,13 @@ Page({
             success() {
               setTimeout(()=>{
                 wx.setStorageSync('isReload', true)
+                if(wx.getStorageSync('obj')) {
+                  let obj = wx.getStorageSync('obj')
+                  obj.stock = that.data.stock;
+                  obj.price = that.data.price;
+                  obj.name = that.data.goodName;
+                  wx.setStorageSync('obj', obj)
+                }
                 wx.navigateBack()
               }, 1500)
             }

+ 21 - 1
pages/announce/announce.js

@@ -248,6 +248,18 @@ Page({
       })
       storageManager.set('subPageResult', null);
     }
+    if(wx.getStorageSync('obj')) {
+      let obj = wx.getStorageSync('obj');
+      console.log(obj);
+      let mockData = that.data.mockData;
+      mockData[obj.index].commodity_name = obj.name;
+      mockData[obj.index].price = obj.price;
+      mockData[obj.index].stock = obj.stock;
+      wx.removeStorageSync('obj');
+      that.setData({
+        mockData
+      })
+    }
   },
 
   /**
@@ -657,7 +669,15 @@ Page({
   // 编辑商品
   editGoods(e) {
     let index = e.currentTarget.dataset.index;
-    console.log(index);
+    let id = this.data.mockData[index].id;
+    let obj = {
+      index: index,
+      id: id
+    }
+    wx.setStorageSync('obj', obj);
+    wx.navigateTo({
+      url: '/pages/addtogood/addtogood?enterType=edit&id=' + id,
+    })
   },
   // 删除商品 
   deleteGoods() {

+ 1 - 1
pages/goodsbank/goodsbank.wxml

@@ -91,8 +91,8 @@
                 起购{{item.starting_purchase}}份
               </view>
               <view class="g-price" wx:if="{{item.help_sell === 0}}">
-                <view><text>C${{item.price}}</text></view>
                 <view><text>C${{item.scribe_price}}</text></view>
+                <view><text>C${{item.price}}</text></view>
               </view>
               <view class="g-price2" wx:if="{{item.type === 0}}">
                 <view style="line-height: 32rpx;">

+ 1 - 1
project.private.config.json

@@ -1,6 +1,6 @@
 {
   "setting": {
-    "compileHotReLoad": true,
+    "compileHotReLoad": false,
     "urlCheck": false,
     "useIsolateContext": false
   },