Prechádzať zdrojové kódy

调整product_list字段修改

junyuanz 4 rokov pred
rodič
commit
e2e4970e31

+ 3 - 2
packageUser/pages/user/comment/comment.js

@@ -180,11 +180,12 @@ Page({
     }
     var success = function (res) {
       wx.showToast({
-        title: '申请添加评论成功',
+        title: '添加评论成功',
         icon: 'none',
         duration: 2000
       })
-	  wx.navigateBack({ changed: true });
+	  setTimeout(function(){wx.navigateBack({ changed: true })},1500)
+	  
     }
     _request.$put(url, params, success)
   },

+ 13 - 0
packageUser/pages/user/orders/orders.js

@@ -34,6 +34,10 @@ Page({
       getApp().globalData.order = false
     }
 	
+	this.setData({
+	  list: [],
+	  tabChange: false
+	})
 	if (rid) {
 	  if (rid === 'unpay') {
 	    this.tabUnpay()
@@ -49,6 +53,7 @@ Page({
 	} else {
 	  this.getOrderList()
 	}
+	
   },
   tabAll: function () {
     if (this.data.type !== '') {
@@ -219,5 +224,13 @@ Page({
     return _request.share({
       sc: 'xcx_user_orders'
     })
+  },
+  toCommend:function(e){
+		let that = this;
+		let id = e.currentTarget.dataset.id;
+		let pid = e.currentTarget.dataset.pid;
+		wx.navigateTo({
+			url:'../comment/comment?id='+id+'&pid='+pid
+		})
   }
 })

+ 2 - 2
packageUser/pages/user/orders/orders.wxml

@@ -32,8 +32,8 @@
 			        </view>
               <!-- <currency wx:if="{{item.status == 'unpay' || item.pay_way == 'weixinpay'}}" symbol="¥" value="{{nitem.price}}"></currency><text style="color:#bbb"> <text wx:if="{{item.status == 'unpay' || item.pay_way == 'balance'}}"> <text wx:if="{{item.status == 'unpay'}}"> 或</text> {{nitem.price}}提货券</text></text><currency symbol="¥" value="{{nitem.price}}" ></currency><text class="order-info__point">(或{{nitem.price}}提货券)</text> -->
             <view class="order-info__count">x{{nitem.count}}</view>
-			<view wx:if="{{!nitem.commend}}" class="order-btn__black">
-				<navigator url="/packageUser/pages/user/comment/comment?id={{nitem.id}}&pid={{nitem.product_id}}" open-type="navigate">商品评论 </navigator>
+			<view wx:if="{{!nitem.commend}}" class="order-btn__black" catchtap="toCommend" data-id="{{nitem.id}}" data-pid="{{nitem.product_id}}">商品评论
+				<!-- <navigator url="/packageUser/pages/user/comment/comment?id={{nitem.id}}&pid={{nitem.product_id}}" open-type="navigate">商品评论 </navigator> -->
 			</view>
 			
           </view>

+ 2 - 0
packageUser/pages/user/orders/orders.wxss

@@ -126,6 +126,8 @@
   margin-top: 20rpx;
   margin-left: 20rpx;
   border-radius: 5rpx;
+  position: relative;
+  z-index: 999;
 }
 .order-btn__red {
   float: right;

+ 1 - 1
pages/pay/pay.js

@@ -84,7 +84,7 @@ Page({
       
       var total = 0;
   		for(var i in val.data.product_list){
-      	total = total + (val.data.product_list[i].price * val.data.product_list[i].order_count)
+      	total = total + (val.data.product_list[i].price * val.data.product_list[i].count)
       }
       
       that.setData({

+ 2 - 2
pages/pay/pay.wxml

@@ -24,7 +24,7 @@
     <view class="pay-project-content">
       <image class="pay-project-img" src="{{item.cover}}"></image>
       <view class="pay-project-info">
-        <text class="pay-project-title ellipsisLn">{{item.name}}</text>
+        <text class="pay-project-title ellipsisLn">{{item.product_name}}</text>
         <text class="pay-project-spec" wx:if="{{item.color_name || item.size_name}}">规格:{{item.color_name}} {{item.size_name}}</text>
         <view class="product-info">
           <view class="pay-project-price fl">
@@ -37,7 +37,7 @@
             <text class="pay-gray" wx:if="{{curPayway==='balance'}}"> {{item.price}}提货券</text> -->
           </view>
           <view class="fr product-count">
-            x{{item.order_count}}
+            x{{item.count}}
           </view>
           <view class="clean"></view>
         </view>