|
|
@@ -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;
|