XSLu08042 4 giorni fa
parent
commit
d5b0905365

+ 1 - 1
components/medicineItem.vue

@@ -1,7 +1,7 @@
 <template>
 	<view :class="type=='store'?'medicine-storeitem':'medicine-item'" @click="showProduct">
 		<view class="x-bc" style="margin-bottom: 16rpx;">
-			<view class="pro-name ellipsis" style="white-space: normal;">{{ item.productName || '' }}</view>
+			<view class="pro-name ellipsis" style="white-space: normal;">{{ item.commonName&&item.commonName!=='-'?item.commonName:item.productName }}</view>
 			<view class="myotctxt" v-show="item.productType" :style="{background:_background(item.productType)}">{{$getDictLabelName("storeProductType",item.productType)}}</view>
 		</view>
 		<view class="x-f">

+ 1 - 1
components/medicineVerticalItem.vue

@@ -5,7 +5,7 @@
 			<view class="otctxt" v-show="item.productType" :style="{background:_background(item.productType)}">{{$getDictLabelName("storeProductType",item.productType)}}</view>
 		</view>
 		<view class="info-box">
-			<view class="title ellipsis2">{{item.productName}}</view>
+			<view class="title ellipsis2">{{ item.commonName&&item.commonName!=='-'?item.commonName:item.productName }}</view>
 			<view class="price-box x-bc">
 				<view>
 					<text class="price-box-unit">¥</text>

+ 10 - 10
pages/shopping/index.vue

@@ -12,15 +12,15 @@
 				</view>
 			</view>
 		</view>
-		<view   class="medic-box">
-			<view class="cate-list" :style="{top: mescrollTop+'px',height:divHeight}" >
+		<view class="medic-box">
+			<!-- <scroll-view class="cate-list" :scroll-y="true" :style="{top: mescrollTop+'px',height:divHeight}" >
 				<view 
 					v-for="(item,index) in cates" 
 					:key="index" 
 					:class="cateSelect == item.cateId?'item active':'item'" 
 					@click="choseCate(item)"
 				>{{item.cateName }}</view>
-			</view>
+			</scroll-view> -->
 			<view class="medic">
 				<!-- 轮播图 -->
 				<!-- <view class="banner-box">
@@ -41,7 +41,7 @@
 				</view> -->
 				<!-- 药品列表 -->
 				<mescroll-body :top="mescrollTop+'px'" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
-					<view style="padding-right: 16rpx;">
+					<view style="padding: 0 24rpx;">
 						<medicineItem v-for="(item, index) in dataList" :key="index" :item="item"></medicineItem>
 						<!-- <medicineVerticalItem v-for="(item, index) in dataList" :key="index" :item="item"></medicineVerticalItem> -->
 					</view>
@@ -116,7 +116,7 @@
 				//小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
 				menus:["shareAppMessage","shareTimeline"] //不设置默认发送给朋友
 			})
-			this.getProductCate();
+			// this.getProductCate();
 		},
 		onShow() {
 			let that=this;
@@ -322,11 +322,11 @@
 				}
 			}
 		}
