zs 2 سال پیش
والد
کامیت
7fa6bd4b9d
6فایلهای تغییر یافته به همراه54 افزوده شده و 37 حذف شده
  1. 2 1
      pagesHome/order/appraise.vue
  2. 4 1
      pagesHome/order/order.vue
  3. 2 1
      pagesMy/order/after.vue
  4. 37 31
      pagesMy/order/appraise.vue
  5. 9 2
      pagesMy/order/index.vue
  6. 0 1
      pagesMy/order/service.vue

+ 2 - 1
pagesHome/order/appraise.vue

@@ -190,7 +190,8 @@
 					...info,
 				})
 				if (res.errcode == '0') {
-					let list = [...that.list, ...res.data]
+					// let list = [...that.list, ...res.data]
+					let list = res.data;
 					for (let val of list) {
 						val.customer.phone = val.customer.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
 					}

+ 4 - 1
pagesHome/order/order.vue

@@ -301,7 +301,10 @@
 											}
 										},
 										fail(e) {
-											console.log('in fail');
+											uni.showToast({
+												title: `支付失败`,
+												icon: 'none'
+											})
 											uni.hideLoading();
 											uni.reLaunch({
 												url: `/pagesMy/order/index?status=${'0'}`

+ 2 - 1
pagesMy/order/after.vue

@@ -45,7 +45,8 @@
 										</view>
 									</view>
 									<view class="btn">
-										<button type="default" size="mini" @tap.stop="toCancel(item)">取消售后</button>
+										<button v-if="item.status=='0'||item.status=='1'" type="default" size="mini"
+											@tap.stop="toCancel(item)">取消售后</button>
 										<button v-if="item.type!='0'" type="default" size="mini"
 											@tap.stop="toRevise(item)">维护信息</button>
 									</view>

+ 37 - 31
pagesMy/order/appraise.vue

@@ -9,14 +9,14 @@
 					<uni-forms-item label="上传评论图片" name="file">
 						<upload :list="file" name="file" :count="6" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
 					</uni-forms-item>
-					<uni-forms-item v-if="!rate_id" label="商品评分" name="goods_score">
-						<uni-rate size="18" v-model="form.goods_score" />
+					<uni-forms-item label="商品评分" name="goods_score">
+						<uni-rate :readonly="readonly" size="18" v-model="form.goods_score" />
 					</uni-forms-item>
-					<uni-forms-item v-if="!rate_id" label="发货评分" name="transport_score">
-						<uni-rate size="18" v-model="form.transport_score" />
+					<uni-forms-item label="发货评分" name="transport_score">
+						<uni-rate :readonly="readonly" size="18" v-model="form.transport_score" />
 					</uni-forms-item>
-					<uni-forms-item v-if="!rate_id" label="店铺评分" name="shop_score">
-						<uni-rate size="18" v-model="form.shop_score" />
+					<uni-forms-item label="店铺评分" name="shop_score">
+						<uni-rate :readonly="readonly" size="18" v-model="form.shop_score" />
 					</uni-forms-item>
 				</uni-forms>
 				<view class="btn">
@@ -57,6 +57,7 @@
 						}]
 					}
 				},
+				readonly: false,
 			};
 		},
 		onLoad: function(e) {
@@ -84,30 +85,27 @@
 				const that = this;
 				that.$refs[ref].validate().then(async params => {
 					if (that.rate_id) {
-						let res = await that.$api(`/goodsRate/${that.rate_id}`);
-						if (res.errcode == '0') {
-							let reply = res.data;
-							let obj = {
-								file: that.file,
-								content: params.content,
-								time: moment().format('YYYY-MM-DD HH:mm:ss')
-							}
-							reply.reply.push(obj)
-							const arr = await that.$api(`/goodsRate/${that.rate_id}`, 'POST', reply)
-							if (arr.errcode == '0') {
-								uni.showToast({
-									title: `追加成功`,
-									icon: 'success',
-								});
-								uni.navigateBack({
-									detail: 1
-								})
-							} else {
-								uni.showToast({
-									title: arr.errmsg,
-									icon: 'none',
-								})
-							}
+						let reply = that.form;
+						let obj = {
+							file: that.file,
+							content: params.content,
+							time: moment().format('YYYY-MM-DD HH:mm:ss')
+						}
+						reply.reply.push(obj)
+						const arr = await that.$api(`/goodsRate/${that.rate_id}`, 'POST', reply)
+						if (arr.errcode == '0') {
+							uni.showToast({
+								title: `追加成功`,
+								icon: 'success',
+							});
+							uni.navigateBack({
+								detail: 1
+							})
+						} else {
+							uni.showToast({
+								title: arr.errmsg,
+								icon: 'none',
+							})
 						}
 					} else {
 						let reply = [{
@@ -160,13 +158,21 @@
 			async search() {
 				const that = this;
 				let user = that.user;
+				let res;
 				if (that.id) {
-					let res = await that.$api(`/orderDetail/${that.id}`);
+					res = await that.$api(`/orderDetail/${that.id}`);
 					if (res.errcode == '0') {
 						that.$set(that, `info`, res.data.order);
 						uni.hideLoading();
 					}
 				}
+				if (that.rate_id) {
+					res = await that.$api(`/goodsRate/${that.rate_id}`);
+					if (res.errcode == '0') {
+						that.$set(that, `form`, res.data);
+						that.$set(that, `readonly`, true)
+					}
+				}
 			},
 		}
 	}

+ 9 - 2
pagesMy/order/index.vue

@@ -192,7 +192,11 @@
 			// 监听用户是否登录
 			that.watchLogin();
 		},
-		onShow: function() {},
+		onShow: function() {
+			const that = this;
+			that.clearPage();
+			that.search();
+		},
 		methods: {
 			// 监听用户是否登录
 			watchLogin() {
@@ -336,7 +340,10 @@
 									that.search();
 								},
 								fail(e) {
-									console.log('in fail');
+									uni.showToast({
+										title: `支付失败`,
+										icon: 'none'
+									})
 									uni.hideLoading();
 									that.clearPage();
 									that.search();

+ 0 - 1
pagesMy/order/service.vue

@@ -175,7 +175,6 @@
 				const that = this;
 				let data = that.goodsList[e.detail.value];
 				if (data) {
-					console.log(data);
 					that.$set(that, `info`, data);
 					that.$set(that.form, `goods_id`, data._id);
 					that.$set(that.form, `goods_name`, data.name);