guhongwei 2 years ago
parent
commit
0b7d7c2ffe

+ 5 - 6
pagesMy/address/add.vue

@@ -113,12 +113,11 @@
 		},
 		onShow: function() {
 			const that = this;
-			uni.getStorage({
-				key: 'system',
-				success: function(res) {
-					that.$set(that, `paltForm`, res.data.uniPlatform)
-				}
-			})
+			let config = that.$config;
+			if (config) {
+				// 账号平台
+				that.$set(that, `paltForm`, config.system.uniPlatform)
+			}
 		},
 		methods: {
 			// 监听用户是否登录

+ 72 - 78
pagesMy/collection/market.vue

@@ -8,27 +8,23 @@
 				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 					<view class="list-scroll-view">
 						<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!=4">
 									{{item.name}}
 								</view>
 								<view v-if="index==4" class="icon4">
 									<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>
 									</view>
 								</view>
 								<view v-else class="icon">
 									<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>
 									</view>
 									<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>
 									</view>
 								</view>
@@ -145,6 +141,12 @@
 			that.searchConfig();
 			that.watchLogin();
 		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
+		},
 		methods: {
 			// 查询基本设置
 			searchConfig() {
@@ -159,6 +161,67 @@
 					}
 				})
 			},
+			// 监听用户是否登录
+			watchLogin() {
+				const that = this;
+				uni.getStorage({
+					key: 'token',
+					success: function(res) {
+						let user = that.$jwt(res.data);
+						that.$set(that, `user`, user);
+						that.search()
+					},
+					fail: function(err) {
+						uni.reLaunch({
+							url: `/pages/login/index`
+						})
+					}
+				})
+			},
+			// 查询列表
+			async search() {
+				const that = this;
+				let user = that.user;
+				let info = {
+					skip: that.skip,
+					limit: that.limit
+				}
+				const res = await that.$api(`/storeGoods/userView`, 'GET', {
+					...info,
+					...that.searchInfo
+				})
+				if (res.errcode == '0') {
+					let list = [...that.list, ...res.data];
+					that.$set(that, `list`, list);
+					that.$set(that, `total`, res.total)
+				}
+			},
+			// 分页
+			toPage() {
+				const that = this;
+				let list = that.list;
+				let limit = that.limit;
+				if (that.total > list.length) {
+					uni.showLoading({
+						title: '加载中',
+						mask: true
+					})
+					let page = that.page + 1;
+					that.$set(that, `page`, page)
+					let skip = page * limit;
+					that.$set(that, `skip`, skip)
+					that.search();
+					uni.hideLoading();
+
+				} else that.$set(that, `is_bottom`, true)
+			},
+			toScroll(e) {
+				const that = this;
+				let up = that.scrollTop;
+				that.$set(that, `scrollTop`, e.detail.scrollTop);
+				let num = Math.sign(up - e.detail.scrollTop);
+				if (num == 1) that.$set(that, `is_bottom`, false);
+			},
 			// 输入框
 			toInput(e) {
 				const that = this;
@@ -249,67 +312,6 @@
 				that.clearPage();
 				that.search();
 			},
-			// 监听用户是否登录
-			watchLogin() {
-				const that = this;
-				uni.getStorage({
-					key: 'token',
-					success: function(res) {
-						let user = that.$jwt(res.data);
-						that.$set(that, `user`, user);
-						that.search()
-					},
-					fail: function(err) {
-						uni.reLaunch({
-							url: `/pages/login/index`
-						})
-					}
-				})
-			},
-			// 查询列表
-			async search() {
-				const that = this;
-				let user = that.user;
-				let info = {
-					skip: that.skip,
-					limit: that.limit
-				}
-				const res = await that.$api(`/storeGoods/userView`, 'GET', {
-					...info,
-					...that.searchInfo
-				})
-				if (res.errcode == '0') {
-					let list = [...that.list, ...res.data];
-					that.$set(that, `list`, list);
-					that.$set(that, `total`, res.total)
-				}
-			},
-			// 分页
-			toPage() {
-				const that = this;
-				let list = that.list;
-				let limit = that.limit;
-				if (that.total > list.length) {
-					uni.showLoading({
-						title: '加载中',
-						mask: true
-					})
-					let page = that.page + 1;
-					that.$set(that, `page`, page)
-					let skip = page * limit;
-					that.$set(that, `skip`, skip)
-					that.search();
-					uni.hideLoading();
-
-				} else that.$set(that, `is_bottom`, true)
-			},
-			toScroll(e) {
-				const that = this;
-				let up = that.scrollTop;
-				that.$set(that, `scrollTop`, e.detail.scrollTop);
-				let num = Math.sign(up - e.detail.scrollTop);
-				if (num == 1) that.$set(that, `is_bottom`, false);
-			},
 			// 清空列表
 			clearPage() {
 				const that = this;
@@ -319,15 +321,7 @@
 				that.$set(that, `page`, 0)
 			}
 		},
