guhongwei 2 lat temu
rodzic
commit
6d01177d09
1 zmienionych plików z 18 dodań i 33 usunięć
  1. 18 33
      pagesMy/order/info.vue

+ 18 - 33
pagesMy/order/info.vue

@@ -40,9 +40,7 @@
 										<view class="goods" v-for="(tag,indexs) in item.goods" :key="indexs">
 											<view class="goods_1">
 												<view class="url">
-													<image class="image"
-														:src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:tag.goods.goods.file[0].url"
-														mode=""></image>
+													<image class="image" :src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:tag.goods.goods.file[0].url" mode=""></image>
 												</view>
 												<view class="goodsname">
 													{{tag.goods.name}}
@@ -73,8 +71,7 @@
 												</view>
 											</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="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}}
@@ -121,9 +118,7 @@
 										<view v-if="item.is_set=='0'">
 											<view class="goods_1" v-for="(tag,indexc) in item.goods" :key="indexc">
 												<view class="url">
-													<image class="image"
-														:src="tag.file&&tag.file.length>0?tag.file[0].url:tag.goods.file[0].url"
-														mode="">
+													<image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:tag.goods.file[0].url" mode="">
 													</image>
 												</view>
 												<view class="goodsname">
@@ -140,9 +135,7 @@
 										</view>
 										<view class="goods_1" v-else>
 											<view class="url">
-												<image class="image"
-													:src="item.file&&item.file.length>0?item.file[0].url:item.goods.file[0].url"
-													mode="">
+												<image class="image" :src="item.file&&item.file.length>0?item.file[0].url:item.goods.file[0].url" mode="">
 												</image>
 											</view>
 											<view class="goodsname">
@@ -168,8 +161,7 @@
 											</view>
 										</view>
 										<view class="goods_2" v-if="item.gift.length>0">赠品</view>
-										<view class="goods_3" v-if="item.gift.length>0"
-											v-for="(tag,indexx) in item.gift" :key="indexx">
+										<view class="goods_3" v-if="item.gift.length>0" v-for="(tag,indexx) in item.gift" :key="indexx">
 											<view class="left">
 												<view class="name">
 													{{tag.goods_name}}
@@ -253,7 +245,6 @@
 			const that = this;
 			that.$set(that, `id`, e.id);
 			that.$set(that, `status`, e.status);
-			console.log(e.is_order);
 			that.$set(that, `is_order`, e.is_order);
 			await that.searchOther();
 			await that.search()
@@ -269,27 +260,21 @@
 				let res;
 				// 待付款
 				if (that.id) {
-					if (that.is_order) {
-						console.log('1');
+					if (JSON.parse(that.is_order)) {
+						res = await that.$api(`/order/${that.id}`);
 					} else {
-						console.log('2');
+						res = await that.$api(`/orderDetail/${that.id}`);
+					}
+					if (res.errcode == '0') {
+						let status = that.statusList.find(i => i.value == res.data.status)
+						if (status) res.data.zhStatus = status.label;
+						// 运费总数和商品总数相加
+						let total = 0;
+						for (let val of res.data?.total_detail) total = this.$plus(total, val.money)
+						res.data.goods_total = total
+						that.$set(that, `info`, res.data);
+						uni.hideLoading();
 					}
-					// if (that.is_order == true) {
-					// 	res = await that.$api(`/order/${that.id}`);
-					// } else if (that.is_order == false) {
-					// 	res = await that.$api(`/orderDetail/${that.id}`);
-					// }
-					// console.log(res);
-					// if (res.errcode == '0') {
-					// 	let status = that.statusList.find(i => i.value == res.data.status)
-					// 	if (status) res.data.zhStatus = status.label;
-					// 	// 运费总数和商品总数相加
-					// 	let total = 0;
-					// 	for (let val of res.data?.total_detail) total = this.$plus(total, val.money)
-					// 	res.data.goods_total = total
-					// 	that.$set(that, `info`, res.data);
-					// 	uni.hideLoading();
-					// }
 				}
 			},
 			// 查询其他信息