-		::v-deep{
-			.mescroll-body, .mescroll-body{
-				padding-left: 204rpx;
-			}
-		}
+		// ::v-deep{
+		// 	.mescroll-body, .mescroll-body{
+		// 		padding-left: 204rpx;
+		// 	}
+		// }
 		.medic-box{
 			.cate-list{
 				position: fixed;

+ 1 - 1
pages_shopping/cart.vue

@@ -18,7 +18,7 @@
 						<view>
 							<view class="title-box">
 								<view class="tag">{{$getDictLabelName("storeProductType",item.productType)}}</view>
-								<view class="title ellipsis">{{ item.productName }}</view>
+								<view class="title ellipsis">{{ item.commonName&&item.commonName!=='-'?item.commonName:item.productName }}</view>
 							</view>
 							<view class="intro ellipsis">{{item.productAttrName}}</view>
 						</view>

+ 2 - 1
pages_shopping/confirmOrder.vue

@@ -40,7 +40,8 @@
 						<view class="info-box">
 							<view>
 								<view class="name-box ellipsis2">
-									<view class="tag" :style="{background:_background(item.productType)}">{{$getDictLabelName("storeProductType",item.productType)}}</view>{{item.productName}}
+									<view class="tag" :style="{background:_background(item.productType)}">{{$getDictLabelName("storeProductType",item.productType)}}</view>
+									{{item.commonName&&item.commonName!=='-'?item.commonName:item.productName}}
 								</view>
 								<view class="spec ellipsis2">{{item.productAttrName}}</view>
 							</view>

+ 89 - 50
pages_shopping/productDetails.vue

@@ -34,15 +34,20 @@
 			</view>
 			<view class="name-box">
 				<view class="tag" :style="{background:_background(product.productType)}">
-					{{$getDictLabelName("storeProductType",product.productType)}}</view>{{product.productName}}
-			</view>
-			<view class="intro" v-if="product.productInfo!=null" v-html="product.productInfo.replace(/\n/g,'<br>')">
+					{{$getDictLabelName("storeProductType",product.productType)}}</view>
+					{{product.commonName&&product.commonName!=='-'?product.commonName:product.productName}}
 			</view>
+			<u-parse class="intro" v-if="product.productInfo!=null" :content="product.productInfo.replace(/\n/g,'<br>')">
+			</u-parse>
 		</view>
 		<view class="other-box">
 			<view class="other-box-item">
 				<view class="label">产品名称</view>
-				<view class="text">{{product.productName||'--'}}</view>
+				<view class="text">{{product.productName||''}}</view>
+			</view>
+			<view class="other-box-item" v-if="!_showTxt">
+				<view class="label">通用名称</view>
+				<view class="text">{{product.commonName}}</view>
 			</view>
 			<view class="other-box-item">
 				<view class="label">包装规格</view>
@@ -56,36 +61,14 @@
 				<view class="label">批准文号</view>
 				<view class="text">{{product.drugRegCertNo||'--'}}</view>
 			</view>
-			<view class="other-box-item">
+		<!-- 	<view class="other-box-item">
 				<view class="label">生产厂家</view>
 				<view class="text">{{product.mah||'--'}}</view>
-			</view>
+			</view> -->
 			<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>
-			<view class="other-box-item">
-				<view class="label" style="width: 4em;">服务</view>
-				<view class="safe-box">
-					<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/safe.png"
-						mode=""></image>
-					<text class="text" style="margin-right: 34rpx;">品质保障</text>
-					<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/safe.png"
-						mode=""></image>
-					<text class="text" style="margin-right: 34rpx;">药师服务</text>
-					<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/safe.png"
-						mode=""></image>
-					<text class="text">隐私保护</text>
-				</view>
-			</view> -->
 		</view>
 		
 		<!-- 购买人数、库存 -->
@@ -109,7 +92,7 @@
 		</view> -->
 		<!-- 功效 -->
 		<view class="effect" v-if="product.instructionManual">
-			<view class="label">{{product.productName}}药品说明书</view>
+			<view class="label">{{product.commonName&&product.commonName!=='-'?product.commonName:product.productName}}药品说明书</view>
 			<view :class="product.productType ==2&&isView==0 ? 'hiddenbox':''" style="margin-top: 20rpx;">
 				<u-parse :content="product.instructionManual" :style="{display: 'block'}"></u-parse>
 			</view>
@@ -144,29 +127,67 @@
 		<view class="det-box">
 			<view class="title">图文详情</view>
 			<view class="inner">
-				<view v-html="product.description" style="font-size:0"></view>
+				<u-parse :content="product.description" :tagStyle="tagStyle"></u-parse>
 			</view>
-			<view class="other-box" style="margin: 0;padding: 24rpx 0;" v-if="product.productType !=2||isView==1">
-				<view class="other-box-item" v-if="product.indications">
-					<view class="label" style="margin-right: 16rpx;">【功能主治】</view>
-					<view class="text">{{product.indications}}</view>
+			<view class="other-box product-other-box" style="margin: 0;padding: 24rpx 0;">
+				<view v-if="_showTxt&&product.medicalRegCertNo">
+					<text class="label" style="margin-right: 16rpx;">医疗器械注册证编号/备案凭证编号:</text>
+					<text class="text">{{product.medicalRegCertNo}}</text>
+				</view>
+				<view v-if="_showTxt&&product.prodLicenseNo">
+					<text class="label" style="margin-right: 16rpx;">生产许可证/备案凭证编号:</text>
+					<text class="text">{{product.prodLicenseNo}}</text>
 				</view>
-				<view class="other-box-item" v-if="product.dosage">
-					<view class="label" style="margin-right: 16rpx;">【用法用量】</view>
-					<view class="text">{{product.dosage}}</view>
+				<view v-if="_showTxt&&product.prodTechReqNo">
+					<text class="label" style="margin-right: 16rpx;">产品技术要求编号:</text>
+					<text class="text">{{product.prodTechReqNo}}</text>
 				</view>
-				<view class="other-box-item" v-if="product.adverseReactions">
-					<view class="label" style="margin-right: 16rpx;">【不良反应】</view>
-					<view class="text">{{product.adverseReactions}}</view>
+				<view v-if="_showTxt&&product.productStructure">
+					<text class="label" style="margin-right: 16rpx;">结构及组成:</text>
+					<text class="text">{{product.productStructure}}</text>
 				</view>
-				<view class="other-box-item" v-if="product.contraindications">
-					<view class="label" style="margin-right: 16rpx;">【禁忌】</view>
-					<view class="text">{{product.contraindications}}</view>
+				<view v-if="product.dosageForm&&!_showTxt">
+					<text class="label" style="margin-right: 16rpx;">【剂型】</text>
+					<text class="text">{{product.dosageForm}}</text>
 				</view>
-				<view class="other-box-item" v-if="product.precautions">
-					<view class="label" style="margin-right: 16rpx;">【注意事项】</view>
-					<view class="text">{{product.precautions}}</view>
+				<view v-if="product.mah">
+					<text class="label" style="margin-right: 16rpx;">{{_showTxt?'【注册人/备案人】':'【上市许可证持有人】'}}</text>
+					<text class="text">{{product.mah}}</text>
 				</view>
+				<view v-if="product.mahAddress">
+					<text class="label" style="margin-right: 16rpx;">{{_showTxt?'【注册人/备案人地址】':'【上市许可证持有人地址】'}}</text>
+					<text class="text">{{product.mahAddress}}</text>
+				</view>
+				<view v-if="product.manufacturer">
+					<text class="label" style="margin-right: 16rpx;">【生产企业】</text>
+					<text class="text">{{product.manufacturer}}</text>
+				</view>
+				<view v-if="product.manufacturerAddress">
+					<text class="label" style="margin-right: 16rpx;">【生产企业地址】</text>
+					<text class="text">{{product.manufacturerAddress}}</text>
+				</view>
+				<template v-if="product.productType !=2||isView==1">
+					<view v-if="product.indications">
+						<text class="label" style="margin-right: 16rpx;">【功能主治/适用范围】</text>
+						<text class="text">{{product.indications}}</text>
+					</view>
+					<view v-if="product.dosage">
+						<text class="label" style="margin-right: 16rpx;">【用法用量】</text>
+						<text class="text">{{product.dosage}}</text>
+					</view>
+					<view v-if="product.adverseReactions">
+						<text class="label" style="margin-right: 16rpx;">【不良反应】</text>
+						<text class="text">{{product.adverseReactions}}</text>
+					</view>
+					<view v-if="product.contraindications">
+						<text class="label" style="margin-right: 16rpx;">{{_showTxt?'【禁忌症】':'【禁忌】'}}</text>
+						<text class="text">{{product.contraindications}}</text>
+					</view>
+					<view v-if="product.precautions">
+						<text class="label" style="margin-right: 16rpx;">【注意事项】</text>
+						<text class="text">{{product.precautions}}</text>
+					</view>
+				</template>
 			</view>
 		</view>
 		<view class="storebox" v-if="chooseStore.storeId">
@@ -322,7 +343,10 @@
 				show: false,
 				isView: 0,
 				storeInfo: {},
-				stockNum: 0
+				stockNum: 0,
+				tagStyle: {
+					img: 'display: block;'
+				}
 			};
 		},
 		computed: {
@@ -342,6 +366,14 @@
 							return '#ccc'
 					}
 				}
