Quellcode durchsuchen

feat: 增加筛查报告查看状态

leap vor 3 Jahren
Ursprung
Commit
49eaf631d7

+ 32 - 28
common/apis/index.js

@@ -2,36 +2,40 @@ import http from '@/common/utils/http'
 
 export default {
 	// 发送手机验证码
-    GetVerificationCode(params) {
-        return http('get', '/api/mp_users/get_verification_code/', params)
-    },
-    // 验证码登录
-    PostSmsLogin(params) {
-        return http('post', '/api/mp_users/sms_login/', params)
-    },
+	GetVerificationCode(params) {
+		return http('get', '/api/mp_users/get_verification_code/', params)
+	},
 	// 验证码登录
-    PostLogout(params) {
-        return http('post', '/api/mp_users/logout/', params)
-    },
+	PostSmsLogin(params) {
+		return http('post', '/api/mp_users/sms_login/', params)
+	},
+	// 验证码登录
+	PostLogout(params) {
+		return http('post', '/api/mp_users/logout/', params)
+	},
+	// 微信授权登录
+	PostWechatLogin(params) {
+		return http('post', '/api/mp_users/wechat_login/', params)
+	},
 	// 关联筛查人员账户(家长关联孩子)
-    PostAssociation(params) {
-        return http('post', '/api/mp_users/association/', params)
-    },
+	PostAssociation(params) {
+		return http('post', '/api/mp_users/association/', params)
+	},
 	// 查询关联关系
-    GetAssociation(params) {
-        return http('get', '/api/mp_users/get_association/', params)
-    },
-	// 查询筛查报告
-    GetHealthReport(params) {
-        return http('get', '/api/exam/health_report/', params)
-    },
+	GetAssociation(params) {
+		return http('get', '/api/mp_users/get_association/', params)
+	},
 	// 删除关联关系
-    PostDeleteAssociation(params) {
-        return http('post', '/api/mp_users/delete_association/', params)
-    },
-	// 微信授权登录
-    PostWechatLogin(params) {
-        return http('post', '/api/mp_users/wechat_login/', params)
-    },
+	PostDeleteAssociation(params) {
+		return http('post', '/api/mp_users/delete_association/', params)
+	},
+	// 报告-获取健康报告
+	GetHealthReport(params) {
+		return http('get', '/api/mp_task/health_report/', params)
+	},
+	// 报告-家长检查报告状态
+	PostInspectionReportStatus(params) {
+		return http('post', '/api/mp_task/inspection_report_status/', params)
+	},
 
-}
+}

+ 27 - 3
common/style/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "font_family"; /* Project id 2684407 */
-  src: url('//at.alicdn.com/t/font_2684407_6yua7rgalqi.woff2?t=1645693433487') format('woff2'),
-       url('//at.alicdn.com/t/font_2684407_6yua7rgalqi.woff?t=1645693433487') format('woff'),
-       url('//at.alicdn.com/t/font_2684407_6yua7rgalqi.ttf?t=1645693433487') format('truetype');
+  src: url('//at.alicdn.com/t/font_2684407_z74k4pswv2.woff2?t=1651043163652') format('woff2'),
+       url('//at.alicdn.com/t/font_2684407_z74k4pswv2.woff?t=1651043163652') format('woff'),
+       url('//at.alicdn.com/t/font_2684407_z74k4pswv2.ttf?t=1651043163652') format('truetype');
 }
 
 .font_family {
@@ -13,6 +13,30 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-gouxuan1:before {
+  content: "\e65c";
+}
+
+.icon-yigouxuan:before {
+  content: "\e65d";
+}
+
+.icon-gouxuan:before {
+  content: "\e7f2";
+}
+
+.icon-youhuiquan:before {
+  content: "\e612";
+}
+
+.icon-yishoucang:before {
+  content: "\e7f1";
+}
+
+.icon-yizhuanzeng:before {
+  content: "\e7f0";
+}
+
 .icon-qiehuan:before {
   content: "\e6d9";
 }

+ 6 - 0
pages.json

@@ -35,6 +35,12 @@
 			"style": {
 				"navigationBarTitleText": "筛查中心"
 			}
+		},
+		{
+			"path": "pages/webview/index",
+			"style": {
+				"navigationBarTitleText": ""
+			}
 		}
 	],
 	"globalStyle": {

+ 11 - 3
pages/index/index.vue

@@ -47,8 +47,8 @@
 						@click="bindChangeDate(item, index)"
 					>
 						<span>
-							<i>{{ item.date.split('-')[1] }}-{{ item.date.split('-')[2] }}</i>
-							<i>{{ item.date.split('-')[0] }}</i>
+							<i>{{ item.time.split('-')[1] }}-{{ item.time.split('-')[2] }}</i>
+							<i>{{ item.time.split('-')[0] }}</i>
 						</span>
 					</div>
 				</scroll-view>
@@ -161,7 +161,15 @@
 						</div>
 					</div>
 				</div>
-				<div class="result-tips">温馨提示:该视力检查结果不作为诊断依据,请到正规的眼科医疗机构进行详细的检查。</div>
+				<div class="tips-box">
+					<div class="tips-content">
+						<img src="../../static/images/check_tips.png" alt="">
+						<div class="text">
+							<span @click="bindChangeTag(currentPatient)"><i class="font_family" :class="[currentPatient.tag ? 'icon-gouxuan' : 'icon-gouxuan1']"></i>我已阅读并知晓</span>
+							<span><i class="name">{{currentPatient.name}}</i>同学的眼健康筛查结果</span>
+						</div>
+					</div>
+				</div>
 			</div>
 		</scroll-view>
 

+ 28 - 8
pages/index/methods.js

@@ -32,9 +32,9 @@ export default {
 			const res = await Apis.GetHealthReport({
 				id: this.currentPatient.id
 			})
-			res.data.forEach((v) => {
-				v.date = v.time && v.time.split(' ')[0]
-			})
+			// res.data.forEach((v) => {
+			// 	v.date = v.time && v.time.split(' ')[0]
+			// })
 			this.currentPatient = {
 				...this.currentPatient,
 				...res.data[0]
@@ -91,6 +91,24 @@ export default {
 			...item
 		}
 	},
+	async bindChangeTag(data) {
+		if (data.tag) return
+		try {
+			uni.showLoading({
+				title: '更新中...'
+			})
+			data.tag = 1
+			await Apis.PostInspectionReportStatus({
+				code: data.code
+			})
+			uni.navigateTo({
+				url: '../webview/index?img=screening_check_1.jpg'
+			})
+		} catch (err) {
+			data.tag = 0
+			console.error(err)
+		}
+	},
 	// 打开切换学生弹窗
 	bindOpenUserPopup() {
 		this.$refs.userPopup.open()
@@ -130,11 +148,13 @@ export default {
 	},
 	bindContact() {
 		wx.openCustomerServiceChat({
-		  extInfo: {url: 'https://work.weixin.qq.com/kfid/kfc68fd21608ac5e9d0'},
-		  corpId: 'ww7975bc6b305b44e9',
-		  complete(res) {
-			  console.log(res)
-		  }
+			extInfo: {
+				url: 'https://work.weixin.qq.com/kfid/kfc68fd21608ac5e9d0'
+			},
+			corpId: 'ww7975bc6b305b44e9',
+			complete(res) {
+				console.log(res)
+			}
 		})
 	}
 }

+ 43 - 3
pages/index/style.scss

@@ -245,10 +245,50 @@
 				}
 			}
 		}
