order 7.23
This commit is contained in:
@@ -26,8 +26,9 @@
|
||||
<view class="hr"></view>
|
||||
<!-- <navs :value="领券"></navs> -->
|
||||
<navs :value="'产品规格'"></navs>
|
||||
<navs :value="'产品颜色'"></navs>
|
||||
<navs :value="'选择尺码'"></navs>
|
||||
<!-- <navs :value="'产品颜色'"></navs> -->
|
||||
<!-- <navs :value="'选择尺码'"></navs> -->
|
||||
<!-- <navs v-for="(value, index) in goodsInfo.spec_name" :value="value" :key="index"></navs> -->
|
||||
<view class="hr"></view>
|
||||
<view class="group-user" v-if="groupUser.length">
|
||||
<view class="top">
|
||||
@@ -84,7 +85,7 @@
|
||||
<view class="name u-line-1">{{ user.member_nickname }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="involvement-btn" @click="settlementOrder('involvement')">参与拼团</view>
|
||||
<view class="involvement-btn" @click="settlementOrder({ type: 'involvement' })">参与拼团</view>
|
||||
<image class="close" src="/static/image/common/17.png" @click="showInvolvementUser=false"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
@@ -119,7 +120,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 普通商品 tool -->
|
||||
<tloos @buy="buy" @xuanze="xuanze" :id="goodsInfo.goods_commonid" :info="info" v-if="type==1"></tloos>
|
||||
<tloos @buy="buy" @xuanze="xuanze" :id="goodsInfo.goods_commonid" :info="goodsInfo" v-if="type==1"></tloos>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
@@ -186,7 +187,7 @@ export default {
|
||||
this.setTitle();
|
||||
},
|
||||
spikeGoods() {
|
||||
this.settlementOrder(3)
|
||||
this.settlementOrder()
|
||||
},
|
||||
setSpikeTime() {
|
||||
const time = this.groupbuyInfo.groupbuy_endtime;
|
||||
@@ -210,45 +211,48 @@ export default {
|
||||
}, 1000)
|
||||
},
|
||||
buy(info){
|
||||
if(info.type == 2){
|
||||
if(info.type == 2){ // 加入购物车
|
||||
this.$u.api.addCart({
|
||||
goods_id: this.id,
|
||||
quantity: info.value,
|
||||
}).then(res => {
|
||||
this.$refs.uToast.show({
|
||||
title: res.errCode[1],
|
||||
title: res.message,
|
||||
type: res.errCode == 0 ? 'success' : 'warning',
|
||||
})
|
||||
})
|
||||
}
|
||||
} else if (info.type == 1) { // 支付
|
||||
this.settlementOrder({num: info.value});
|
||||
}
|
||||
},
|
||||
getGoodsDetails(id) {
|
||||
this.id = id;
|
||||
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
this.goodsInfo = res.data.goods;
|
||||
let list = [];
|
||||
res.data.goods_image[0].forEach(item => {
|
||||
let temp = {
|
||||
image: item
|
||||
}
|
||||
list.push(temp);
|
||||
})
|
||||
this.list = list;
|
||||
// console.log(this.goodsInfo.mobile_body);
|
||||
}
|
||||
})
|
||||
this.$u.api.goodsInfo({id}).then((res)=>{
|
||||
// console.log(res)
|
||||
this.info = res.data.goods;
|
||||
this.glist = res.data.spec_list;
|
||||
})
|
||||
},
|
||||
settlementOrder(type) {
|
||||
// getGoodsDetails(id) {
|
||||
// this.id = id;
|
||||
// this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
|
||||
// if (res.errCode == 0) {
|
||||
// this.goodsInfo = res.data.goods;
|
||||
// let list = [];
|
||||
// res.data.goods_image[0].forEach(item => {
|
||||
// let temp = {
|
||||
// image: item
|
||||
// }
|
||||
// list.push(temp);
|
||||
// })
|
||||
// this.list = list;
|
||||
// this.info = res.data.goods;
|
||||
// this.glist = res.data.spec_list;
|
||||
// // console.log(this.goodsInfo.mobile_body);
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// 下单
|
||||
/*
|
||||
* @params {Number} type 拼团或者开团
|
||||
**/
|
||||
settlementOrder({type, num = 1} = {}) {
|
||||
// ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
|
||||
let params = {
|
||||
ifcart: 0,
|
||||
cart_id: [this.goodsInfo.goods_id + '|' + 1],
|
||||
cart_id: [this.goodsInfo.goods_id + '|' + num],
|
||||
}
|
||||
if(this.type == 2) {
|
||||
if(type == 'involvement') {
|
||||
@@ -288,7 +292,7 @@ export default {
|
||||
let title = '';
|
||||
switch (this.type) {
|
||||
case 1:
|
||||
|
||||
title = '商品详情';
|
||||
break;
|
||||
case 2:
|
||||
title = '拼团商品详情';
|
||||
|
||||
Reference in New Issue
Block a user