zs преди 2 години
родител
ревизия
faebe735ff
променени са 2 файла, в които са добавени 31 реда и са изтрити 40 реда
  1. 8 34
      pagesMy/order/index.vue
  2. 23 6
      pagesMy/order/info.vue

+ 8 - 34
pagesMy/order/index.vue

@@ -142,40 +142,7 @@
 				searchInfo: {},
 				tabs: {
 					active: '0',
-					menu: [ //菜单列表
-						{
-							title: '未支付',
-							active: '0'
-						},
-						{
-							title: '已支付',
-							active: '1'
-						},
-						{
-							title: '发货中',
-							active: '2'
-						},
-						{
-							title: '已收货',
-							active: '3'
-						},
-						{
-							title: '取消订单',
-							active: '-1'
-						},
-						{
-							title: '申请售后',
-							active: '-2'
-						},
-						{
-							title: '售后处理中',
-							active: '-3'
-						},
-						{
-							title: '售后结束',
-							active: '-4'
-						}
-					]
+					menu: []
 				},
 				list: [],
 				total: 0,
@@ -508,6 +475,13 @@
 				})
 				if (res.errcode == '0') {
 					that.$set(that, `statusList`, res.data);
+					var menu = res.data.map((item) => {
+						return {
+							title: item.label,
+							active: item.value
+						}
+					})
+					that.$set(that.tabs, `menu`, menu)
 				}
 			},
 			// 选择选项卡

+ 23 - 6
pagesMy/order/info.vue

@@ -23,7 +23,7 @@
 						</view>
 						<view class="two">
 							<view class="two_0">
-								<text>{{info.status=='0'?'待付款':info.status=='1'?'已支付':info.status=='-1'?'取消订单':info.status=='2'?'发货中':info.status=='-2'?'已退款':info.status=='3'?'已收货':info.status=='-3'?'申请售后':info.status=='-4'?'正在售后中':info.status=='-5'?'售后已结束':'未识别'}}</text>
+								<text>{{info.zhStatus||'未识别'}}</text>
 							</view>
 							<view class="two_1" v-if="info.status=='0'">
 								<view class="list" v-for="(item,index) in info.goods" :key="index">
@@ -113,7 +113,7 @@
 							</view>
 							<view class="four_1">
 								<text>订单状态</text>
-								<text>{{info.status=='0'?'待付款':info.status=='1'?'已支付':info.status=='-1'?'取消订单':info.status=='2'?'发货中':info.status=='-2'?'已退款':info.status=='3'?'已收货':info.status=='-3'?'申请售后':info.status=='-4'?'正在售后中':info.status=='-5'?'售后已结束':'未识别'}}</text>
+								<text>{{info.zhStatus||'未识别'}}</text>
 							</view>
 							<view class="four_1">
 								<text>下单时间</text>
@@ -141,14 +141,17 @@
 			return {
 				id: '',
 				status: '',
-				info: {}
+				info: {},
+				// 售后状态
+				statusList: [],
 			};
 		},
-		onLoad: function(e) {
+		onLoad: async function(e) {
 			const that = this;
 			that.$set(that, `id`, e.id);
 			that.$set(that, `status`, e.status);
-			that.search()
+			await that.searchOther();
+			await that.search()
 		},
 		onShow: function() {},
 		methods: {
@@ -166,10 +169,24 @@
 					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;
 					that.$set(that, `info`, res.data);
 					uni.hideLoading();
 				}
-			}
+			},
+			// 查询其他信息
+			async searchOther() {
+				const that = this;
+				let res;
+				// 查询状态
+				res = await that.$api(`/dictData`, 'GET', {
+					code: 'order_process'
+				})
+				if (res.errcode == '0') {
+					that.$set(that, `statusList`, res.data);
+				}
+			},
 		}
 	}
 </script>