This commit is contained in:
徐哼唧L
2023-12-20 15:36:31 +08:00
parent dd655db39d
commit 0ce8f9db96

View File

@@ -17,8 +17,8 @@
<!-- <u-search :disabled="userMes.pointPower == 0 && oneCateList[curOneCateIndex].id == 3 || userMes
.pointPower == 0 && oneCateList[curOneCateIndex].id == 6 ? true : false" @click="checkDisable" placeholder="请输入方剂名" @focus="focus" @clear="clear"
v-model="searchValue" @input="input" @blur="blur" @search="search"></u-search> -->
<u-search @click="checkDisable" placeholder="请输入方剂名" @focus="focus" @clear="clear"
v-model="searchValue" @input="input" @blur="blur" @search="search" @custom="search"></u-search>
<u-search @click="checkDisable" placeholder="请输入方剂名" @focus="focus" @clear="clear" v-model="searchValue"
@input="input" @blur="blur" @search="search" @custom="search"></u-search>
</view>
<view class="searchList" v-show="showSearchList">
<view class="itemBox" v-if="searchList.length > 0">
@@ -31,33 +31,52 @@
</view>
</view>
<!-- </scroll-view> -->
<view v-show="!showSearchList">
<view class="grid twoCateList" v-if="twoCateList.length > 0">
<u-grid :col="3" border class="u-grid-list">
<u-grid-item v-for="(item, index) in twoCateList" :key="item.prescriptCategoryId"
@click="setTwoCateIndex(item, index)">
<view :class="['grid-text',curTwoCateIndex == index ? 'cur' : '']">{{item.title}}</view>
</u-grid-item>
</u-grid>
</view>
<view class="titleList" v-if="oneCateList[curOneCateIndex].prescriptCategoryId != 3">
<u-grid :col="3" v-if="titleList.length > 0">
<u-grid-item v-for="(item, index) in titleList" :key="item.prescriptId" @click="gotoDetail(item)">
<view :class="['titleItem']">{{item.title}}</view>
</u-grid-item>
</u-grid>
<u-divider v-else text="暂无方剂数据哦~"></u-divider>
</view>
<view class="titleList" v-else>
<u-grid :col="1" v-if="titleList">
<u-grid-item v-for="(item, index) in titleList" :key="index">
<view :class="['titleItem']">{{index}}</view>
<u-grid-item v-for="(item1, index1) in item" :key="item1.prescriptId" >
<view :class="['JFtitleItem']" @click="gotoDetail(item1)">{{item1.title}}</view>
<view v-show="!showSearchList">
<view v-if="limiOneFour==0">
<view class="grid twoCateList" v-if="twoCateList.length > 0">
<u-grid :col="3" border class="u-grid-list">
<u-grid-item v-for="(item, index) in twoCateList" :key="item.prescriptCategoryId"
@click="setTwoCateIndex(item, index)">
<view :class="['grid-text',curTwoCateIndex == index ? 'cur' : '']">{{item.title}}</view>
</u-grid-item>
</u-grid-item>
</u-grid>
<u-divider v-else text="暂无方剂数据哦~"></u-divider>
</u-grid>
</view>
<view class="titleList" v-if="curOneCateIndex != 2">
<u-grid :col="3" v-if="titleList.length > 0">
<u-grid-item v-for="(item, index) in titleList" :key="item.prescriptId"
@click="gotoDetail(item)">
<view :class="['titleItem']">{{item.title}}</view>
</u-grid-item>
</u-grid>
<u-divider v-else text="暂无方剂数据哦~"></u-divider>
</view>
<view class="titleList" v-else>
<u-grid :col="1" v-if="titleList">
<u-grid-item v-for="(item, index) in titleList" :key="index">
<view :class="['titleItem']">{{index}}</view>
<u-grid-item v-for="(item1, index1) in item" :key="item1.prescriptId">
<view :class="['JFtitleItem']" @click="gotoDetail(item1)">{{item1.title}}</view>
</u-grid-item>
</u-grid-item>
</u-grid>
<u-divider v-else text="暂无方剂数据哦~"></u-divider>
</view>
</view>
<view v-else>
<view v-if="curOneCateIndex == 0">
<text class="limiTy">
此功能使用权限仅对同一手机账号注册过一路健康APP且开通吴门验方基础班上中下吴门验方提高班上下五部课程的疯子读书APP学员开通
<br>如果您符合条件请联系微信客服开通
<br>客服微信<b>yilujiankangkefu</b>
</text>
</view>
<view v-if="curOneCateIndex == 3">
<text class="limiTy">
此功能使用权限仅对在疯子读书APP购买肿瘤六经辨证法书籍的学员开通
<br>如果您符合条件请联系微信客服开通
<br>客服微信<b>yilujiankangkefu</b>
</text>
</view>
</view>
</view>
</view>
@@ -69,13 +88,11 @@
<text class="prompt">请输入方剂名</text>
</view>
</view> -->
<music-play :playData="playData"></music-play>
<z-navigation></z-navigation>
</view>
</template>
<script>
import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
import {
mapState
@@ -85,7 +102,9 @@
return {
playData: {},
searchValue: '',
oneCateList: [], // 一级分类标题1
oneCateList: [{
prescriptCategoryId: 0
}], // 一级分类标题1
twoCateList: [], // 二级分类标题
titleList: [], // 方剂标题
curOneCateIndex: 0, // 当前选中的一级分类
@@ -94,7 +113,7 @@
showSearchList: false,
userMes: {}, // 用户信息
searchDisable: false, // 搜索不可用
limiOneFour: 1,
}
},
onLoad() {
@@ -103,8 +122,8 @@
},
onHide() {
this.showSearchList = false
this.searchList = []
// this.showSearchList = false
// this.searchList = []
},
computed: {
...mapState(['userInfo']),
@@ -141,8 +160,11 @@
.post('book/user/info/' + this.userInfo.id)
.then(res => {
this.userMes = res.user
if (this.userMes.prescriptAPower == 1) {
this.limiOneFour = 0
}
this.getCateList()
console.log(this.userMes, '呼呼')
// console.log(this.userMes, '呼呼')
});
}
},
@@ -153,10 +175,10 @@
// .pointPower == 0 && this.oneCateList[this.curOneCateIndex].prescriptCategoryId == 6) { // 等于0 就是没有权限
// this.showNoRights()
// } else {
// 等于1 就是有权限
uni.navigateTo({
url: "./prescriptDetail?id=" + item.prescriptId
})
// 等于1 就是有权限
uni.navigateTo({
url: "./prescriptDetail?id=" + item.prescriptId
})
// }
},
@@ -218,7 +240,16 @@
this.searchValue = ''
this.searchList = []
this.showSearchList = false
if(index!=2){
this.limiOneFour = 0
if (index != 2) {
if (index == 0 && this.userMes.prescriptAPower != 1) {
this.limiOneFour = 1
return
}
if (index == 3 && this.userMes.prescriptBPower != 1) {
this.limiOneFour = 1
return
}
this.getTowCateList(id)
} else {
this.getJFList(id)
@@ -253,9 +284,11 @@
transformData(inputData) {
const result = {};
inputData.forEach(item => {
const { letter } = item;
const {
letter
} = item;
if (!result[letter]) {
result[letter] = [];
result[letter] = [];
}
result[letter].push(item);
});
@@ -277,7 +310,7 @@
if (res.code == 0 && res.list.length > 0) {
this.twoCateList = []
this.titleList = this.transformData(res.list)
console.log('JF经方',this.titleList)
console.log('JF经方', this.titleList)
// this.getTitles(this.twoCateList[0].prescriptCategoryId)
} else {
this.twoCateList = []
@@ -334,7 +367,7 @@
if (res.code == 0 && res.list.length >= 0) {
this.showSearchList = true
this.searchList = res.list
}else{
} else {
this.searchList = []
}
}).catch(e => {
@@ -406,7 +439,7 @@
// #endif
},
components: {
musicPlay
},
}
</script>
@@ -471,7 +504,8 @@
.titleItem {
padding: 20rpx 10rpx;
}
.JFtitleItem{
.JFtitleItem {
background-color: #ffffff;
padding: 20rpx 10rpx;
width: 100%;
@@ -527,4 +561,11 @@
.flexbox {
display: flex;
}
.limiTy {
display: block;
font-size: 26rpx;
line-height: 48rpx;
padding: 0 25rpx;
}
</style>