|
@@ -18,7 +18,10 @@
|
|
|
|
|
|
<view class="grid t0b48"></view>
|
|
<view class="grid t0b48"></view>
|
|
|
|
|
|
- <view class="fight-tip">还差<text>1</text>人,赶快邀请好友来拼单吧!</view>
|
|
|
|
|
|
+ <view class="fight-tip"
|
|
|
|
+ >还差<text>{{ collageData.needNum }}</text
|
|
|
|
+ >人,赶快邀请好友来拼单吧!</view
|
|
|
|
+ >
|
|
<!-- 倒计时 -->
|
|
<!-- 倒计时 -->
|
|
<countdown-box :countDownTime="countDownTime"></countdown-box>
|
|
<countdown-box :countDownTime="countDownTime"></countdown-box>
|
|
|
|
|
|
@@ -27,7 +30,7 @@
|
|
|
|
|
|
<view class="grid t48b48"></view>
|
|
<view class="grid t48b48"></view>
|
|
<!-- 拼单用户列表 -->
|
|
<!-- 拼单用户列表 -->
|
|
- <user-list></user-list>
|
|
|
|
|
|
+ <user-list :memberNum="collageData.memberNum" :existNum="collageData.existNum"></user-list>
|
|
<view class="line"></view>
|
|
<view class="line"></view>
|
|
<view class="goods-info">
|
|
<view class="goods-info">
|
|
<image :src="collageData.productImage" class="cover"></image>
|
|
<image :src="collageData.productImage" class="cover"></image>
|
|
@@ -43,7 +46,12 @@
|
|
<view class="right">
|
|
<view class="right">
|
|
<view class="number">
|
|
<view class="number">
|
|
<text>数量:</text>
|
|
<text>数量:</text>
|
|
- <cm-number-box v-model="count" :min="1" :max="2"></cm-number-box>
|
|
|
|
|
|
+ <cm-number-box
|
|
|
|
+ v-model="count"
|
|
|
|
+ :min="1"
|
|
|
|
+ :max="collageData.limitedNum"
|
|
|
|
+ :defaultVal="count"
|
|
|
|
+ ></cm-number-box>
|
|
</view>
|
|
</view>
|
|
<view class="single-price">
|
|
<view class="single-price">
|
|
<text>单价:¥</text> <text class="price">{{ collageData.price | formatPrice }}</text>
|
|
<text>单价:¥</text> <text class="price">{{ collageData.price | formatPrice }}</text>
|
|
@@ -53,6 +61,18 @@
|
|
<view class="btn" @click="buyGroupNow">确认</view>
|
|
<view class="btn" @click="buyGroupNow">确认</view>
|
|
</view>
|
|
</view>
|
|
</cm-drawer>
|
|
</cm-drawer>
|
|
|
|
+
|
|
|
|
+ <!-- 操作弹窗 -->
|
|
|
|
+ <tui-modal
|
|
|
|
+ :show="modal"
|
|
|
|
+ :content="modalText"
|
|
|
|
+ :size="32"
|
|
|
|
+ :maskClosable="false"
|
|
|
|
+ color="#333"
|
|
|
|
+ shape="circle"
|
|
|
|
+ @click="handleModalConfirm"
|
|
|
|
+ :button="modalButton"
|
|
|
|
+ ></tui-modal>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -72,7 +92,11 @@ export default {
|
|
CmNumberBox
|
|
CmNumberBox
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- ...mapGetters(['userId', 'hasLogin'])
|
|
|
|
|
|
+ ...mapGetters(['userId', 'hasLogin']),
|
|
|
|
+ // 自定义标签
|
|
|
|
+ tagsList() {
|
|
|
|
+ return [`${this.collageData.memberNum}人拼团价`]
|
|
|
|
+ }
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -80,14 +104,32 @@ export default {
|
|
collageId: '',
|
|
collageId: '',
|
|
initiatorId: '',
|
|
initiatorId: '',
|
|
collageData: {},
|
|
collageData: {},
|
|
- // 自定义标签
|
|
|
|
- tagsList: ['2人拼团价'],
|
|
|
|
// 倒计时
|
|
// 倒计时
|
|
countDownTime: {},
|
|
countDownTime: {},
|
|
timer: null,
|
|
timer: null,
|
|
// 商品数量
|
|
// 商品数量
|
|
count: 1,
|
|
count: 1,
|
|
- countVisible: false
|
|
|
|
|
|
+ countVisible: false,
|
|
|
|
+
|
|
|
|
+ modal: false,
|
|
|
|
+ modalText: '您已经参加过该拼团活动了,请前往订单详情查看订单',
|
|
|
|
+ modalButton: [
|
|
|
|
+ {
|
|
|
|
+ text: '取消',
|
|
|
|
+ type: 'danger',
|
|
|
|
+ plain: true //是否空心
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '前往查看',
|
|
|
|
+ type: 'danger',
|
|
|
|
+ plain: false
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ hasLogin() {
|
|
|
|
+ this.fetchOrderDetails()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
@@ -124,12 +166,11 @@ export default {
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
this.collageId = options.collageId
|
|
this.collageId = options.collageId
|
|
this.initiatorId = options.initiatorId
|
|
this.initiatorId = options.initiatorId
|
|
- setTimeout(()=>{
|
|
|
|
- this.fetchOrderDetails()
|
|
|
|
- }, 2000)
|
|
|
|
|
|
+ this.fetchOrderDetails()
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
- !this.isRequest && this.countDown()
|
|
|
|
|
|
+ !this.isRequest && this.countDown()
|
|
|
|
+ this.fetchOrderDetails()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
handleClick(type) {
|
|
handleClick(type) {
|
|
@@ -145,14 +186,22 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
- if (this.userId == this.initiatorId) {
|
|
|
|
- this.$util.msg('您不能参与自己发起的拼团')
|
|
|
|
|
|
+ if (this.collageData.orderId > 0) {
|
|
|
|
+ this.modal = true
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
this.countVisible = true
|
|
this.countVisible = true
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ handleModalConfirm(e) {
|
|
|
|
+ if (!e.index) return (this.modal = false)
|
|
|
|
+ console.log('查看订单')
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: `/pages/order/order-detail?orderId=${this.collageData.orderId}`
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
// 拼团购买
|
|
// 拼团购买
|
|
buyGroupNow() {
|
|
buyGroupNow() {
|
|
console.log('拼团购买')
|
|
console.log('拼团购买')
|
|
@@ -166,7 +215,7 @@ export default {
|
|
collageId: this.collageId
|
|
collageId: this.collageId
|
|
}
|
|
}
|
|
uni.setStorageSync('commitProductInfo', productStp)
|
|
uni.setStorageSync('commitProductInfo', productStp)
|
|
- this.$api.navigateTo('/pages/order/create-order?type=prodcut')
|
|
|
|
|
|
+ uni.redirectTo({ url: '/pages/order/create-order?type=prodcut' })
|
|
this.countVisible = false
|
|
this.countVisible = false
|
|
},
|
|
},
|
|
|
|
|
|
@@ -189,13 +238,13 @@ export default {
|
|
}).then(res => {
|
|
}).then(res => {
|
|
this.collageData = res.data
|
|
this.collageData = res.data
|
|
// 拼团已完成
|
|
// 拼团已完成
|
|
- if (this.collageData.orderId) {
|
|
|
|
- this.$util.msg('拼团已结束')
|
|
|
|
- setTimeout(() => {
|
|
|
|
- uni.switchTab({ url: '/pages/tabBar/index/index' })
|
|
|
|
- }, 2000)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ // if (this.collageData.status === 2) {
|
|
|
|
+ // this.$util.msg('拼团已结束')
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
+ // uni.switchTab({ url: '/pages/tabBar/index/index' })
|
|
|
|
+ // }, 2000)
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
// 拼团未完成
|
|
// 拼团未完成
|
|
this.countDown()
|
|
this.countDown()
|
|
this.isRequest = false
|
|
this.isRequest = false
|