|
|
@@ -40,10 +40,18 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="other-box">
|
|
|
+ <view class="other-box-item">
|
|
|
+ <view class="label">产品名称</view>
|
|
|
+ <view class="text">{{product.productName||'--'}}</view>
|
|
|
+ </view>
|
|
|
<view class="other-box-item">
|
|
|
<view class="label">包装规格</view>
|
|
|
<view class="text">{{product.prescribeSpec||'--'}}</view>
|
|
|
</view>
|
|
|
+ <view class="other-box-item">
|
|
|
+ <view class="label">包装单位</view>
|
|
|
+ <view class="text">{{product.unitName||'--'}}</view>
|
|
|
+ </view>
|
|
|
<view class="other-box-item">
|
|
|
<view class="label">批准文号</view>
|
|
|
<view class="text">{{product.batchNumber||'--'}}</view>
|
|
|
@@ -52,7 +60,15 @@
|
|
|
<view class="label">生产厂家</view>
|
|
|
<view class="text">{{product.mah||'--'}}</view>
|
|
|
</view>
|
|
|
- <view class="other-box-item" v-if="product.sales">
|
|
|
+ <view class="other-box-item">
|
|
|
+ <view class="label">商品条码</view>
|
|
|
+ <view class="text">{{product.barCode||'--'}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="other-box-item">
|
|
|
+ <view class="label">功能主治</view>
|
|
|
+ <view class="text">{{product.indications||'--'}}</view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="other-box-item" v-if="product.sales">
|
|
|
<view class="label">已售</view>
|
|
|
<view class="text">{{$formatSalesNum(product.sales)}}</view>
|
|
|
</view>
|
|
|
@@ -69,17 +85,20 @@
|
|
|
mode=""></image>
|
|
|
<text class="text">隐私保护</text>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
- <view class="storebox x-bc" v-if="chooseStore.storeId">
|
|
|
- <view class="x-f">
|
|
|
- <image class="logo" :src="chooseStore.logoUrl" mode="aspectFill"></image>
|
|
|
- <view class="storebox-r" @click="goStoreDetail(chooseStore)">
|
|
|
- <view class="storename ellipsis2">{{chooseStore.storeName||''}}</view>
|
|
|
- <!-- <view class="storedesc">24小时营业 销售{{$formatSalesNum(chooseStore.salesCount) }}</view> -->
|
|
|
+ <view class="storebox" v-if="chooseStore.storeId">
|
|
|
+ <view class="x-bc">
|
|
|
+ <view class="x-f">
|
|
|
+ <image class="logo" :src="chooseStore.logoUrl" mode="aspectFill"></image>
|
|
|
+ <view class="storebox-r" @click="goStoreDetail(chooseStore)">
|
|
|
+ <view class="storename ellipsis2">{{chooseStore.storeName||''}}</view>
|
|
|
+ <!-- <view class="storedesc">24小时营业 销售{{$formatSalesNum(chooseStore.salesCount) }}</view> -->
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+ <view class="storebox-btn" @click="goStoreDetail(chooseStore)">进店</view>
|
|
|
</view>
|
|
|
- <view class="storebox-btn" @click="goStoreDetail(chooseStore)">进店</view>
|
|
|
+ <detail :source="'product'" ref="getStoreInfo" :storeInfo="storeInfo"></detail>
|
|
|
</view>
|
|
|
<!-- 购买人数、库存 -->
|
|
|
<!-- <view class="inventor">
|
|
|
@@ -101,11 +120,27 @@
|
|
|
</view>
|
|
|
</view> -->
|
|
|
<!-- 功效 -->
|
|
|
- <!-- <view class="effect">
|
|
|
- <view class="label">药品说明书</view>
|
|
|
- <view class="label">查看</view>
|
|
|
-
|
|
|
- </view> -->
|
|
|
+ <view class="effect" v-if="product.instructionManual">
|
|
|
+ <view class="label">{{product.productName}}药品说明书</view>
|
|
|
+ <view :class="product.productType ==2&&isView==0 ? 'hiddenbox':''">
|
|
|
+ <u-parse :content="product.instructionManual" :style="{display: 'block'}"></u-parse>
|
|
|
+ </view>
|
|
|
+ <view class="shadowbox" v-if="product.productType ==2&&isView==0">
|
|
|
+ <view class="shadowbox-btn x-ac" @click="handleShow">
|
|
|
+ <text style="margin-right: 10rpx;">点击查看说明书全文</text>
|
|
|
+ <u-icon name="arrow-down" color="#999" size="14"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <u-popup :show="show" mode="center" :round="10" @close="show=false" :closeOnClickOverlay="false">
|
|
|
+ <view class="popupbox">
|
|
|
+ <view class="popupbox-title">如何查看说明书</view>
|
|
|
+ <view class="popupbox-body">
|
|
|
+ <text style="font-weight: bold;">普通用户:</text>需要先问诊获得处方后才能查看说明书,请点<text class="confirm" @click="addCart('buy')">问诊开药</text>开处方!
|
|
|
+ </view>
|
|
|
+ <view class="popupbox-footer" @click="show=false">我知道了</view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
<!-- 商品评价 -->
|
|
|
<view class="det-box evaluate">
|
|
|
<view class="title">商品评价({{evaluateTotal}})</view>
|
|
|
@@ -123,11 +158,7 @@
|
|
|
<view class="inner">
|
|
|
<view v-html="product.description" style="font-size:0"></view>
|
|
|
</view>
|
|
|
- <view class="other-box" style="margin: 0;padding: 24rpx 0;">
|
|
|
- <view class="other-box-item" v-if="product.indications">
|
|
|
- <view class="label" style="margin-right: 16rpx;">【功能主治】</view>
|
|
|
- <view class="text">{{product.indications}}</view>
|
|
|
- </view>
|
|
|
+ <!-- <view class="other-box" style="margin: 0;padding: 24rpx 0;">
|
|
|
<view class="other-box-item" v-if="product.dosage">
|
|
|
<view class="label" style="margin-right: 16rpx;">【用法用量】</view>
|
|
|
<view class="text">{{product.dosage}}</view>
|
|
|
@@ -144,7 +175,7 @@
|
|
|
<view class="label" style="margin-right: 16rpx;">【注意事项】</view>
|
|
|
<view class="text">{{product.precautions}}</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
<!-- 底部按钮 -->
|
|
|
<view class="btn-foot">
|
|
|
@@ -240,16 +271,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {getCartCount} from '@/api/index.js'
|
|
|
+ import detail from '@/components/storeDetail.vue'
|
|
|
+ import {getCartCount,storeDetail} from '@/api/index.js'
|
|
|
import {getDicts} from '@/api/common.js'
|
|
|
- import { getProductDetails, addCart } from './api/product.js'
|
|
|
+ import { getProductDetails, addCart,instructionsViewable } from './api/product.js'
|
|
|
import {selectCommentByUser} from '@/api/myStoreOrder.js'
|
|
|
import popupBottom from './components/px-popup-bottom.vue'
|
|
|
import evaluateItem from '@/components/evaluateItem.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
popupBottom,
|
|
|
- evaluateItem
|
|
|
+ evaluateItem,
|
|
|
+ detail
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -280,7 +313,10 @@
|
|
|
storeList: [],
|
|
|
storeId: '',
|
|
|
evaluateTotal: 0,
|
|
|
- evaluate: []
|
|
|
+ evaluate: [],
|
|
|
+ show: false,
|
|
|
+ isView: 0,
|
|
|
+ storeInfo: {}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -357,6 +393,35 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ getStoreInfo() {
|
|
|
+ storeDetail(this.storeId).then(res=>{
|
|
|
+ if(res.code==200) {
|
|
|
+ this.storeInfo =res.data || {}
|
|
|
+ this.$refs.getStoreInfo.getDescHeight()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleShow() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ instructionsViewable({productId: this.productId}).then(
|
|
|
+ res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code==200){
|
|
|
+ this.isView = res.data ? 1 : 0
|
|
|
+ this.show = this.isView == 0
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title: "请求失败",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rej => {}
|
|
|
+ );
|
|
|
+ },
|
|
|
goStoreDetail(item) {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages_store/storeIndex?storeId=' + item.storeId
|
|
|
@@ -479,6 +544,7 @@
|
|
|
}
|
|
|
this.choseSpec(0, 0)
|
|
|
this.getCommentByUser()
|
|
|
+ this.getStoreInfo();
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
@@ -529,6 +595,7 @@
|
|
|
},
|
|
|
// 加入购物车
|
|
|
addCart(type) {
|
|
|
+ this.show=false
|
|
|
this.$isLogin().then(res => {
|
|
|
if (res) {
|
|
|
this.type = type;
|
|
|
@@ -642,6 +709,53 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+ .hiddenbox {
|
|
|
+ height: 240rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ .popupbox {
|
|
|
+ width: 80vw;
|
|
|
+ font-size: 30upx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ color: #333333;
|
|
|
+ &-title{
|
|
|
+ font-weight: bold;
|
|
|
+ padding: 30rpx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ &-body {
|
|
|
+ padding: 24rpx 30rpx;
|
|
|
+ line-height: 2;
|
|
|
+ }
|
|
|
+ .confirm {
|
|
|
+ background-color: #2583EB;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ color: #fff;
|
|
|
+ padding: 10rpx 24rpx;
|
|
|
+ margin: 0 10rpx;
|
|
|
+ }
|
|
|
+ &-footer {
|
|
|
+ border-top: 1rpx solid #F7F7F7;
|
|
|
+ padding: 30rpx;
|
|
|
+ color: red;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .shadowbox{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255,0.5) 50%,rgb(255, 255, 255) 80%);
|
|
|
+ padding-top: 240rpx;
|
|
|
+ margin-top: -240rpx;
|
|
|
+ position: relative;
|
|
|
+ &-btn {
|
|
|
+ padding: 10rpx 40rpx;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ border: 1rpx solid #ccc;
|
|
|
+ display: inline-flex;
|
|
|
+ }
|
|
|
+ }
|
|
|
.img-item {
|
|
|
position: relative;
|
|
|
width: 44rpx;
|
|
|
@@ -941,25 +1055,22 @@
|
|
|
|
|
|
.effect {
|
|
|
box-sizing: border-box;
|
|
|
- padding: 20upx 30upx;
|
|
|
+ padding: 30rpx;
|
|
|
background: #FFFFFF;
|
|
|
font-size: 28upx;
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
color: #666666;
|
|
|
line-height: 1.8;
|
|
|
- margin-top: 10upx;
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
-
|
|
|
+ margin: 24rpx 24rpx 0 24rpx;
|
|
|
+ border-radius: 16rpx;
|
|
|
+
|
|
|
.label {
|
|
|
- font-size: 28upx;
|
|
|
+ font-size: 30upx;
|
|
|
font-family: PingFang SC;
|
|
|
- font-weight: 500;
|
|
|
- color: #111111;
|
|
|
- line-height: 1.8;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 1;
|
|
|
}
|
|
|
}
|
|
|
|