+			},
+			_showTxt() {
+				if(this.product&&this.product.productType) {
+					const name = this.$getDictLabelName("storeProductType",this.product.productType)
+					return name.includes('器械');
+				}else {
+					return false
+				}
 			}
 		},
 		onLoad(options) {
@@ -378,7 +410,7 @@
 				if (res) {
 					var user = JSON.parse(uni.getStorageSync('userInfo'))
 					return {
-						title: this.product.productName,
+						title: this.commonName&&this.product.commonName!=='-'?this.product.commonName:this.product.productName,
 						path: '/pages_shopping/productDetails?productId=' + this.product.productId + "&userId=" +
 							user.userId,
 					}
@@ -391,7 +423,7 @@
 				if (res) {
 					var user = JSON.parse(uni.getStorageSync('userInfo'))
 					return {
-						title: this.product.productName,
+						title: this.commonName&&this.product.commonName!=='-'?this.product.commonName:this.product.productName,
 						query: 'productId=' + this.product.productId + "&userId=" + user.userId, //页面参数
 					}
 				}
@@ -725,6 +757,13 @@
 </script>
 
 <style lang="scss" scoped>
+	.product-other-box {
+		.other-box-item {
+			.label {
+				// width: 6em;
+			}
+		}
+	}
 	.hiddenbox {
 		height: 240rpx;
 		overflow: hidden;
@@ -824,7 +863,7 @@
 		.text {
 			font-family: PingFang SC, PingFang SC;
 			font-weight: 400;
-			font-size: 24rpx;
+			font-size: 26rpx;
 			color: #333333;
 		}
 	}

+ 1 - 1
pages_shopping/shopping/activityDetails.vue

@@ -27,7 +27,7 @@
 		  
 	  </view>
 	 <view class="inner">
-	 	<view  v-html="activity.content" style="font-size:0"></view>
+	 	<view  v-html="activity.content"></view>
 	 </view>
 	 <view class="product">
 		<view>

+ 17 - 11
pages_store/storeIndex.vue

@@ -47,17 +47,17 @@
 				<detail class="store-detail" ref="getStoreInfo" :storeInfo="storeInfo"></detail>
 			</view>
 			<view v-if="current==1" class="medic-box">
-				<view class="cate-list" :style="{top: mescrollTop+'px',height:divHeight}">
+				<!-- <scroll-view :scroll-y="true" class="cate-list" :style="{top: mescrollTop+'px',height:divHeight}">
 					<view 
 						v-for="(item,index) in cates" 
 						:key="index" 
 						:class="cateSelect == item.cateId?'item active':'item'" 
 						@click="choseCate(item)"
 					>{{item.cateName }}</view>
-				</view>
+				</scroll-view> -->
 				<view class="medic">
 					<mescroll-body :top="mescrollTop+'px'" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
-					<view  style="padding-right: 16rpx;">
+					<view  style="padding: 0 24rpx;">
 						<medicineItem v-for="(item, index) in dataList" :key="index" :item="item" :storeId="storeId"></medicineItem>
 						<!-- <medicineVerticalItem v-for="(item, index) in dataList" :key="index" :item="item" :storeId="storeId"></medicineVerticalItem> -->
 					</view>
@@ -124,7 +124,7 @@
 					},
 					{
 						id:2,
-						name:'分类'
+						name:'药品'
 					},
 					{
 						id:3,
@@ -187,7 +187,7 @@
 				//小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
 				menus:["shareAppMessage","shareTimeline"] //不设置默认发送给朋友
 			})
