Jelajahi Sumber

满意度中转页及页面参数获取兼容

xuyousan 3 minggu lalu
induk
melakukan
87affdbe36

+ 15 - 2
hook/use-small-program-login/index.ts

@@ -130,8 +130,21 @@ const smallProgramLoginByGONGZHONGHAODiy = (app: App.AppInstance) => {
 		// 	}
 		// 	return;
 		// }
-		const token = new URL(location.href).searchParams.get('token');
-		const openid = new URL(location.href).searchParams.get('openid');
+		// 兼容解析:优先读取标准URL query,其次读取hash路由中的query
+		const getUrlParam = (key: string) => {
+			let value = new URL(location.href).searchParams.get(key);
+			if (!value) {
+				const hash = location.hash || '';
+				const qIndex = hash.indexOf('?');
+				if (qIndex !== -1) {
+					const hashQuery = hash.slice(qIndex + 1);
+					value = new URLSearchParams(hashQuery).get(key);
+				}
+			}
+			return value;
+		};
+		const token = getUrlParam('token');
+		const openid = getUrlParam('openid');
 		console.log(token);
 		const { channelId, configKey, hosId, wechatConfigKey } = app.globalData;
 		if (!token) {

+ 6 - 0
pages.json

@@ -33,6 +33,12 @@
 				"style": {
 					"navigationBarTitleText": ""
 				}
+			},
+			{
+				"path": "satisfaction/business/satisfactionHome/satisfactionHome",
+				"style": {
+					"navigationBarTitleText": "满意度调查"
+				}
 			}
 		]
 	}],

+ 19 - 2
pages/business/tabbar/transferPage/transferPage.vue

@@ -1,11 +1,14 @@
 <template>
 	<view class="container">
-		<view class="content"> </view>
+		<view class="content">
+		</view>
 	</view>
 </template>
 
 <script lang="ts" setup>
+import { reactive, ref } from 'vue';
 import { useOnLoad } from '@/hook';
+import { onLoad } from '@dcloudio/uni-app';
 import {
 	useSetMenuList,
 	useLoadViewMenu,
@@ -17,6 +20,7 @@ import { common, menuClick } from '@/utils';
 import { menu } from '@/config';
 
 const app = getApp();
+const type = ref("")
 
 const main = async (options: any = {}) => {
 	let menuList = common.isEmpty(uni.getStorageSync('menuList'))
@@ -123,6 +127,20 @@ const main = async (options: any = {}) => {
 			url = `/${overdueOptions.route}?${queryString}`;
 			await checkAuthAndDefaultMember(url);
 			uni.setStorageSync('overdueOptions', '');
+		} else if(options.type == 'sms_myddc') {
+			let url = ""
+			common.showModal("请选择问卷类型", () => {
+				url = `/pagesAdmin/satisfaction/business/satisfactionHome/satisfactionHome?objType=4&type=${options.type}&cardNo=${options.cardNo}&cardType=${options.cardType}`
+				common.goToUrl(url, {
+				skipWay: 'reLaunch',
+			})
+			},{cancelColor: "#74B72F",confirmText: "住院问卷",cancelText: "门诊问卷",callBack:() => {
+				url = `/pagesAdmin/satisfaction/business/satisfactionHome/satisfactionHome?objType=3&type=${options.type}&cardNo=${options.cardNo}&cardType=${options.cardType}`
+				common.goToUrl(url, {
+				skipWay: 'reLaunch',
+			})
+			}})
+			return
 		} else {
 			// 不等于前面特定页面时 走菜单获取 type值为菜单名称
 			const childArray = this.getAllChildren(menuList.map((item) => item.Children));
@@ -208,7 +226,6 @@ const getAllChildren = (arr) => {
 		}
 	});
 };
