Przeglądaj źródła

修改内容,使其需要登录

刘拾玖 4 miesięcy temu
rodzic
commit
c08c0ad7c8
8 zmienionych plików z 156 dodań i 12 usunięć
  1. 2 2
      lib/config/index.ts
  2. 4 0
      lib/link.ts
  3. 1 0
      lib/type.ts
  4. 3 3
      lib/util.ts
  5. 6 0
      pages.json
  6. 3 1
      pages/feedback/details.vue
  7. 14 6
      pages/feedback/index.vue
  8. 123 0
      pages/login/index.vue

+ 2 - 2
lib/config/index.ts

@@ -4,14 +4,14 @@
 
 // //--- 本地服务器
 // export const  SERVER= ''
-export const  SERVER= 'http://192.168.31.36:48086'
+export const  SERVER= 'http://192.168.31.36:48080'
 
 // //--- 正式服务器
 // export const SERVER = '/'
 
 export const BASE_URL = SERVER //+ '/dev-api'
 
-export const VITE_UPLOAD_URL = 'http://192.168.31.36:48086'
+export const VITE_UPLOAD_URL = 'http://192.168.31.36:48080'
 
 export const TOKEN_KEY = "token";
 export const TENANT_KEY = "tenant-id";

+ 4 - 0
lib/link.ts

@@ -62,6 +62,10 @@ export const login = () => {
 	})
 }
 