-		onPullDownRefresh: async function() {
-			const that = this;
-			that.$set(that, `list`, [])
-			that.$set(that, `skip`, 0)
-			that.$set(that, `limit`, 6)
-			that.$set(that, `page`, 0)
-			await that.search();
-			uni.stopPullDownRefresh();
-		}
+
 	}
 </script>
 

+ 59 - 64
pagesMy/collection/shop.vue

@@ -8,27 +8,23 @@
 				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 					<view class="list-scroll-view">
 						<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">
 									{{item.name}}
 								</view>
 								<view v-if="index==2" class="icon4">
 									<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>
 									</view>
 								</view>
 								<view v-else class="icon">
 									<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>
 									</view>
 									<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>
 									</view>
 								</view>
@@ -125,6 +121,12 @@
 			that.searchConfig();
 			that.watchLogin();
 		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
+		},
 		methods: {
 			// 查询基本设置
 			searchConfig() {
@@ -139,52 +141,6 @@
 					}
 				})
 			},
-			// 输入框
-			toInput(e) {
-				const that = this;
-				if (e.detail.value) that.$set(that.searchInfo, `name`, e.detail.value);
-				that.clearPage();
-				that.search();
-			},
-			// 筛选
-			toCond(index, e) {
-				const that = this;
-				let condActive = that.condActive;
-				that.$set(that, `condActive`, index);
-				if (condActive != index && that.xia == '') {
-					that.$set(that, `shang`, '0');
-					that.$set(that, `xia`, '-1');
-				} else if (condActive == index && that.xia == '-1') {
-					that.$set(that, `shang`, '1');
-					that.$set(that, `xia`, '0');
-				} else if (condActive == index && that.shang == '1') {
-					that.$set(that, `shang`, '0');
-					that.$set(that, `xia`, '-1');
-				} else if (condActive = index && that.shang == '1') {
-					that.$set(that, `shang`, '0');
-					that.$set(that, `xia`, '-1');
-				}
-				let value;
-				if (index != 0) {
-					value = that.shang == '0' ? that.xia : that.shang;
-				} else {
-					that.$set(that, `searchInfo`, {})
-				}
-				if (index == 1) {
-					that.$set(that, `searchInfo`, {})
-					that.$set(that.searchInfo, `time`, value);
-				} else if (index == 2) {
-					if (e.shang == 'icon-shitugonggeListBox') {
-						that.$set(e, `shang`, 'icon-liebiaoxingshi');
-						that.$set(that, `type`, 'list');
-					} else {
-						that.$set(e, `shang`, 'icon-shitugonggeListBox');
-						that.$set(that, `type`, 'gongge');
-					}
-				}
-				that.clearPage();
-				that.search();
-			},
 			// 监听用户是否登录
 			watchLogin() {
 				const that = this;
@@ -247,6 +203,53 @@
 				let num = Math.sign(up - e.detail.scrollTop);
 				if (num == 1) that.$set(that, `is_bottom`, false);
 			},
+			// 输入框
+			toInput(e) {
+				const that = this;
+				if (e.detail.value) that.$set(that.searchInfo, `name`, e.detail.value);
+				that.clearPage();
+				that.search();
+			},
+			// 筛选
+			toCond(index, e) {
+				const that = this;
+				let condActive = that.condActive;
+				that.$set(that, `condActive`, index);
+				if (condActive != index && that.xia == '') {
+					that.$set(that, `shang`, '0');
+					that.$set(that, `xia`, '-1');
+				} else if (condActive == index && that.xia == '-1') {
+					that.$set(that, `shang`, '1');
+					that.$set(that, `xia`, '0');
+				} else if (condActive == index && that.shang == '1') {
+					that.$set(that, `shang`, '0');
+					that.$set(that, `xia`, '-1');
+				} else if (condActive = index && that.shang == '1') {
+					that.$set(that, `shang`, '0');
+					that.$set(that, `xia`, '-1');
+				}
+				let value;
+				if (index != 0) {
+					value = that.shang == '0' ? that.xia : that.shang;
+				} else {
+					that.$set(that, `searchInfo`, {})
+				}
+				if (index == 1) {
+					that.$set(that, `searchInfo`, {})
+					that.$set(that.searchInfo, `time`, value);
+				} else if (index == 2) {
+					if (e.shang == 'icon-shitugonggeListBox') {
+						that.$set(e, `shang`, 'icon-liebiaoxingshi');
+						that.$set(that, `type`, 'list');
+					} else {
+						that.$set(e, `shang`, 'icon-shitugonggeListBox');
+						that.$set(that, `type`, 'gongge');
+					}
+				}
+				that.clearPage();
+				that.search();
+			},
+
 			// 详细信息
 			toView(e) {
 				const that = this;
@@ -284,19 +287,11 @@
 				const that = this;
 				that.$set(that, `list`, [])
 				that.$set(that, `skip`, 0)
-				that.$set(that, `limit`, 5)
+				that.$set(that, `limit`, 6)
 				that.$set(that, `page`, 0)
 			}
