| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 | 
							- <template>
 
- 	<view class="content">
 
- 		<view class="bg-box">
 
- 			<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/71014b69fdcc4b56ae2a84bdc28f11c3.png"></image>
 
- 			<view class="title-box">
 
- 				<view class="title">
 
- 					{{item.name}}
 
- 				</view>
 
- 			</view>
 
- 		</view>
 
- 		<view class="cont">
 
- 			<view class="msg-box">
 
- 				<view class="msg">{{item.msg}}</view>
 
- 			</view>
 
- 			<view class="line"></view>
 
- 			<view class="desc-box">
 
- 				<view class="desc" v-html="item.descs"> </view>
 
- 			</view>
 
- 			<view class="btn-box">
 
- 				<view class="btn" @click="navTo('/pages_index/test?tempId='+item.tempId)">立即开始</view>
 
- 			</view>
 
- 		</view>
 
- 		
 
- 	</view> 
 
- </template>
 
- <script>
 
- 	import {getTestDetails} from '@/api/test.js'
 
- 	export default {
 
- 		data() {
 
- 			return {
 
- 				tempId:null,
 
- 				item:{},
 
- 			};
 
- 		},
 
- 		onLoad(option) {
 
- 			this.tempId=option.tempId;
 
- 			 
 
- 		},
 
- 		onShow() {
 
- 			this.getTestDetails();
 
- 		},
 
- 		//发送给朋友
 
- 		onShareAppMessage(res) {
 
- 			if(this.$isLogin()){
 
- 				return {
 
- 					title: "健康自测",
 
- 					path: '/pages_index/testDetails?tempId='+this.tempId,
 
- 					imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 
- 				}
 
- 			}
 
- 			
 
- 		},
 
- 		//分享到朋友圈
 
- 		onShareTimeline(res) {
 
- 			if(this.$isLogin()){
 
- 				return {
 
- 					title: "健康自测",
 
- 					imageUrl: 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/sharelogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
 
- 				}
 
- 			}
 
- 			
 
- 		},
 
- 		methods:{
 
- 			navTo(url) {
 
- 				this.$isLogin().then(
 
- 					res => {
 
- 						console.log(res)
 
- 						if(res){
 
- 							uni.navigateTo({
 
- 								url: url
 
- 							})
 
- 						}
 
- 						else{
 
- 							uni.navigateTo({
 
- 								url:'/pages/auth/login'
 
- 							})
 
- 						}
 
- 					}
 
- 				);
 
- 				
 
- 			},
 
- 			getTestDetails(){
 
- 				let data = {tempId:this.tempId};
 
- 				getTestDetails(data).then(
 
- 					res => {
 
- 						if(res.code==200){
 
- 							this.item=res.data;
 
- 							uni.setNavigationBarTitle({
 
- 							      title: this.item.name+"自测"
 
- 							});
 
- 							 
 
- 						}else{
 
- 							uni.showToast({
 
- 								icon:'none',
 
- 								title: "请求失败",
 
- 							});
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				);
 
- 			},
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss">
 
- 	page{
 
- 		height: 100%;
 
- 	}
 
- 	.content{
 
- 		position: relative;
 
- 		height: 100%;
 
- 		display: flex;
 
- 		flex-direction: column;
 
- 		.bg-box{
 
- 			position: absolute;
 
- 			width: 100%;
 
- 			height: 600rpx;
 
- 			.title-box{
 
- 				top: 50rpx;
 
- 				left:50rpx;
 
- 				position: absolute;
 
- 				
 
- 				.title{
 
- 					border-radius: 5rpx;
 
- 					border: 1rpx solid #fff;
 
- 					padding: 20rpx 30rpx;
 
- 					font-size: 36rpx;
 
- 					font-family: Source Han Sans CN;
 
- 					font-weight: bold;
 
- 					color: #fff;
 
- 				}
 
- 				
 
- 				
 
- 				
 
- 			}
 
- 			image{
 
- 				position: absolute;
 
- 				width: 100%;
 
- 				height: 100%;
 
- 			}
 
- 			
 
- 		}
 
- 		.cont{
 
- 			position: relative;
 
- 			margin-top: 550rpx;
 
- 			z-index: 9999;
 
- 			padding: 30rpx;
 
- 			height: 100%;
 
- 			display: flex;
 
- 			flex-direction: column;
 
- 			padding: 30rpx;
 
- 			background-color: #fff;
 
- 			border-radius: 30rpx 30rpx 0rpx 0rpx;
 
- 			.msg-box{
 
- 				.msg{
 
- 					font-size: 36rpx;
 
- 					font-family: Source Han Sans CN;
 
- 					font-weight: bold;
 
- 					color: #111;
 
- 				}
 
- 			}
 
- 			.line{
 
- 				margin: 15rpx 0rpx;
 
- 				background-color: #F6F6F6;
 
- 				height:5rpx;
 
- 				width: 100%;
 
- 			}
 
- 			.desc-box{
 
- 				margin-top: 20rpx;
 
- 				background: #FFFFFF;
 
- 				.desc{
 
- 					color: #814E1B;
 
- 				}
 
- 			}
 
- 			.logo{
 
- 				display: flex;
 
- 				align-items: center;
 
- 				justify-content: center;
 
- 				margin: 60rpx 0rpx;
 
- 				width: 100%;
 
- 				image{
 
- 					width: 200rpx;
 
- 					height:100rpx;
 
- 				}
 
- 			}
 
- 			.btn-box{
 
- 				margin-top: 60rpx;
 
- 			 	height: 140upx;
 
- 			 	width: 100%;
 
- 			 	box-sizing: border-box;
 
- 			 	display: flex;
 
- 			 	align-items: center;
 
- 			 	justify-content: center;
 
- 				
 
- 			 	.btn{
 
- 			 		width: 100%;
 
- 			 		height: 88upx;
 
- 			 		line-height: 88upx;
 
- 			 		text-align: center;
 
- 			 		font-size: 34upx;
 
- 			 		font-family: PingFang SC;
 
- 			 		font-weight: bold;
 
- 			 		color: #FFFFFF;
 
- 			 		background: #2583EB;
 
- 			 		border-radius: 50upx;
 
- 			 	}
 
- 			 }
 
- 		}
 
- 		
 
- 		
 
- 	}
 
- 	 
 
- </style>
 
 
  |