|
|
@ -58,15 +58,15 @@ |
|
|
<qn-footer fixed height="100rpx"> |
|
|
<qn-footer fixed height="100rpx"> |
|
|
<view class="footer-row"> |
|
|
<view class="footer-row"> |
|
|
<view class="left"> |
|
|
<view class="left"> |
|
|
<view class=""> |
|
|
|
|
|
|
|
|
<view @click="storeTap"> |
|
|
<image class="icon" src="/static/imgs/paperDetails/shop-icon.png"></image> |
|
|
<image class="icon" src="/static/imgs/paperDetails/shop-icon.png"></image> |
|
|
<view class="label" @tap="storeTap">店铺</view> |
|
|
|
|
|
|
|
|
<view class="label">店铺</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class=""> |
|
|
|
|
|
|
|
|
<view @click="shoppingCartTap"> |
|
|
<image class="icon" src="/static/imgs/paperDetails/shopping-trolley.png"></image> |
|
|
<image class="icon" src="/static/imgs/paperDetails/shopping-trolley.png"></image> |
|
|
<view class="label" @tap="shoppingCartTap">购物车</view> |
|
|
|
|
|
|
|
|
<view class="label">购物车</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="" @tap="addShoppingTap(1)"> |
|
|
|
|
|
|
|
|
<view @click="addShoppingTap(1)"> |
|
|
<image class="icon" src="/static/imgs/paperDetails/add-shopping-trolley.png"></image> |
|
|
<image class="icon" src="/static/imgs/paperDetails/add-shopping-trolley.png"></image> |
|
|
<view class="label">加购物车</view> |
|
|
<view class="label">加购物车</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -227,14 +227,35 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
this.params.productId = option.paperId |
|
|
|
|
|
this.queryData() |
|
|
|
|
|
|
|
|
if (option.paperId) { |
|
|
|
|
|
this.params.productId = option.paperId |
|
|
|
|
|
if (this.hasLogin) { |
|
|
|
|
|
this.queryData() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$store.commit('setNextPage', { name: 'paper-detail', data: { paperId: option.paperId } }) |
|
|
|
|
|
go2('login') |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '参数错误', |
|
|
|
|
|
icon: 'fail', |
|
|
|
|
|
success: () => { |
|
|
|
|
|
back() |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
buyTon() { |
|
|
buyTon() { |
|
|
let num = 0 |
|
|
let num = 0 |
|
|
num = round(this.buyPaperDto.gramWeight * this.buyPaperDto.width * this.buyPaperDto.length * this.buyPaperDto.pieceQuantity * 1e-12, 4) |
|
|
num = round(this.buyPaperDto.gramWeight * this.buyPaperDto.width * this.buyPaperDto.length * this.buyPaperDto.pieceQuantity * 1e-12, 4) |
|
|
return num |
|
|
return num |
|
|
|
|
|
}, |
|
|
|
|
|
hasCompany() { |
|
|
|
|
|
return this.$store.state.companyInfo.id != null |
|
|
|
|
|
}, |
|
|
|
|
|
hasLogin() { |
|
|
|
|
|
return this.$store.state.qnToken != '' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
@ -266,6 +287,13 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 立即订购 |
|
|
// 立即订购 |
|
|
addShoppingTap(type) { |
|
|
addShoppingTap(type) { |
|
|
|
|
|
if (!this.hasCompany) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '请先完善公司信息', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.shoppingCarType = type |
|
|
this.shoppingCarType = type |
|
|
this.buyPaperDto = { |
|
|
this.buyPaperDto = { |
|
|
buyTon: 0, |
|
|
buyTon: 0, |
|
|
@ -283,6 +311,13 @@ export default { |
|
|
|
|
|
|
|
|
// 路由到实单询比价 |
|
|
// 路由到实单询比价 |
|
|
inquiryTap() { |
|
|
inquiryTap() { |
|
|
|
|
|
if (!this.hasCompany) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '请先完善公司信息', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
go2('for-comparison', { id: this.info.supplierId, productImg: this.info.imgList[0] }) |
|
|
go2('for-comparison', { id: this.info.supplierId, productImg: this.info.imgList[0] }) |
|
|
}, |
|
|
}, |
|
|
closeTap() { |
|
|
closeTap() { |
|
|
|