wangyong 6 years ago
parent
commit
a532a9bea2
4 changed files with 14 additions and 8 deletions
  1. 8 2
      pages/buy/buy.js
  2. 4 4
      pages/index/index.wxml
  3. 1 1
      pages/orderCanvas/orderCanavs.js
  4. 1 1
      pages/orderList/orderList.js

+ 8 - 2
pages/buy/buy.js

@@ -735,8 +735,13 @@ Page({
                   dataList: dataList,
                   showNum: sumTotal,
                   commodityChannelPrice: res.data.data[0].product_channel_price,
-                  showPrice: res.data.data[0].product_channel_price,
+                  
                 })
+                if (that.data.loginStatic && res.data.data[0].product_channel_price){
+                  that.setData({
+                    showPrice: res.data.data[0].product_channel_price,
+                  })
+                }
                 loadingFlag++;
                 if (loadingFlag == 6) {
                   //组合sku
@@ -1162,7 +1167,8 @@ Page({
       var showNum = SKUResult[selectedIds.join('-')].product_repertory;//当前规格下的库存
       var showPrice = maxPrice > minPrice ? minPrice + "-" + maxPrice : maxPrice; //当前规格下的价格
       if(that.data.loginStatic){ // 表示是渠道价格
-        showPrice = SKUResult[selectedIds.join('-')].product_channel_price//当前规格下的渠道价格
+        console.log(SKUResult[selectedIds.join('-')].product_channel_price,"SKUResult[selectedIds.join('-')].product_channel_price")
+        showPrice = SKUResult[selectedIds.join('-')].product_channel_price[0] ? SKUResult[selectedIds.join('-')].product_channel_price : showPrice  //当前规格下的渠道价格
       }
       var num = this.data.minNumber;//当前数量
       if (num >= showNum){

+ 4 - 4
pages/index/index.wxml

@@ -150,8 +150,8 @@
                 <!-- <view class='goods-summry'>产品描述产品描述产品描述</view> -->
               </view>
               <view class='f-box'>
-                <view class='c-theme' wx:if="{{loginStatic && item.commodityChannelPrice}}">¥{{item.commodityChannelPrice}}</view>
-                <view class='c-theme f-item {{loginStatic && item.commodityChannelPrice ? "price-cancel" : ""}}'>¥{{item.commodity_sale}}</view>
+                <view class='c-theme' wx:if="{{loginStatic && item.commodity_channel_price}}">¥{{item.commodity_channel_price}}</view>
+                <view class='c-theme f-item {{loginStatic && item.commodity_channel_price ? "price-cancel" : ""}}'>¥{{item.commodity_sale}}</view>
               </view>
             </view>
           </view>
@@ -165,8 +165,8 @@
               <!-- <view class='goods-summary'></view> -->
               <view class='goods-title'>{{item.commodity_name}}</view>
               <view class='f-box'>
-                <view wx:if="{{item.commodityChannelPrice && loginStatic}}" class='c-theme'>¥{{item.commodityChannelPrice}}</view>
-                <view class='c-theme f-item {{item.commodityChannelPrice && loginStatic ? "price-cancel" : ""}}'>¥{{item.commodity_sale}}</view>
+                <view wx:if="{{item.commodity_channel_price && loginStatic}}" class='c-theme'>¥{{item.commodity_channel_price}}</view>
+                <view class='c-theme f-item {{item.commodity_channel_price && loginStatic ? "price-cancel" : ""}}'>¥{{item.commodity_sale}}</view>
               </view>
             </view>
           </view>

+ 1 - 1
pages/orderCanvas/orderCanavs.js

@@ -98,7 +98,7 @@ Page({
           },
           success(res) {
             console.log(res, '我上传完了')
-            if (res.data == 'success') {
+            if (res.data) {
               wx.showToast({
                 title: '支付凭证上传成功!',
                 icon: 'none'

+ 1 - 1
pages/orderList/orderList.js

@@ -128,7 +128,7 @@ Page({
         data.forEach(res=>{
           let total = 0;
           res.list_order_aff_data.forEach(el=>{
-            total += el.order_Price * 1
+            total += el.com_price * 1
           })
           res.com_price_total = total;
         })