bbbb
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 评价 -->
|
||||
<view class="eva-section">
|
||||
<!-- <view class="eva-section">
|
||||
<view class="e-header">
|
||||
<text class="tit">评价</text>
|
||||
<text>({{ consultCount.all }})</text>
|
||||
@@ -82,7 +82,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="detail-desc">
|
||||
<view class="d-header"><text>图文详情</text></view>
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--
|
||||
<view class="mask" :class="maskState===0 ? 'none' : maskState===1 ? 'show' : ''" @click="toggleMask">
|
||||
<view class="mask-content" @click.stop.prevent="stopPrevent">
|
||||
<view @click="obtainCoupon(item)" class="coupon-item" v-for="(item,index) in couponList" :key="index">
|
||||
@@ -129,7 +129,7 @@
|
||||
<text class="tips">{{item.categoryTitle?'限' + item.categoryTitle + '可用': '全品类可用'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<!-- 分享 -->
|
||||
@@ -189,13 +189,20 @@ export default {
|
||||
},
|
||||
async onLoad(ops) {
|
||||
//接收传值,id里面放的是标题,因为测试数据并没写id
|
||||
|
||||
console.log('zzzz',ops)
|
||||
ops={id:204}
|
||||
let id = ops.id;
|
||||
// let id = 408;
|
||||
if (id) {
|
||||
this.logining = true;
|
||||
let params = { id: ops.id };
|
||||
// let params = { id: ops.id };
|
||||
let params = { id:204 };
|
||||
console.log('11111',id)
|
||||
let data = await Api.apiCall('get', Api.goods.secskillDetail, params);
|
||||
this.logining = false;
|
||||
|
||||
console.log('vvvv',data)
|
||||
if (data) {
|
||||
let detailData = data.goods;
|
||||
let goods = detailData.goods;
|
||||
@@ -217,8 +224,10 @@ export default {
|
||||
title: goods.name
|
||||
});
|
||||
}
|
||||
console.log('mmmmm',this.hasLogin)
|
||||
if (this.hasLogin) {
|
||||
let params = { goodsId: ops.id };
|
||||
// let params = { goodsId: ops.id };
|
||||
let params = { goodsId: 204 };
|
||||
await Api.apiCall('post', Api.goods.addView, params);
|
||||
}
|
||||
let params1 = { goodsId: ops.id };
|
||||
@@ -251,17 +260,29 @@ export default {
|
||||
//领取优惠券
|
||||
async obtainCoupon(index) {
|
||||
if (!this.hasLogin) {
|
||||
this.$api.msg('请先登录');
|
||||
// this.$api.msg('请先登录');
|
||||
|
||||
uni.showToast({title:'请先登录',
|
||||
duration:1500,
|
||||
mask:false,
|
||||
icon:"none"
|
||||
});
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
|
||||
let params = { couponId: index.id };
|
||||
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
let data = null; //await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
console.log(data);
|
||||
if (data) {
|
||||
this.$api.msg(data);
|
||||
// this.$api.msg(data);
|
||||
|
||||
uni.showToast({title:data,
|
||||
duration:1500,
|
||||
mask:false,
|
||||
icon:"none"
|
||||
});
|
||||
this.toggleMask()
|
||||
}
|
||||
uni.hideLoading();
|
||||
@@ -333,9 +354,11 @@ export default {
|
||||
|
||||
|
||||
if (data) {
|
||||
this.$api.msg('添加购物车成功!');
|
||||
// this.$api.msg('添加购物车成功!');
|
||||
uni.showToast({title:"添加购物车成功",icon: "none"});
|
||||
} else {
|
||||
this.$api.msg('加入购物车错误');
|
||||
// this.$api.msg('加入购物车错误');
|
||||
uni.showToast({title:"加入购物车错误",icon: "none"});
|
||||
}
|
||||
},
|
||||
stopPrevent() {}
|
||||
|
||||
Reference in New Issue
Block a user