-		},
-		onPullDownRefresh: async function() {
-			const that = this;
-			that.$set(that, `list`, [])
-			that.$set(that, `skip`, 0)
-			that.$set(that, `limit`, 6)
-			that.$set(that, `page`, 0)
-			await that.search();
-			uni.stopPullDownRefresh();
 		}
+
 	}
 </script>
 

+ 7 - 11
pagesMy/discount/index.vue

@@ -44,7 +44,12 @@
 			that.searchConfig();
 			// 监听用户是否登录
 			that.watchLogin();
-			
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
 		},
 		methods: {
 			// 查询基本设置
@@ -131,18 +136,9 @@
 				const that = this;
 				that.$set(that, `list`, [])
 				that.$set(that, `skip`, 0)
-				that.$set(that, `limit`, 5)
+				that.$set(that, `limit`, 6)
 				that.$set(that, `page`, 0)
 			}
-		},
-		onPullDownRefresh: async function() {
-			const that = this;
-			that.$set(that, `list`, [])
-			that.$set(that, `skip`, 0)
-			that.$set(that, `limit`, 6)
-			that.$set(that, `page`, 0)
-			await that.search();
-			uni.stopPullDownRefresh();
 		}
 	}
 </script>

+ 31 - 35
pagesMy/dough/index.vue

@@ -11,8 +11,7 @@
 							<view class="list-scroll-view">
 								<view class="list" v-for="(item, index) in list" :key="index" @click="toShare(item)">
 									<view class="image">
-										<image class="file" v-for="(tag, indexs) in item.persons.slice(0,9)"
-											:key="indexs" :src="tag.icon&&tag.icon.length>0?tag.icon[0].url:''" mode="">
+										<image class="file" v-for="(tag, indexs) in item.persons.slice(0,9)" :key="indexs" :src="tag.icon&&tag.icon.length>0?tag.icon[0].url:''" mode="">
 										</image>
 									</view>
 									<view class="list_1">
@@ -99,32 +98,14 @@
 		onShow: function() {
 			const that = this;
 			that.watchLogin();
-			
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
 		},
 		methods: {
-			// 输入框
-			toInput(e) {
-				const that = this;
-				if (e.detail.value) that.$set(that.searchInfo, `name`, e.detail.value);
-				that.clearPage();
-				that.search();
-			},
-			// 选择选项卡
-			tabsChange(e) {
-				const that = this;
-				that.$set(that.tabs, `active`, e.active)
-				that.$set(that, `status`, e.active);
-				that.clearPage();
-				that.search()
-			},
-			// 分享
-			toShare(e) {
-				const that = this;
-				that.clearPage();
-				uni.navigateTo({
-					url: `/pagesHome/group/share?id=${e._id}`
-				})
-			},
 			// 监听用户是否登录
 			watchLogin() {
 				const that = this;
@@ -201,6 +182,30 @@
 					uni.hideLoading();
 				} else {}
 			},
+			// 输入框
+			toInput(e) {
+				const that = this;
+				if (e.detail.value) that.$set(that.searchInfo, `name`, e.detail.value);
+				that.clearPage();
+				that.search();
+			},
+			// 选择选项卡
+			tabsChange(e) {
+				const that = this;
+				that.$set(that.tabs, `active`, e.active)
+				that.$set(that, `status`, e.active);
+				that.clearPage();
+				that.search()
+			},
+			// 分享
+			toShare(e) {
+				const that = this;
+				that.clearPage();
+				uni.navigateTo({
+					url: `/pagesHome/group/share?id=${e._id}`
+				})
+			},
+
 			// 清空列表
 			clearPage() {
 				const that = this;
@@ -209,15 +214,6 @@
 				that.$set(that, `limit`, 6)
 				that.$set(that, `page`, 0)
 			}
