zhangbs преди 2 години
родител
ревизия
867db4e0d9
променени са 6 файла, в които са добавени 1144 реда и са изтрити 77 реда
  1. 7 0
      pages.json
  2. 14 63
      pages/home/index.vue
  3. 51 6
      pages/my/index.vue
  4. 4 1
      pagesMy/assets/index.vue
  5. 37 7
      pagesMy/dough/index.vue
  6. 1031 0
      pagesMy/order/all.vue

+ 7 - 0
pages.json

@@ -83,6 +83,13 @@
 						"navigationBarTitleText": "订单详细"
 					}
 				},
+				{
+					"path": "order/all",
+					"style": {
+						"navigationBarTitleText": "全部订单",
+						"enablePullDownRefresh": true
+					}
+				},
 				{
 					"path": "order/after",
 					"style": {

+ 14 - 63
pages/home/index.vue

@@ -5,15 +5,8 @@
 			<view class="list-scroll-view">
 				<view class="main">
 					<view class="zero one">
-						<view class="one_1">
-							<input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')"
-								placeholder-class="placss">
-						</view>
-						<view class="one_2" @tap="toNotice()">
-							<uni-badge :text="notice_total" absolute="rightTop" size="normal">
-								<text class="iconfont icon-xiaoxitongzhi"></text>
-							</uni-badge>
-						</view>
+						<input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')"
+							placeholder-class="placss">
 					</view>
 					<view class="zero two">
 						<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff"
@@ -127,8 +120,6 @@
 				skip: 0,
 				limit: 10,
 				page: 0,
-				// 未读消息
-				notice_total: 0,
 				// 返回顶部
 				scrollTop: 0,
 				old_scrollTop: 0
@@ -137,7 +128,6 @@
 		onLoad: async function() {
 			const that = this;
 			await that.search();
-			await that.notice();
 		},
 		onPullDownRefresh: async function() {
 			const that = this;
@@ -146,23 +136,6 @@
 			uni.stopPullDownRefresh();
 		},
 		methods: {
-			// 消息通知
-			notice() {
-				const that = this;
-				uni.getStorage({
-					key: 'token',
-					success: async (res) => {
-						let user = that.$jwt(res.data);
-						if (user && user._id) {
-							let res = await that.$api(`/notice`, 'GET', {
-								customer: user._id,
-								status: '0'
-							});
-							if (res.errcode == '0') that.$set(that, `notice_total`, res.total);
-						}
-					}
-				})
-			},
 			async search() {
 				const that = this;
 				let res;
@@ -213,12 +186,6 @@
 					that.$set(that, `total`, res.total)
 				}
 			},
-			// 系统消息页
-			toNotice() {
-				uni.navigateTo({
-					url: `/pagesHome/notice/index`
-				})
-			},
 			// 公共跳转
 			toCommon(e) {
 				uni.navigateTo({
@@ -337,36 +304,20 @@
 		}
 
 		.one {
-			display: flex;
-			justify-content: center;
-			align-items: center;
-
-			.one_1 {
-				width: 88vw;
-				background-color: var(--fFB1Color);
-				border-radius: 20px;
-				padding: 0 2vw;
-
-				input {
-					font-size: var(--font15Size);
-					color: var(--fffColor);
-					border-radius: 14px;
-					width: 100%;
-					padding: 1.5vw 0;
-				}
-
-				.placss {
-					color: var(--fffColor);
-				}
+			background-color: var(--fFB1Color);
+			border-radius: 20px;
+			padding: 0 2vw;
+
+			input {
+				font-size: var(--font15Size);
+				color: var(--fffColor);
+				border-radius: 14px;
+				width: 100%;
+				padding: 1.5vw 0;
 			}
 
-			.one_2 {
-				width: 12vw;
-				text-align: center;
-
-				.iconfont {
-					font-size: 24px;
-				}
+			.placss {
+				color: var(--fffColor);
 			}
 
 		}

+ 51 - 6
pages/my/index.vue

@@ -7,6 +7,11 @@
 					<view class="name">未登录</view>
 				</view>
 				<view class="one_1" v-else>
+					<view class="one_1_1" @tap="toNotice()">
+						<uni-badge :text="notice_total" absolute="rightTop" size="normal">
+							<text class="iconfont icon-xiaoxitongzhi"></text>
+						</uni-badge>
+					</view>
 					<image class="image" :src="user.icon&&user.icon.length>0?user.icon[0].url:''"></image>
 					<view class="name">
 						<text>{{user.name||'暂无名称'}}</text>
@@ -29,8 +34,8 @@
 				<view class="two_1">
 					<view class="title">我的订单</view>
 					<view class="title">
-						<!-- <text @click="toOrder({route:'pagesMy/order/index',type:'order',status:'-0'})">全部订单</text>
-						<text class="iconfont icon-jiantouyou"></text> -->
+						<text @click="toAllOrder()">全部订单</text>
+						<text class="iconfont icon-jiantouyou"></text>
 					</view>
 				</view>
 				<view class="two_2">
@@ -77,15 +82,19 @@
 				// 收藏店铺
 				shop_num: '',
 				// 积分
-				integral: ''
+				integral: '',
+				// 未读消息
+				notice_total: 0,
 			};
 		},
-		onShow: function() {
+		onShow:async function() {
 			const that = this;
 			// 查询其他信息
-			that.searchOther();
+			await that.searchOther();
 			// 监听用户登录
-			that.watchLogin();
+			await that.watchLogin();
+			// 监听用户登录
+			await that.notice();
 		},
 		methods: {
 			// 监听用户登录
@@ -120,6 +129,23 @@
 					fail: (err) => {}
 				})
 			},
+			// 消息通知
+			notice() {
+				const that = this;
+				uni.getStorage({
+					key: 'token',
+					success: async (res) => {
+						let user = that.$jwt(res.data);
+						if (user && user._id) {
+							let res = await that.$api(`/notice`, 'GET', {
+								customer: user._id,
+								status: '0'
+							});
+							if (res.errcode == '0') that.$set(that, `notice_total`, res.total);
+						}
+					}
+				})
+			},
 			// 查询其他信息
 			async searchOther() {
 				const that = this;
@@ -151,6 +177,12 @@
 					that.$set(that, `serviceContactInfo`, res.data[0])
 				}
 			},
+			// 全部订单
+			toAllOrder(){
+				uni.navigateTo({
+					url: `/pagesMy/order/all`
+				})
+			},
 			// 公共跳转
 			toCommon(e) {
 				uni.getStorage({
@@ -168,6 +200,12 @@
 				});
 
 			},
+			// 系统消息页
+			toNotice() {
+				uni.navigateTo({
+					url: `/pagesHome/notice/index`
+				})
+			},
 			// 订单跳转页面 
 			toOrder(e) {
 				const that = this;
@@ -229,6 +267,13 @@
 
 			.one_1 {
 				margin: 0 0 5vw 0;
+				.one_1_1{
+					position: absolute;
+					left: 55vw;
+					.iconfont {
+						font-size: 20px;
+					}
+				}
 
 				image {
 					width: 25vw;

+ 4 - 1
pagesMy/assets/index.vue

@@ -221,8 +221,11 @@
 						customer: user._id
 					})
 					if (arr.errcode == '0'){
+						if(arr.data.money<0) that.$set(that, `money`, 0);
+						else that.$set(that, `money`, 0);
 						 that.$set(that, `money`, arr.data.total);
-						 that.$set(that, `canGet`, arr.data.canGet);
+						if(arr.data.canGet<0) that.$set(that, `canGet`, 0);
+						else that.$set(that, `canGet`, arr.data.canGet);
 					}
 				}
 			},

+ 37 - 7
pagesMy/dough/index.vue

@@ -96,7 +96,7 @@
 														{{item.goods.name||'暂无'}}
 													</view>
 													<view class="other_1">
-														商品规格:<text>{{item.goodsSpec.name||'暂无'}}</text>
+														商品规格:<text>{{item.spec.name||'暂无'}}</text>
 													</view>
 													<view class="other_1" v-if="item.type!='3'">
 														退款:<text>¥{{item.money||0}}</text>
@@ -159,11 +159,13 @@
 												</view>
 											</view>
 											<view class="btn">
+												<button type="default" v-if="item.can_group==true" size="mini"
+													@tap.stop="toCan(item)">开团</button>
 												<button type="default" v-if="item.status=='0'" size="mini"
 													@tap.stop="toShare(item)">分享</button>
 												<button type="default" v-if="item.status=='0'||item.status=='1'"
 													size="mini" @tap.stop="toHandle(item)">团处理</button>
-													<button type="default"  size="mini" @tap.stop="toSet(item)">设置状态</button>
+												<button type="default" size="mini" @tap.stop="toSet(item)">设置状态</button>
 											</view>
 										</view>
 									</view>
@@ -654,6 +656,34 @@
 					}
 				});
 			},
