| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 | 
							- <template>
 
- 	<view class="content">
 
- 		<view class="top-box">
 
- 			<!-- 搜索框 -->
 
- 			<view class="search-cont">
 
- 				<view class="inner">
 
- 					<image class="icon-search" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/icon_search.png" mode=""></image>
 
- 					<input type="text" v-model="keyword" placeholder="输入关键字搜索" confirm-type="search" @confirm="doSearch" placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
 
- 				</view>
 
- 			</view>
 
- 			<view class="tabs">
 
- 				 <u-tabs
 
- 				  :scrollable="false"
 
- 				  :list="tabs"  
 
- 				  lineColor="#2583EB"
 
- 				 @change="tabChange">
 
- 				 </u-tabs>
 
- 			</view>
 
- 		</view>
 
- 		<view class="cont-box">
 
- 			<view class="left">
 
- 				<view class="items">
 
- 					<view v-if="tabIndex==1" @click="typeClick(item)" v-for="item in typeOptions" :class="item.dictValue==prescribeType?'item ellipsis active':'item ellipsis'">
 
- 						<text class="line" v-if="item.dictValue==prescribeType"></text>
 
- 						{{$parseText(item.dictLabel,4)}}
 
- 					</view>
 
- 					<view v-if="tabIndex==2" @click="indicationClick(item)" v-for="item in indicationOptions" :class="item.dictLabel==indication?'item ellipsis active':'item ellipsis'">
 
- 						<text class="line" v-if="item.dictLabel==indication"></text>
 
- 						{{$parseText(item.dictLabel,4)}}
 
- 					</view>
 
- 					<view v-if="tabIndex==3" @click="bookClick(item)" v-for="item in bookOptions" :class="item.dictLabel==belongBook?'item ellipsis active':'item ellipsis'">
 
- 						<text class="line" v-if="item.dictLabel==belongBook"></text>
 
- 						{{$parseText(item.dictLabel,4)}}
 
- 					</view>
 
- 				</view>
 
- 			</view>
 
- 			<view class="right" >
 
- 				<view class="title">{{title}}</view>
 
- 				<scroll-view @scrolltolower="scrolltolower" scroll-y="true"  style="height: calc(100vh - 180rpx);">
 
- 				<view class="items">
 
- 					<view class="r-item" @click="showDetail(item)" v-for="item in dataList">
 
- 						<view class="r-left">{{item.prescribeName}}</view>
 
- 						<view class="r-right">
 
- 							<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/fire.png"></image>
 
- 						</view>
 
- 					</view>
 
- 				</view>
 
- 				</scroll-view>
 
- 			</view>
 
- 		</view>
 
- 		 
 
- 		
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import {getDictByKey} from '@/api/common.js'
 
- 	import {getFamousPrescribeList} from '@/api/index.js'
 
