XSLu08042 vor 1 Tag
Ursprung
Commit
72ee6711ed

+ 1 - 1
common/request.js

@@ -7,7 +7,7 @@ export default class Request {
 
 		var path = 'https://storeuserapp.bjyjbao.com'; //正式
 		// var path = "https://3ce64c10ba0e.ngrok-free.app"
-		// var path = "http://w4579365.natappfree.cc"
+		// var path = "http://pc73965f.natappfree.cc"
 		// var path = "http://192.168.10.126:8113"
 		let token="";
 		let type = 0

+ 41 - 16
pages/shopping/index.vue

@@ -13,14 +13,14 @@
 			</view>
 		</view>
 		<view class="medic-box">
-			<!-- <scroll-view class="cate-list" :scroll-y="true" :style="{top: mescrollTop+'px',height:divHeight}" >
+			<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'" 
+					:class="cateSelect == item.dictValue?'item active':'item'" 
 					@click="choseCate(item)"
-				>{{item.cateName }}</view>
-			</scroll-view> -->
+				>{{item.dictLabel }}</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: 0 24rpx;">
+					<view style="padding: 0 24rpx 0 0;">
 						<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>
@@ -52,6 +52,7 @@
 </template>
 
 <script>
+	import {getDicts} from '@/api/common.js'
 	import {getProductCate,getProducts} from '@/api/index.js'
 	import {getAdv} from '@/api/adv'
 	import medicineVerticalItem from "@/components/medicineVerticalItem";
@@ -84,6 +85,7 @@
 				upOption: {
 					onScroll:true,
 					use: true, // 是否启用上拉加载; 默认true
+					auto: false,
 					page: {
 						num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
 						size: 10 // 每页数据的数量,默认10
@@ -105,6 +107,7 @@
 					productName:"",
 					storeId: "",
 					cateId:'',
+					productType:'',
 					pid:''
 				},
 				mescrollTop: 200
@@ -116,7 +119,7 @@
 				//小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
 				menus:["shareAppMessage","shareTimeline"] //不设置默认发送给朋友
 			})
-			// this.getProductCate();
+			this.getProductType();
 		},
 		onShow() {
 			let that=this;
@@ -197,12 +200,34 @@
 					rej => {}
 				);
 			},
