|
@@ -48,7 +48,7 @@
|
|
|
<text>{{item.sell_money||0}}</text>
|
|
|
</view>
|
|
|
<view class="other_2">
|
|
|
- <view class="btn" @click="toJoin(item)">
|
|
|
+ <view class="btn" @click="onSubmit(item)">
|
|
|
<text>{{item.status||'开团中'}}</text>立即参团
|
|
|
</view>
|
|
|
</view>
|
|
@@ -91,7 +91,7 @@
|
|
|
shopInfo: {},
|
|
|
// 参团列表
|
|
|
list: [],
|
|
|
- num: 0,
|
|
|
+ num: 1,
|
|
|
total: 0,
|
|
|
skip: 0,
|
|
|
limit: 6,
|
|
@@ -115,64 +115,46 @@
|
|
|
async toGroup() {
|
|
|
const that = this;
|
|
|
that.$refs.popup.open();
|
|
|
- // let user = that.user;
|
|
|
- // if (user._id) {
|
|
|
- // let data = {
|
|
|
- // customer: user._id,
|
|
|
- // shop: that.shopInfo._id,
|
|
|
- // goods: that.goodsInfo._id,
|
|
|
- // goodsSpec: that.specsInfo._id,
|
|
|
- // num: that.num,
|
|
|
- // }
|
|
|
- // let arr = await that.$api(`/util/checkCanBuy`, 'POST', data)
|
|
|
- // if (arr.errcode == '0') {
|
|
|
- // if (arr.data.result == true) {
|
|
|
- // uni.navigateTo({
|
|
|
- // url: `/pagesHome/order/order?key=${arr.data.key}`
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // uni.showToast({
|
|
|
- // title: arr.data.msg,
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // uni.showToast({
|
|
|
- // title: arr.errmsg,
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
- // }
|
|
|
- // const arr = await that.$api(`/group`, 'POST', data)
|
|
|
- // if (arr.errcode == '0') {
|
|
|
- // uni.showToast({
|
|
|
- // title: '开团成功',
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
- // that.clearPage();
|
|
|
- // that.search()
|
|
|
- // } else {
|
|
|
- // uni.showToast({
|
|
|
- // title: arr.data.errmsg,
|
|
|
- // icon: 'none'
|
|
|
- // })
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // uni.navigateTo({
|
|
|
- // url: `/pages/login/index`
|
|
|
- // })
|
|
|
- // }
|
|
|
},
|
|
|
// 计数器
|
|
|
toCount(e) {
|
|
|
const that = this;
|
|
|
that.num = e;
|
|
|
},
|
|
|
- // 立即参团
|
|
|
- toJoin(e) {
|
|
|
+ // 确认开团 立即参团
|
|
|
+ async onSubmit(e) {
|
|
|
const that = this;
|
|
|
let user = that.user;
|
|
|
if (user._id) {
|
|
|
- console.log(e);
|
|
|
+ let data = {
|
|
|
+ customer: user._id,
|
|
|
+ shop: that.shopInfo._id,
|
|
|
+ goods: that.goodsInfo._id,
|
|
|
+ goodsSpec: that.specsInfo._id,
|
|
|
+ num: that.num,
|
|
|
+ type: '1'
|
|
|
+ }
|
|
|
+ if (e._id) {
|
|
|
+ data.group_id = e._id
|
|
|
+ }
|
|
|
+ let arr = await that.$api(`/util/checkCanBuy`, 'POST', data)
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ if (arr.data.result == true) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pagesHome/order/order?key=${arr.data.key}`
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: arr.data.msg,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: arr.errmsg,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/login/index`
|