-		},
-		onPullDownRefresh: async function() {
-			const that = this;
-			that.$set(that, `list`, [])
-			that.$set(that, `skip`, 0)
-			that.$set(that, `limit`, 6)
-			that.$set(that, `page`, 0)
-			await that.search();
-			uni.stopPullDownRefresh();
 		}
 	}
 </script>

+ 30 - 33
pagesMy/integral/index.vue

@@ -63,13 +63,14 @@
 			const that = this;
 			that.clearPage();
 		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
+		},
 		methods: {
-			// 兑换记录
-			toRecord() {
-				uni.navigateTo({
-					url: `/pagesIntegral/record/index`
-				})
-			},
+
 			// 查询基本设置
 			searchConfig() {
 				const that = this;
@@ -124,24 +125,6 @@
 					if (arr.errcode == '0') that.$set(that, `integral`, arr.data);
 				}
 			},
-			// 查询其他信息
-			async searchOther() {
-				const that = this;
-				let res;
-				res = await that.$api(`/dictData`, 'GET', {
-					code: "point_status"
-				});
-				if (res.errcode == '0') {
-					that.$set(that, `statusList`, res.data)
-				}
-				res = await that.$api(`/dictData`, 'GET', {
-					code: "point_source"
-				});
-				if (res.errcode == '0') {
-					that.$set(that, `sourceList`, res.data)
-				}
-			},
-
 			// 分页
 			toPage(e) {
 				const that = this;
@@ -167,6 +150,29 @@
 				let num = Math.sign(up - e.detail.scrollTop);
 				if (num == 1) that.$set(that, `is_bottom`, false);
 			},
+			// 查询其他信息
+			async searchOther() {
+				const that = this;
+				let res;
+				res = await that.$api(`/dictData`, 'GET', {
+					code: "point_status"
+				});
+				if (res.errcode == '0') {
+					that.$set(that, `statusList`, res.data)
+				}
+				res = await that.$api(`/dictData`, 'GET', {
+					code: "point_source"
+				});
+				if (res.errcode == '0') {
+					that.$set(that, `sourceList`, res.data)
+				}
+			},
+			// 兑换记录
+			toRecord() {
+				uni.navigateTo({
+					url: `/pagesIntegral/record/index`
+				})
+			},
 			// 清空列表
 			clearPage() {
 				const that = this;
@@ -175,15 +181,6 @@
 				that.$set(that, `limit`, 6)
 				that.$set(that, `page`, 0)
 			}
-		},
-		onPullDownRefresh: async function() {
-			const that = this;
-			that.$set(that, `list`, [])
-			that.$set(that, `skip`, 0)
-			that.$set(that, `limit`, 6)
-			that.$set(that, `page`, 0)
-			await that.search();
-			uni.stopPullDownRefresh();
 		}
 	}
 </script>

+ 50 - 54
pagesMy/order/after.vue

@@ -20,8 +20,7 @@
 										</view>
 									</view>
 									<view class="list_2">
-										<image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''"
-											mode="">
+										<image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''" mode="">
 										</image>
 										<view class="other">
 											<view class="name">
@@ -45,8 +44,7 @@
 										</view>
 									</view>
 									<view class="btn">
-										<button v-if="item.status=='0'||item.status=='1'" 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>
 									</view>
 								</view>
 								<view class="is_bottom" v-if="is_bottom">
@@ -121,6 +119,12 @@
 			await that.watchLogin();
 
 		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
+		},
 		methods: {
 			// 查询基本设置
 			searchConfig() {
@@ -135,46 +139,6 @@
 					}
 				})
 			},
-			// 选择选项卡
-			tabsChange(e) {
-				const that = this;
-				that.$set(that.tabs, `active`, e.active)
-				that.$set(that, `status`, e.active);
-				that.clearPage();
-				that.search()
-			},
-			// 订单详细
-			toInfo(item) {
-				uni.navigateTo({
-					url: `/pagesMy/order/info?id=${item.order_detail._id}&status=${item.order_detail.status}`
-				})
-			},
-			// 取消售后
-			toCancel(e) {
-				const that = this;
-				uni.showModal({
-					title: '提示',
-					content: '确定删除售后申请吗?',
-					success: async function(res) {
-						if (res.confirm) {
-							const arr = await that.$api(`/afterSale/${e._id}`, 'DELETE');
-							if (arr.errcode == '0') {
-								uni.showToast({
-									title: '删除售后成功',
-									icon: 'none'
-								})
-								that.clearPage();
-								that.search();
-							} else {
-								uni.showToast({
-									title: arr.errmsg,
-									icon: 'none'
-								})
-							}
-						}
-					}
-				});
-			},
 			// 监听用户是否登录
 			watchLogin() {
 				const that = this;
@@ -252,23 +216,55 @@
 				let num = Math.sign(up - e.detail.scrollTop);
 				if (num == 1) that.$set(that, `is_bottom`, false);
 			},