-		.result-tips {
-			padding: 16px 10px;
-			@include FONT(#999999, 12px, 400);
+		.tips-box {
 			border-top: 1px solid #ededed;
+			padding: 16px 10px;
+			.tips-content {
+				width: 100%;
+				height: 132px;
+				border-radius: 10px;
+				overflow: hidden;
+				position: relative;
+
+				img {
+					width: 100%;
+					height: 100%;
+					position: absolute;
+				}
+				.text {
+					position: absolute;
+					top: 20px;
+					left: 20px;
+					@include FONT(#000000, 14px, 400);
+					span:nth-child(1) {
+						display: flex;
+						align-items: center;
+						font-weight: 500;
+						i {
+							margin-right: 6px;
+							color: #ffffff;
+						}
+						.icon-gouxuan {
+							color: #999999;
+						}
+					}
+					span:nth-child(2) {
+						display: flex;
+						align-items: center;
+						margin-left: 20px;
+						.name {
+							@include FONT(#333333, 12px, 400);
+							padding: 4px 10px;
+							border-bottom: 1px solid #bfecff;
+						}
+					}
+				}
+			}
 		}
 	}
 }

+ 45 - 0
pages/webview/index.vue

@@ -0,0 +1,45 @@
+<template>
+	<div>
+		<!-- <block v-if="url"><web-view :src="url" @message="onMessage"></web-view></block> -->
+		<div class="img-box" v-if="imgName"><img mode="widthFix" lazy-load :src="imgUrl + imgName + queryTime" /></div>
+	</div>
+</template>
+
+<script>
+import methods from './methods.js';
+
+export default {
+	data() {
+		return {
+			imgUrl: '',
+			imgName: ''
+		};
+	},
+	computed: {
+		queryTime() {
+			return `?t=${new Date().getTime()}`;
+		}
+	},
+	onLoad(options) {
+		let app = getApp();
+		this.imgUrl = app.globalData.imgUrl;
+		this.imgName = options.img
+		if (this.imgName == 'screening_check_1.jpg') {
+			wx.setNavigationBarTitle({
+			  title: '感谢查阅'
+			})
+		} else {
+			wx.setNavigationBarTitle({
+			  title: '视光筛查'
+			})
+		}
+	},
+	onShow() {},
+	methods: {
+		...methods
+	}
+};
+</script>
+<style lang="scss" scoped>
+@import './style.scss';
+</style>

+ 9 - 0
pages/webview/methods.js

@@ -0,0 +1,9 @@
+import env from '@/env.js';
+import Apis from '@/common/apis/index'
+import qs from 'qs'
+
+export default {
+	onMessage(data) {
+		console.log(data)
+	}
+}

+ 5 - 0
pages/webview/style.scss

@@ -0,0 +1,5 @@
+.img-box {
+	img {
+		width: 100%;
+	}
+}

BIN
static/images/check_tips.png