zs 2 vuotta sitten
vanhempi
commit
9129f7eb85
2 muutettua tiedostoa jossa 33 lisäystä ja 23 poistoa
  1. 1 1
      pagesHome/order/detail.vue
  2. 32 22
      pagesMy/collection/shop.vue

+ 1 - 1
pagesHome/order/detail.vue

@@ -237,7 +237,7 @@
 		},
 		},
 		onLoad: async function(e) {
 		onLoad: async function(e) {
 			const that = this;
 			const that = this;
-			that.$set(that, `id`, e.id || '635e4b5b42e87c7a2880d0a8');
+			that.$set(that, `id`, e.id || '');
 			that.$set(that, `inviter`, e.inviter || '');
 			that.$set(that, `inviter`, e.inviter || '');
 			await that.searchConfig();
 			await that.searchConfig();
 			await that.search();
 			await that.search();

+ 32 - 22
pagesMy/collection/shop.vue

@@ -8,23 +8,27 @@
 				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 					<view class="list-scroll-view">
 					<view class="list-scroll-view">
 						<view class="two_1">
 						<view class="two_1">
-							<view :class="['list',condActive==index?'activeList':'']" v-for="(item,index) in condList" :key="index" @tap="toCond(index,item)">
+							<view :class="['list',condActive==index?'activeList':'']" v-for="(item,index) in condList"
+								:key="index" @tap="toCond(index,item)">
 								<view class="name" v-if="index!=2">
 								<view class="name" v-if="index!=2">
 									{{item.name}}
 									{{item.name}}
 								</view>
 								</view>
 								<view v-if="index==2" class="icon4">
 								<view v-if="index==2" class="icon4">
 									<view class="icon_1">
 									<view class="icon_1">
-										<text :class="['iconfont',item.shangActive]" v-if="condActive==index&&shang=='1'"></text>
+										<text :class="['iconfont',item.shangActive]"
+											v-if="condActive==index&&shang=='1'"></text>
 										<text :class="['iconfont',item.shang]" v-else></text>
 										<text :class="['iconfont',item.shang]" v-else></text>
 									</view>
 									</view>
 								</view>
 								</view>
 								<view v-else class="icon">
 								<view v-else class="icon">
 									<view class="icon_1">
 									<view class="icon_1">
-										<text :class="['iconfont',item.shangActive]" v-if="condActive==index&&shang=='1'"></text>
+										<text :class="['iconfont',item.shangActive]"
+											v-if="condActive==index&&shang=='1'"></text>
 										<text :class="['iconfont',item.shang]" v-else></text>
 										<text :class="['iconfont',item.shang]" v-else></text>
 									</view>
 									</view>
 									<view class="icon_1">
 									<view class="icon_1">
-										<text :class="['iconfont', item.xiaActive]" v-if="condActive==index&&xia=='-1'"></text>
+										<text :class="['iconfont', item.xiaActive]"
+											v-if="condActive==index&&xia=='-1'"></text>
 										<text :class="['iconfont', item.xia]" v-else></text>
 										<text :class="['iconfont', item.xia]" v-else></text>
 									</view>
 									</view>
 								</view>
 								</view>
@@ -262,25 +266,31 @@
 			async toDel(e) {
 			async toDel(e) {
 				const that = this;
 				const that = this;
 				let user = that.user;
 				let user = that.user;
-				if (user && user._id && e && e._id) {
-					let res = await that.$api(`/storeShop`, `POST`, {
-						customer: user._id,
-						shop: e._id
-					});
-					if (res.errcode == '0') {
-						uni.showToast({
-							title: res.data.msg,
-							icon: 'none'
-						})
-						that.clearPage();
-						that.search()
+				uni.showModal({
+					title: '提示',
+					content: '确定取消收藏吗?',
+					success: async function(res) {
+						if (res.confirm) {
+							const arr = await that.$api(`/storeShop`, 'POST', {
+								customer: user._id,
+								shop: e._id
+							});
+							if (arr.errcode == '0') {
+								uni.showToast({
+									title: '取消收藏成功',
+									icon: 'none'
+								})
+								that.clearPage();
+								that.search();
+							} else {
+								uni.showToast({
+									title: arr.errmsg,
+									icon: 'none'
+								})
+							}
+						}
 					}
 					}
-				} else {
-					uni.showToast({
-						title: '缺少必要信息,无法收藏',
-						icon: 'none'
-					})
-				}
+				});
 			},
 			},
 			// 清空列表
 			// 清空列表
 			clearPage() {
 			clearPage() {