+			getProductType(){
+				let data = {};
+				getDicts(data).then(
+					res => {
+						if(res.code==200){
+							uni.setStorageSync('dicts', JSON.stringify(res));
+							const key = 'storeProductType'
+							let dict=Array.isArray(key) ? key : res[key];
+							this.cates=dict;
+							if(this.cates!=null&&this.cates.length>0){
+								this.cateSelect=this.cates[0].dictValue;
+								this.form.productType = this.cates[0].dictValue;
+								this.mescroll.resetUpScroll()
+							}
+						}else{
+							uni.showToast({
+								icon:'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
 			// 药品分类选择
 			choseCate(item) {
-				this.cateSelect = item.cateId;
-				// this.getSubCate()
-				this.form.cateId = item.cateId;
-				// this.form.pid = item.pid;
+				this.cateSelect = item.dictValue;
+				this.form.productType = item.dictValue;
 				this.mescroll.resetUpScroll()
 			},
 			getSubCate(){
@@ -221,7 +246,7 @@
 			// 查看药品详情
 			showProductList(item) {
 				uni.navigateTo({
-					url: '/pages_shopping/productList?cateId='+item.cateId+"&pid="+item.pid
+					url: '/pages_shopping/productList?productType='+item.productType+"&pid="+item.pid
 				})
 			},
 			goSearch(e) {
@@ -322,11 +347,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/productDetails.vue

@@ -42,7 +42,7 @@
 		</view>
 		<view class="other-box">
 			<view class="other-box-item">
-				<view class="label">品名称</view>
+				<view class="label">品名称</view>
 				<view class="text">{{product.productName||''}}</view>
 			</view>
 			<view class="other-box-item" v-if="!_showTxt">

+ 4 - 4
pages_shopping/registerMerchant.vue

@@ -137,14 +137,14 @@
 						<u-form-item required labelWidth="auto" borderBottom label="药品经营许可证经营范围" prop="drugLicenseBusinessScope">
 							<u--textarea v-model="form.drugLicenseBusinessScope" placeholder="请输入药品经营许可证经营范围" maxlength="2000"></u--textarea>
 						</u-form-item>
-						<u-form-item required labelWidth="auto"  borderBottom label="药品经营许可证范围是否包含" prop="drugScopeHasFrozen">
+					<!-- 	<u-form-item required labelWidth="auto"  borderBottom label="药品经营许可证范围是否包含" prop="drugScopeHasFrozen">
 							<u-radio-group placement="row" v-model="form.drugScopeHasFrozen" >
 								<u-radio activeColor="#2583EB" :customStyle="{marginRight: '16px'}" key="0" label="否 " name="0" > </u-radio>
 								<u-radio activeColor="#2583EB" :customStyle="{marginRight: '16px'}" key="1" label="冷冻" name="1" > </u-radio>
 								<u-radio activeColor="#2583EB" :customStyle="{marginRight: '16px'}" key="2" label="冷藏" name="2" > </u-radio>
 								<u-radio activeColor="#2583EB" :customStyle="{marginRight: '16px'}" key="3" label="冷冻、冷藏" name="3" > </u-radio>
 							 </u-radio-group>
-						</u-form-item>
+						</u-form-item> -->
 						<u-form-item  labelWidth="auto"  borderBottom label="2类器械经营备案" prop="medicalDevice2">
 							<u-upload
 								:fileList="fileList4"
@@ -461,7 +461,7 @@ export default {
 				medicalDevice2BusinessScope: '',
 				medicalDevice3BusinessScope:'',
 				drugLicenseBusinessScope: '',
-				drugScopeHasFrozen: 0,
+				drugScopeHasFrozen: 3,
 				foodLicenseBusinessScope:''
 			},
 			rules: {
@@ -480,7 +480,7 @@ export default {
 				drugLicense: [{required: true, message: '请上传药品经营许可证'}],
 				drugLicenseBusinessScope: [{required: true, message: '请输入药品经营许可证经营范围'}],
 				drugCode: [{required: true, message: '请输入药品经营许可证编码'}],
-				drugScopeHasFrozen: [{required: true, message: '药品经营许可证范围是否包含'}],
+				// drugScopeHasFrozen: [{required: true, message: '药品经营许可证范围是否包含'}],
 				// drugLicenseExpiryStart: [{required: true, message: '请选择药品经营许可证编号有效期'}],
 				// medicalDevice2: [{required: true, message: '请上传2类医疗器械备案'}],
 				// medicalDevice2Code: [{required: true, message: '请输入2类医疗器械备案编码'}],

+ 42 - 16
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">
-				<!-- <scroll-view :scroll-y="true" 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'" 
+						:class="cateSelect == item.dictValue?'item active':'item'" 
 						@click="choseCate(item)"
-					>{{item.cateName }}</view>
-				</scroll-view> -->
+					>{{item.dictLabel }}</view>
+				</scroll-view>
 				<view class="medic">
 					<mescroll-body :top="mescrollTop+'px'" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
-					<view  style="padding: 0 24rpx;">
+					<view  style="padding: 0 24rpx 0 0;">
 						<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>
@@ -85,6 +85,7 @@
 </template>
 
 <script>
+	import {getDicts} from '@/api/common.js'
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import tuiStoreProduct from './components/tuiStoreProduct.vue'
 	import qualifications from './components/qualifications.vue'
@@ -147,6 +148,7 @@
 				upOption: {
 					onScroll:true,
 					use: true, // 是否启用上拉加载; 默认true
+					// auto: false,
 					page: {
 						num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
 						size: 10 // 每页数据的数量,默认10
@@ -168,6 +170,7 @@
 					productName:"",
 					storeId: "",
 					cateId:'',
+					productType:'',
 					pid:'',
 					storeId: ''
 				},
@@ -187,7 +190,7 @@
 				//小程序的原生菜单中显示分享按钮,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
 				menus:["shareAppMessage","shareTimeline"] //不设置默认发送给朋友
 			})
-			// this.getProductCate();
+			this.getProductType();
 			this.getStoreInfo();
 			this.getCommentByUser();
 		},
@@ -264,7 +267,7 @@
 				  uni.navigateBack({ delta: 1 }); // 有上一页才返回
 				} else {
 				  // 如果是首页,跳转到某个默认页面(如首页)
-				  uni.reLaunch({ url: '/pages/home/index' });
+				  uni.switchTab({ url: 'pages/index/index' });
 				}
 			},
 			tabChange(item) {
@@ -350,11 +353,34 @@
 					rej => {}
 				);
 			},
+			getProductType(){
+				let data = {};
+				getDicts(data).then(
+					res => {
+						if(res.code==200){
+							uni.setStorageSync('dicts', JSON.stringify(res));
+							const key = 'storeProductType'
+							let dict=Array.isArray(key) ? key : res[key];
+							this.cates=dict;
+							if(this.cates!=null&&this.cates.length>0){
+								this.cateSelect=this.cates[0].dictValue;
+								this.form.productType = this.cates[0].dictValue;
+								this.mescroll&&this.mescroll.resetUpScroll()
+							}
+						}else{
+							uni.showToast({
+								icon:'none',
+								title: "请求失败",
+							});
+						}
+					},
+					rej => {}
+				);
+			},
 			// 药品分类选择
 			choseCate(item) {
-				this.cateSelect = item.cateId;
-				// this.getSubCate()
-				this.form.cateId = item.cateId;
+				this.cateSelect = item.dictValue;
+				this.form.productType = item.dictValue;
 				this.mescroll.resetUpScroll()
 				
 			},
@@ -373,7 +399,7 @@
 			// 查看药品详情
 			showProductList(item) {
 				uni.navigateTo({
-					url: '/pages_shopping/productList?cateId='+item.cateId+"&pid="+item.pid+'&storeId='+this.storeId
+					url: '/pages_shopping/productList?productType='+item.productType+"&pid="+item.pid+'&storeId='+this.storeId
 				})
 			},
 			goSearch(e) {
@@ -561,11 +587,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;