|
@@ -216,31 +216,40 @@
|
|
<scroll-view class="tui-popup-scroll" scroll-y="true">
|
|
<scroll-view class="tui-popup-scroll" scroll-y="true">
|
|
<view class="content-tr">
|
|
<view class="content-tr">
|
|
<view class="content-td">起订量</view>
|
|
<view class="content-td">起订量</view>
|
|
- <view class="content-th">{{product.minBuyNumber}}</view>
|
|
|
|
|
|
+ <view class="content-th">{{ product.minBuyNumber }}</view>
|
|
</view>
|
|
</view>
|
|
<view class="content-tr">
|
|
<view class="content-tr">
|
|
<view class="content-td">品牌</view>
|
|
<view class="content-td">品牌</view>
|
|
- <view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
|
|
|
|
|
|
+ <view class="content-th">{{
|
|
|
|
+ product.brandName == null ? '其他' : product.brandName
|
|
|
|
+ }}</view>
|
|
</view>
|
|
</view>
|
|
<view class="content-tr">
|
|
<view class="content-tr">
|
|
<view class="content-td">分类</view>
|
|
<view class="content-td">分类</view>
|
|
- <view class="content-th">{{product.typeName == null? '暂无' : product.typeName}}</view>
|
|
|
|
|
|
+ <view class="content-th">{{
|
|
|
|
+ product.typeName == null ? '暂无' : product.typeName
|
|
|
|
+ }}</view>
|
|
</view>
|
|
</view>
|
|
<view class="content-tr">
|
|
<view class="content-tr">
|
|
- <view class="content-td">包装规格</view>
|
|
|
|
- <view class="content-th">{{product.unit}}</view>
|
|
|
|
|
|
+ <view class="content-td">包装规格</view>
|
|
|
|
+ <view class="content-th">{{ product.unit }}</view>
|
|
</view>
|
|
</view>
|
|
<view class="content-tr">
|
|
<view class="content-tr">
|
|
<view class="content-td">商品编码</view>
|
|
<view class="content-td">商品编码</view>
|
|
- <view class="content-th">{{product.productCode}}</view>
|
|
|
|
|
|
+ <view class="content-th">{{ product.productCode }}</view>
|
|
</view>
|
|
</view>
|
|
<view class="content-tr">
|
|
<view class="content-tr">
|
|
<view class="content-td">库存</view>
|
|
<view class="content-td">库存</view>
|
|
- <view class="content-th">{{product.stock}}</view>
|
|
|
|
|
|
+ <view class="content-th">{{ product.stock }}</view>
|
|
</view>
|
|
</view>
|
|
- <view class="content-tr" v-if="product.parametersList.length>0" v-for="(item, index) in product.parametersList" :key="index">
|
|
|
|
- <view class="content-td">{{item.paramsName}}</view>
|
|
|
|
- <view class="content-th">{{item.paramsContent}}</view>
|
|
|
|
|
|
+ <view
|
|
|
|
+ class="content-tr"
|
|
|
|
+ v-if="product.parametersList.length > 0"
|
|
|
|
+ v-for="(item, index) in product.parametersList"
|
|
|
|
+ :key="index"
|
|
|
|
+ >
|
|
|
|
+ <view class="content-td">{{ item.paramsName }}</view>
|
|
|
|
+ <view class="content-th">{{ item.paramsContent }}</view>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</div>
|
|
</div>
|
|
@@ -268,6 +277,7 @@ import customP from '@/components/cm-module/headerNavbar/header-poduct' //自定
|
|
import cmPrice from '@/components/cm-module/productDetails/cm-price.vue' //价格显示
|
|
import cmPrice from '@/components/cm-module/productDetails/cm-price.vue' //价格显示
|
|
import cmAttributes from '@/components/cm-module/productDetails/cm-attributes.vue' //规格信息
|
|
import cmAttributes from '@/components/cm-module/productDetails/cm-attributes.vue' //规格信息
|
|
import parser from '@/components/jyf-Parser/index' //富文本处理
|
|
import parser from '@/components/jyf-Parser/index' //富文本处理
|
|
|
|
+import shareAlert from '@/components/cm-module/modelAlert/shareAlert' //分享弹窗
|
|
import tuiSkeleton from '@/components/tui-skeleton/tui-skeleton'
|
|
import tuiSkeleton from '@/components/tui-skeleton/tui-skeleton'
|
|
import recommend from '@/components/cm-module/productDetails/recommend' //相关推荐
|
|
import recommend from '@/components/cm-module/productDetails/recommend' //相关推荐
|
|
import cmParameter from '@/components/cm-module/productDetails/cm-parameter' //相关参数
|
|
import cmParameter from '@/components/cm-module/productDetails/cm-parameter' //相关参数
|
|
@@ -285,7 +295,8 @@ export default {
|
|
cmPrice,
|
|
cmPrice,
|
|
cmAttributes,
|
|
cmAttributes,
|
|
cmParameter,
|
|
cmParameter,
|
|
- cmService
|
|
|
|
|
|
+ cmService,
|
|
|
|
+ shareAlert
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -363,21 +374,55 @@ export default {
|
|
this.backPage = option.page
|
|
this.backPage = option.page
|
|
}
|
|
}
|
|
if (this.isShareType == 'share') {
|
|
if (this.isShareType == 'share') {
|
|
|
|
+ this.initData()
|
|
authorize.getSetting().then(wxResponse => {
|
|
authorize.getSetting().then(wxResponse => {
|
|
// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
|
|
// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
|
|
- console.log(wxResponse)
|
|
|
|
if (wxResponse == 1) {
|
|
if (wxResponse == 1) {
|
|
wxLogin.wxLoginAuthorize()
|
|
wxLogin.wxLoginAuthorize()
|
|
} else {
|
|
} else {
|
|
console.log(new Date() + '用户未授权微信信息')
|
|
console.log(new Date() + '用户未授权微信信息')
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ } else {
|
|
|
|
+ this.$api
|
|
|
|
+ .getStorage()
|
|
|
|
+ .then(resolve => {
|
|
|
|
+ this.userID = resolve.userID ? resolve.userID : ''
|
|
|
|
+ this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
|
|
|
|
+ this.shopID = resolve.shopID ? resolve.shopID : ''
|
|
|
|
+ if (
|
|
|
|
+ this.userIdentity == 0 ||
|
|
|
|
+ this.userIdentity == 2 ||
|
|
|
|
+ this.userIdentity == 4
|
|
|
|
+ ) {
|
|
|
|
+ this.isShowButton = true
|
|
|
|
+ } else {
|
|
|
|
+ this.isShowButton = false
|
|
|
|
+ }
|
|
|
|
+ if (isPreviewImg) {
|
|
|
|
+ isPreviewImg = false
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ this.initData()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(error => {
|
|
|
|
+ this.initData()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
this.getWinHeight()
|
|
this.getWinHeight()
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['hasLogin', 'isWxAuthorize', 'identity'])
|
|
...mapState(['hasLogin', 'isWxAuthorize', 'identity'])
|
|
},
|
|
},
|
|
|
|
+ onShareAppMessage() {
|
|
|
|
+ console.log(this.product)
|
|
|
|
+ return {
|
|
|
|
+ title: this.product.productName,
|
|
|
|
+ path: `/pages/goods/product?type=share&id=${this.product.productId}`,
|
|
|
|
+ imageUrl: `${this.productImage[0]}`
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
initData() {
|
|
initData() {
|
|
// 初始化商品详情查询
|
|
// 初始化商品详情查询
|
|
@@ -621,13 +666,12 @@ export default {
|
|
//丢弃
|
|
//丢弃
|
|
},
|
|
},
|
|
onShare(res) {
|
|
onShare(res) {
|
|
- console.log(this.product)
|
|
|
|
//分享转发
|
|
//分享转发
|
|
if (res.from === 'button') {
|
|
if (res.from === 'button') {
|
|
// 来自页面内转发按钮
|
|
// 来自页面内转发按钮
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
- title: `${this.product.productName}`,
|
|
|
|
|
|
+ title: this.product.productName,
|
|
path: `pages/goods/product?type=share&id=${this.productId}`,
|
|
path: `pages/goods/product?type=share&id=${this.productId}`,
|
|
imageUrl: `${this.productImage[0]}`
|
|
imageUrl: `${this.productImage[0]}`
|
|
}
|
|
}
|
|
@@ -736,40 +780,7 @@ export default {
|
|
this.isScrollTop = false
|
|
this.isScrollTop = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onShareAppMessage(res) {
|
|
|
|
- //分享转发
|
|
|
|
- if (res.from === 'button') {
|
|
|
|
- // 来自页面内转发按钮
|
|
|
|
- }
|
|
|
|
- return {
|
|
|
|
- title: `${this.product.name}`,
|
|
|
|
- path: `pages/goods/product?type=share&id=${this.productID}`,
|
|
|
|
- imageUrl: `${this.productImage[0]}`
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- onShow() {
|
|
|
|
- this.$api
|
|
|
|
- .getStorage()
|
|
|
|
- .then(resolve => {
|
|
|
|
- this.userID = resolve.userID ? resolve.userID : ''
|
|
|
|
- this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 0
|
|
|
|
- this.shopID = resolve.shopID ? resolve.shopID : ''
|
|
|
|
- if (this.userIdentity == 0 || this.userIdentity == 2 || this.userIdentity == 4) {
|
|
|
|
- this.isShowButton = true
|
|
|
|
- } else {
|
|
|
|
- this.isShowButton = false
|
|
|
|
- }
|
|
|
|
- if (isPreviewImg) {
|
|
|
|
- isPreviewImg = false
|
|
|
|
- return
|
|
|
|
- } else {
|
|
|
|
- this.initData()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- .catch(error => {
|
|
|
|
- this.initData()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ onShow() {}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|