Browse Source

修改authcode储存方式

leaf 4 months ago
parent
commit
6d260dfaf4

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+node_modules/

+ 78 - 67
App.vue

@@ -1,77 +1,88 @@
 <script>
-import { onMounted, ref } from 'vue'
-import * as link from '@/lib/link'
-import rest from '@/stores/rest'
-import dd from 'gdt-jsapi';
-import { useUserStore } from '@/lib/store'
-import { storeToRefs } from 'pinia'
+	import {
+		onMounted,
+		ref
+	} from 'vue'
+	import * as link from '@/lib/link'
+	import {
+		computed
+	} from "vue";
+	import rest from '@/stores/rest'
+	import dd from 'gdt-jsapi';
+	import {
+		useUserStore
+	} from '@/lib/store'
+	import {
+		storeToRefs
+	} from 'pinia'
 
-export default {
-  setup() {
-	const store = useUserStore();
-	const { globalParameter } = storeToRefs(store);
+	export default {
+		setup() {
+			const store = useUserStore();
+			const globalParameter = computed(() => store.getGlobalParameter);
 
-	const formData = ref({
-		appkey: null,
-		appsecret: null,
-		authCode: null,
-		domainname: null,
-	})
-	const getBasicInfo = ()=> {
-		console.log("监听咯")
-		getAuthCode()
-	}
-	
-	const getAuthCode =  () => {
-		console.log("监听咯-getAuthCode")
-		dd.ready(()=> {
-			dd.getAuthCode({}).then((result) => {
-				 if (result.code){
-					formData.value.authCode = result.code
-				 }else {
-					formData.value.authCode = result.auth_code
-				 }
-				 globalParameter.value.authCode = formData.value.authCode
-				localStorage.setItem('authCode', formData.value.authCode);
-			}).catch(err => {
-				link.goLogin()
+			const formData = ref({
+				appkey: null,
+				appsecret: null,
+				authCode: null,
+				domainname: null,
 			})
-		})
-	}
-	
-	const getUserInfo = async () => {
-	  try {
-		await rest.post('/zyyp/ykz/getUserInfo?authCode='+ formData.value.authCode,'')
-	  } catch (error) {
-	    console.error(error);
-	  }
-	};
-	
-    const startIntervalTask = () => {
-      // 每 60 分钟执行一次任务
-      setInterval(() => {
-        getBasicInfo();
-      }, 60 * 60 * 1000); // 60 分钟
-    };
+			const getBasicInfo = () => {
+				console.log("监听咯")
+				getAuthCode()
+			}
+
+			const getAuthCode = () => {
+				console.log("监听咯-getAuthCode")
+				dd.ready(() => {
+					dd.getAuthCode({}).then((result) => {
+						if (result.code) {
+							formData.value.authCode = result.code
+						} else {
+							formData.value.authCode = result.auth_code
+						}
+						let obj = Object.assign({}, globalParameter.value)
+						obj.authCode = formData.value.authCode;
+						store.setGlobalParameter(obj)
+					}).catch(err => {
+						link.goLogin()
+					})
+				})
+			}
 
-    onMounted(() => {
-      console.log('App Created');
-      startIntervalTask();
-    });
+			const getUserInfo = async () => {
+				try {
+					await rest.post('/zyyp/ykz/getUserInfo?authCode=' + formData.value.authCode, '')
+				} catch (error) {
+					console.error(error);
+				}
+			};
 
-    return {
-      formData,
-      getBasicInfo,
-	  getAuthCode,
-	  getUserInfo,
-      startIntervalTask,
-    };
-  }
-}
+			const startIntervalTask = () => {
+				// 每 60 分钟执行一次任务
+				setInterval(() => {
+					getBasicInfo();
+				}, 60 * 60 * 1000); // 60 分钟
+			};
+
+			onMounted(() => {
+				console.log('App Created');
+				startIntervalTask();
+			});
+
+			return {
+				formData,
+				getBasicInfo,
+				getAuthCode,
+				getUserInfo,
+				startIntervalTask,
+			};
+		}
+	}
 </script>
 
 <style lang="scss">
-/*每个页面公共css */
-@import "uni.scss";
-@import "static/style/base.scss";
+	/*每个页面公共css */
+	@import "uni.scss";
+	@import "static/style/base.scss";
 </style>

+ 6 - 6
lib/link.ts

@@ -62,23 +62,23 @@ export const login = () => {
 	})
 }
 
