Kaynağa Gözat

fix(application): 组件添加props
feat(mine):添加退出登录按钮

lzm 3 ay önce
ebeveyn
işleme
9e3543b4f6

+ 3 - 3
pages/subpack/components/apply/apply-item.vue

@@ -11,9 +11,9 @@
 			<view class="flex-row align-center">
 				<u-image class="apply-item-image2" width="36rpx" height="36rpx" bgColor="transparent"
 					src="@/pages/subpack/static/images/app/cat-icon.png" />
-				<view class="apply-item-tips">
+				<view class="apply-item-tips text-overflow">
 					<text>需求:</text>
-					<text>{{item.careNeeds}}</text>
+					<text>{{item.careNeeds??'-'}}</text>
 				</view>
 			</view>
 			<view class="flex-row align-center mt-08">
@@ -21,7 +21,7 @@
 					src="@/pages/subpack/static/images/app/time-icon.png" />
 				<view class="apply-item-tips1">
 					<text>申请日期:</text>
-					<text>{{item.applyDate}}</text>
+					<text>{{item.applyDate??'-'}}</text>
 				</view>
 			</view>
 		</view>

+ 37 - 24
pages/subpack/pages/application/componenets/page1.vue

@@ -13,21 +13,23 @@
 							{{chooseInfo.name??'请选择护理人员'}}
 						</view>
 					</view>
-					<view class="icon-box" @tap="goToChoosePage" >
+					<view class="icon-box" @tap="goToChoosePage">
 						<up-icon v-if="!chooseInfo.name" size="28" class="up-icon" name="plus" />
-						<up-avatar v-else size="80rpx" :text="nameText(chooseInfo.name)" shape="square" bgColor="#305BFF" />
+						<up-avatar v-else size="80rpx" :text="nameText(chooseInfo.name)" shape="square"
+							bgColor="#305BFF" />
 					</view>
-					
+
 				</view>
 			</up-form-item>
 			<up-form-item label="护理打卡(0/6)" labelWidth="auto" required>
 				<view class="flex-row justify-between align-center" style="width: 100%;">
-					<u-upload :sizeType="['compressed']" :capture="['camera']"/>
+					<u-upload :sizeType="['compressed']" :capture="['camera']" />
 				</view>
 			</up-form-item>
 			<up-form-item label="护理评分" labelWidth="auto" required>
 				<view class="flex-row justify-between align-center" style="width: 100%;">
-					<up-rate v-model="formData.score" activeIcon="heart-fill" inactiveIcon="heart" count="10" :size="25"/>
+					<up-rate v-model="formData.score" activeIcon="heart-fill" inactiveIcon="heart" count="10"
+						:size="25" />
 					<view>{{formData.score*10}}</view>
 				</view>
 			</up-form-item>
@@ -53,17 +55,24 @@
 		onLoad,
 		onUnload
 	} from "@dcloudio/uni-app"
-
+	const props = defineProps({
+		item: {
+			type: Object,
+			default () {
+				return {}
+			}
+		}
+	})
 	// 使用 ref 创建响应式引用  
 	const formRef = ref(null);
 	const formData = reactive({
-		remark: '',//审核意见
-		careCompany: '',//护理公司
-		careStaff: '',//护理人员
-		score: 1,//评分
+		remark: '', //审核意见
+		careCompany: '', //护理公司
+		careStaff: '', //护理人员
+		score: 1, //评分
 	})
-	const chooseInfo = ref({});//选择的数据
-	
+	const chooseInfo = ref({}); //选择的数据
+
 	const nameText = computed(() => {
 		return (name) => {
 			let index = name.length - 2;
@@ -71,26 +80,28 @@
 			return name.substring(index);
 		};
 	})
