Przeglądaj źródła

优化,满意度已提交问卷不允许再次提交

高晟悦 1 miesiąc temu
rodzic
commit
c38437d02d

+ 24 - 18
App.vue

@@ -19,24 +19,29 @@ import { nextTick } from 'vue';
 let app = null;
 
 const beforeMain = async () => {
-	common.showLoading();
-	// 获取前端当前配置信息版本号 并控制是否 前端配置信息是否要重新获取
-	await useFrontEndConfigVersion();
-	// 获取前端配置信息
-	let has = await useSetFrontEndConfig();
-	// 判断获取配置信息是否成功 不成功不让往下
-	if (has) return;
-	// 判断应用状态,非运行中的应用跳转对应状态的缺省页
-	// await useAppStatus();
-	common.hideLoading();
-	if (!app.globalData.logSuccess) {
-		main();
-	} else {
-		// 配置判断是否需要互联网医院Websocket
-		if (app.globalData.hasWebsocket) {
-			// 链接websocket
-			connectWebsocket(true);
+	try {
+		common.showLoading();
+		// 获取前端当前配置信息版本号 并控制是否 前端配置信息是否要重新获取
+		await useFrontEndConfigVersion();
+		// 获取前端配置信息
+		let has = await useSetFrontEndConfig();
+		// 判断获取配置信息是否成功 不成功不让往下
+		if (has) return;
+		// 判断应用状态,非运行中的应用跳转对应状态的缺省页
+		// await useAppStatus();
+		common.hideLoading();
+		if (!app.globalData.logSuccess) {
+			await main();
+		} else {
+			// 配置判断是否需要互联网医院Websocket
+			if (app.globalData.hasWebsocket) {
+				// 链接websocket
+				connectWebsocket(true);
+			}
 		}
+	} catch(e) {
+		common.hideLoading();
+		common.showModal(e.message || `启动异常`, () => {}, { title: "发生错误" });
 	}
 };
 const main = async function () {
@@ -60,7 +65,7 @@ const main = async function () {
 	// const resp = await useSmallProgramLogin(app);
 	const resp = await useSmallProgramLoginDiy(app);
 	if (resp) {
-		// await getEncryptData();
+		await getEncryptData();
 		app.globalData.logSuccess = true;
 		// await useGetSysAppPageList();
 		// await usePreserMember();
@@ -108,6 +113,7 @@ const getEncryptData = async () => {
 		}
 	} catch (e) {
 		console.error('解析 EncryptData 失败', e);
+		throw new Error('解析 EncryptData 失败');
 	}
 	// #endif
 	

+ 2 - 1
pagesAdmin/satisfaction/business/satisfactionQuestions/satisfactionQuestions.vue

@@ -512,6 +512,7 @@ const querySample_V3 = async () => {
 		    }
 		  })
 		})
+		complete.value = true;
 	}
 }
 
@@ -893,9 +894,9 @@ const setVal = (e) => {
 
 /** 提交 */
 const submit = async () => {
-	uni.showLoading();
 	await common.sleep(1000);
 	if (complete.value) return;
+	uni.showLoading();
 	const answers = { ...quesAnswers } as any;
 	for (var i = 0; i < answers.AnswerList.length; i++) {
 		let item = answers.AnswerList[i];

+ 1 - 31
pagesCrm/business/home/home.vue

@@ -88,14 +88,6 @@ const main = (options) => {
 /** 刷新 */
 const refresh = async (options: any = {}) => {
 	try {
-		if(!currentUser.value) {
-			// common.showModal("getEncryptData - home - start")
-			await getEncryptData();
-			// common.showModal("getEncryptData - home - end")
-		}
-		
-		
-		// common.showModal("currentUser" + JSON.stringify(currentUser.value))
 		if (!currentUser.value) {
 			let [user = {}] = memberList.value.filter((item) => {
 				if (options.memberId) {
@@ -118,7 +110,7 @@ const refresh = async (options: any = {}) => {
 		await getPatientExecPlanList();
 		uni.stopPullDownRefresh();
 	} catch (e) {
-		// outputInfo("[Error]", e.message)
+		outputInfo("发生错误", `[Error]: ${e.message}`);
 	}
 };
 /** 查询患者执行计划科室列表 */
@@ -192,28 +184,6 @@ const changeItemReadStatus = (date, index, status) => {
 	datelineData.value[date][index].IsRead = status;
 };
 
-/** 解密 */
-const getEncryptData = async () => {
-	// 只在 H5/WEB 端解析 URL 上的 EncryptData,兼容外部跳转进来的完整地址
-	let encryptData = '';
-	// #ifdef H5 || WEB
-	try {
-		// 例: https://fzsclqyy.com/KasiteWeb/module/hcrmUserCenter/index.html?EncryptData=xxx&token=xxx&openid=xxx#/
-		// 先截掉 hash 部分,再解析 ? 后面的查询参数
-		const url = (typeof window !== 'undefined' && window.location && window.location.href) ? window.location.href : '';
-		const queryPart = url.split('?')[1]?.split('#')[0] || '';
-		if (queryPart) {
-			const params = new URLSearchParams(queryPart);
-			encryptData = params.get('EncryptData') || '';
-		}
-	} catch (e) {
-		console.error('解析 EncryptData 失败', e);
-	}
-	// #endif
-	
-	await useGetMemberIdByEncryptData(encryptData);
-}
-
 /**
  * 输出异常
  */

+ 2 - 2
pagesCrm/service/home/index.ts

@@ -6,13 +6,13 @@ import { request, handle } from '@kasite/uni-app-base';
  * @param EncryptData String 加密串
  */
 export const GetMemberIdByEncryptData = async (queryData: any) => {
-	let resp = handle.promistHandle(
+	let resp = handle.promistHandleNew(
 		await request.doPost(
 			`${REQUEST_CONFIG.BASE_URL}wsgw/crm/diyBusiness/GetMemberIdByEncryptData/callApiJSON.do`,
 			queryData
 		)
 	);
-	return handle.catchPromise(resp, () => resp);
+	return handle.catchPromiseNew(resp, () => resp);
 };