|
@@ -17,9 +17,9 @@
|
|
|
<view :style="{height:statusBarHeight+'px'}"></view>
|
|
|
<u-swiper mode="number" :border-radius="0" bg-color="#000" img-mode="widthFix" :interval="3000" :height="450" :list="imgList"></u-swiper>
|
|
|
<view class="product-info-text">
|
|
|
- <view class="product-info-text-title">{{detail.productName}}</view>
|
|
|
+ <view class="product-info-text-title">{{detail.productName}} <view class="copyText" @click="copy(detail.product.origCode)">复制</view></view>
|
|
|
<view class="product-info-text-attr">
|
|
|
- <view class="product-info-price">
|
|
|
+ <view class="product-info-price flex align_center">
|
|
|
¥<text class="price-red">{{hasLogin ? detail.price : '***'}}</text>
|
|
|
</view>
|
|
|
<view class="product-info-nums">
|
|
@@ -31,19 +31,18 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-divider bg-color="">商品详情</u-divider>
|
|
|
- <view class="product-info-guige" v-if="detail">
|
|
|
- <view class="row">品牌:<text>{{detail.productBrandName||'--'}}</text></view>
|
|
|
- <view class="row-ban">原厂编码:<text>{{detail.productOrigCode||'--'}} </text></view>
|
|
|
- <view class="row-ban">产品编码:<text>{{detail.productCode||'--'}}</text></view>
|
|
|
- <view class="row-ban">计量单位:<text>{{detail.unit||'--'}}</text></view>
|
|
|
- <view class="row-ban">包装数:<text>{{ (detail && detail.packQty) || '--' }}{{ (detail && detail.packQty) ? detail.unit : '' }}/{{ detail.packQtyUnit||'--' }}</text></view>
|
|
|
- <view class="row-ban">尺寸:<text>{{detail.size||'--'}}</text></view>
|
|
|
- <view class="row-ban">内盒尺寸:<text>{{detail.size||'--'}}</text></view>
|
|
|
- <view class="row-ban">重量:<text>{{detail.weight||'--'}}</text></view>
|
|
|
- <view class="row-ban">颜色:<text>{{detail.color||'--'}}</text></view>
|
|
|
+ <view class="product-info-guige" v-if="detail&&detail.product">
|
|
|
+ <view class="row">品牌:<text>{{detail.product.productBrandName||'--'}}</text></view>
|
|
|
+ <view class="row">原厂编码:<text>{{detail.product.origCode||'--'}} </text> <view class="copyText" @click="copy(detail.product.origCode)">复制</view></view>
|
|
|
+ <view class="row">产品编码:<text>{{detail.product.code||'--'}}</text> <view class="copyText" @click="copy(detail.product.origCode)">复制</view></view>
|
|
|
+ <view class="row">条形码:<text>{{detail.product.qrCode||'--'}}</text> <view class="copyText" @click="copy(detail.product.origCode)">复制</view></view>
|
|
|
+ <view class="row-ban">商品尺寸:<text>{{detail.product.size||'--'}}</text></view>
|
|
|
+ <view class="row-ban">计量单位:<text>{{detail.product.unit||'--'}}</text></view>
|
|
|
+ <view class="row-ban">重量:<text>{{detail.product.weight||'--'}}</text></view>
|
|
|
+ <view class="row-ban">包装数:<text>{{ (detail.product.packQty) || '--' }}{{ detail.product.packQty ? detail.product.unit : '' }}/{{ detail.product.packQtyUnit||'--' }}</text></view>
|
|
|
</view>
|
|
|
<view class="product-info-content">
|
|
|
- <rich-text v-if="detail && detail.description" :nodes="detail.description"></rich-text>
|
|
|
+ <rich-text v-if="detail && detail.product && detail.product.description" :nodes="detail.product.description"></rich-text>
|
|
|
<view v-else style="font-size: 12px;color: #999;text-align: center;">暂无产品介绍</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -52,7 +51,7 @@
|
|
|
<view class="scrollPage-footer-box">
|
|
|
<view class="footer-left">
|
|
|
<view class="footer-left-item" @click="toCart">
|
|
|
- <u-icon :size='50' name="shopping-cart"></u-icon>
|
|
|
+ <u-icon :size='50' color="#666" name="shopping-cart"></u-icon>
|
|
|
<text class="footer-left-item-text">购物车</text>
|
|
|
<text class="badge" v-if="totalNum">{{totalNum>99?'99+':totalNum}}</text>
|
|
|
</view>
|
|
@@ -156,6 +155,12 @@
|
|
|
goBack(){
|
|
|
uni.navigateBack()
|
|
|
},
|
|
|
+ // 复制
|
|
|
+ copy(text){
|
|
|
+ uni.setClipboardData({
|
|
|
+ data: text,
|
|
|
+ })
|
|
|
+ },
|
|
|
// 产品详情
|
|
|
getDetail(){
|
|
|
uni.showLoading({
|
|
@@ -167,7 +172,13 @@
|
|
|
}).then(res => {
|
|
|
if(res.status == 200){
|
|
|
this.detail = res.data
|
|
|
- this.imgList = [res.data.productMsg]
|
|
|
+ if(res.data && res.data.productPicList){
|
|
|
+ res.data.productPicList.forEach(item => {
|
|
|
+ this.imgList.push(item.imageUrl+'?x-oss-process=image/resize,p_50')
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.imgList.push(res.data.productMsg+'?x-oss-process=image/resize,p_50')
|
|
|
+ }
|
|
|
}
|
|
|
uni.hideLoading()
|
|
|
})
|
|
@@ -183,6 +194,11 @@
|
|
|
// 加入购物车
|
|
|
addCart(){
|
|
|
if(this.hasLogin){
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加入中...',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ // 加入购物车
|
|
|
addCart({
|
|
|
qty: 1,
|
|
|
price: this.detail.price,
|
|
@@ -190,10 +206,7 @@
|
|
|
}).then(res => {
|
|
|
if(res.status == 200){
|
|
|
this.cartCount()
|
|
|
- uni.showToast({
|
|
|
- title: '加入成功',
|
|
|
- icon: 'success'
|
|
|
- })
|
|
|
+ uni.hideLoading()
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
@@ -308,6 +321,17 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .copyText{
|
|
|
+ background-color: #efefef;
|
|
|
+ border-radius: 100rpx;
|
|
|
+ padding: 0 20rpx;
|
|
|
+ color: #03A9F4;
|
|
|
+ font-size: 20rpx;
|
|
|
+ display: inline-block;
|
|
|
+ margin-left: 20rpx;
|
|
|
+ height: 44rpx;
|
|
|
+ line-height: 44rpx;
|
|
|
+ }
|
|
|
.scrollPage-content{
|
|
|
flex: 1;
|
|
|
overflow-y: auto;
|