+			// 选择选项卡
+			tabsChange(e) {
+				const that = this;
+				that.$set(that.tabs, `active`, e.active)
+				that.$set(that, `status`, e.active);
+				that.clearPage();
+				that.search()
+			},
+			// 订单详细
+			toInfo(item) {
+				uni.navigateTo({
+					url: `/pagesMy/order/info?id=${item.order_detail._id}&status=${item.order_detail.status}`
+				})
+			},
+			// 取消售后
+			toCancel(e) {
+				const that = this;
+				uni.showModal({
+					title: '提示',
+					content: '确定删除售后申请吗?',
+					success: async function(res) {
+						if (res.confirm) {
+							const arr = await that.$api(`/afterSale/${e._id}`, 'DELETE');
+							if (arr.errcode == '0') {
+								uni.showToast({
+									title: '删除售后成功',
+									icon: 'none'
+								})
+								that.clearPage();
+								that.search();
+							} else {
+								uni.showToast({
+									title: arr.errmsg,
+									icon: 'none'
+								})
+							}
+						}
+					}
+				});
+			},
+
 			// 清空列表
 			clearPage() {
 				const that = this;
 				that.$set(that, `list`, [])
 				that.$set(that, `skip`, 0)
-				that.$set(that, `limit`, 5)
+				that.$set(that, `limit`, 6)
 				that.$set(that, `page`, 0)
 			}
-		},
-		onPullDownRefresh: async function() {
-			const that = this;
-			that.$set(that, `list`, [])
-			that.$set(that, `skip`, 0)
-			that.$set(that, `limit`, 6)
-			that.$set(that, `page`, 0)
-			await that.search();
-			uni.stopPullDownRefresh();
 		}
 	}
 </script>

+ 38 - 38
pagesMy/order/appraise.vue

@@ -68,6 +68,43 @@
 			that.watchLogin();
 		},
 		methods: {
+			// 监听用户是否登录
+			watchLogin() {
+				const that = this;
+				uni.getStorage({
+					key: 'token',
+					success: function(res) {
+						let user = that.$jwt(res.data);
+						if (user) that.$set(that, `user`, user);
+						that.search();
+					},
+					fail: function(err) {
+						uni.navigateTo({
+							url: `/pages/login/index`
+						})
+					}
+				});
+			},
+			// 查询列表
+			async search() {
+				const that = this;
+				let user = that.user;
+				let res;
+				if (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)
+					}
+				}
+			},
 			// 图片上传
 			uplSuc(e) {
 				const that = this;
@@ -136,44 +173,7 @@
 						}
 					}
 				})
-			},
-			// 监听用户是否登录
-			watchLogin() {
-				const that = this;
-				uni.getStorage({
-					key: 'token',
-					success: function(res) {
-						let user = that.$jwt(res.data);
-						if (user) that.$set(that, `user`, user);
-						that.search();
-					},
-					fail: function(err) {
-						uni.navigateTo({
-							url: `/pages/login/index`
-						})
-					}
-				});
-			},
-			// 查询列表
-			async search() {
-				const that = this;
-				let user = that.user;
-				let res;
-				if (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)
-					}
-				}
-			},
+			}
 		}
 	}
 </script>

+ 13 - 13
pagesMy/order/detail.vue

@@ -37,6 +37,18 @@
 			that.watchLogin();
 		},
 		methods: {
+			watchLogin() {
+				const that = this;
+				uni.getStorage({
+					key: 'token',
+					success: async (res) => {},
+					fail: (err) => {
+						uni.navigateTo({
+							url: `/pages/login/index`
+						})
+					}
+				})
+			},
 			// 提交保存
 			async onSubmit(ref) {
 				const that = this;
@@ -61,19 +73,7 @@
 						})
 					}
 				})
-			},
-			watchLogin() {
-				const that = this;
-				uni.getStorage({
-					key: 'token',
-					success: async (res) => {},
-					fail: (err) => {
-						uni.navigateTo({
-							url: `/pages/login/index`
-						})
-					}
-				})
-			},
+			}
 		}
 	}
 </script>

