| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 | 
							- <template>
 
- 	<view class="content" v-if="item!=null">
 
- 		<view class="detail-cont">
 
- 			<view class="title-box">
 
- 				<view class="line"></view>
 
- 				<view class="title">疾病名称</view>
 
- 			</view>
 
- 			<view class="desc" v-html="item.diseaseName"></view>
 
- 			<view class="title-box">
 
- 				<view class="line"></view>
 
- 				<view class="title">病情症状</view>
 
- 			</view>
 
- 			<view class="desc" v-html="item.symptom"></view>
 
- 			<view class="title-box">
 
- 				<view class="line"></view>
 
- 				<view class="title">病情诊断</view>
 
- 			</view>
 
- 			<view class="desc" v-html="item.diagnose"></view>
 
- 			<view class="title-box">
 
- 				<view class="line"></view>
 
- 				<view class="title">相关检验</view>
 
- 			</view>
 
- 			<view class="desc" v-html="item.inspect"></view>
 
- 		</view>
 
- 		<view class="ad">
 
- 			<u-swiper
 
- 					:list="advImgs"
 
- 					indicator
 
- 					indicatorMode="line"
 
- 					circular
 
- 					@click="handleAdvClick"
 
- 			></u-swiper>
 
- 		</view>
 
- 	</view> 
 
- </template>
 
- <script>
 
- 	import {getDiseaseById} from '@/api/disease'
 
- 	import {getAdvList} from '@/api/adv.js'
 
- 	export default {
 
- 		data() {
 
- 			return {
 
- 				advs:[],
 
- 				advImgs:[],
 
- 				diseaseId:null,
 
- 				item:{},
 
- 			};
 
- 		},
 
- 		onLoad(option) {
 
- 			this.diseaseId=option.diseaseId;
 
- 		},
 
- 		onShow() {
 
- 			this.getAdvList();
 
- 			this.getDiseaseById();
 
- 		},
 
- 		onShareAppMessage(res) {
 
- 			if(this.$isLogin()){
 
- 				return {
 
- 					title: this.item.diseaseName,
 
- 					path: '/pages_index/diseaseDetails?id='+this.diseaseId,
 
- 					imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 
- 				}
 
- 			}
 
- 			
 
- 		},
 
- 		//分享到朋友圈
 
- 		onShareTimeline(res) {
 
- 			if(this.$isLogin()){
 
- 				return {
 
- 					title: this.item.diseaseName,
 
- 					imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 
- 				}
 
- 			}
 
- 			
 
- 		},
 
- 		methods:{
 
- 			handleAdvClick(index){
 
- 				var ad=this.advs[index];
 
- 				console.log(ad.advUrl);
 
- 				if(ad.showType==1){
 
- 					uni.setStorageSync('url',ad.advUrl);
 
- 					uni.navigateTo({
 
- 						url:"h5"
 
- 					})
 
- 				}
 
- 				else if(ad.showType==2){
 
- 					uni.navigateTo({
 
- 						url:ad.advUrl
 
- 					})
 
- 				}
 
- 				else if(ad.showType==3){
 
- 					 uni.setStorageSync('content',ad.content);
 
- 					 uni.navigateTo({
 
- 					 	url:"content"
 
- 					 })
 
- 				}
 
- 				
 
- 			},
 
- 			getAdvList() {
 
- 				//联网加载数据
 
- 				var that = this;
 
- 				var data = {
 
- 					advType:7
 
- 				};
 
- 				getAdvList(data).then(res => {
 
- 					if(res.code==200){
 
- 						that.advImgs=[];
 
- 						that.advs=[];
 
- 						res.data.forEach(function(element) {
 
- 							if(element.imageUrl!=null&&element.imageUrl!=""){
 
- 								that.advs.push(element);
 
- 								that.advImgs.push(element.imageUrl);
 
- 							}
 
- 						});
 
- 						
 
- 					}else{
 
- 						uni.showToast({
 
- 							icon:'none',
 
- 							title: "请求失败",
 
- 						});
 
- 					}
 
- 				});
 
- 			},
 
- 			getDiseaseById(){
 
- 				let data = {diseaseId:this.diseaseId};
 
- 				getDiseaseById(data).then(
 
- 					res => {
 
- 						if(res.code==200){
 
- 							this.item=res.data;
 
- 						}else{
 
- 							uni.showToast({
 
- 								icon:'none',
 
- 								title: "请求失败",
 
- 							});
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				);
 
- 			},
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss">
 
- 	page{
 
- 		height: 100%;
 
- 	}
 
-  
 
- 	.content{
 
- 	}
 
- 	.detail-cont{
 
- 		margin: 20rpx;
 
- 		padding: 15rpx;
 
- 		box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
 
- 		background-color: #fff;
 
- 		border-radius: 15rpx;
 
- 		.title-box{
 
- 			width: 100%;
 
- 			display: flex;
 
- 			justify-content: flex-start;
 
- 			align-items: center;
 
- 			.line{
 
- 				width: 6rpx;
 
- 				height:30rpx;
 
- 				background-color: #2583EB;
 
- 				 
 
- 			}
 
- 			.title{
 
- 				margin-left: 15rpx;
 
- 				font-size: 32upx;
 
- 				font-family: PingFang SC;
 
- 				font-weight: bold;
 
- 				color: #333;
 
- 			}
 
- 			 
 
- 		}
 
- 		.desc{
 
- 			margin-top: 15rpx;
 
- 			margin-bottom: 15rpx;
 
- 			font-size: 28upx;
 
- 			font-family: PingFang SC;
 
- 			color: #9a9a9c;
 
- 		}
 
- 	}
 
- 	.ad{
 
- 		margin-bottom: 50rpx;
 
- 		width: 100%;
 
- 		padding: 15rpx;
 
- 		 
 
- 	}
 
- 	 
 
- </style>
 
 
  |