zs 2 年之前
父节点
当前提交
fed7c45595
共有 4 个文件被更改,包括 77 次插入59 次删除
  1. 52 50
      pagesHome/group/index.vue
  2. 9 3
      pagesHome/order/order.vue
  3. 2 2
      pagesMy/order/index.vue
  4. 14 4
      pagesMy/order/info.vue

+ 52 - 50
pagesHome/group/index.vue

@@ -28,30 +28,28 @@
 				<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
 					<view class="list-scroll-view">
 						<view class="list" v-for="(item, index) in list" :key="index">
-							<image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''" mode="">
+							<view class="image">
+								<image class="file" v-for="(tag, indexs) in item.persons.slice(0,7)" :key="indexs"
+									:src="tag.icon&&tag.icon.length>0?tag.icon[0].url:''" mode="">
+
+							</view>
 							</image>
 							<view class="list_1">
 								<view class="name">
-									{{item.leader||'暂无'}}
+									{{item.person_limit||0}}人即可开团成功
 								</view>
 								<view class="some">
-									<text>商品名称</text>
-									<text>{{item.name||'暂无'}}</text>
+									<text>团长</text>
+									<text>{{item.leader.name||'暂无'}}</text>
 								</view>
 								<view class="some">
 									<text>参团人数</text>
-									<text>{{item.person_limit||0}}人</text>
+									<text>{{item.persons.length||0}}人</text>
 								</view>
-								<view class="other">
-									<view class="other_1">
-										<text>¥</text>
-										<text>{{item.sell_money||0}}</text>
-									</view>
-									<view class="other_2">
-										<view class="btn" @click="onSubmit(item)">
-											<text>{{item.status||'开团中'}}</text>立即参团
-										</view>
-									</view>
+							</view>
+							<view class="other">
+								<view class="btn" @click="onSubmit(item)">
+									<text>{{item.zhStatus||'暂无状态'}}</text>立即参团
 								</view>
 							</view>
 						</view>
@@ -91,6 +89,7 @@
 				shopInfo: {},
 				// 参团列表
 				list: [],
+				statusList: [],
 				num: 1,
 				total: 0,
 				skip: 0,
@@ -105,10 +104,10 @@
 				specs_id: e.specs_id || '634394bc32c3065a80eb14ad'
 			});
 		},