-export const goBJList = (hzsfzh:string,hzxm:string) => {
-	navto('/pages/feedback/index?hzsfzh='+ hzsfzh + '&hzxm=' + hzxm)
+export const goBJList = (hzsfzh : string, hzxm : string, replace = false) => {
+	navto('/pages/feedback/index?hzsfzh=' + hzsfzh + '&hzxm=' + hzxm, replace = false)
 }
 
 // 办件详情
 export const goBJDetails = (id = null) => {
-	if (id){
+	if (id) {
 		navto('/pages/feedback/details?id=' + id)
-	}else {
+	} else {
 		navto('/pages/feedback/details')
 	}
 }
 //  登录页面
-export const goLogin = ()=> {
+export const goLogin = () => {
 	navto('/pages/login/index')
 }
 // 错误页面
-export const getErrorPage = ()=> {
+export const getErrorPage = () => {
 	navto('/pages/error/index')
 }

+ 21 - 10
lib/store.ts

@@ -1,14 +1,25 @@
 import { defineStore } from 'pinia';
 
 export const useUserStore = defineStore('user', {
-  state: () => {
-    return {
-      globalParameter: {
-        authCode: '',
-		userName: '',
-		zjhm: '',
-		isLeader: false,
-      }
-    }
-  }
+	state: () => ({
+		globalParameter: {
+			authCode: '',
+			userName: '',
+			zjhm: '',
+			isLeader: false,
+		}
+	}),
+	getters: {
+		getGlobalParameter() {
+			return this.globalParameter
+		}
+	},
+	actions: {
+		setGlobalParameter(param : { authCode : string, userName : string, zjhm : string, isLeader : boolean }) {
+			this.globalParameter = param
+		}
+	},
+	persist: {
+		storage: sessionStorage
+	},
 });

+ 30 - 24
main.js

@@ -7,37 +7,43 @@ import './uni.promisify.adaptor'
 Vue.config.productionTip = false
 App.mpType = 'app'
 const app = new Vue({
-  ...App
+	...App
 })
 app.$mount()
 // #endif
 
 // #ifdef VUE3
-import { createSSRApp } from 'vue'
 import {
-  Skeleton,
-  SkeletonTitle,
-  SkeletonImage,
-  SkeletonAvatar,
-  SkeletonParagraph,
+	createSSRApp
+} from 'vue'
+import {
+	Skeleton,
+	SkeletonTitle,
+	SkeletonImage,
+	SkeletonAvatar,
+	SkeletonParagraph,
 } from 'vant';
-import { createPinia } from 'pinia';
+import {
+	createPinia
+} from 'pinia';
+import piniaPersistedstate from 'pinia-plugin-persistedstate';
 
 export function createApp() {
-  const app = createSSRApp(App);
-  // 实例化Pinia
-  const pinia = createPinia()
-  // 传递给项目应用
-  app.use(pinia)
-  // 使用 Vant 组件
-  app.use(Skeleton);
-  app.use(SkeletonTitle);
-  app.use(SkeletonImage);
-  app.use(SkeletonAvatar);
-  app.use(SkeletonParagraph);
-  
-  return {
-    app
-  }
+	const app = createSSRApp(App);
+	// 实例化Pinia
+	const pinia = createPinia()
+	pinia.use(piniaPersistedstate)
+	// 传递给项目应用
+	app.use(pinia)
+	// 使用 Vant 组件
+	app.use(Skeleton);
+	app.use(SkeletonTitle);
+	app.use(SkeletonImage);
+	app.use(SkeletonAvatar);
+	app.use(SkeletonParagraph);
+
+	return {
+		app
+	}
 }
-// #endif
+// #endif

+ 12 - 1
node_modules/.bin/parser

@@ -1 +1,12 @@
-../@babel/parser/bin/babel-parser.js
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
+else 
+  exec node  "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
+fi

+ 6 - 2
node_modules/@babel/parser/lib/index.js

@@ -8607,7 +8607,9 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
   tsParseAmbientExternalModuleDeclaration(node) {
     if (this.isContextual(112)) {
       node.kind = "global";
-      node.global = true;
+      {
+        node.global = true;
+      }
       node.id = this.parseIdentifier();
     } else if (this.match(134)) {
       node.kind = "module";
@@ -8745,7 +8747,9 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass {
           this.prodParam.enter(0);
           const mod = node;
           mod.kind = "global";
-          mod.global = true;
+          {
+            node.global = true;
+          }
           mod.id = expr;
           mod.body = this.tsParseModuleBlock();
           this.scope.exit();

File diff suppressed because it is too large
+ 1 - 1
node_modules/@babel/parser/lib/index.js.map


+ 2 - 2
node_modules/@babel/parser/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@babel/parser",
-  "version": "7.26.2",
+  "version": "7.26.3",
   "description": "A JavaScript parser",
   "author": "The Babel Team (https://babel.dev/team)",
   "homepage": "https://babel.dev/docs/en/next/babel-parser",
@@ -35,7 +35,7 @@
   },
   "# dependencies": "This package doesn't actually have runtime dependencies. @babel/types is only needed for type definitions.",
   "dependencies": {
-    "@babel/types": "^7.26.0"
+    "@babel/types": "^7.26.3"
   },
   "devDependencies": {
     "@babel/code-frame": "^7.26.2",

+ 6 - 4
node_modules/@babel/types/lib/definitions/typescript.js

@@ -374,15 +374,17 @@ defineType("TSEnumMember", {
 defineType("TSModuleDeclaration", {
   aliases: ["Statement", "Declaration"],
   visitor: ["id", "body"],
-  fields: {
+  fields: Object.assign({
     kind: {
       validate: (0, _utils.assertOneOf)("global", "module", "namespace")
     },
-    declare: (0, _utils.validateOptional)(bool),
-    global: (0, _utils.validateOptional)(bool),
+    declare: (0, _utils.validateOptional)(bool)
+  }, {
+    global: (0, _utils.validateOptional)(bool)
+  }, {
     id: (0, _utils.validateType)("Identifier", "StringLiteral"),
     body: (0, _utils.validateType)("TSModuleBlock", "TSModuleDeclaration")
-  }
+  })
 });
 defineType("TSModuleBlock", {
   aliases: ["Scopable", "Block", "BlockParent", "FunctionParent"],

File diff suppressed because it is too large
+ 1 - 1
node_modules/@babel/types/lib/definitions/typescript.js.map


+ 3 - 3
node_modules/@babel/types/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@babel/types",
-  "version": "7.26.0",
+  "version": "7.26.3",
   "description": "Babel Types is a Lodash-esque utility library for AST nodes",
   "author": "The Babel Team (https://babel.dev/team)",
   "homepage": "https://babel.dev/docs/en/next/babel-types",
@@ -28,8 +28,8 @@
     "@babel/helper-validator-identifier": "^7.25.9"
   },
   "devDependencies": {
-    "@babel/generator": "^7.26.0",
-    "@babel/parser": "^7.26.0",
+    "@babel/generator": "^7.26.3",
+    "@babel/parser": "^7.26.3",
     "glob": "^7.2.0"
   },
   "engines": {

+ 2 - 1
node_modules/magic-string/package.json

@@ -1,6 +1,6 @@
 {
   "name": "magic-string",
-  "version": "0.30.14",
+  "version": "0.30.15",
   "packageManager": "pnpm@9.6.0",
   "description": "Modify strings, generate sourcemaps",
   "keywords": [
@@ -15,6 +15,7 @@
   "author": "Rich Harris",
   "main": "./dist/magic-string.cjs.js",
   "module": "./dist/magic-string.es.mjs",
+  "sideEffects": false,
   "jsnext:main": "./dist/magic-string.es.mjs",
   "types": "./dist/magic-string.cjs.d.ts",
   "exports": {

File diff suppressed because it is too large
+ 1915 - 411
package-lock.json


+ 10 - 9
package.json

@@ -1,10 +1,11 @@
 {
-  "dependencies": {
-    "@vant/compat": "^1.0.1",
-    "crypto-js": "^4.2.0",
-    "gdt-jsapi": "^1.9.51",
-    "pinia": "^2.3.0",
-    "sm-crypto": "^0.3.13",
-    "vant": "^4.9.9"
-  }
-}
+	"dependencies": {
+		"@vant/compat": "^1.0.1",
+		"crypto-js": "^4.2.0",
+		"gdt-jsapi": "^1.9.51",
+		"pinia": "^2.3.0",
+		"pinia-plugin-persistedstate": "^4.1.3",
+		"sm-crypto": "^0.3.13",
+		"vant": "^4.9.9"
+	}
+}

+ 32 - 44
pages/accredit/index.vue

@@ -2,74 +2,62 @@
 </template>
 
 <script setup lang="ts">
-	import { ref } from "vue";
+	import { ref, computed } from "vue";
 	import * as link from '@/lib/link'
 	import dd from 'gdt-jsapi';
 	import rest from '@/stores/rest'
 	import { aesEncrypt, aesDecrypt } from "@/lib/encryption"
 	import { onLoad } from "@dcloudio/uni-app";
-	
+
 	import { useUserStore } from '@/lib/store';
-	import { storeToRefs } from 'pinia';
-	const store = useUserStore();	 
-	const { globalParameter } = storeToRefs(store);
-	
+	const store = useUserStore();
+	const globalParameter = computed(() => store.getGlobalParameter);
+
 	const formData = ref({
 		appkey: null,
 		appsecret: null,
 		authCode: null,
 		domainname: null,
 	})
-	
-	const login = ()=> {
-		dd.ready(()=> {
+
+	const login = () => {
+		dd.ready(() => {
 			dd.getAuthCode({}).then((result) => {
-				 if (result.code){
-					 formData.value.authCode = result.code
-				 }else {
-					 formData.value.authCode = result.auth_code
-				 }
-				globalParameter.value.authCode = formData.value.authCode
-				localStorage.setItem('authCode', formData.value.authCode);
-				setTimeout(() => { 
-					getUserInfo(formData.value.authCode); 
+				if (result.code) {
+					formData.value.authCode = result.code
+				} else {
+					formData.value.authCode = result.auth_code
+				}
+				setTimeout(() => {
+					getUserInfo(formData.value.authCode);
 				}, 0);
 			}).catch(err => {
-				alert('不是钉钉环境',err)
+				alert('不是钉钉环境', err)
 				link.goLogin()
 			})
 		})
 	}
-	
+
 	const getUserInfo = async (authCode) => {
-	  try {
-		let res = await rest.post('/zyyp/ykz/getUserInfo?authCode='+ authCode,'')
-		localStorage.setItem('zjhm', res.openid);
-		localStorage.setItem('userName', res.lastName);
-		localStorage.setItem('isLeader', res.leader);
-		// alert("查看内容(2):" + JSON.stringify(res))
-		link.goBJList(aesEncrypt(res.openid),aesEncrypt(res.lastName))
-	  } catch (error) {
-	    console.error(error);
-	  }
+		try {
+			let res = await rest.post('/zyyp/ykz/getUserInfo?authCode=' + authCode, '')
+			if (!res) return
+			let obj = Object.assign({}, globalParameter.value)
+			obj.authCode = formData.value.authCode;
+			obj.zjhm = res.openid;
+			obj.userName = res.lastName;
+			obj.isLeader = res.leader;
+			store.setGlobalParameter(obj)
+			// alert("查看内容(2):" + JSON.stringify(res))
+			link.goBJList(aesEncrypt(res.openid), aesEncrypt(res.lastName), true)
+		} catch (error) {
+			console.error(error);
+		}
 	};
 
 
 	onLoad((res) => {
-		if (res.auth_code && res.appkey && res.appSecret && res.domain){
-			const auth_code = res.auth_code
-			const appkey  = res.appkey
-			const appsecret = res.appsecret
-			const domainname  = res.domain
-			const data = {
-				authcode:auth_code,
-				appkey:appkey,
-				appsecret:appsecret,
-				domainname:domainname,
-			}
-		}else{
-			login()
-		}
+		login()
 	})
 </script>
 

+ 66 - 54
pages/feedback/details.vue

@@ -5,12 +5,12 @@
 				<view class="feedback-info">
 					<view class="feedback-info-title">登记人信息</view>
 					<uni-forms-item label="姓名" name="djr">
-						<uni-easyinput :disabled="disabledRef" class="pub-input" :inputBorder="false" trim="all" v-model="formData.djr"
-							placeholder="请输入"></uni-easyinput>
+						<uni-easyinput :disabled="disabledRef" class="pub-input" :inputBorder="false" trim="all"
+							v-model="formData.djr" placeholder="请输入"></uni-easyinput>
 					</uni-forms-item>
 					<uni-forms-item label="联系电话">
-						<uni-easyinput :disabled="disabledRef" class="pub-input" :inputBorder="false" trim="all" v-model="formData.lxdh"
-							placeholder="请输入"></uni-easyinput>
+						<uni-easyinput :disabled="disabledRef" class="pub-input" :inputBorder="false" trim="all"
+							v-model="formData.lxdh" placeholder="请输入"></uni-easyinput>
 					</uni-forms-item>
 					<uni-forms-item label="医疗机构">
 						<view class="form-feedback" @click="openPickerDept">
@@ -19,7 +19,8 @@
 							</view>
 							<view><text class="iconfont checkbox">&#xe656;</text></view>
 						</view>
-						<PickerType ref="pickerDeptRef" :feedbackArray="yljgList" :feedbackType="formData.yljgdm" @change="onChangeYljg" />
+						<PickerType ref="pickerDeptRef" :feedbackArray="yljgList" :feedbackType="formData.yljgdm"
+							@change="onChangeYljg" />
 					</uni-forms-item>
 				</view>
 				<view class="feedback-info feedback-formdate">
@@ -30,10 +31,12 @@
 							</view>
 							<view><text class="iconfont checkbox">&#xe656;</text></view>
 						</view>
-						<PickerType ref="pickerTypeRef" :feedbackArray="feedbackArray" :feedbackType="formData.fklx" @change="onChangeType" />
+						<PickerType ref="pickerTypeRef" :feedbackArray="feedbackArray" :feedbackType="formData.fklx"
+							@change="onChangeType" />
 					</uni-forms-item>
 					<uni-forms-item label="反馈详情" name="fkxq">
-						<uni-easyinput v-if="!disabledRef" :inputBorder="false" trim="all" type="textarea" v-model="formData.fkxq" placeholder="请输入"></uni-easyinput>
+						<uni-easyinput v-if="!disabledRef" :inputBorder="false" trim="all" type="textarea" v-model="formData.fkxq"
+							placeholder="请输入"></uni-easyinput>
 						<view v-else class="other-text">{{ formData.fkxq }}</view>
 					</uni-forms-item>
 				</view>
@@ -41,7 +44,7 @@
 			<view v-if="disabledRef" class="feedback-schedule">
 				<view class="schedule-title">进度</view>
 				<view class="schedule-timeline">
-					 <view class="step-item" v-for="(item,index) in timeLine" :key="index">
+					<view class="step-item" v-for="(item,index) in timeLine" :key="index">
 						<view class="step_circle_item">
 							<view class="dot"></view>
 							<view class="line"></view>
@@ -58,9 +61,9 @@
 	</view>
 </template>
 <script lang="ts" setup>
-	import { ref, reactive } from 'vue'
+	import { ref, reactive, computed } from 'vue'
 	import rest from '@/stores/rest'
-	import dlg from '@/lib/dlg.ts'
+	import dlg from '@/lib/dlg'
 	import * as link from '@/lib/link'
 	import { onLoad, onShow } from "@dcloudio/uni-app";
 	import PickerType from './PickertType.vue'
@@ -68,9 +71,8 @@
 	import { formatDate } from '@/lib/util'
 
 	import { useUserStore } from '@/lib/store';
-	import { storeToRefs } from 'pinia';
-	const store = useUserStore();	 
-	const { globalParameter } = storeToRefs(store);
+	const store = useUserStore();
+	const globalParameter = computed(() => store.getGlobalParameter);
 
 	const formRules = reactive({
 		djr: {
@@ -92,7 +94,7 @@
 			}]
 		},
 	})
-	
+
 	const feedbackArray = ref([
 		{
 			name: '缺药补药',
@@ -106,10 +108,10 @@
 			name: '其他建议',
 			value: 3,
 		},
-			
+
 	])
 	const itemId = ref()
-	const disabledRef= ref(false)
+	const disabledRef = ref(false)
 	const pickerDeptRef = ref()
 	const popupDeptText = ref()
 	const yljgList = ref() // 医疗机构列表
@@ -125,21 +127,21 @@
 		yljgdm: '',
 		fklx: '',
 		fkxq: '',
-		zjhm:'',
+		zjhm: '',
 	})
 	const timeLine = ref([])
-	
-	const openPickerDept = ()=> {
-		if (!disabledRef.value) { 
+
+	const openPickerDept = () => {
+		if (!disabledRef.value) {
 			pickerDeptRef.value?.openPop()
 		}
 	}
-	const openPickerType = ()=> {
-		if (!disabledRef.value){
+	const openPickerType = () => {
+		if (!disabledRef.value) {
 			pickerTypeRef.value?.openPop()
 		}
 	}
-	
+
 	const onChangeYljg = (e) => {
 		formData.value.yljgmc = e.name
 		formData.value.yljgdm = e.value
@@ -157,7 +159,7 @@
 			// 提交请求
 			try {
 				if (uniType.value == 'add') {
-					await rest.post('/zyyp/feedback/create', formData.value,globalParameter.value.authCode)
+					await rest.post('/zyyp/feedback/create', formData.value, globalParameter.value.authCode)
 					dlg.success('已新增反馈登记!')
 				}
 				link.back()
@@ -168,30 +170,30 @@
 			console.log('表单错误信息:', err);
 		})
 	}
-	
+
 	//  初始化数据
 	const getInfo = async () => {
 		try {
-			formData.value.djr = globalParameter.value.userName 
+			formData.value.djr = globalParameter.value.userName
 			formData.value.zjhm = globalParameter.value.zjhm
 			// 医疗机构列表
-			let res = await rest.get('/system/dept/list-all-simple2',{ orgType: 1 },globalParameter.value.authCode)
+			let res = await rest.get('/system/dept/list-all-simple2', { orgType: 1 }, globalParameter.value.authCode)
 			if (!res) return
 			// 转换数据 
-			yljgList.value = (res as any[]).map(item => ({ 
-				name: item.orgName, 
-				value: item.orgCode ,
+			yljgList.value = (res as any[]).map(item => ({
+				name: item.orgName,
+				value: item.orgCode,
 			}));
 			// 
-			if (itemId.value){
-				let itemRes = await rest.get('/zyyp/feedback/get', { id: itemId.value },globalParameter.value.authCode) as feedbackVO
+			if (itemId.value) {
+				let itemRes = await rest.get('/zyyp/feedback/get', { id: itemId.value }, globalParameter.value.authCode) as feedbackVO
 				formData.value = itemRes
 				popupDeptText.value = itemRes.yljgmc
 				const matchedItem = feedbackArray.value.find(item => item.value === Number(itemRes.fklx));
 				popupTypeText.value = matchedItem ? matchedItem.name : '未找到匹配项';
 				timeLine.value = itemRes.jd
-				if (itemRes.fkzt == '1'){
-					timeLine.value.push({desc:'等待受理',time:null})
+				if (itemRes.fkzt == '1') {
+					timeLine.value.push({ desc: '等待受理', time: null })
 				}
 				disabledRef.value = true
 			}
@@ -199,20 +201,15 @@
 			dlg.error(e)
 		}
 	}
-	
+
 
 	onLoad((data) => {
-		if (data.id){
+		if (data.id) {
 			itemId.value = data.id
 		}
 	})
-	
+
 	onShow(() => {
-		if (!globalParameter.value.zjhm || !globalParameter.value.userName || !globalParameter.value.authCode) {
-		  globalParameter.value.zjhm = localStorage.getItem('zjhm');
-		  globalParameter.value.userName = localStorage.getItem('userName');
-		  globalParameter.value.authCode = localStorage.getItem('authCode');
-		}
 		getInfo()
 	})
 </script>
@@ -255,6 +252,7 @@
 					color: $uni-text-color;
 				}
 			}
+
 			:deep(.is-disabled) {
 				background-color: #ffffff !important;
 				color: #363A44 !important;
@@ -270,6 +268,7 @@
 
 			:deep(.uni-easyinput__content) {
 				border-bottom: 1px solid $uni-border-color;
+
 				.uni-easyinput__content-input {
 					padding-left: 0 !important;
 					height: 70rpx;
@@ -289,11 +288,12 @@
 					}
 				}
 			}
+
 			:deep(.uni-easyinput__content-textarea) {
-				 margin: 8rpx 0 4rpx;
-				 height: 220rpx;
-				 min-height: 220rpx;
-				 // overflow-y: auto !important;
+				margin: 8rpx 0 4rpx;
+				height: 220rpx;
+				min-height: 220rpx;
+				// overflow-y: auto !important;
 
 				.uni-easyinput__placeholder-class {
 					font-size: $uni-font-size-lg;
@@ -308,66 +308,77 @@
 				}
 			}
 		}
+
 		.feedback-formdate {
 			margin-top: 20rpx;
-			:deep(.uni-forms-item:last-of-type .uni-easyinput__content) { 
-				border-bottom: none; 
+
+			:deep(.uni-forms-item:last-of-type .uni-easyinput__content) {
+				border-bottom: none;
 			}
 		}
+
 		.other-text {
 			margin-top: 10rpx;
 			font-size: $uni-font-size-lg;
 			line-height: $uni-line-height-lg;
 			color: $uni-text-color;
 		}
+
 		.feedback-schedule {
 			margin-top: 10rpx;
 			background-color: #fff;
 			padding: $uni-spacing-col-s4 $page-row-spacing $uni-spacing-col-s3;
+
 			.schedule-title {
 				font-size: 28rpx;
 				font-weight: 600;
 			}
+
 			.schedule-timeline {
-			    padding: 20px 10px 0;
-			    overflow: auto;
-			    .step-item {
+				padding: 20px 10px 0;
+				overflow: auto;
+
+				.step-item {
 					color: $uni-text-color-grey;
 					display: flex;
 					min-height: 140rpx;
+
 					.step_circle_item {
 						padding-top: 4rpx;
 						@include flex;
 						flex-direction: column;
 						margin-right: 24rpx;
-						
+
 						.dot {
 							width: 24rpx;
 							height: 24rpx;
 							background: $uni-border-color;
 							border-radius: 50%;
 						}
-						
+
 						.line {
 							flex: 1;
 							border-left: 1px solid $uni-border-color;
 							margin: 12rpx 0;
 						}
 					}
+
 					.step_content_item {
 						width: 100%;
 						margin-bottom: 32rpx;
 						font-size: 24rpx;
+
 						.step_content {
 							font-size: 28rpx;
 							line-height: $uni-line-height-base;
 							margin-bottom: 16rpx;
 						}
-						
+
 						.step_date {
 							margin-bottom: 8rpx;
 						}
 					}
+
 					&:last-child {
 						.step_circle_item {
 							.line {
@@ -377,6 +388,7 @@
 					}
 				}
 			}
+
 			.submit {
 				margin: 0 32rpx 16rpx;
 			}

+ 141 - 140
pages/feedback/index.vue

@@ -2,9 +2,10 @@
 	<view class="switchRecord-container">
 		<!--顶部导航栏-->
 		<scroll-view class="scroll-view" scroll-x="true" @scroll="scroll">
-			<view class="scroll-view-item" v-for="(tab,index) in tabBars" :key="tab.id" :id="tab.id" :class="navIndex==index ? 'activite' : ''" @tap="checkIndex(index)">
+			<view class="scroll-view-item" v-for="(tab,index) in tabBars" :key="tab.id" :id="tab.id"
+				:class="navIndex==index ? 'activite' : ''" @tap="checkIndex(index)">
 				{{tab.name}}
-			</view> 
+			</view>
 		</scroll-view>
 		<!-- 内容 -->
 		<swiper :current="navIndex" @change="tabChange" class="swiper_content">
@@ -14,15 +15,15 @@
 			</swiper-item>
 			<swiper-item class="swiper_item">
 				<DetailedFeedbackList v-if="globalParameter.isLeader" :listArray="listArray" />
-				<FeedbackList v-else :listArray="listArray"  @click="onClick" @nextPage="onNextPage"  />
+				<FeedbackList v-else :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
 			</swiper-item>
 			<swiper-item class="swiper_item">
 				<DetailedFeedbackList v-if="globalParameter.isLeader" :listArray="listArray" />
-				<FeedbackList v-else :listArray="listArray"  @click="onClick" @nextPage="onNextPage"  />
+				<FeedbackList v-else :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
 			</swiper-item>
 			<swiper-item class="swiper_item">
 				<DetailedFeedbackList v-if="globalParameter.isLeader" :listArray="listArray" />
-				<FeedbackList v-else :listArray="listArray"  @click="onClick" @nextPage="onNextPage"  />
+				<FeedbackList v-else :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
 			</swiper-item>
 		</swiper>
 		<!-- 新增 -->
@@ -34,7 +35,7 @@
 </template>
 
 <script setup lang="ts">
-	import { ref } from "vue"
+	import { ref, computed } from "vue"
 	import * as link from '@/lib/link'
 	import rest from '@/stores/rest'
 	import { onLoad, onShow } from "@dcloudio/uni-app";
@@ -42,12 +43,11 @@
 	import { formatDate } from '@/lib/util'
 	import FeedbackList from './FeedbackList.vue'
 	import DetailedFeedbackList from './DetailedFeedbackList.vue'
-	
+
 	import { useUserStore } from '@/lib/store';
-	import { storeToRefs } from 'pinia';
 	const store = useUserStore();
-	const { globalParameter } = storeToRefs(store);
-	
+	const globalParameter = computed(() => store.getGlobalParameter);
+
 	const queryParams = ref({
 		pageNo: 1,
 		pageSize: 10,
@@ -58,29 +58,29 @@
 	const navIndex = ref(0)
 	const tabBars = ref([
 		{
-			name:'全部',
+			name: '全部',
 			id: 0
 		},
 		{
-			name:'待受理',
+			name: '待受理',
 			id: 1
 		},
 		{
-			name:'受理中 ',
+			name: '受理中 ',
 			id: 2
 		},
 		{
-			name:'已办结 ',
+			name: '已办结 ',
 			id: 3
 		}
 	])
-	
-	const scroll = (e: any) => {
-		console.log("scroll",e); 
-		scrollTop.value = e.detail.scrollTop; 
+
+	const scroll = (e : any) => {
+		console.log("scroll", e);
+		scrollTop.value = e.detail.scrollTop;
 	};
-	const checkIndex = (idx:number) => {
-		if (navIndex.value !== idx){
+	const checkIndex = (idx : number) => {
+		if (navIndex.value !== idx) {
 			navIndex.value = idx;
 			switch (idx) {
 				case 0:
@@ -101,23 +101,23 @@
 			getList()
 		}
 	}
-	const tabChange = async(e:any) => {
+	const tabChange = async (e : any) => {
 		let _idx = e.detail.current
 		checkIndex(_idx)
 	}
-	
+
 	const listArray = ref([])
 	const list = ref() //处方列表
 	const total = ref(0)
 	const status = ref('loading')
-	
+
 	const getList = async () => {
 		try {
 			// loaded.value = true;
-			let res = await rest.get('/zyyp/feedback/page', queryParams.value,globalParameter.value.authCode)
+			let res = await rest.get('/zyyp/feedback/page', queryParams.value, globalParameter.value.authCode)
 			let _list = res.list
-	
-	
+
+
 			if (queryParams.value.pageNo === 1) {
 				list.value = _list;
 			} else {
@@ -128,45 +128,45 @@
 			if (res.total && queryParams.value.pageNo >= total.value / queryParams.value.pageSize) {
 				status.value = "noMore"
 			}
-			
+
 		} catch (e) {
 		} finally {
 		}
 	}
-	
-	
+
+
 	const titleArray = [
-	  { title: '办件编号', key: 'id' },
-	  { title: '登记时间', key: 'createTime' },
+		{ title: '办件编号', key: 'id' },
+		{ title: '登记时间', key: 'createTime' },
 	];
 	const leaderArray = [
 		{ title: '编号', key: 'id' },
 		{ title: '内容', key: 'fkxq' },
 	]
-	
+
 	const getFormattedData = (listData) => {
-	  const selectedArray = globalParameter.value.isLeader ? leaderArray : titleArray;
-	  const formattedData = listData.map(item => {
-		const formattedItem = selectedArray.map(titleItem => {
-		  let value = item[titleItem.key];
-		  if (titleItem.key === 'createTime') {
-		    value = formatDate(item[titleItem.key], '{y}-{m}-{d} {h}:{i}:{s}');
-		  }
-		  return {
-		    title: titleItem.title,
-		    value: value
-		  };
+		const selectedArray = globalParameter.value.isLeader ? leaderArray : titleArray;
+		const formattedData = listData.map(item => {
+			const formattedItem = selectedArray.map(titleItem => {
+				let value = item[titleItem.key];
+				if (titleItem.key === 'createTime') {
+					value = formatDate(item[titleItem.key], '{y}-{m}-{d} {h}:{i}:{s}');
+				}
+				return {
+					title: titleItem.title,
+					value: value
+				};
+			});
+			return {
+				...item,
+				formattedData: formattedItem,
+			};
 		});
-		return { 
-			...item, 
-			formattedData: formattedItem ,
-		};
-	  });
-	  listArray.value = formattedData;
-	  console.log("查询",listArray.value)
+		listArray.value = formattedData;
+		console.log("查询", listArray.value)
 	};
-	
-	const onNextPage = ()=> {
+
+	const onNextPage = () => {
 		if (!list.value || queryParams.value.pageNo > (total.value / queryParams.value.pageSize)) {
 			return false;
 		}
@@ -179,113 +179,114 @@
 		queryParams.value.pageNo++;
 		getList();
 	}
-	
-	const onClick = (e)=> {
+
+	const onClick = (e) => {
 		link.goBJDetails(e.id)
 	}
-	const onClickAdd = ()=> {
+	const onClickAdd = () => {
 		link.goBJDetails()
 	}
-	
+
 	onLoad((data) => {
 		// alert("onLoad:" + JSON.stringify(globalParameter.value))
 		queryParams.value.zjhm = aesDecrypt(data.hzsfzh)
-		let zjhm = aesDecrypt(data.hzsfzh)
-		let name = aesDecrypt(data.hzxm)
 	})
-	
-	onShow(() => { 
+
+	onShow(() => {
 		queryParams.value.pageNo = 1;
-		if (!globalParameter.value.zjhm || !globalParameter.value.userName || !globalParameter.value.authCode || !globalParameter.value.isLeader) {
-			queryParams.value.zjhm = localStorage.getItem('zjhm');
-		  globalParameter.value.zjhm = localStorage.getItem('zjhm');
-		  globalParameter.value.userName = localStorage.getItem('userName');
-		  globalParameter.value.authCode = localStorage.getItem('authCode');
-		}
-		const isLeaderStr = localStorage.getItem('isLeader');
-		globalParameter.value.isLeader = isLeaderStr === 'true';
+		queryParams.value.zjhm = globalParameter.value.zjhm;
 		getList()
 	})
 </script>
 
 
 <style lang="scss">
-.switchRecord-container {
-  display: flex;
-  background-color: #f2f2f2;
-  flex-direction: column;
-  height: calc(100vh);
-  position: relative;
+	.switchRecord-container {
+		display: flex;
+		background-color: #f2f2f2;
+		flex-direction: column;
+		height: calc(100vh);
+		position: relative;
+
+		.scroll-view {
+			background-color: #fff;
+			color: #3D3D3D;
+			display: flex;
+			overflow-x: auto;
+			white-space: nowrap;
+			box-sizing: border-box;
+		}
 
-  .scroll-view {
-    background-color: #fff;
-    color: #3D3D3D;
-    display: flex;
-    overflow-x: auto;
-    white-space: nowrap;
-    box-sizing: border-box;
-  }
+		.scroll-view-item {
+			display: inline-block;
+			width: calc(100% / 4);
+			height: 88rpx;
+			line-height: 88rpx;
+			text-align: center;
+			font-size: 24rpx;
+			font-weight: 400;
+			position: relative;
+			/* 添加相对定位 */
+			box-sizing: border-box;
+			/* 确保边框在总宽度内计算 */
 
-  .scroll-view-item {
-    display: inline-block;
-    width: calc(100% / 4);
-    height: 88rpx;
-    line-height: 88rpx;
-    text-align: center;
-    font-size: 24rpx;
-    font-weight: 400;
-    position: relative; /* 添加相对定位 */
-    box-sizing: border-box; /* 确保边框在总宽度内计算 */
+			&::after {
+				content: '';
+				display: inline-block;
+				width: 50%;
+				/* 默认宽度为50% */
+				margin: 0 auto;
+				position: absolute;
+				bottom: 0;
+				left: 25%;
+				/* 使其居中 */
+				height: 2rpx;
+				/* 默认未选中的高度 */
+				background: #fff;
+				/* 默认未选中的颜色 */
+				z-index: 1;
+			}
 
-    &::after {
-      content: '';
-      display: inline-block;
-      width: 50%; /* 默认宽度为50% */
-      margin: 0 auto;
-      position: absolute;
-      bottom: 0;
-      left: 25%; /* 使其居中 */
-      height: 2rpx; /* 默认未选中的高度 */
-      background: #fff; /* 默认未选中的颜色 */
-      z-index: 1;
-    }
+			&.activite {
+				font-weight: 600;
+				color: #1E92F0;
 
-    &.activite {
-		font-weight: 600;
-		color: #1E92F0;
-		&::after {
-			background: #1E92F0;
-			height: 4rpx;
-			width: 50%;
+				&::after {
+					background: #1E92F0;
+					height: 4rpx;
+					width: 50%;
+				}
+			}
 		}
-    }
-  }
 
-  .swiper_content {
-    background-color: #f2f2f2;
-    flex: 1;
-  }
-  .feedback-add-icon {
-	  position: absolute;
-	  bottom: 300rpx;
-	  right: 32rpx;
-	  width: 120rpx;
-	  height: 120rpx;
-	  @include flex-center;
-	  flex-direction: column;
-	  border-radius: 50%;
-	  background-color: #fff;
-	  box-shadow: 0px 4px 10px 0px rgba(216, 216, 216, 0.8),inset 0px 4px 10px 0px rgba(216, 216, 216, 0.3);
-	  .add-icon {
-		margin-top: 16rpx;
-		width: 55rpx;
-		height: 55rpx;
-	  }
-	  .add-title {
-		  color: #1E92F0;
-		  font-size: 24rpx;
-		  font-weight: 600;
-	  }
-  }
-}
+		.swiper_content {
+			background-color: #f2f2f2;
+			flex: 1;
+		}
+
+		.feedback-add-icon {
+			position: absolute;
+			bottom: 300rpx;
+			right: 32rpx;
+			width: 120rpx;
+			height: 120rpx;
+			@include flex-center;
+			flex-direction: column;
+			border-radius: 50%;
+			background-color: #fff;
+			box-shadow: 0px 4px 10px 0px rgba(216, 216, 216, 0.8), inset 0px 4px 10px 0px rgba(216, 216, 216, 0.3);
+
+			.add-icon {
+				margin-top: 16rpx;
+				width: 55rpx;
+				height: 55rpx;
+			}
+
+			.add-title {
+				color: #1E92F0;
+				font-size: 24rpx;
+				font-weight: 600;
+			}
+		}
+	}
 </style>

+ 9 - 9
pages/login/index.vue

@@ -16,17 +16,16 @@
 </template>
 
 <script lang="ts" setup>
-	import { ref, reactive } from 'vue'
+	import { ref, reactive, computed } from 'vue'
 	import dlg from '@/lib/dlg'
 	import { aesEncrypt, aesDecrypt } from "@/lib/encryption"
 	import * as link from '@/lib/link'
-	
+
 	import { useUserStore } from '@/lib/store';
-	import { storeToRefs } from 'pinia';
-	
+
 	const store = useUserStore();
-	const { globalParameter } = storeToRefs(store);
-	
+	const globalParameter = computed(() => store.getGlobalParameter);
+
 	const formData = ref({
 		hzxm: '',
 		hzsfzh: '',
@@ -62,9 +61,10 @@
 		formRef.value.validate().then(async res => {
 			// 提交请求
 			try {
-				globalParameter.value.authCode = formData.value.hzsfzh
-				localStorage.setItem('authCode', formData.value.hzsfzh);
-				link.goBJList(aesEncrypt(formData.value.hzsfzh),aesEncrypt(formData.value.hzxm))
+				let obj = Object.assign({}, globalParameter.value)
+				obj.authCode = formData.value.hzsfzh;
+				store.setGlobalParameter(obj)
+				link.goBJList(aesEncrypt(formData.value.hzsfzh), aesEncrypt(formData.value.hzxm))
 			} catch (e) {
 				dlg.error(e)
 			}