+ 26 - 45
pagesMy/order/index.vue

@@ -12,8 +12,7 @@
 								<view class="list_1" v-if="tabs.active=='-0'">
 									全部订单
 								</view>
-								<view class="list_2" v-for="(item,index) in list" :key="index"
-									v-else-if="tabs.active=='0'" @tap="toInfo(item)">
+								<view class="list_2" v-for="(item,index) in list" :key="index" v-else-if="tabs.active=='0'" @tap="toInfo(item)">
 									<view class="status">
 										{{item.status=='0'?'待付款':item.status=='1'?'已支付':item.status=='-1'?'取消订单':item.status=='2'?'发货中':item.status=='-2'?'已退款':item.status=='3'?'已收货':item.status=='-3'?'申请售后':item.status=='-4'?'正在售后中':item.status=='-5'?'售后已结束':'未识别'}}
 									</view>
@@ -27,9 +26,7 @@
 										<view class="goods_2">
 											<view class="market" v-for="(tags,indexss) in tag.goods" :key="indexss">
 												<view class="url">
-													<image class="image"
-														:src="tags.goods.file&&tags.goods.file.length>0?tags.goods.file[0].url:''"
-														mode=""></image>
+													<image class="image" :src="tags.goods.file&&tags.goods.file.length>0?tags.goods.file[0].url:''" mode=""></image>
 												</view>
 												<view class="goodsname">
 													{{tags.goods.name}}
@@ -56,22 +53,15 @@
 										<text>总价¥{{item.total_detail.goods_total}}</text>
 									</view>
 									<view class="btn">
-										<button v-if="item.status=='0'" type="default" size="mini"
-											@tap.stop="toCancel(item)">取消订单</button>
-										<button class="toPay" v-if="item.status=='0'" type="default" size="mini"
-											@tap.stop="toPay(item)">付款</button>
-										<button v-if="item.status=='2'" type="default" size="mini"
-											@tap.stop="toConfirm(item)">确认收货</button>
-										<button v-if="item.status!='0'" type="default" size="mini"
-											@tap.stop="toAfter(item)">申请售后</button>
-										<button v-if="item.status=='3'&&!item.rate" type="default" size="mini"
-											@tap.stop="toAppraise(item)">立即评价</button>
-										<button v-if="item.status=='3'&&item.rate" type="default" size="mini"
-											@tap.stop="toAppraise(item)">追加评价</button>
+										<button v-if="item.status=='0'" type="default" size="mini" @tap.stop="toCancel(item)">取消订单</button>
+										<button class="toPay" v-if="item.status=='0'" type="default" size="mini" @tap.stop="toPay(item)">付款</button>
+										<button v-if="item.status=='2'" type="default" size="mini" @tap.stop="toConfirm(item)">确认收货</button>
+										<button v-if="item.status!='0'" type="default" size="mini" @tap.stop="toAfter(item)">申请售后</button>
+										<button v-if="item.status=='3'&&!item.rate" type="default" size="mini" @tap.stop="toAppraise(item)">立即评价</button>
+										<button v-if="item.status=='3'&&item.rate" type="default" size="mini" @tap.stop="toAppraise(item)">追加评价</button>
 									</view>
 								</view>
-								<view class="list_2 list_3" v-for="(item,index) in list" :key="index"
-									@tap="toInfo(item)" v-else>
+								<view class="list_2 list_3" v-for="(item,index) in list" :key="index" @tap="toInfo(item)" v-else>
 									<view class="list_3_1">
 										<view class="goods_1">
 											<view class="shopname">
@@ -114,20 +104,13 @@
 										<text>总价¥{{item.real_pay}}</text>
 									</view>
 									<view class="btn">
