zs пре 2 година
родитељ
комит
cd2b915f32
3 измењених фајлова са 34 додато и 3 уклоњено
  1. 2 1
      pagesHome/group/index.vue
  2. 0 2
      pagesHome/group/order.vue
  3. 32 0
      pagesMy/dough/index.vue

+ 2 - 1
pagesHome/group/index.vue

@@ -96,7 +96,8 @@
 					title: '提示',
 					content: '确定是否开团吗?',
 					success: async function(res) {
-						that.$set(that.form, `leader`, that.user.id || '');
+						that.$set(that.form, `leader`, that.user.id || '');	
+						that.$set(that.form, `status`, '0');
 						that.$refs[ref].validate().then(async params => {
 							// 创建团数据
 							let res = await that.$api(`/group`, 'POST', that.form, 'group');

+ 0 - 2
pagesHome/group/order.vue

@@ -212,13 +212,11 @@
 									"provider": "wxpay",
 									...p2.data,
 									success: async function(res) {
-										console.log(res);
 										uni.reLaunch({
 											url: `/pagesMy/dough/index`
 										})
 									},
 									fail: function(err) {
-										console.log(err);
 										uni.showToast({
 											title: `支付失败`,
 											icon: 'none'

+ 32 - 0
pagesMy/dough/index.vue

@@ -163,6 +163,7 @@
 													@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>
 											</view>
 										</view>
 									</view>
@@ -661,6 +662,37 @@
 					url: `/pagesMy/dough/handle?id=${e._id}`
 				})
 			},
+			// 设置状态
+			toSet(e){	
+				const that = this;
+				uni.showModal({
+					title: '提示',
+					content: e.status != '2'?'确定将该团改为准备中吗?':'确定解散该团吗?',
+					success: async function(res) {
+						if (res.confirm) {
+							let status='';
+							if(e.status=='2')status='-1'
+							else status='2'
+							let arr = await that.$api(`/group/${e._id}`, 'POST', {
+								status: status
+							}, 'group')
+							if (arr.errcode == '0') {
+								uni.showToast({
+									title: '修改状态成功',
+									icon: 'none'
+								})
+								that.clearPage();
+								that.search();
+							} else {
+								uni.showToast({
+									title: arr.errmsg,
+									icon: 'none'
+								})
+							}
+						}
+					}
+				});
+			},
 			// 分页
 			toPage(e) {
 				const that = this;