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