-	
+
 
 	function goToChoosePage() {
 		let params = {
 			maxCount: 1
 		}
-		if(chooseInfo.value.name) {
-			params.dufaultIds = chooseInfo.value.id+"";
+		if (chooseInfo.value.name) {
+			params.dufaultIds = chooseInfo.value.id + "";
 		}
 		console.log(params);
 		uni.$u.route('/pages/subpack/pages/application/choose', params)
 	}
-	
-	
-	onLoad(()=>{
-		uni.$on('choose', ({checkList})=>{
-			if(checkList && checkList.length>0) chooseInfo.value = checkList[0];
+
+
+	onLoad(() => {
+		uni.$on('choose', ({
+			checkList
+		}) => {
+			if (checkList && checkList.length > 0) chooseInfo.value = checkList[0];
 		})
 	})
-	onUnload(()=>{
+	onUnload(() => {
 		uni.$off('choose')
 	})
 </script>
@@ -123,13 +134,15 @@
 			width: 100rpx;
 		}
 	}
-	.theme-color{
+
+	.theme-color {
 		color: #305BFF !important;
 	}
-	.icon-box{
+
+	.icon-box {
 		overflow: hidden;
 		width: 80rpx;
 		height: 80rpx;
-		
+
 	}
 </style>

+ 8 - 0
pages/subpack/pages/application/componenets/page2.vue

@@ -30,6 +30,14 @@
 		reactive,
 		ref
 	} from 'vue';
+	const props = defineProps({
+		item: {
+			type: Object,
+			default () {
+				return {}
+			}
+		}
+	})
 	const objKeyValue = reactive([{
 			name: '姓名',
 			key: 'name'

+ 9 - 2
pages/subpack/pages/application/componenets/page3.vue

@@ -3,7 +3,7 @@
 		<view class="info-dot">审批进度</view>
 		<view class="flow-list">
 			<up-steps current="2" direction="column">
-				<up-steps-item v-for="(flow, index) in flowList" ::key="index" class="position-relative"
+				<up-steps-item v-for="(flow, index) in flowList" :key="index" class="position-relative"
 					:title="flow.flowName">
 					<template #icon>
 						<view class="flow-icon"></view>
@@ -68,7 +68,14 @@
 		computed,
 		reactive
 	} from 'vue';
-
+	const props = defineProps({
+		item: {
+			type: Object,
+			default () {
+				return {}
+			}
+		}
+	})
 	// 0 不同意 1 待审  2 同意
 	const flowList = reactive([{
 			flowName: '资料提交',

+ 19 - 0
pages/subpack/pages/application/info.vue

@@ -28,11 +28,16 @@
 	import Page1 from './componenets/page1.vue';
 	import Page2 from './componenets/page2.vue';
 	import Page3 from './componenets/page3.vue';
+	import {
+		onLoad
+	} from '@dcloudio/uni-app'
+	import { getCareInfo } from '@/common/config/application-api.js'
 	
 	// 计算属性来确定要渲染的组件名称
 	// const pages = [Page1, Page2, Page3];
 	// const currentComponent = computed(() => pages[tabbarIndex.value]);
 	//tabbar 
+	const id = ref(0);
 	const tabbarIndex = ref(0);
 
 	function tabbarChange(index) {
@@ -44,6 +49,20 @@
 		else if (tabbarIndex.value === 1) return '基本信息';
 		else return '申请进度';
 	})
+	
+	function initData() {
+		getCareInfo({
+			id: id.value
+		}).then(res=>{
+			console.log('getCareInfo=>', res);
+		})
+	}
+	onLoad((params)=>{
+		if(params.id) {
+			id.value = params.id;
+			initData();
+		}
+	})
 </script>
 <style>
 	page {

+ 9 - 2
pages/subpack/pages/application/list.vue

@@ -107,6 +107,11 @@
 			query: {
 				status: 'wait_check'
 			}
+		}, {
+			name: '待指派',
+			query: {
+				status: 'wait_assign_company'
+			}
 		}, {
 			name: '进行中',
 			query: {
@@ -126,7 +131,7 @@
 		company: [{
 			name: '待分配',
 			query: {
-				status: 'no_check'
+				status: 'wait_assign_nurse'
 			}
 		}, {
 			name: '进行中',
@@ -199,7 +204,9 @@
 
 
 	function tapItemHandle(item) {
-		uni.$u.route('/pages/subpack/pages/application/info')
+		// console.log('tapItemHandle=>', item);
+		if(!item.applyId) return false;
+		uni.$u.route('/pages/subpack/pages/application/info',{id: item.applyId})
 	}
 </script>
 <style>

+ 22 - 0
pages/subpack/pages/myInfo/info.vue

@@ -14,6 +14,10 @@
 				</template>
 			</u-cell>
 		</u-cell-group>
+		<view class="position-fixed" style="bottom: 150rpx;left: 100rpx;width: 550rpx;">
+			<up-button type="error" @click="logout">退出登录</up-button>
+		</view>
+
 	</view>
 </template>
 
@@ -30,6 +34,24 @@
 	const user = ref({
 		nickName: ' '
 	})
+
+	function logout() {
+		uni.showModal({
+			title: '提示',
+			content: '您确定要退出登录吗?',
+			success(res) {
+				if (res.confirm) {
+					store.state.vuex_token = 'none';
+					store.state.vuex_user = {};
+					uni.redirectTo({
+						url: '/pages/subpack/pages/login/login'
+					})
+				}
+			}
+		})
+	}
+
+
 	onMounted(() => {
 		user.value = store.state.vuex_user;
 	})