+export const goBJList = (hzsfzh:string,hzxm:string) => {
+	navto('/pages/feedback/index?hzsfzh='+ hzsfzh + '&hzxm=' + hzxm)
+}
+
 // 办件详情
 export const goBJDetails = (id = null) => {
 	if (id){

+ 1 - 0
lib/type.ts

@@ -6,6 +6,7 @@ export interface feedbackVO {
 	fklx: string;
 	fkxq: string;
 	fkzt: string;
+	zjhm: string;
 	jd: []
 }
 

+ 3 - 3
lib/util.ts

@@ -240,9 +240,9 @@ export function filterApplicationBgColor(index){
 }
 
 // 定义全局变量
-export const globalState = {
-  showIcon: true,
-  lastVisitDate: ''
+export const userInfo = {
+  zjhm: '',
+  userName: ''
 }
 
 

+ 6 - 0
pages.json

@@ -1,6 +1,12 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
+			"path": "pages/login/index",
+			"style": {
+				"navigationBarTitleText": "登录"
+			}
+		},
+		{
 			"path": "pages/feedback/index",
 			"style": {
 				"navigationBarTitleText": "办件记录",

+ 3 - 1
pages/feedback/details.vue

@@ -63,7 +63,7 @@
 	import { onLoad } from "@dcloudio/uni-app";
 	import PickerType from './PickertType.vue'
 	import { feedbackVO } from '../../lib/type';
-	import { formatDate } from '@/lib/util'
+	import { formatDate,userInfo } from '@/lib/util'
 
 	const formRules = reactive({
 		djr: {
@@ -139,6 +139,7 @@
 		yljgdm: '',
 		fklx: '',
 		fkxq: '',
+		zjhm:'',
 	})
 	const timeLine = ref([])
 	
@@ -185,6 +186,7 @@
 	//  初始化数据
 	const getInfo = async () => {
 		try {
+			formData.value.zjhm = userInfo.zjhm
 			// 医疗机构列表
 			let res = await rest.get('/admin-api/system/dept/list-all-simple', { orgType: 1 })
 			if (!res) return

+ 14 - 6
pages/feedback/index.vue

@@ -9,7 +9,7 @@
 		<!-- 内容 -->
 		<swiper :current="navIndex" @change="tabChange" class="swiper_content">
 			<swiper-item class="swiper_item">
-				<FeedbackList :status="status" :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
+				<FeedbackList :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
 			</swiper-item>
 			<swiper-item class="swiper_item">
 				<FeedbackList :listArray="listArray"  @click="onClick" @nextPage="onNextPage"  />
@@ -29,10 +29,12 @@
 </template>
 
 <script setup lang="ts">
-	import { ref,onMounted } from "vue"
+	import { ref } from "vue"
 	import * as link from '@/lib/link'
 	import rest from '@/stores/rest'
-	import { formatDate } from '@/lib/util'
+	import { onLoad, onShow } from "@dcloudio/uni-app";
+	import { aesEncrypt, aesDecrypt } from "@/lib/encryption";
+	import { formatDate,userInfo } from '@/lib/util'
 	
 	import FeedbackList from './FeedbackList.vue'
 	
@@ -40,6 +42,7 @@
 		pageNo: 1,
 		pageSize: 10,
 		fkzt: '',
+		zjhm: '',
 	})
 	const scrollTop = ref(0)
 	const navIndex = ref(0)
@@ -85,7 +88,6 @@
 			}
 			queryParams.value.pageNo = 1
 			list.value = []
-			console.log("内容")
 			getList()
 		}
 	}
@@ -171,8 +173,14 @@
 		link.goBJDetails()
 	}
 	
-	// 页面每次加载
-	onMounted(() => {
+	onLoad((data) => {
+		queryParams.value.zjhm = aesDecrypt(data.hzsfzh)
+		userInfo.zjhm = aesDecrypt(data.hzsfzh)
+		userInfo.userName =  aesDecrypt(data.hzxm)
+	})
+	
+	onShow(() => { 
+		queryParams.value.pageNo = 1;
 		getList()
 	})
 </script>

+ 123 - 0
pages/login/index.vue

@@ -0,0 +1,123 @@
+<template>
+	<view class="login">
+		<view class="login-content">
+			<view class="login-title">账号登录</view>
+			<uni-forms ref="formRef" :modelValue="formData" :rules="formRules" style="margin-top: 10px;">
+				<uni-forms-item name="hzxm">
+					<uni-easyinput class="pub-input" trim="all" v-model="formData.hzxm" placeholder="请输入姓名"></uni-easyinput>
+				</uni-forms-item>
+				<uni-forms-item name="hzsfzh">
+					<uni-easyinput class="pub-input" trim="all" v-model="formData.hzsfzh" placeholder="请输入身份证号"></uni-easyinput>
+				</uni-forms-item>
+			</uni-forms>
+			<view class=" pub-button is-bg large" @click="submit">登录</view>
+		</view>
+	</view>
+</template>
+
+<script lang="ts" setup>
+	import { ref, reactive } from 'vue'
+	import dlg from '@/lib/dlg'
+	import { aesEncrypt, aesDecrypt } from "@/lib/encryption"
+	import * as link from '@/lib/link'
+
+	const formData = ref({
+		hzxm: '',
+		hzsfzh: '',
+	})
+	const formRef = ref()
+	const formRules = reactive({
+		hzxm: {
+			rules: [{
+				required: true,
+				errorMessage: '姓名不能为空'
+			}]
+		},
+		hzsfzh: {
+			rules: [{
+				required: true,
+				errorMessage: '身份证号不能为空',
+			}, {
+				validateFunction: function (rule, value, data, callback) {
+					let CardNoReg = (
+						/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$)/
+					); //身份证
+					if (!CardNoReg.test(value)) {
+						callback('身份证格式不正确,请重新填写')
+					}
+				}
+			}]
+		},
+	})
+
+
+	const submit = async () => {
+		// 校验表单
+		formRef.value.validate().then(async res => {
+			// 提交请求
+			try {
+				link.goBJList(aesEncrypt(formData.value.hzsfzh),aesEncrypt(formData.value.hzxm))
+			} catch (e) {
+				dlg.error(e)
+			}
+		}).catch(err => {
+			console.log('表单错误信息:', err);
+		})
+	}
+</script>
+
+<style lang="scss" scoped>
+	.login {
+		height: 100%;
+		width: 100%;
+		background-image: url("~@/static/image/logo_bg.png");
+		background-repeat: no-repeat;
+		background-position: center;
+		width: 100%;
+		background-size: cover;
+		position: relative;
+		text-align: center;
+
+		.login-content {
+			top: 360rpx;
+			left: 96rpx;
+			position: absolute;
+			background: #FFFFFF;
+			border-radius: $uni-border-radius-r1;
+			width: calc(100% - 194rpx);
+			padding: 40rpx $page-row-spacing 16rpx;
+			box-sizing: border-box;
+
+			.login-title {
+				font-size: $uni-font-size-xl;
+				line-height: $uni-line-height-xl;
+			}
+
+			.pub-input {
+				:deep(.uni-easyinput__content) {
+					border-color: $uni-border-color !important;
+					border-radius: 4rpx;
+
+					.uni-easyinput__content-input {
+						height: 88rpx;
+						font-size: $uni-font-size-lg;
+						line-height: $uni-line-height-lg;
+						color: $uni-text-color;
+
+						.uni-input-placeholder {
+							color: $uni-text-color-light;
+							font-size: $uni-font-size-lg;
+							line-height: $uni-line-height-lg;
+						}
+					}
+				}
+
+
+			}
+
+			.pub-button {
+				margin-top: 40rpx;
+			}
+		}
+	}
+</style>