-										<button v-if="item.status=='2'||item.status=='3'" type="default" size="mini"
-											@tap.stop="toLogi(item)">查看物流</button>
-										<button v-if="item.status=='0'" type="default" size="mini"
-											@tap.stop="toCancel(item)">取消订单</button>
-										<button class="toPay" v-if="item.status=='0'" type="default" size="mini"
-											@tap.stop="toPay(item)">付款</button>
-										<button v-if="item.status=='2'" type="default" size="mini"
-											@tap.stop="toConfirm(item)">确认收货</button>
-										<button v-if="item.status!='0'" type="default" size="mini"
-											@tap.stop="toAfter(item)">申请售后</button>
-										<button v-if="item.status=='3'&&!item.rate" type="default" size="mini"
-											@tap.stop="toAppraise(item)">立即评价</button>
-										<button v-if="item.status=='3'&&item.rate" type="default" size="mini"
-											@tap.stop="toAppraise(item)">追加评价</button>
+										<button v-if="item.status=='2'||item.status=='3'" type="default" size="mini" @tap.stop="toLogi(item)">查看物流</button>
+										<button v-if="item.status=='0'" type="default" size="mini" @tap.stop="toCancel(item)">取消订单</button>
+										<button class="toPay" v-if="item.status=='0'" type="default" size="mini" @tap.stop="toPay(item)">付款</button>
+										<button v-if="item.status=='2'" type="default" size="mini" @tap.stop="toConfirm(item)">确认收货</button>
+										<button v-if="item.status!='0'" type="default" size="mini" @tap.stop="toAfter(item)">申请售后</button>
+										<button v-if="item.status=='3'&&!item.rate" type="default" size="mini" @tap.stop="toAppraise(item)">立即评价</button>
+										<button v-if="item.status=='3'&&item.rate" type="default" size="mini" @tap.stop="toAppraise(item)">追加评价</button>
 									</view>
 								</view>
 								<view class="is_bottom" v-if="is_bottom">
@@ -187,7 +170,7 @@
 				list: [],
 				total: 0,
 				skip: 0,
-				limit: 5,
+				limit: 6,
 				page: 0,
 				// 数据是否触底
 				is_bottom: false,
@@ -200,7 +183,13 @@
 			that.searchConfig();
 			// 监听用户是否登录
 			that.watchLogin();
-			
+
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
 		},
 		methods: {
 			// 查询基本设置
@@ -465,19 +454,11 @@
 				const that = this;
 				that.$set(that, `list`, [])
 				that.$set(that, `skip`, 0)
-				that.$set(that, `limit`, 5)
+				that.$set(that, `limit`, 6)
 				that.$set(that, `page`, 0)
 			}
 		},
-		onPullDownRefresh: async function() {
-			const that = this;
-			that.$set(that, `list`, [])
-			that.$set(that, `skip`, 0)
-			that.$set(that, `limit`, 6)
-			that.$set(that, `page`, 0)
-			await that.search();
-			uni.stopPullDownRefresh();
-		}
+
 	}
 </script>
 

+ 26 - 25
pagesMy/order/noService.vue

@@ -8,8 +8,7 @@
 					</view>
 					<view class="list_2">
 						<view class="l">
-							<image class="image"
-								:src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''" mode="">
+							<image class="image" :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''" mode="">
 							</image>
 						</view>
 						<view class="c">
@@ -76,28 +75,6 @@
 			that.watchLogin();
 		},
 		methods: {
-			// 提交保存
-			async onSubmit(ref) {
-				const that = this;
-				that.$refs[ref].validate().then(async params => {
-					params.order_detail = that.id
-					const arr = await that.$api(`/afterSale/orderCancel`, 'POST', params);
-					if (arr.errcode == '0') {
-						uni.showToast({
-							title: `申请售后成功`,
-							icon: 'success',
-						});
-						uni.navigateBack({
-							detail: 1
-						})
-					} else {
-						uni.showToast({
-							title: arr.errmsg,
-							icon: 'none',
-						})
-					}
-				})
-			},
 			// 监听用户是否登录
 			watchLogin() {
 				const that = this;
@@ -123,6 +100,29 @@
 					}
 				})
 			},
+			// 提交保存
+			async onSubmit(ref) {
+				const that = this;
+				that.$refs[ref].validate().then(async params => {
+					params.order_detail = that.id
+					const arr = await that.$api(`/afterSale/orderCancel`, 'POST', params);
+					if (arr.errcode == '0') {
+						uni.showToast({
+							title: `申请售后成功`,
+							icon: 'success',
+						});
+						uni.navigateBack({
+							detail: 1
+						})
+					} else {
+						uni.showToast({
+							title: arr.errmsg,
+							icon: 'none',
+						})
+					}
+				})
+			}
+
 		}
 	}
 </script>
