zs 2 سال پیش
والد
کامیت
f61788ebfd
3فایلهای تغییر یافته به همراه111 افزوده شده و 51 حذف شده
  1. 17 5
      pages/market/index.vue
  2. 1 6
      pagesMy/order/index.vue
  3. 93 40
      pagesMy/order/info.vue

+ 17 - 5
pages/market/index.vue

@@ -42,7 +42,7 @@
 											<view class="img">
 												<image :src="getFile(gs)"></image>
 											</view>
-											<view class=" one_1" v-if="num==0"
+											<view class="one_1" v-if="num==0"
 												@click="toCommon('/pagesHome/order/detail',gs)">
 												<view class="name">{{gs.goods_name}}</view>
 												<view class="info">
@@ -50,9 +50,12 @@
 														<text>规格:{{gs.goodsSpec_name}}</text>
 													</view>
 												</view>
+												<view class="info">
+													<text v-if="gs.gift.length>0" class="gift">赠品</text>
+												</view>
 											</view>
 											<view class="money" v-if="num==0">
-												<view>¥{{gs.money}}</view>
+												<view>¥{{gs.price}}</view>
 												<view>x{{gs.num}}</view>
 											</view>
 											<view class="num" v-if="num==1">
@@ -326,7 +329,7 @@
 					for (const val of list) {
 						for (let s of val.goods) {
 							if (s.check == true) {
-								let total = that.$multiply(s.money, s.num);
+								let total = that.$multiply(s.price, s.num);
 								totalMoney += Number(total);
 							}
 						}
@@ -455,7 +458,7 @@
 				.content {
 					display: flex;
 					flex-direction: row;
-					padding: 3vw 0;
+					padding: 2vw 0;
 					font-size: var(--font16Size);
 					border-bottom: 1px dashed var(--fcColor);
 
@@ -476,7 +479,7 @@
 					}
 
 					.one_1 {
-						margin: 2.5vw;
+						margin: 0 2.5vw;
 						flex-grow: 1;
 
 						.info {
@@ -494,6 +497,15 @@
 									padding: 5px;
 								}
 							}
+
+							.gift {
+								margin: 2vw 0 0 0;
+								font-size: 12px;
+								color: #FFA500;
+								border: 1px solid #FFA500;
+								border-radius: 5px;
+								padding: 0 1vw;
+							}
 						}
 					}
 

+ 1 - 6
pagesMy/order/index.vue

@@ -37,8 +37,7 @@
 															<view class="specs">
 																{{tags.name}}
 															</view>
-															<text v-if="tags.gift.length>0"
-																@tap.stop="toGift(tags.gift)" class="gift">赠品</text>
+															<text v-if="tags.gift.length>0" class="gift">赠品</text>
 														</view>
 														<view class="market_3">
 															<view v-if="item.type=='0'" class="price">
@@ -297,10 +296,6 @@
 					url: `/pagesMy/order/info?id=${item._id}&status=${item.status}`
 				})
 			},
-			// 查看赠品
-			toGift(e) {
-				console.log(e);
-			},
 			// 取消订单-未支付
 			toCancel(e) {
 				const that = this;

+ 93 - 40
pagesMy/order/info.vue

@@ -33,26 +33,51 @@
 									</view>
 									<view class="list_2">
 										<view class="goods" v-for="(tag,indexs) in item.goods" :key="indexs">
-											<view class="url">
-												<image class="image"
-													:src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:''"
-													mode=""></image>
-											</view>
-											<view class="goodsname">
-												{{tag.goods.name}}
-												<view class="specs">
-													{{tag.name}}
+											<view class="goods_1">
+												<view class="url">
+													<image class="image"
+														:src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:''"
+														mode=""></image>
 												</view>
-											</view>
-											<view class="goodsother">
-												<view v-if="info.type=='0'" class="price">
-													¥{{tag.price}}
+												<view class="goodsname">
+													{{tag.goods.name}}
+													<view class="specs">
+														{{tag.name}}
+													</view>
 												</view>
-												<view v-else class="price">
-													¥{{tag.group_config.money}}
+												<view class="goodsother">
+													<view v-if="info.type=='0'" class="price">
+														¥{{tag.price}}
+													</view>
+													<view v-else class="price">
+														¥{{tag.group_config.money}}
+													</view>
+													<view class="num">
+														×{{tag.buy_num}}
+													</view>
 												</view>
-												<view class="num">
-													×{{tag.buy_num}}
+											</view>
+											<view class="goods_2" v-if="tag.gift.length>0">赠品</view>
+											<view class="goods_3" v-if="tag.gift.length>0"
+												v-for="(tags,indexx) in tag.gift" :key="indexx">
+												<view class="left">
+													<view class="name">
+														{{tags.goods_name}}
+													</view>
+													<view class="Spec">
+														规格:{{tags.spec_name}}
+													</view>
+													<view class="Spec">
+														说明:{{tags.desc}}
+													</view>
+												</view>
+												<view class="right">
+													<view class="price">
+														¥{{tags.money||0}}
+													</view>
+													<view class="num">
+														×{{tags.num}}
+													</view>
 												</view>
 											</view>
 										</view>
@@ -190,9 +215,9 @@
 						// 优惠劵相减
 						total = that.$minus(total, discount_detail);
 					}
-					if (res.data?.act) {
+					if (res.data?.total_detail?.act) {
 						let act_total = 0;
-						for (let val of res.data.act) act_total = that.$plus(act_total, val.discount)
+						for (let val of res.data.total_detail.act) act_total = that.$plus(act_total, val.discount)
 						// 活动相减
 						total = that.$minus(total, act_total);
 					}
@@ -297,38 +322,66 @@
 							flex-direction: column;
 
 							.goods {
-								display: flex;
 								border-bottom: 1px dashed #f1f1f1;
 								padding: 2vw 0;
 
-								.url {
-									width: 20vw;
+								.goods_1 {
+									display: flex;
+
+									.url {
+										width: 20vw;
 
-									.image {
-										width: 100%;
-										height: 20vw;
-										border-radius: 5px;
+										.image {
+											width: 100%;
+											height: 20vw;
+											border-radius: 5px;
 
+										}
 									}
-								}
 
-								.goodsname {
-									display: flex;
-									flex-direction: column;
-									width: 60vw;
-									padding: 0 2vw;
-									font-size: 16px;
-
-									.specs {
-										color: var(--f85Color);
-										font-size: var(--font12Size);
+									.goodsname {
+										display: flex;
+										flex-direction: column;
+										width: 60vw;
+										padding: 0 2vw;
+										font-size: 16px;
+
+										.specs {
+											color: var(--f85Color);
+											font-size: var(--font12Size);
+										}
+
+									}
+
+									.goodsother {
+										width: 15vw;
+										text-align: right;
 									}
+								}
 
+								.goods_2 {
+									padding: 0 1vw 1vw 0;
+									font-size: var(--font14Size);
 								}
 
-								.goodsother {
-									width: 15vw;
-									text-align: right;
+								.goods_3 {
+									display: flex;
+									justify-content: space-between;
+									border: 1px solid var(--fcColor);
+									border-radius: 5px;
+									margin: 0 0 1vw 0;
+									padding: 1vw;
+
+									.left {
+										.name {
+											font-size: 14px;
+										}
+
+										.Spec {
+											font-size: var(--font12Size);
+											color: var(--f85Color);
+										}
+									}
 								}
 							}
 						}