zs 2 年之前
父節點
當前提交
d1af5e4196
共有 2 個文件被更改,包括 26 次插入10 次删除
  1. 15 1
      pagesMy/order/index.vue
  2. 11 9
      pagesMy/order/info.vue

+ 15 - 1
pagesMy/order/index.vue

@@ -37,10 +37,12 @@
 															<view class="specs">
 																{{tags.name}}
 															</view>
+															<text v-if="tags.gift.length>0"
+																@tap.stop="toGift(tags.gift)" class="gift">赠品</text>
 														</view>
 														<view class="market_3">
 															<view v-if="item.type=='0'" class="price">
-																¥{{tags.sell_money}}
+																¥{{tags.price}}
 															</view>
 															<view v-else class="price">
 																¥{{tags.group_config.money}}
@@ -295,6 +297,10 @@
 					url: `/pagesMy/order/info?id=${item._id}&status=${item.status}`
 				})
 			},
+			// 查看赠品
+			toGift(e) {
+				console.log(e);
+			},
 			// 取消订单-未支付
 			toCancel(e) {
 				const that = this;
@@ -622,6 +628,14 @@
 												font-size: 14px;
 												color: #858585;
 											}
+
+											.gift {
+												font-size: 12px;
+												color: #FFA500;
+												border: 1px solid #FFA500;
+												border-radius: 5px;
+												padding: 0 1vw;
+											}
 										}
 
 										.market_3 {

+ 11 - 9
pagesMy/order/info.vue

@@ -46,7 +46,7 @@
 											</view>
 											<view class="goodsother">
 												<view v-if="info.type=='0'" class="price">
-													¥{{tag.sell_money}}
+													¥{{tag.price}}
 												</view>
 												<view v-else class="price">
 													¥{{tag.group_config.money}}
@@ -172,6 +172,8 @@
 					let status = that.statusList.find(i => i.value == res.data.status)
 					if (status) res.data.zhStatus = status.label;
 					// 计算优惠劵
+					// 运费总数和商品总数相加
+					let total = that.$plus(res.data.total_detail.freight_total, res.data.total_detail.goods_total)
 					if (res.data?.total_detail?.discount_detail) {
 						// 有优惠券
 						var key = Object.keys(res.data.total_detail.discount_detail);
@@ -185,16 +187,16 @@
 								}
 							}
 						}
-						// 运费总数和商品总数相加
-						let total = that.$plus(res.data.total_detail.freight_total, res.data.total_detail
-							.goods_total)
 						// 优惠劵相减
-						res.data.goods_total = that.$minus(total, discount_detail);
-					} else {
-						// 无优惠劵
-						res.data.goods_total = that.$plus(res.data.total_detail.freight_total, res.data.total_detail
-							.goods_total)
+						total = that.$minus(total, discount_detail);
 					}
+					if (res.data?.act) {
+						let act_total = 0;
+						for (let val of res.data.act) act_total = that.$plus(act_total, val.discount)
+						// 活动相减
+						total = that.$minus(total, act_total);
+					}
+					res.data.goods_total = total
 					that.$set(that, `info`, res.data);
 					uni.hideLoading();
 				}