@@ -163,7 +163,8 @@
 					.c {
 						width: 50vw;
 						padding: 0 2vw;
-						.specs{
+
+						.specs {
 							color: var(--f85Color);
 							font-size: var(--font12Size);
 						}

+ 49 - 51
pagesMy/order/service.vue

@@ -8,8 +8,7 @@
 					</view>
 					<view class="list_2">
 						<view class="l">
-							<image class="image"
-								:src="info.goods.file&&info.goods.file.length>0?info.goods.file[0].url:''" mode="">
+							<image class="image" :src="info.goods.file&&info.goods.file.length>0?info.goods.file[0].url:''" mode="">
 							</image>
 						</view>
 						<view class="c">
@@ -42,8 +41,7 @@
 			<view class="two">
 				<uni-forms ref="form" :rules="rules" :model="form" label-width="auto">
 					<uni-forms-item label="退款商品" name="goods_id">
-						<picker class="picker" mode="selector" :range="goodsList" @change="goodsChange"
-							range-key="name">
+						<picker class="picker" mode="selector" :range="goodsList" @change="goodsChange" range-key="name">
 							<view>{{form.goods_name||'请选择退款商品'}}</view>
 						</picker>
 					</uni-forms-item>
@@ -59,8 +57,7 @@
 						</view>
 					</uni-forms-item>
 					<uni-forms-item label="申请理由" name="reason">
-						<picker class="picker" mode="selector" :range="reasonList" @change="reasonChange"
-							range-key="label">
+						<picker class="picker" mode="selector" :range="reasonList" @change="reasonChange" range-key="label">
 							<view>{{form.reason_name||'请选择申请理由'}}</view>
 						</picker>
 					</uni-forms-item>
@@ -89,7 +86,7 @@
 			return {
 				id: '',
 				// 订单类型
-				type:'',
+				type: '',
 				user: {},
 				// 商品详情
 				info: {},
@@ -134,6 +131,48 @@
 			await that.watchLogin();
 		},
 		methods: {
+			// 监听用户是否登录
+			watchLogin() {
+				const that = this;
+				uni.getStorage({
+					key: 'token',
+					success: async function(res) {
+						let user = that.$jwt(res.data);
+						if (user) {
+							that.$set(that, `user`, user);
+							if (that.id) {
+								let arr = await that.$api(`/orderDetail/${that.id}`, 'GET')
+								if (arr.errcode == '0') {
+									that.$set(that, `goodsList`, arr.data.goods)
+									that.$set(that, `type`, arr.data.type)
+								}
+							}
+						}
+					},
+					fail: function(err) {
+						uni.reLaunch({
+							url: '/pages/login/index'
+						})
+					}
+				})
+			},
+			// 查询其他信息
+			async searchOther() {
+				const that = this;
+				let res;
+				res = await that.$api(`/dictData`, 'GET', {
+					code: "afterSale_type"
+				});
+				if (res.errcode == '0') {
+					that.$set(that, `typeList`, res.data)
+				}
+				res = await that.$api(`/dictData`, 'GET', {
+					code: "afterSale_reason"
+				});
+				if (res.errcode == '0') {
+					that.$set(that, `reasonList`, res.data)
+				}
+			},
 			// 退款金额
 			toMoney(value) {
 				const that = this;
@@ -252,49 +291,7 @@
 						}
 					}
 				})
-			},
-			// 查询其他信息
-			async searchOther() {
-				const that = this;
-				let res;
-				res = await that.$api(`/dictData`, 'GET', {
-					code: "afterSale_type"
-				});
-				if (res.errcode == '0') {
-					that.$set(that, `typeList`, res.data)
-				}
-				res = await that.$api(`/dictData`, 'GET', {
-					code: "afterSale_reason"
-				});
-				if (res.errcode == '0') {
-					that.$set(that, `reasonList`, res.data)
-				}
-			},
-			// 监听用户是否登录
-			watchLogin() {
-				const that = this;
-				uni.getStorage({
-					key: 'token',
-					success: async function(res) {
-						let user = that.$jwt(res.data);
-						if (user) {
-							that.$set(that, `user`, user);
-							if (that.id) {
-								let arr = await that.$api(`/orderDetail/${that.id}`, 'GET')
-								if (arr.errcode == '0') {
-									that.$set(that, `goodsList`, arr.data.goods)
-									that.$set(that, `type`, arr.data.type)
-								}
-							}
-						}
-					},
-					fail: function(err) {
-						uni.reLaunch({
-							url: '/pages/login/index'
-						})
-					}
-				})
-			},
+			}
 		}
 	}
 </script>
@@ -335,7 +332,8 @@
 					.c {
 						width: 50vw;
 						padding: 0 2vw;
-						.specs{
+
+						.specs {
 							color: var(--f85Color);
 							font-size: var(--font12Size);
 						}

+ 1 - 1
pagesRest/activity/info.vue

@@ -56,7 +56,7 @@
 		},
 		onLoad: async function(e) {
 			const that = this;
-			that.$set(that, `id`, e.id || '634fa595e4ed552882f05a6f');
+			that.$set(that, `id`, e.id || '');
 			that.searchConfig();
 			await that.searchAct();
 			await that.configShare();