zs 2 년 전
부모
커밋
70de62c427
5개의 변경된 파일76개의 추가작업 그리고 56개의 파일을 삭제
  1. 9 3
      pagesHome/group/index.vue
  2. 9 37
      pagesHome/group/share.vue
  3. 29 1
      pagesHome/order/appraise.vue
  4. 11 12
      pagesHome/order/order.vue
  5. 18 3
      pagesMy/dough/index.vue

+ 9 - 3
pagesHome/group/index.vue

@@ -144,9 +144,15 @@
 					if (arr.errcode == '0') {
 						if (arr.data.result == true) {
 							that.clearPage();
-							uni.navigateTo({
-								url: `/pagesHome/order/order?key=${arr.data.key}&group_id=${e?._id}`
-							})
+							if (e._id) {
+								uni.navigateTo({
+									url: `/pagesHome/order/order?key=${arr.data.key}&group_id=${e._id}`
+								})
+							} else {
+								uni.navigateTo({
+									url: `/pagesHome/order/order?key=${arr.data.key}`
+								})
+							}
 						} else {
 							uni.showToast({
 								title: arr.data.msg,

+ 9 - 37
pagesHome/group/share.vue

@@ -14,7 +14,8 @@
 			<view class="two">
 				<view class="two_1">
 					<view class="img">
-						<image class="image" :src="info.goods.file&&info.goods.file.length>0?info.goods.file[0].url:''" mode=""></image>
+						<image class="image" :src="info.goods.file&&info.goods.file.length>0?info.goods.file[0].url:''"
+							mode=""></image>
 					</view>
 				</view>
 				<view class="two_2">
@@ -22,7 +23,7 @@
 						{{info.goods.name}}
 					</view>
 					<view class="money">
-						¥{{info.goods.sell_money}}元
+						¥{{info.goodsSpec.group_config.money}}元
 					</view>
 					<view class="brief">
 						{{info.goods.brief||''}}
@@ -34,10 +35,11 @@
 					<view class="list-scroll-view">
 						<view class="thr_1">
 							<view class="list" v-for="(item,index) in info.persons" :key="index">
-								<view class="img">
-									<image class="image" src="../../static/logo.png" mode=""></image>
+								<view class="img" v-if="item.status==0">
+									<image class="image" :src="item.icon&&item.icon.length>0?item.icon[0].url:''"
+										mode=""></image>
 								</view>
-								<view class="name">
+								<view class="name" v-if="item.status==0">
 									{{item.name}}
 								</view>
 							</view>
@@ -58,37 +60,7 @@
 			return {
 				id: '',
 				user: {},
-				info: {
-					group_persons: 6,
-					goods: {
-						file: [ //
-							{
-								url: this.$config.logoUrl
-							}
-						],
-						name: '测试商品',
-						sell_money: 10,
-						brief: '信息简介'
-					},
-					persons: [ //
-						{
-							file: [ //
-								{
-									url: this.$config.logoUrl
-								}
-							],
-							name: '顾红伟'
-						},
-						{
-							file: [ //
-								{
-									url: this.$config.logoUrl
-								}
-							],
-							name: '顾红伟'
-						},
-					]
-				},
+				info: {},
 				// 分享
 				share: {
 					title: '测试商品',
@@ -122,7 +94,7 @@
 				if (that.id) {
 					let res = await that.$api(`/group/${that.id}`, `GET`);
 					if (res.errcode == '0') {
-						// that.$set(that, `info`, res.data);
+						that.$set(that, `info`, res.data);
 					} else {
 						uni.showToast({
 							title: res.errmsg,

+ 29 - 1
pagesHome/order/appraise.vue

@@ -8,7 +8,9 @@
 					<text class="text3">{{info.rate}}%</text>
 				</view>
 				<view class="one_2">
-					<view class="one_2_1" v-for="(item,index) in addressList" :key="index"></view>
+					<view class="one_2_1" v-for="(item,index) in btnlist" :key="index">
+						<text>{{item.name}}</text><text>({{item.num||0}})</text>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -19,6 +21,32 @@
 	export default {
 		data() {
 			return {
+				btnlist: [{
+						name: '全部好评',
+						num: '1',
+						code: '0'
+					},
+					{
+						name: '好评',
+						num: '1',
+						code: '0'
+					},
+					{
+						name: '中评',
+						num: '1',
+						code: '0'
+					},
+					{
+						name: '差评',
+						num: '1',
+						code: '0'
+					}
+				],
+				info: {
+					name: '高精面粉',
+					specs: '5g',
+					rate: '95'
+				},
 				list: []
 			};
 		},

+ 11 - 12
pagesHome/order/order.vue

@@ -250,7 +250,7 @@
 						coupon: that.coupon,
 						type: that.type,
 					}
-					if (that?.group_id) {
+					if (that.group_id) {
 						data.group = that.group_id
 					}
 					const arr = await that.$api(`/order`, 'POST', data)
@@ -269,20 +269,19 @@
 										...res.data,
 										async success(res) {
 											const group = await that.$api('/group/getGroup',
-												'get', {
+												'GET', {
 													order_id: arr.data,
 												})
 											if (group.errcode == '0') {
-												console.log(group.data);
-												// 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'}`
-												// 	})
-												// }
+												if (group.data) {
+													uni.navigateTo({
+														url: `/pagesHome/group/share?id=${group.data}`
+													})
+												} else {
+													uni.reLaunch({
+														url: `/pagesMy/order/index?status=${'1'}`
+													})
+												}
 											} else {
 												uni.showToast({
 													title: group.errmsg,

+ 18 - 3
pagesMy/dough/index.vue

@@ -7,7 +7,7 @@
 			<view class="two">
 				<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">
+						<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,7)" :key="indexs"
 									v-if="tag.status==0" :src="tag.icon&&tag.icon.length>0?tag.icon[0].url:''" mode="">
@@ -31,12 +31,15 @@
 								</view>
 							</view>
 							<view class="other">
-								<view v-if="item.status=='0'" class="btn" @click="onSubmit(item)">
-									<text>{{item.zhStatus||'暂无状态'}}</text>立即参团
+								<view v-if="item.status=='0'" class="btn">
+									<text>{{item.zhStatus||'暂无状态'}}</text>
 								</view>
 								<view v-else-if="item.status=='-1'" class="button">
 									{{item.zhStatus||'暂无状态'}}
 								</view>
+								<view v-else-if="item.status=='2'" class="button">
+									已退团
+								</view>
 								<view v-else class="button">
 									{{item.zhStatus||'暂无状态'}}
 								</view>
@@ -69,6 +72,14 @@
 			that.watchLogin()
 		},
 		methods: {
+			// 分享
+			toShare(e) {
+				const that = this;
+				that.clearPage();
+				uni.navigateTo({
+					url: `/pagesHome/group/share?id=${e._id}`
+				})
+			},
 			// 监听用户是否登录
 			watchLogin() {
 				const that = this;
@@ -109,6 +120,10 @@
 					if (res.errcode == '0') {
 						let list = [...that.list, ...res.data];
 						for (let val of list) {
+							let personsstatus = val.persons.find(i => i.customer == user._id)
+							if (personsstatus.status == 1) {
+								val.status = '2';
+							}
 							val.persons = val.persons.filter(i => i.status == '0')
 							let status = that.statusList.find(i => i.value == val.status)
 							if (status) val.zhStatus = status.label;