+			// 开团
+			toCan(e) {
+				const that = this;
+				uni.showModal({
+					title: '提示',
+					content: '确定开团吗?',
+					success: async function(res) {
+						if (res.confirm) {
+							const arr = await that.$api(`/group/${e._id}`, 'POST', {
+								status: '1'
+							}, 'group');
+							if (arr.errcode == '0') {
+								uni.showToast({
+									title: '开团成功',
+									icon: 'none'
+								})
+								that.clearPage();
+								that.search();
+							} else {
+								uni.showToast({
+									title: arr.errmsg,
+									icon: 'none'
+								})
+							}
+						}
+					}
+				});
+			},
 			// 团处理
 			toHandle(e) {
 				const that = this;
@@ -663,16 +693,16 @@
 				})
 			},
 			// 设置状态
-			toSet(e){	
+			toSet(e) {
 				const that = this;
 				uni.showModal({
 					title: '提示',
-					content: e.status != '2'?'确定将该团改为准备中吗?':'确定解散该团吗?',
+					content: e.status != '2' ? '确定将该团改为准备中吗?' : '确定解散该团吗?',
 					success: async function(res) {
 						if (res.confirm) {
-							let status='';
-							if(e.status=='2')status='-1'
-							else status='2'
+							let status = '';
+							if (e.status == '2') status = '-1'
+							else status = '2'
 							let arr = await that.$api(`/group/${e._id}`, 'POST', {
 								status: status
 							}, 'group')

Файловите разлики са ограничени, защото са твърде много
+ 1031 - 0
pagesMy/order/all.vue