|
@@ -1,6 +1,13 @@
|
|
|
<template>
|
|
|
<view class="product">
|
|
|
- <header-back :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :headerColor="headerColor" :page='backPage'></header-back>
|
|
|
+ <header-poduct v-if="isHeaderPoduct"
|
|
|
+ :systeminfo='systeminfo'
|
|
|
+ :navbar-data='nvabarData'
|
|
|
+ :headerBtnPosi ="headerBtnPosi"
|
|
|
+ :headerColor="headerColor"
|
|
|
+ :type="isShareType"
|
|
|
+ :page='backPage'>
|
|
|
+ </header-poduct>
|
|
|
<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="9"></tui-skeleton>
|
|
|
<view class="container-product tui-skeleton">
|
|
|
<view class="product-top">
|
|
@@ -140,7 +147,7 @@
|
|
|
<view class="item-bt" @click="buyProductCart()">
|
|
|
<image src="../../static/icon-cart-active@3x.png"></image>
|
|
|
<text>购物车</text>
|
|
|
- <text v-if="goodsData.cartCount > 0"
|
|
|
+ <text v-if="hasLogin"
|
|
|
class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
|
|
|
:class="[goodsData.cartCount < 10 ? 'goleft':'']">
|
|
|
{{ goodsData.cartCount >= 100 ? '99+': goodsData.cartCount}}
|
|
@@ -197,7 +204,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState,mapMutations } from 'vuex'
|
|
|
- import headerBack from '@/components/module/headerNavbar/header-poduct' //自定义导航
|
|
|
+ import headerPoduct from '@/components/module/headerNavbar/header-poduct' //自定义导航
|
|
|
import uniStars from '@/components/uni-stars/uni-stars.vue'
|
|
|
import parser from "@/components/jyf-Parser/index" //富文本处理
|
|
|
import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
|
|
@@ -210,7 +217,7 @@
|
|
|
var isPreviewImg;
|
|
|
export default{
|
|
|
components:{
|
|
|
- headerBack,
|
|
|
+ headerPoduct,
|
|
|
parser,
|
|
|
tuiSkeleton,
|
|
|
supplierDetails,
|
|
@@ -226,7 +233,8 @@
|
|
|
specClass: '',//规格弹窗css类,控制开关动画
|
|
|
isBtnType:'',
|
|
|
current:0,
|
|
|
- telPhone:'',
|
|
|
+ isShareType:'',
|
|
|
+ isHeaderPoduct:false,
|
|
|
navbarFiexd:'none',
|
|
|
ladderPriceFlag:'',
|
|
|
ladderPriceList:'',
|
|
@@ -267,8 +275,10 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- let self = this;
|
|
|
this.productID = option.id;//获取商品ID
|
|
|
+ this.isShareType = option.type
|
|
|
+ this.isHeaderPoduct = true
|
|
|
+ console.log(this.isShareType)
|
|
|
if(option.page == 2){
|
|
|
this.backPage = option.page
|
|
|
}
|
|
@@ -292,7 +302,10 @@
|
|
|
this.product.imageList.forEach(item =>{
|
|
|
this.productImage.push(item.image);
|
|
|
})
|
|
|
- this.goodsData.cartCount = this.product.productCount
|
|
|
+ //购物车数量
|
|
|
+ if(this.product.productCount>0){
|
|
|
+ this.goodsData.cartCount = this.product.productCount
|
|
|
+ }
|
|
|
//处理阶梯价格
|
|
|
if(this.product.ladderPriceList!=null){
|
|
|
this.ladderPriceList = this.product.ladderPriceList;
|
|
@@ -479,6 +492,9 @@
|
|
|
})
|
|
|
return systeminfo
|
|
|
},
|
|
|
+ getOptionFn(e){
|
|
|
+ this.isShareType = e.type
|
|
|
+ },
|
|
|
discard(){
|
|
|
//丢弃
|
|
|
}
|
|
@@ -511,14 +527,14 @@
|
|
|
}
|
|
|
return {
|
|
|
title: `${this.product.name}`,
|
|
|
- path: `pages/goods/product?id=${this.productID}`,
|
|
|
+ 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
|
|
|
+ this.userIdentity = resolve.userIdentity ? resolve.userIdentity : 3
|
|
|
console.log(this.userIdentity)
|
|
|
if (isPreviewImg) {
|
|
|
isPreviewImg = false;
|