|
|
|
@ -21,7 +21,7 @@ |
|
|
|
<view class="box-right"> |
|
|
|
<view class="box-right-name">{{item.productName}}</view> |
|
|
|
<view class="box-right-num">{{item.productSn}}</view> |
|
|
|
<view class="box-right-price"> |
|
|
|
<view class="box-right-price" v-if="item.wholesalePrice"> |
|
|
|
<view class="price-box" v-if="type==0"> |
|
|
|
<text>{{item.purchasePrice}}</text> |
|
|
|
<text>采购价</text> |
|
|
|
@ -40,7 +40,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<checkbox-group @tap="checkboxChange(item)"> |
|
|
|
<checkbox-group @tap="checkboxChange(item)" v-if="item.wholesalePrice"> |
|
|
|
<label> |
|
|
|
<checkbox :checked="item.checked" class="checkbox" /> |
|
|
|
</label> |
|
|
|
@ -63,7 +63,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 分享弹出层 --> |
|
|
|
<uni-popup ref="share" type="share" @select='select' safeArea backgroundColor="#fff"> |
|
|
|
<uni-popup ref="share" type="share" safeArea backgroundColor="#fff"> |
|
|
|
<uni-popup-share></uni-popup-share> |
|
|
|
</uni-popup> |
|
|
|
<!-- 弹出输入框 --> |
|
|
|
@ -138,6 +138,20 @@ |
|
|
|
}, |
|
|
|
created() { |
|
|
|
uni.hideHomeButton() //左上角HOME按钮 |
|
|
|
}, |
|
|
|
onShareTimeline() { |
|
|
|
return { |
|
|
|
title: '查看我的推荐', |
|
|
|
imageUrl:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/abdc5c897c4f4fe198b74091a708030b.jpg', |
|
|
|
query: 'khid=' + this.khid |
|
|
|
} |
|
|
|
}, |
|
|
|
onShareAppMessage() { |
|
|
|
return { |
|
|
|
title: '查看我的推荐', |
|
|
|
imageUrl:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/abdc5c897c4f4fe198b74091a708030b.jpg', |
|
|
|
path: '/pages/index/shareStyle?khid=' + this.khid |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
|
|
|
|
@ -152,9 +166,7 @@ |
|
|
|
methods: { |
|
|
|
//初始化获取分类列表 |
|
|
|
getGategoryList() { |
|
|
|
this.tui.request("/app/productCategory/list", "get", { |
|
|
|
// shopId: 1, |
|
|
|
}, false, true).then((res) => { |
|
|
|
this.tui.request("/app/productCategory/list", "get", {}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.indexList = res.result; |
|
|
|
for (var i = 0; i < this.indexList.length; i++) { |
|
|
|
@ -163,10 +175,14 @@ |
|
|
|
} else { |
|
|
|
this.indexList[i].parentId = false |
|
|
|
} |
|
|
|
this.categoryId = this.indexList[i].id |
|
|
|
this.getShareList(this.indexList[i].id); |
|
|
|
let data = { |
|
|
|
categoryId: this.indexList[i].id |
|
|
|
} |
|
|
|
this.shopList.push(data) |
|
|
|
this.categoryId = this.indexList[i].id |
|
|
|
this.getShareList(this.indexList[i].id) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
@ -175,14 +191,23 @@ |
|
|
|
//点击分类获取商品列表 |
|
|
|
getShareList(id) { |
|
|
|
this.tui.request("/app/product/getShareList", "POST", { |
|
|
|
categoryId: this.categoryId, |
|
|
|
categoryId: id, |
|
|
|
searchStr: this.searchName, |
|
|
|
pageNum: this.pageNum, |
|
|
|
pageSize: '100' |
|
|
|
}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
|
|
|
|
this.shopList.push(res.result.records) |
|
|
|
if (res.code == 200) { |
|
|
|
for (var i = 0; i < this.shopList.length; i++) { |
|
|
|
if(res.result.records != []){ |
|
|
|
if(this.shopList[i].categoryId == res.result.records[0].categoryId){ |
|
|
|
this.shopList[i] = res.result.records |
|
|
|
} |
|
|
|
}else{ |
|
|
|
this.shopList[i] = [] |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
console.log(this.shopList) |
|
|
|
this.goodsList = this.shopList[0] |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
@ -269,26 +294,14 @@ |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
//点击的是转发朋友圈还是微信好友 |
|
|
|
select(index) { |
|
|
|
if (index == 0) { |
|
|
|
this.onShareAppMessage() |
|
|
|
} else { |
|
|
|
this.onShareTimeline() |
|
|
|
} |
|
|
|
}, |
|
|
|
onShareTimeline() { |
|
|
|
return { |
|
|
|
title: '查看我的推荐', |
|
|
|
query: 'khid=' + this.khid |
|
|
|
} |
|
|
|
}, |
|
|
|
onShareAppMessage() { |
|
|
|
return { |
|
|
|
title: '查看我的推荐', |
|
|
|
path: '/pages/index/shareStyle?khid=' + this.khid |
|
|
|
} |
|
|
|
}, |
|
|
|
// //点击的是转发朋友圈还是微信好友 |
|
|
|
// select(index) { |
|
|
|
// if (index == 0) { |
|
|
|
// this.onShareAppMessage() |
|
|
|
// } else { |
|
|
|
// this.onShareTimeline() |
|
|
|
// } |
|
|
|
// }, |
|
|
|
//弹出购物车或者商品规格选择弹窗 |
|
|
|
toggle(type, item) { |
|
|
|
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
|
|
|
|