|
@@ -6,7 +6,8 @@
|
|
|
<goods-sku :productInfo="productInfo" @handlerSku="handlerSku"/>
|
|
|
<goods-classification :productInfo="productInfo"/>
|
|
|
<goods-detail :productInfo="productInfo"/>
|
|
|
- <div class="buy-now" v-if="isLock">
|
|
|
+ <div class="offline" v-if="isgoBy">该商品已下架啦~</div>
|
|
|
+ <div class="buy-now" v-if="isLock && !isgoBy">
|
|
|
<div class="foot" @click="$router.push('/shopping-mall')">
|
|
|
<van-image class="index" width="80%" height="80%" src="https://static.caimei365.com/app/mini-distribution/index.png"></van-image>
|
|
|
<div>首页</div>
|
|
@@ -40,7 +41,8 @@ export default {
|
|
|
skus: {},
|
|
|
imageList: [],
|
|
|
userInfo: {},
|
|
|
- dataInfo: {}
|
|
|
+ dataInfo: {},
|
|
|
+ isgoBy: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -67,12 +69,16 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
async productDetail () {
|
|
|
- const data = await productDetail(Object.assign(this.formData, { productId: this.productId, typeId: this.typeId }))
|
|
|
- this.productInfo = data
|
|
|
- this.imageList = data.imageList.map(i => i.image)
|
|
|
- this.skus = data.skus
|
|
|
- this.dataInfo.productImage = this.imageList[0]
|
|
|
- this.dataInfo.name = this.productInfo.name
|
|
|
+ try {
|
|
|
+ const data = await productDetail(Object.assign(this.formData, { productId: this.productId, typeId: this.typeId }))
|
|
|
+ this.productInfo = data
|
|
|
+ this.imageList = data.imageList.map(i => i.image)
|
|
|
+ this.skus = data.skus
|
|
|
+ this.dataInfo.productImage = this.imageList[0]
|
|
|
+ this.dataInfo.name = this.productInfo.name
|
|
|
+ } catch (err) {
|
|
|
+ this.isgoBy = true
|
|
|
+ }
|
|
|
},
|
|
|
handlerSku ({ selectedNum, selectedSku }) {
|
|
|
this.$router.push(`/order-create?selectedNum=${selectedNum}&selectedSku=${selectedSku.s1}&typeId=${this.typeId}&productId=${this.productId}&cId=${this.cId}`)
|
|
@@ -89,10 +95,10 @@ export default {
|
|
|
this.$wxReady((wx) => {
|
|
|
// 需在用户可能点击分享按钮前就先调用
|
|
|
// wx.updateAppMessageShareData({
|
|
|
- // title: `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享标题
|
|
|
- // desc: `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享描述
|
|
|
- // link: `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
|
|
|
- // imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png', // 分享图标
|
|
|
+ // title: '商品详情', // 分享标题
|
|
|
+ // desc: `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享描述
|
|
|
+ // link: `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
|
|
|
+ // imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`, // 分享图标
|
|
|
// fail: () => {
|
|
|
// alert('updateAppMessageShareData: 设置错误')
|
|
|
// },
|
|
@@ -101,10 +107,10 @@ export default {
|
|
|
// }
|
|
|
// }) // `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`
|
|
|
wx.onMenuShareAppMessage({
|
|
|
- title: `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享标题
|
|
|
- desc: `https://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享描述
|
|
|
- link: `http://sell-b.caimei365.com/goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
|
|
|
- imgUrl: 'https://static.caimei365.com/app/mini-distribution/qrcode.png', // 分享图标
|
|
|
+ title: '分销商城', // 分享标题
|
|
|
+ desc: '分销商城', // 分享描述
|
|
|
+ link: `${process.env.VUE_APP_DATA_API}goods-detail?productId=${this.productId}&typeId=0&suid=${this.$store.getters.userId}&isIns=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
|
|
|
+ imgUrl: `${process.env.VUE_APP_DATA_API}favicon.png`, // 分享图标
|
|
|
type: 'link',
|
|
|
success: () => {
|
|
|
alert('onMenuShareAppMessage: 设置成功')
|
|
@@ -129,6 +135,20 @@ export default {
|
|
|
.classification {
|
|
|
margin-bottom: 2.7vw;
|
|
|
}
|
|
|
+.offline {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background: rgba($color: #000000, $alpha: 0.5);
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ height: 10.7vw;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 3.7vw;
|
|
|
+}
|
|
|
.buy-now {
|
|
|
width: 100%;
|
|
|
padding: 1vw 3.2vw 1vw 8.4vw;
|