- 	export default {
 
- 		data() {
 
- 			return {
 
- 				tabIndex:1,
 
- 				indication:"",
 
- 				belongBook:"",
 
- 				title:"",
 
- 				prescribeType:0,
 
- 				pageNum:1,
 
- 				pageSize:20,
 
- 				typeOptions:[],
 
- 				bookOptions:[],
 
- 				indicationOptions:[],
 
- 				tabs: [
 
- 					{name:"按类型",id:"1"},
 
- 					{name:"按疾病",id:"2"},
 
- 					{name:"按书籍",id:"3"}
 
- 				],
 
- 				keyword: '',
 
- 				dataList: []
 
- 			};
 
- 		},
 
- 		onLoad() {
 
- 			this.getDictByKey("sys_famous_prescribe_type");
 
- 			this.getDictByKey("sys_famous_prescribe_indication");
 
- 			this.getDictByKey("sys_famous_prescribe_book");
 
- 			
 
- 		},
 
- 		methods:{
 
- 			scrolltolower(e){
 
- 				this.pageNum++;
 
- 				this.getFamousPrescribeList()
 
- 				console.log(e)
 
- 			},
 
- 			typeClick(item){
 
- 				this.indication=""
 
- 				this.belongBook="";
 
- 				this.prescribeType=parseInt(item.dictValue);
 
- 				console.log(this.prescribeType)
 
- 				this.title=item.dictLabel;
 
- 				this.pageNum=1;
 
- 				this.getFamousPrescribeList()
 
- 			},
 
- 			bookClick(item){
 
- 				this.indication=""
 
- 				this.prescribeType=0;
 
- 				this.belongBook=item.dictLabel;
 
- 				this.title=item.dictLabel;
 
- 				this.pageNum=1;
 
- 				this.getFamousPrescribeList()
 
- 			},
 
- 			indicationClick(item){
 
- 				console.log(item)
 
- 				this.belongBook=""
 
- 				this.prescribeType=0;
 
- 				this.indication=item.dictLabel;
 
- 				this.title=item.dictLabel;
 
- 				this.pageNum=1;
 
- 				this.getFamousPrescribeList()
 
- 			},
 
- 			getDictByKey(key){
 
- 				var data={key:key}
 
- 				getDictByKey(data).then(
 
- 					res => {
 
- 						if(res.code==200){
 
- 							if(key=="sys_famous_prescribe_type"){
 
- 								this.typeOptions=res.data;
 
- 								if(this.typeOptions!=null&&this.typeOptions.length>0){
 
- 									this.typeClick(this.typeOptions[0])
 
- 								}
 
- 							}
 
- 							if(key=="sys_famous_prescribe_indication"){
 
- 								this.indicationOptions=res.data;
 
- 								 
 
- 							}
 
- 							if(key=="sys_famous_prescribe_book"){
 
- 								this.bookOptions=res.data;
 
- 								 
 
- 							}
 
- 						}
 
- 					},
 
- 					err => {
 
- 					}
 
- 				);
 
- 				
 
- 			},
 
- 			tabChange(item) {
 
- 				this.tabIndex = item.id
 
- 				this.getFamousPrescribeList()
 
- 			},
 
- 			doSearch(){
 
- 				this.pageNum=1;
 
- 				this.getFamousPrescribeList()
 
- 			},
 
- 			getFamousPrescribeList() {
 
- 				//联网加载数据
 
- 				var that = this;
 
- 				var data = {
 
- 					indication:this.indication,
 
- 					belongBook:this.belongBook,
 
- 					prescribeType:this.prescribeType,
 
- 					keyword:this.keyword,
 
- 					pageNum: this.pageNum,
 
- 					pageSize: this.pageSize
 
- 				};
 
- 				// uni.showLoading({
 
- 				// 	title:"加载中..."
 
- 				// })
 
- 				getFamousPrescribeList(data).then(res => {
 
- 					// uni.hideLoading()
 
- 					if(res.code==200){
 
- 						//设置列表数据
 
- 						if (this.pageNum == 1) {
 
- 							that.dataList = res.data.list; 
 
- 							
 
- 						} else {
 
- 							that.dataList = that.dataList.concat(res.data.list);
 
- 							 
 
- 						}
 
- 						
 
- 					}else{
 
- 						uni.showToast({
 
- 							icon:'none',
 
- 							title: "请求失败",
 
- 						});
 
- 						that.dataList = [];
 
- 					}
 
- 				});
 
- 			},
 
- 			 
 
- 			// 查看详情
 
- 			showDetail(item) {
 
- 				uni.navigateTo({
 
- 					url: './famousPrescribeDetails?id=' + item.id
 
- 				})
 
- 			}
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss">
 
- 	.content{
 
- 		height: 100%;
 
- 		overflow: hidden;
 
- 	}
 
- 	.top-box{
 
- 		width: 100%;
 
- 		height: 180rpx;
 
- 		background-color: #FFFFFF;
 
- 		.search-cont{
 
- 			padding: 16upx 30upx;
 
- 			.inner{
 
- 				box-sizing: border-box;
 
- 				width: 100%;
 
- 				height: 72upx;
 
- 				background: #F7F7F7;
 
- 				border-radius: 36upx;
 
- 				display: flex;
 
- 				align-items: center;
 
- 				padding: 0 30upx;
 
- 				.icon-search{
 
- 					width: 28upx;
 
- 					height: 28upx;
 
- 					margin-right: 20upx;
 
- 				}
 
- 				input{
 
- 					height: 60upx;
 
- 					line-height: 60upx;
 
- 					flex: 1;
 
- 				}
 
- 			}
 
- 		}
 
- 		.tabs{
 
- 		}
 
- 	}
 
- 	.cont-box{
 
- 		height: calc(100% - 180rpx);
 
- 		display: flex;
 
- 		align-items: flex-start;
 
- 		justify-content: flex-start;
 
- 		.left{
 
- 			padding: 30rpx 0rpx;
 
- 			width: 240rpx;
 
- 			height: 100%;
 
- 			overflow-y: auto;
 
- 			display: flex;
 
- 			flex-direction: column;
 
- 			align-items: flex-start;
 
- 			justify-content: flex-start;
 
- 			.items{
 
- 				width: 240rpx;
 
- 				width: 100%;
 
- 				display: flex;
 
- 				flex-direction: column;
 
- 				align-items: center;
 
- 				justify-content: flex-start;
 
- 				.item{
 
- 					width: 240rpx;
 
- 					padding: 0rpx 20rpx;
 
- 					display: flex;
 
- 					align-items: center;
 
- 					justify-content: flex-start;
 
- 					font-size: 32upx;
 
- 					font-family: PingFang SC;
 
- 					font-weight: normal;
 
- 					color: #111111;
 
- 					font-weight: 500;
 
- 					line-height: 80upx;
 
- 					.line{
 
- 						margin-right: 15rpx;
 
- 						border-radius: 5rpx;
 
- 						width: 8rpx;
 
- 						height:30rpx;
 
- 						background-color: #2583EB;
 
- 					}
 
- 					
 
- 				}
 
- 				.active{
 
- 					background-color: #fff;
 
- 					font-weight: bold;
 
- 					color: #2583EB;
 
- 				}
 
- 			}
 
- 			
 
- 		}
 
- 		.right{
 
- 			padding: 30rpx 15rpx;
 
- 			background-color: #fff;
 
- 			height: 100%;
 
- 			overflow-y: auto;
 
- 			display: flex;
 
- 			flex-direction: column;
 
- 			align-items: flex-start;
 
- 			justify-content: flex-start;
 
- 			width: calc(100% - 240rpx);
 
- 			.title{
 
- 				font-size: 40upx;
 
- 				font-family: PingFang SC;
 
- 				font-weight: bold;
 
- 				color: #2583EB;
 
- 				line-height: 80upx;
 
- 			}
 
- 			.items{
 
- 				width: 100%;
 
- 				display: flex;
 
- 				flex-direction: column;
 
- 				align-items: flex-start;
 
- 				justify-content: flex-start;
 
- 				.r-item{
 
- 					line-height: 80rpx;
 
- 					width: 100%;
 
- 					display: flex;
 
- 					align-items: center;
 
- 					justify-content: flex-start;
 
- 					.r-left{
 
- 						flex: 1;
 
- 						font-size: 32upx;
 
- 						font-family: PingFang SC;
 
- 						font-weight: 500;
 
- 						color: #080808;
 
- 					}
 
- 					.r-right{
 
- 						padding: 0rpx 20rpx;
 
- 						display: flex;
 
- 						align-items: center;
 
- 						justify-content: center;
 
- 						image{
 
- 							width: 22rpx;
 
- 							height:30rpx;
 
- 						}
 
- 					}
 
- 					
 
- 				}
 
- 				 
 
- 			}
 
- 		}
 
- 	}
 
- 	 
 
- </style>
 
 
  |