-		onShow: function() {
+		onShow: async function() {
 			const that = this;
-			that.watchLogin();
-			that.search();
+			await that.watchLogin();
+			await that.search();
 		},
 		methods: {
 			// 开团
@@ -140,6 +139,7 @@
 					let arr = await that.$api(`/util/checkCanBuy`, 'POST', data)
 					if (arr.errcode == '0') {
 						if (arr.data.result == true) {
+							that.clearPage();
 							uni.navigateTo({
 								url: `/pagesHome/order/order?key=${arr.data.key}`
 							})
@@ -166,9 +166,15 @@
 				const that = this;
 				uni.getStorage({
 					key: 'token',
-					success: function(res) {
+					success: async function(res) {
 						let user = that.$jwt(res.data);
 						that.$set(that, `user`, user);
+						let status = await that.$api(`/dictData`, 'GET', {
+							code: "group_status"
+						});
+						if (status.errcode == '0') {
+							that.$set(that, `statusList`, status.data)
+						}
 					},
 					fail: function(err) {}
 				})
@@ -191,12 +197,18 @@
 				let info = {
 					skip: that.skip,
 					limit: that.limit,
+					goodsSpec: that.query.specs_id,
+					status: '0'
 				}
 				res = await that.$api(`/group`, 'GET', {
 					...info
 				})
 				if (res.errcode == '0') {
 					let list = [...that.list, ...res.data];
+					for (let val of list) {
+						let status = that.statusList.find(i => i.value == val.status)
+						if (status) val.zhStatus = status.label;
+					}
 					that.$set(that, `list`, list);
 					that.$set(that, `total`, res.total)
 				}
@@ -318,10 +330,17 @@
 				border-radius: 5px;
 
 				.image {
-					width: 25vw;
-					height: 25vw;
+					display: flex;
+					flex-wrap: wrap;
+					width: 27vw;
+					height: 27vw;
 					border-radius: 5px;
 					margin: 0 2vw 0 0;
+
+					.file {
+						width: 9vw;
+						height: 9vw;
+					}
 				}
 
 				.list_1 {
@@ -345,39 +364,22 @@
 							color: var(--f00Color);
 						}
 					}
+				}
 
-					.other {
+				.other {
+					.btn {
 						display: flex;
-						justify-content: space-between;
+						flex-direction: column;
 						align-items: center;
+						margin: 0 2vw;
+						padding: 2vw 3vw;
+						background-color: var(--ff0Color);
+						color: var(--fffColor);
+						border-radius: 2vw;
+						font-size: var(--font14Size);
 
-						.other_1 {
-							font-size: var(--font14Size);
-							color: var(--f85Color);
-
-							text {
-								font-weight: bold;
-								padding: 0 1vw 0 0;
-								color: var(--ff0Color);
-							}
-						}
-
-						.other_2 {
-							.btn {
-								display: flex;
-								flex-direction: column;
-								align-items: center;
-								margin: 0 2vw;
-								padding: 2vw 3vw;
-								background-color: var(--ff0Color);
-								color: var(--fffColor);
-								border-radius: 2vw;
-								font-size: var(--font14Size);
-
-								text {
-									font-size: var(--font12Size);
-								}
-							}
+						text {
+							font-size: var(--font12Size);
 						}
 					}
 				}

+ 9 - 3
pagesHome/order/order.vue

@@ -262,9 +262,15 @@
 										"provider": "wxpay",
 										...res.data,
 										success(res) {
-											uni.reLaunch({
-												url: `/pagesMy/order/index?status=${'1'}`
-											})
+											if (that.type == '1' && res.data?.group_id) {
+												uni.navigateTo({
+													url: `/pagesHome/group/share?group_id=${res.data.group_id}`
+												})
+											} else {
+												uni.reLaunch({
+													url: `/pagesMy/order/index?status=${'1'}`
+												})
+											}
 										},
 										fail(e) {
 											console.log('in fail');

+ 2 - 2
pagesMy/order/index.vue

@@ -91,10 +91,10 @@
 												</view>
 												<view class="goodsother">
 													<view v-if="item.type=='0'" class="price">
-														¥{{tags.sell_money}}
+														¥{{tag.sell_money}}
 													</view>
 													<view v-else class="price">
-														¥{{tags.group_config.money}}
+														¥{{tag.group_config.money}}
 													</view>
 													<view class="num">
 														×{{tag.buy_num}}

+ 14 - 4
pagesMy/order/info.vue

@@ -34,15 +34,20 @@
 									<view class="list_2">
 										<view class="goods" v-for="(tag,indexs) in item.goods" :key="indexs">
 											<view class="url">
-												<image class="image" :src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:''" mode=""></image>
+												<image class="image"
+													:src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:''"
+													mode=""></image>
 											</view>
 											<view class="goodsname">
 												{{tag.name}}
 											</view>
 											<view class="goodsother">
-												<view class="price">
+												<view v-if="info.type=='0'" class="price">
 													¥{{tag.sell_money}}
 												</view>
+												<view v-else class="price">
+													¥{{tag.group_config.money}}
+												</view>
 												<view class="num">
 													×{{tag.buy_num}}
 												</view>
@@ -59,15 +64,20 @@
 								<view class="list_2">
 									<view class="goods" v-for="(item,index) in info.goods" :key="index">
 										<view class="url">
-											<image class="image" :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''" mode=""></image>
+											<image class="image"
+												:src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''"
+												mode=""></image>
 										</view>
 										<view class="goodsname">
 											{{item.name}}
 										</view>
 										<view class="goodsother">
-											<view class="price">
+											<view v-if="info.type=='0'" class="price">
 												¥{{item.sell_money}}
 											</view>
+											<view v-else class="price">
+												¥{{item.group_config.money}}
+											</view>
 											<view class="num">
 												×{{item.buy_num}}
 											</view>