-			this.getProductCate();
+			// this.getProductCate();
 			this.getStoreInfo();
 			this.getCommentByUser();
 		},
@@ -259,7 +259,13 @@
 				})
 			},
 			navback() {
-				uni.navigateBack()
+				const pages = getCurrentPages(); // 获取当前页面栈
+				if (pages.length > 1) {
+				  uni.navigateBack({ delta: 1 }); // 有上一页才返回
+				} else {
+				  // 如果是首页,跳转到某个默认页面(如首页)
+				  uni.reLaunch({ url: '/pages/home/index' });
+				}
 			},
 			tabChange(item) {
 				this.current=item.index
@@ -555,11 +561,11 @@
 		.medic-box{
 			display: flex;
 			background: #fff;
-			::v-deep{
-				.mescroll-body, .mescroll-body{
-					padding-left: 204rpx;
-				}
-			}
+			// ::v-deep{
+			// 	.mescroll-body, .mescroll-body{
+			// 		padding-left: 204rpx;
+			// 	}
+			// }
 			.cate-list{
 				position: fixed;
 				left: 0;

+ 1 - 1
pages_user/shopping/refundOrder.vue

@@ -11,7 +11,7 @@
 						</view>
 						<view class="info">
 							<view class="top">
-								<view class="title ellipsis2">{{ JSON.parse(item.jsonInfo).productName}}</view>
+								<view class="title ellipsis2">{{JSON.parse(item.jsonInfo).commonName&&JSON.parse(item.jsonInfo).commonName!=='-'?JSON.parse(item.jsonInfo).commonName:JSON.parse(item.jsonInfo).productName}}</view>
 								<view class="spec">{{JSON.parse(item.jsonInfo).sku}}</view>
 							</view>
 							<view class="price-num">

+ 1 - 1
pages_user/shopping/refundOrderDetail.vue

@@ -120,7 +120,7 @@
 								</view>
 								<view class="info-box">
 									<view>
-										<view class="title ellipsis2">{{JSON.parse(item.jsonInfo).productName}}</view>
+										<view class="title ellipsis2">{{JSON.parse(item.jsonInfo).commonName&&JSON.parse(item.jsonInfo).commonName!=='-'?JSON.parse(item.jsonInfo).commonName:JSON.parse(item.jsonInfo).productName}}</view>
 										<view class="spec">规格:{{JSON.parse(item.jsonInfo).sku}}</view>
 									</view>
 									<view class="price-num">

+ 1 - 1
pages_user/shopping/refundOrderList.vue

@@ -41,7 +41,7 @@
 									<view>
 										<view class="name-box ellipsis2">
 											<!-- <view class="tag">处方药</view> -->
-											{{JSON.parse(subitem.jsonInfo).productName}}
+											{{JSON.parse(subitem.jsonInfo).commonName&&JSON.parse(subitem.jsonInfo).commonName!=='-'?JSON.parse(subitem.jsonInfo).commonName:JSON.parse(subitem.jsonInfo).productName}}
 										</view>
 										<view class="spec">规格:{{JSON.parse(subitem.jsonInfo).sku}}</view>
 									</view>

+ 1 - 1
pages_user/shopping/refundOrderProduct.vue

@@ -9,7 +9,7 @@
 					<image class="goods-img" :src="JSON.parse(item.jsonInfo).image" mode="aspectFit"></image>
 					<view class="info">
 						<view class="top">
-							<view class="title ellipsis2">{{ JSON.parse(item.jsonInfo).productName}}</view>
+							<view class="title ellipsis2">{{JSON.parse(item.jsonInfo).commonName&&JSON.parse(item.jsonInfo).commonName!=='-'?JSON.parse(item.jsonInfo).commonName:JSON.parse(item.jsonInfo).productName}}</view>
 							<view class="spec">{{JSON.parse(item.jsonInfo).sku}}</view>
 						</view>
 						<view class="price-num">

+ 2 - 1
pages_user/shopping/storeOrder.vue

@@ -50,7 +50,8 @@
 							<view class="drug-info" >
 								<view>
 									<view class="name-box ellipsis2">
-										<view v-if="subItem.isPrescribe==1" class="tag">处方药</view>{{JSON.parse(subItem.jsonInfo).productName}}
+										<view v-if="subItem.isPrescribe==1" class="tag">处方药</view>
+										{{JSON.parse(subItem.jsonInfo).commonName&&JSON.parse(subItem.jsonInfo).commonName!=='-'?JSON.parse(subItem.jsonInfo).commonName:JSON.parse(subItem.jsonInfo).productName}}
 									</view>
 									<view class="spec ellipsis2">{{JSON.parse(subItem.jsonInfo).sku}}</view>
 								</view>

+ 2 - 1
pages_user/shopping/storeOrderDetail.vue

@@ -116,7 +116,8 @@
 								<view class="info-box">
 									<view>
 										<view class="name-box ellipsis2">
-											<view v-if="item.isPrescribe==1" class="tag">处方药</view>{{JSON.parse(item.jsonInfo).productName}}
+											<view v-if="item.isPrescribe==1" class="tag">处方药</view>
+											{{JSON.parse(item.jsonInfo).commonName&&JSON.parse(item.jsonInfo).commonName!=='-'?JSON.parse(item.jsonInfo).commonName:JSON.parse(item.jsonInfo).productName}}
 										</view>
 										<view class="spec ellipsis2">{{JSON.parse(item.jsonInfo).sku}}</view>
 									</view>