Ver código fonte

Merge branch 'master' of http://git.cc-lotus.info/pointToNetwork/point-app

guhongwei 2 anos atrás
pai
commit
0f78a39e47
3 arquivos alterados com 58 adições e 24 exclusões
  1. 15 8
      pagesHome/exchange/index.vue
  2. 1 1
      pagesHome/shop/index.vue
  3. 42 15
      pagesMy/order/service.vue

+ 15 - 8
pagesHome/exchange/index.vue

@@ -47,14 +47,21 @@
 						if (res.confirm) {
 							const arr = await that.$api(`/userCoupon/getCoupon/${e._id}`, 'POST');
 							if (arr.errcode == '0') {
-								uni.showToast({
-									title: `领取成功`,
-									icon: 'none',
-									duration: 3000
-								})
-								uni.navigateBack({
-									detail: 1
-								})
+								if (arr.data) {
+									uni.showToast({
+										title: arr.data.msg,
+										icon: 'none',
+										duration: 2000
+									});
+								} else {
+									uni.showToast({
+										title: `领取成功`,
+										icon: 'none',
+										duration: 3000
+									})
+									that.clearPage();
+									that.search();
+								}
 							} else {
 								uni.showToast({
 									title: arr.errmsg,

+ 1 - 1
pagesHome/shop/index.vue

@@ -222,7 +222,7 @@
 					// 查询店铺信息
 					const res = await that.$api(`/shop/${that.id}`, 'GET');
 					if (res.errcode == '0') that.$set(that, `info`, res.data);
-					let arr = await that.$api(`/storeGoods/check`, `GET`, {
+					let arr = await that.$api(`/storeShop/check`, `GET`, {
 						customer: that.user._id,
 						shop: that.id
 					});

+ 42 - 15
pagesMy/order/service.vue

@@ -200,22 +200,49 @@
 			async onSubmit(ref) {
 				const that = this;
 				that.$refs[ref].validate().then(async params => {
-					params.file = that.icon;
-					params.order_detail = that.id;
-					const arr = await that.$api(`/afterSale`, 'POST', params);
-					if (arr.errcode == '0') {
-						uni.showToast({
-							title: `申请售后成功`,
-							icon: 'success',
-						});
-						uni.navigateBack({
-							detail: 1
-						})
+					if (params.type != '2') {
+						if (params.money) {
+							params.file = that.icon;
+							params.order_detail = that.id;
+							const arr = await that.$api(`/afterSale`, 'POST', params);
+							if (arr.errcode == '0') {
+								uni.showToast({
+									title: `申请售后成功`,
+									icon: 'success',
+								});
+								uni.navigateBack({
+									detail: 1
+								})
+							} else {
+								uni.showToast({
+									title: arr.errmsg,
+									icon: 'none',
+								})
+							}
+						} else {
+							uni.showToast({
+								title: `请输入退款金额`,
+								icon: 'none',
+							});
+						}
 					} else {
-						uni.showToast({
-							title: arr.errmsg,
-							icon: 'none',
-						})
+						params.file = that.icon;
+						params.order_detail = that.id;
+						const arr = await that.$api(`/afterSale`, 'POST', params);
+						if (arr.errcode == '0') {
+							uni.showToast({
+								title: `申请售后成功`,
+								icon: 'success',
+							});
+							uni.navigateBack({
+								detail: 1
+							})
+						} else {
+							uni.showToast({
+								title: arr.errmsg,
+								icon: 'none',
+							})
+						}
 					}
 				})
 			},