-
 useOnLoad((options) => {
 	uni.showLoading();
 	main(options);

+ 98 - 0
pagesAdmin/satisfaction/business/satisfactionHome/satisfactionHome.vue

@@ -0,0 +1,98 @@
+<template>
+	<view class="container">
+		<view class="content">
+			<view class="list">
+				<view class="item" v-for="(item,index) in list" :key="index" @click="itemClick(item)">
+					<image class="item_img" :src="iconUrl.home_back"></image>
+					<view class="item_val">{{item.SubjectTitle}}</view>
+				</view>
+				<view v-if="list.length == 0" class="noData">
+					<noData value="暂无数据"></noData>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script lang="ts" setup>
+	import { reactive, ref } from 'vue';
+	import { useOnLoad } from '@/hook';
+	import { useDomain } from '@kasite/uni-app-base';
+	import { mapGetters } from '@kasite/uni-app-base/store/hook';
+	import {
+		QuerySubjectListToChannelTask_V3
+	} from '../../service';
+	import icon from '@/utils/icon';
+	import { common, throttle } from '@/utils';
+	import fn from './fn';
+
+	const app = getApp();
+
+	const list = ref([])
+	const iconUrl = ref(icon)
+	const objType = ref("")
+	const cardNo = ref("")
+	const cardType = ref("")
+	const type = ref("")
+
+
+	useOnLoad((options) => {
+		console.log("options===",options,app.globalData)
+		main(options);
+	});
+	const main = async (options) => {
+		let queryData = {
+			OrgId: app.globalData.hosId,
+			State: 1,
+			SubjectWay: 'smallpro',
+			// 1=面向所有患者、2=面向医院职工、3=面向门诊患者、4=面向住院患者、5=面向体检患者
+			GroupType: options.objType || "3"
+		}
+		let resp = await QuerySubjectListToChannelTask_V3(queryData);
+		
+		if(!common.isEmpty(resp)) {
+			objType.value = options.objType || '3'
+			list.value = resp || []
+			cardNo.value = options.cardNo
+			cardType.value = options.cardType
+			type.value = options.type
+		}
+
+	};
+	/**
+	 * 满意度点击
+	 */
+	const itemClick = (item) => {
+		common.goToUrl(`/pagesAdmin/satisfaction/business/satisfactionQuestions/satisfactionQuestions?subjectId=${item.SubjectId}&taskId=${item.TaskId}&cardNo=${cardNo.value}&cardType=${cardType.value}&type=${type.value}`)
+	}
+</script>
+
+<style lang="scss" scoped>
+	.list {
+		padding: 30upx;
+	}
+
+	.item {
+		margin-bottom: 30upx;
+		background: rgba(255, 255, 255, 1);
+		border-radius: 20upx;
+		overflow: hidden;
+	}
+
+	.item_img {
+		width: 100%;
+		height: 340upx;
+	}
+
+	.item_val {
+		font-size: 32upx;
+		font-family: Source Han Sans CN;
+		font-weight: 500;
+		color: rgba(0, 0, 0, 1);
+		height: 100upx;
+		display: flex;
+		align-items: center;
+		padding: 0 30upx;
+		line-height: 1.4em;
+	}
+</style>

+ 10 - 3
pagesAdmin/satisfaction/business/satisfactionQuestions/satisfactionQuestions.vue

@@ -370,13 +370,20 @@ const main = async (options) => {
 		quesAnswers.SubjectId = options.subjectId;
 		//如果不是执行选择直接调用对应填写按钮
 		if (anonymous != 3) {
-			isAnonymous(anonymous);
+			isAnonymous(anonymousType.value);
 		}
 		await querySubjectInfoById_V3();
 		// 查询样本和答案
 		// await querySample_V3();
 		// 开始计算答卷时间
 		getSec();
+		
+		if(options?.type == "sms_myddc") {
+			currentUser.value.cardNo = options.cardNo
+			currentUser.value.cardType = options.cardType
+			showModal_Anonymous.value = false
+			showModal_User.value = false
+		}
 	} else {
 		common.showModal('该任务已失效', () => {
 			common.goToUrl(`/pages/business/tabbar/homePage/homePage`, { skipWay: 'reLaunch' });
@@ -460,7 +467,6 @@ const querySubjectInfoById_V3 = async () => {
 		});
 		resp[0].QuestionList = bySort(resp[0].QuestionList);
 		quesList.value = resp[0];
-		console.log(quesList.value);
 	}
 };
 
@@ -895,7 +901,6 @@ const setVal = (e) => {
 /** 提交 */
 const submit = () => {
 	throttle(async () => {
-		
 		await common.sleep(1000);
 		if (complete.value) return;
 		uni.showLoading();
@@ -927,6 +932,8 @@ const submit = () => {
 		quesAnswers.HospitalNo = objType.value == '4' ? currentUser.value.cardNo : '';
 		quesAnswers.CardNo = objType.value == '3' ? currentUser.value.cardNo : '';
 		quesAnswers.TaskId = taskId.value;
+		quesAnswers.CardType = objType.value == '3' ? currentUser.value.cardType : '';
+		
 		let res = await CommitAnswer_V3(quesAnswers);
 		clearTimeout(time);
 		if (common.isNotEmpty(res)) {

+ 11 - 0
pagesAdmin/satisfaction/service/satisfactionQuestions/index.ts

@@ -44,3 +44,14 @@ export const QuerySample_V3 = async (queryData) => {
 	);
 	return handle.catchPromise(resp, () => resp);
 };
+
+/** 查询院内就诊卡信息 */
+export const QueryMemberCardList_V3 = async (queryData: any) => {
+	const resp = handle.promistHandleNew(
+		await request.doPost(
+			`${REQUEST_CONFIG.BASE_URL}wsgw/accountMember/api/QueryMemberCardList_V3/callApiJSON.do`,
+			queryData
+		)
+	);
+	return handle.catchPromiseNew(resp, () => resp);
+};