高晟悦 1 月之前
父節點
當前提交
1e97de56a9

+ 21 - 19
App.vue

@@ -1,6 +1,6 @@
 <script>
 import { GLOBALDATA, frontEndConfig, menu } from './config';
-import { common, LocationSearch } from '@kasite/uni-app-base';
+import { common } from '@kasite/uni-app-base';
 import {
 	useFrontEndConfigVersion,
 	useSetFrontEndConfig,
@@ -11,7 +11,6 @@ import {
 	usePreserMember,
 	useSetFrontEndForm,
 	useSetMenuList,
-	useGetMemberIdByEncryptData,
 } from './hook';
 import { nextTick } from 'vue';
 
@@ -26,7 +25,7 @@ const beforeMain = async () => {
 	// 判断获取配置信息是否成功 不成功不让往下
 	if (has) return;
 	// 判断应用状态,非运行中的应用跳转对应状态的缺省页
-	await useAppStatus();
+	// await useAppStatus();
 	common.hideLoading();
 	if (!app.globalData.logSuccess) {
 		main();
@@ -55,28 +54,26 @@ const main = async function () {
 	common.showLoading();
 	// 同步获取设备信息
 	app.globalData.smallPro_systemInfo = JSON.stringify(uni.getSystemInfoSync());
-
+	
 	const resp = await useSmallProgramLogin(app);
 	if (resp) {
 		app.globalData.logSuccess = true;
-		await useGetSysAppPageList();
+		// await useGetSysAppPageList();
 		// await usePreserMember();
-		const search = new LocationSearch();
-		await useGetMemberIdByEncryptData(search.obj.EncryptData);
 		// 判断前端配置信息有修改获取form表单存储为空从新获取一遍form表单
-		if (
-			uni.getStorageSync('frontEndConfigRequest') ||
-			common.isEmpty(uni.getStorageSync('formConfigList'))
-		) {
-			await useSetFrontEndForm(frontEndConfig);
-		}
+		// if (
+		// 	uni.getStorageSync('frontEndConfigRequest') ||
+		// 	common.isEmpty(uni.getStorageSync('formConfigList'))
+		// ) {
+		// 	await useSetFrontEndForm(frontEndConfig);
+		// }
 		// 判断前端配置信息有修改获取菜单存储为空从新获取一遍菜单
-		if (
-			uni.getStorageSync('frontEndConfigRequest') ||
-			common.isEmpty(uni.getStorageSync('menuList'))
-		) {
-			await useSetMenuList(menu);
-		}
+		// if (
+		// 	uni.getStorageSync('frontEndConfigRequest') ||
+		// 	common.isEmpty(uni.getStorageSync('menuList'))
+		// ) {
+		// 	await useSetMenuList(menu);
+		// }
 		common.hideLoading();
 		// 配置判断是否需要互联网医院Websocket
 		if (app.globalData.hasWebsocket) {
@@ -127,4 +124,9 @@ export default {
 
 <style lang="scss">
 @import '/theme/index';
+
+/* 隐藏所有页面的 navigationBar */
+uni-page-head {
+  display: none;
+}
 </style>

+ 3 - 0
hook/use-get-memberId-by-encrypt/index.ts

@@ -1,3 +1,4 @@
+import store from '@/store';
 import { GetMemberIdByEncryptData } from '@/pagesCrm/service';
 
 export const useGetMemberIdByEncryptData = async (EncryptData) => {
@@ -6,4 +7,6 @@ export const useGetMemberIdByEncryptData = async (EncryptData) => {
 		EncryptData,
 	});
 	console.log(res);
+	store.commit('setCurrentUser', res[0]);
+	return res;
 };

+ 9 - 2
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "uni-app-demo",
-    "appid" : "__UNI__2391417",
+    "appid" : "__UNI__797F817",
     "description" : "demo",
     "versionName" : "1.0.0",
     "versionCode" : "100",
@@ -65,5 +65,12 @@
     "uniStatistics" : {
         "enable" : false
     },
-    "vueVersion" : "3"
+    "vueVersion" : "3",
+    "h5" : {
+        "optimization" : {
+            "treeShaking" : {
+                "enable" : false
+            }
+        }
+    }
 }

+ 1 - 1
pages.json

@@ -4,7 +4,7 @@
 			"path": "pagesCrm/business/home/home",
 			"style": {
 				"navigationBarTitleText": "我的随访",
-				"enablePullDownRefresh": true
+  				"enablePullDownRefresh": false
 			}
 		},
 		{

+ 63 - 8
pagesAdmin/satisfaction/business/satisfactionQuestions/satisfactionQuestions.vue

@@ -242,10 +242,10 @@
 			</view>
 		</scroll-view>
 
-		<view class="yjfl" @click="yjfk">
+		<!-- <view class="yjfl" @click="yjfk">
 			<image :src="icon.satisfaction.yjfk" alt="" style="width: 140rpx; height: 140rpx" />
 			<view class="title"> 意见反馈 </view>
-		</view>
+		</view> -->
 		<view class="footer_box displayFlexRow">
 			<text :class="complete ? 'backgroundCustom_D9' : ''" @click="submit">提交</text>
 		</view>
@@ -302,6 +302,7 @@ import {
 	QuerySubjectInfoById_V3,
 	UploadZxFile,
 	CommitAnswer_V3,
+	QuerySample_V3,
 } from '../../service';
 import icon from '@/utils/icon';
 import { common } from '@/utils';
@@ -371,7 +372,9 @@ const main = async (options) => {
 		if (anonymous != 3) {
 			isAnonymous(anonymous);
 		}
-		querySubjectInfoById_V3();
+		await querySubjectInfoById_V3();
+		// 查询样本和答案
+		await querySample_V3();
 		// 开始计算答卷时间
 		getSec();
 	} else {
@@ -390,7 +393,7 @@ const isAnonymous = (type) => {
 	}
 	//匿名
 	else {
-		currentUser.value = {};
+		// currentUser.value = {};
 		showModal_Anonymous.value = false;
 	}
 };
@@ -460,6 +463,58 @@ const querySubjectInfoById_V3 = async () => {
 		console.log(quesList.value);
 	}
 };
+
+/** 查询样本和答案 */
+const querySample_V3 = async () => {
+	const resp = await QuerySample_V3({
+		SubjectId: quesAnswers.SubjectId,
+		IsGetAnswer: true,
+		ThirdPartyId: currentUser.MemberId,
+		State: 1
+	});
+	if (common.isNotEmpty(resp)) {
+		quesList.value.QuestionList.forEach((item) => {
+		  resp[0].AnswerList.forEach((childItem) => {
+		    if(item.QuestId == childItem.QuestId) {
+		      if(item.QuestType == "Input") {
+		        item.AnswerList = childItem.Answer
+		      }
+		      
+		      if(item.QuestType == "UploadImage") {
+		        item.AnswerList = childItem.Answer.split(",")
+		      }
+		      
+		      if(common.isNotEmpty(item.QuestionItemList)) {
+		        if(item.QuestType == "Select"){
+		          item.QuestionItemList.forEach((sunItem,sunIndex) => {
+		            if(sunItem.ItemId == childItem.Answer) {
+		              item.AnswerList = sunIndex
+		            }
+		          })
+		        }else {
+		          item.AnswerList = childItem.Answer.split(",")
+		        }
+		      }
+		    }
+	
+		      
+		    if(common.isNotEmpty(item.MatrixQuestionList)) {
+		      item.MatrixQuestionList.forEach((sunItem) => {
+		        if(sunItem.QuestId == childItem.QuestId) {
+		          if(sunItem.QuestType == "MatrixInput") {
+		            sunItem.AnswerList = childItem.Answer
+		          }
+		          if(sunItem.QuestType == "MatrixCheckbox" || sunItem.QuestType == "MatrixRadio" || sunItem.QuestType == "MatrixScale") {
+		            sunItem.AnswerList = childItem.Answer.split(",")
+		          }
+		        }
+		      })
+		    }
+		  })
+		})
+	}
+}
+
 /** 计算答题时间 */
 const getSec = () => {
 	time = setTimeout(() => {
@@ -856,15 +911,15 @@ const submit = async () => {
 		}
 	});
 	answers.AnswerList = JSON.stringify(quesAnswers.AnswerList);
-	quesAnswers.IP = (await getIP()).cip;
-	quesAnswers.Location = (await getIP()).cname;
+	// quesAnswers.IP = (await getIP()).cip;
+	// quesAnswers.Location = (await getIP()).cname;
 	quesAnswers.UserAgent = app.globalData.smallPro_systemInfo;
 	quesAnswers.Mobile = currentUser.value.mobile;
 	quesAnswers.UserName = currentUser.value.memberName;
-	quesAnswers.MemberId = currentUser.value.memberId;
+	quesAnswers.MemberId = currentUser.value.MemberId;
 	quesAnswers.Sex = currentUser.value.sex;
 	quesAnswers.Age = currentUser.value.age;
-	quesAnswers.ThirdPartyId = currentUser.value.memberId || uni.getStorageSync('openid');
+	quesAnswers.ThirdPartyId = currentUser.value.MemberId || uni.getStorageSync('openid');
 	quesAnswers.BedNo = '';
 	quesAnswers.HospitalNo = objType.value == '4' ? currentUser.value.cardNo : '';
 	quesAnswers.CardNo = objType.value == '3' ? currentUser.value.cardNo : '';

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

@@ -28,7 +28,17 @@ export const QuerySubjectInfoById_V3 = async (queryData) => {
 export const CommitAnswer_V3 = async (queryData) => {
 	let resp = handle.promistHandle(
 		await request.doPost(
-			`${REQUEST_CONFIG.BASE_URL}wsgw/surveyV3/SurveyWs/CommitAnswer_V3/callApiJSON.do`,
+			`${REQUEST_CONFIG.BASE_URL}wsgw/surveyV3/SurveyWs/CommitAnswer/callApiJSON.do`,
+			queryData
+		)
+	);
+	return handle.catchPromise(resp, () => resp);
+};
+/** 查询样本和答案 */
+export const QuerySample_V3 = async (queryData) => {
+	let resp = handle.promistHandle(
+		await request.doPost(
+			`${REQUEST_CONFIG.BASE_URL}wsgw/surveyV3/SurveyWs/QuerySample/callApiJSON.do`,
 			queryData
 		)
 	);

+ 30 - 5
pagesCrm/business/home/home.vue

@@ -55,7 +55,7 @@
 <script lang="ts" setup>
 import { getCurrentInstance, nextTick, ref } from 'vue';
 import { useStore } from 'vuex';
-import { useOnLoad } from '@/hook';
+import { useOnLoad, useGetMemberIdByEncryptData } from '@/hook';
 import { mapState, mapGetters, mapMutations } from '@kasite/uni-app-base/store';
 import { common } from '@kasite/uni-app-base';
 import { schemeTypeEnum } from '../../static/schemeDetail';
@@ -82,11 +82,14 @@ const { setCurrentUser } = mapMutations({
 });
 
 const main = (options) => {
+	console.log(options)
+	uni.setStorageSync('openid', options.openid);
 	/**默认查全部记录 */
 	refresh(options);
 };
 /** 刷新 */
 const refresh = async (options: any = {}) => {
+	await getEncryptData();
 	if (!currentUser.value) {
 		let [user = {}] = memberList.value.filter((item) => {
 			if (options.memberId) {
@@ -111,15 +114,15 @@ const refresh = async (options: any = {}) => {
 };
 /** 查询患者执行计划科室列表 */
 const getPatientExecPlanDeptList = async () => {
-	if (!cardInfo.value.memberId) return;
+	if (!cardInfo.value.MemberId) return;
 	const resp = await GetPatientExecPlanDeptList({
-		MemberId: cardInfo.value.memberId,
+		MemberId: cardInfo.value.MemberId,
 	});
 	deptList.value = resp;
 };
 /** 查询患者组内执行计划列表 */
 const getPatientExecPlanList = async (e = undefined) => {
-	if (!cardInfo.value.memberId) return;
+	if (!cardInfo.value.MemberId) return;
 	if (noMore.value) return;
 	let PIndex = pIndex.value;
 	if (!e) {
@@ -128,7 +131,7 @@ const getPatientExecPlanList = async (e = undefined) => {
 		PIndex++;
 	}
 	const resp = await GetPatientExecPlanList({
-		MemberId: cardInfo.value.memberId,
+		MemberId: cardInfo.value.MemberId,
 		DeptId: deptId.value,
 		Page: {
 			PIndex,
@@ -180,6 +183,28 @@ 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);
+}
+
 useOnLoad((options) => {
 	main(options);
 	// 兜底:监听事件总线的状态更新

+ 1 - 3
pagesCrm/business/schemeDetail/template/announcements.vue

@@ -7,9 +7,7 @@
 		</view>
 		<view class="body">
 			<view class="title">注意事项</view>
-			<rich-text>
-				{{ pushContent }}
-			</rich-text>
+			<rich-text :nodes="pushContent"></rich-text>
 		</view>
 	</view>
 </template>

+ 1 - 0
vite.config.js

@@ -46,6 +46,7 @@ export default defineConfig(({ mode }) => {
 	};
 
 	return {
+		base: process.env.UNI_PLATFORM === 'h5' ? '/KasiteWeb/' : '/',
 		envDir: 'env',
 		plugins: [
 			uni(),