瀏覽代碼

fix: 代码合并

chenjj 4 月之前
父節點
當前提交
97166efd9b
共有 2 個文件被更改,包括 634 次插入72 次删除
  1. 169 72
      pages/Client/new_file.vue
  2. 465 0
      pages/mine.vue

+ 169 - 72
pages/Client/new_file.vue

@@ -21,16 +21,13 @@
 		<template v-else-if="userType == 2">
 			<view class="Wrapper-grid">
 				<up-grid :border="false" col="4" @click="handleGridClick">
-					<up-grid-item v-for="(item, index) in serviceList2" :key="index" :custom-style="custmoStyle">
-						<view class="grid-box">
-							<!-- 图标 -->
-							<view class="grid-icon">
-								<image :src="item.icon" class="service-img" mode="aspectFit" />
-							</view>
-
-							<!-- 文本 -->
-							<text class="grid-text">{{ item.name }}</text>
-						</view>
+					<up-grid-item v-for="(item, index) in serviceList2" :key="index"
+						:custom-style="{ padding: '20rpx' }">
+						<!-- 图标 -->
+						<image :src="item.icon" class="service-img" mode="aspectFit" />
+
+						<!-- 文本 -->
+						<text class="grid-text">{{ item.name }}</text>
 					</up-grid-item>
 				</up-grid>
 
@@ -58,8 +55,12 @@
 	// } from "@/api/volunteerDetailsApi/details.js"
 	import {
 		workDate,
+<<<<<<< HEAD
 		getDataTime,
 		getVolunteerInfo
+=======
+		getDataTime
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
 	} from '@/api/volunteer.js'
 	import {
 		volunteerSeachgetTreeList,
@@ -80,6 +81,7 @@
 		insert: false,
 	})
 	const selected = ref([])
+<<<<<<< HEAD
 
 
 
@@ -164,6 +166,8 @@
 		key: 7
 	},
 ]);
+=======
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
 
 	const parentIdMap = {
 		'孩子陪护': 2,
@@ -177,6 +181,7 @@
 
 	const getParentId = (service) => parentIdMap[service.name] || 1;
 
+<<<<<<< HEAD
 	// 宫格点击事件
 	const handleGridClick = async (index) => {
 		const service = serviceList1.value[index]; // 获取点击的服务条目
@@ -206,28 +211,143 @@
 		// 志愿者
 		if (userType == 2 && uToastRef.value) {
 		// pages_home/pages
+=======
 
-		const data = serviceList2.value[index]
-		if (data.key !== 7) {
-			const res = await getVolunteerInfo({ serviceCategory: data.key });
-			if (res.code === 200 && res.data) {
-				//已有注册,跳转详情页面
+	// 普通用户
+	const serviceList1 = ref([{
+			icon: '/static/img/统一知识平台-营运@1x.png',
+			name: '孩子陪护',
+			key: 2,
+		},
+		{
+			icon: '/static/img/编组.png',
+			name: '陪伴陪聊',
+			key: 1,
+		},
+		{
+			icon: '/static/img/清空.png',
+			name: '家庭助理',
+			key: 3,
+		},
+		{
+			icon: '/static/img/构建.png',
+			name: '健康管理',
+			key: 4,
+		},
+		{
+			icon: '/static/img/报事报修@6x.png',
+			name: '家庭清洁',
+			key: 5,
+		},
+		{
+			icon: '/static/img/报事报修@6x.png',
+			name: '家务帮手',
+			key: 6,
+		},
+		{
+			icon: '/static/img/报事报修@6x.png',
+			name: '资讯与服务',
+			key: 7,
+		},
+	]);
+	//志愿者
+	const serviceList2 = ref([{
+			icon: '/static/img/统一知识平台-营运@1x.png',
+			name: '孩子陪护注册',
+			key: 2,
+		},
+		{
+			icon: '/static/img/编组.png',
+			name: '陪伴陪聊注册',
+			key: 1,
+		},
+		{
+			icon: '/static/img/清空.png',
+			name: '家庭助理注册',
+			key: 3,
+		},
+		{
+			icon: '/static/img/构建.png',
+			name: '健康管理注册',
+			key: 4
+		},
+		{
+			icon: '/static/img/报事报修@6x.png',
+			name: '家庭清洁注册',
+			key: 5
+		},
+		{
+			icon: '/static/img/报事报修@6x.png',
+			name: '家务帮手注册',
+			key: 6
+		},
+		{
+			icon: '/static/img/清空.png',
+			name: '排班管理',
+			key: 7
+		},
+	]);
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
+
+	const parentIdMap = {
+		'孩子陪护': 2,
+		'陪伴陪聊': 1,
+		'家庭助理': 3,
+		'健康管理': 4,
+		'家庭清洁': 5,
+		'家务帮手': 6,
+		'资讯与服务': 7,
+	};
+
+	const getParentId = (service) => parentIdMap[service.name] || 1;
+
+	// 宫格点击事件
+	const handleGridClick = async (index) => {
+		const service = serviceList1.value[index]; // 获取点击的服务条目
+		// 用户
+		if (userType == 1) {
+			// 动态获取 parentId
+			const parentId = getParentId(service); // 通过服务条目动态获取 parentId
+			const params = {
+				parentId: parentId
+			}
+			const res = await volunteerSeachgetTreeList(params)
+			console.log(res, '>>>>>dictSort = null')
+		
+			// 只有第一条和第二条可以跳转
+			if (index === 0 || index === 1) {
 				uni.navigateTo({
-					url: `/pages_home/pages/details/index?data=${encodeURIComponent(JSON.stringify(data))}`
+					url: `/pages_home/pages/client/details?dataList=${encodeURIComponent(JSON.stringify(res.data))}`
+				});
+			} else {
+				// 其他条目提示“敬请期待”
+				uni.showToast({
+					title: '敬请期待',
+					icon: 'none'
+				});
+			}
+		}
+		// 志愿者
+		if (userType == 2 && uToastRef.value) {
+			const data = serviceList2.value[index]
+			if (data.key !== 7) {
+				data.key === 1 || data.key === 2 ? uni.navigateTo({
+					url: `/pages_home/pages/register/index?data=${encodeURIComponent(JSON.stringify(data))}`
+				}) : uni.showToast({
+					title: '敬请期待',
+					icon: 'none'
 				})
-				return
+				return;
 			}
-			data.key === 1 || data.key === 2 ? uni.navigateTo({
-				url: `/pages_home/pages/register/index?data=${encodeURIComponent(JSON.stringify(data))}`
-			}) : uni.showToast({
-				title: '敬请期待',
-				icon: 'none'
-			})
-			return;
+			init();
+			calendar.value.open();
 		}
+<<<<<<< HEAD
 		init();
 
 	}
+=======
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
 	};
 
 
@@ -307,9 +427,14 @@
 	}
 
 	const init = () => {
+<<<<<<< HEAD
 	getDataTime().then(res => {
 		console.log('res', res);
 		if (res.code === 200) {
+=======
+		getDataTime().then(res => {
+			console.log('res', res);
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
 			selected.value = res.data.map(item => {
 				return {
 					date: item.workDate,
@@ -320,12 +445,9 @@
 					}
 				}
 			})
-			calendar.value.open();
-		}
 
-
-	})
-}
+		})
+	}
 
 
 
@@ -335,47 +457,22 @@
 </script>
 
 <style scoped>
-.Wrapper-grid {
-	/* margin-top: 170rpx; */
-	margin-top: 36rpx;
-}
-
-/* 图标样式 */
-.service-img {
-	/* width: 80rpx;
-	height: 80rpx; */
-	/* margin-bottom: 15rpx; */
-}
-
-/* 文本样式 */
-.grid-text {
-	font-size: 24rpx;
-	color: #333;
-	text-align: center;
-	margin-top: 18rpx;
-}
-
-.grid-box {
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	flex-direction: column;
-	margin-bottom: 48rpx;
-}
-
-.grid-icon {
-	width: 96rpx;
-	height: 96rpx;
-	opacity: 1;
-	border-radius: 8rpx;
-	background: rgba(0, 122, 255, 0.1);
-	display: flex;
-	align-items: center;
-	justify-content: center;
-}
-
-.service-img {
-	width: 48rpx;
-	height: 48rpx;
-}
+	.Wrapper-grid {
+		margin-top: 170rpx;
+	}
+
+	/* 图标样式 */
+	.service-img {
+		width: 80rpx;
+		height: 80rpx;
+		margin-bottom: 15rpx;
+	}
+
+	/* 文本样式 */
+	.grid-text {
+		font-size: 24rpx;
+		color: #333;
+		text-align: center;
+		margin-top: 10rpx;
+	}
 </style>

+ 465 - 0
pages/mine.vue

@@ -1,4 +1,5 @@
 <template>
+<<<<<<< HEAD
 	<view class="mine-container">
 
 		<view class="mine-header">
@@ -7,6 +8,39 @@
 				<text class="info-name">{{ userInfo.nickName }}</text>
 				<text class="info-id">ID: 88888888</text>
 				<text class="info-edit" @click="handLsetTing">设置> </text>
+=======
+	<view class="mine-container" :style="{ height: `${windowHeight}px` }">
+		<view class="mine-top-bgc"></view>
+		<view class="mine-box">
+			<view class="mine-user">
+				<view class="user-name-box">
+					<view class="user-avatar">
+						<up-avatar :src="userInfo.avatar" shape="square"></up-avatar>
+					</view>
+					<view class="user-name">{{ userInfo.nickName }}</view>
+					<view class="grid-box" v-for="(listItem, listIndex) in setTing" :key="listIndex">
+						<!-- <up-badge :isDot="true" type="success" class="item-badge"></up-badge> -->
+						<up-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="listItem.iconName" :size="22"
+							@click="handLsetTing"></up-icon>
+						<text class="grid-text">{{ listItem.name }}</text>
+
+					</view>
+				</view>
+				<up-divider></up-divider>
+				<view class="service-list">
+					<up-grid :border="false" col="4">
+						<up-grid-item v-for="(listItem, listIndex) in serviceList" :key="listIndex"
+							@click="onClick(listItem)">
+							<view class="grid-box">
+								<!-- <up-badge :isDot="true" type="success" class="item-badge"></up-badge> -->
+								<up-icon :customStyle="{ paddingTop: 20 + 'rpx' }" :name="listItem.iconName"
+									:size="22"></up-icon>
+								<text class="grid-text">{{ listItem.name }}</text>
+							</view>
+						</up-grid-item>
+					</up-grid>
+				</view>
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
 			</view>
 		</view>
 
@@ -72,6 +106,7 @@
 </template>
 
 <script setup>
+<<<<<<< HEAD
 import { onMounted, ref } from 'vue';
 import {
 	onLoad,
@@ -238,11 +273,210 @@ const getDetails = async () => {
 }
 
 const handLsetTing = () => {
+=======
+	import {
+		onMounted,
+		ref
+	} from 'vue';
+	import {
+		getVolunteerAccount
+	} from '@/api/volunteer.js'
+	import {
+		onLoad,
+		onShow
+	} from '@dcloudio/uni-app';
+	import store from "@/store"
+	const userType = uni.getStorageSync('userType') //读取本地存储
+
+	// 用户/志愿者 识别标识
+	const userOrWorker = uni.getStorageSync('storage_data').vuex_userOrWorker //读取本地存储
+
+	const userInfo = ref({});
+
+	const setTing = ref(
+		[{
+			iconName: 'setting-fill',
+			value: 1,
+		}, ]);
+
+	const serviceList = ref(
+		[{
+				name: '待服务',
+				iconName: 'clock',
+				page: '/pages/classify',
+				value: 1
+			},
+			{
+				name: '进行中',
+				iconName: 'car',
+				page: '/pages/classify',
+				value: 2
+			},
+			{
+				name: '已完成',
+				iconName: 'car-fill',
+				page: '/pages/classify',
+				value: 3
+			},
+			{
+				name: '差评申述',
+				iconName: 'edit-pen',
+				page: '/pages_mine/pages/bad/index'
+			},
+			{
+				name: '钱包',
+				iconName: 'rmb-circle',
+				page: '/pages_mine/pages/wallet/index'
+			},
+			{
+				name: '帮助与客服',
+				iconName: 'kefu-ermai',
+			},
+			{
+				name: '服务地址',
+				iconName: 'map',
+				page: '/pages_mine/pages/serviceInforMation/index'
+			},
+		]);
+
+
+
+
+	const serviceList2 = ref([{
+			name: '待服务',
+			iconName: 'clock',
+			page: '/pages/classify',
+			value: 1
+		},
+
+		{
+			name: '进行中',
+			iconName: 'car',
+			page: '/pages/classify',
+			value: 2
+		},
+		{
+			name: '已完成',
+			iconName: 'car-fill',
+			page: '/pages/classify',
+			value: 3
+		},
+		{
+			name: '评论',
+			iconName: 'edit-pen',
+			// page: '/pages/myCenter/bad'
+		},
+		{
+			name: '钱包',
+			iconName: 'rmb-circle',
+			page: '/pages_mine/pages/wallet/index'
+		},
+		{
+			name: '帮助与客服',
+			iconName: 'kefu-ermai',
+		},
+		{
+			name: '浏览记录',
+			iconName: 'eye',
+			page: '/pages_mine/pages/wallet/index'
+		},
+		{
+			name: '收藏',
+			iconName: 'star',
+		},
+	]);
+
+	const priceList = [{
+			name: '余额',
+			key: 'balance',
+			decimals: 2
+		},
+		{
+			name: '订单总数',
+			key: 'orderCount',
+			decimals: 0
+		}
+	]
+
+
+
+	const orderList = ref([{
+			name: '预约单',
+			key: 'orderCount'
+		},
+
+		{
+			name: '进行单',
+			key: 'orderCount'
+
+		},
+		{
+			name: '完成单',
+			key: 'orderCount'
+
+		},
+		{
+			name: '取消单',
+			key: 'orderCount'
+
+		}
+	]);
+
+	const avatarSrc = ref('/static/my/客服.png');
+	const data = ref({
+		balance: 0.0,
+		orderCount: 0,
+	});
+	const rateValue = ref(3);
+	const onClick = (record) => {
+		console.log('record', record, record.page);
+		if (record.page && record.value) {
+			const app = getApp();
+			app.globalData.switchTabParams = {
+				tabKey: record.value
+			};
+			// JS跳转 
+			uni.switchTab({
+				url: record.page
+			});
+			return;
+		}
+		if (record.page) {
+			uni.navigateTo({
+				url: record.page
+			});
+		}
+
+		onMounted(getDetails)
+	}
+
+	const getDetails = async () => {
+		try {
+			// const res = await getVolunteerAccount();
+			// console.log('res',res);
+
+		} catch (error) {
+			console.log('error', error);
+
+		}
+	}
+
+
+
+	const geUserInfo = () => {
+		console.log(store.state, '>>>>99');
+		userInfo.value = store.state.user
+	}
+
+	// 设置
+	const handLsetTing = () => {
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
 		console.log('123')
 		uni.navigateTo({
 			url: '/pages_mine/pages/setupUser/index'
 		})
 	}
+<<<<<<< HEAD
 
 
 
@@ -336,6 +570,132 @@ onShow(() => {
 					font-weight: 400;
 					line-height: 36rpx;
 					color: rgba(153, 153, 153, 1);
+=======
+	onShow(() => {
+		geUserInfo();
+
+	})
+</script>
+
+<style lang="scss" scoped>
+	.mine-card {
+		border-radius: 8px;
+		background: rgba(255, 255, 255, 1);
+		padding: 12px;
+		margin-bottom: 12px;
+	}
+
+	.mine-container {
+		position: fixed;
+		top: 0px;
+		left: 0px;
+		right: 0px;
+		bottom: 0px;
+		background: rgba(245, 245, 245, 1);
+
+		.mine-top-bgc {
+			height: 120px;
+			background: linear-gradient(180deg, rgba(255, 219, 171, 1) 0%, rgba(242, 151, 99, 1) 100%);
+
+		}
+
+		.mine-box {
+			position: absolute;
+			top: 40px;
+			left: 12px;
+			right: 12px;
+			bottom: 0px;
+			overflow-y: auto;
+
+
+			.mine-user {
+				border-radius: 8px;
+				background: rgba(255, 255, 255, 1);
+				margin-bottom: 12px;
+
+				.user-name-box {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					padding: 12px 12px 0;
+
+					.user-avatar {}
+
+					.user-name {
+						font-size: 18px;
+						font-weight: 700;
+						line-height: 21.09px;
+						color: rgba(51, 51, 51, 1);
+						margin-left: 12px;
+					}
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
+				}
+			}
+		}
+
+		.service-img {
+			width: 60rpx;
+			height: 60rpx;
+			margin-bottom: 10rpx;
+		}
+
+		.service-list {
+			padding-bottom: 12px;
+		}
+
+		.grid-text {
+			font-size: 14px;
+			color: #909399;
+			padding: 10rpx 0 20rpx 0rpx;
+			/* #ifndef APP-PLUS */
+			box-sizing: border-box;
+			/* #endif */
+		}
+
+
+		.grid-box {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			flex-direction: column;
+			position: relative;
+
+			.item-badge {
+				position: absolute;
+			}
+		}
+
+		.price-box {
+			display: flex;
+			align-content: center;
+			justify-content: space-between;
+			// padding: 12px;
+
+			.price-item {
+				width: 50%;
+				padding: 12px;
+				display: flex;
+				flex-direction: column;
+				align-items: center;
+				justify-content: center;
+
+				.user-name-box {
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					justify-content: center;
+
+					padding: 12px 12px 0;
+
+					.user-avatar {}
+
+					.user-name {
+						font-size: 18px;
+						font-weight: 700;
+						line-height: 21.09px;
+						color: rgba(51, 51, 51, 1);
+						margin-left: 12px;
+					}
 				}
 			}
 		}
@@ -439,7 +799,10 @@ onShow(() => {
 					line-height: 42rpx;
 					color: rgba(51, 51, 51, 1);
 				}
+
+
 			}
+<<<<<<< HEAD
 		}
 
 		.count-card {
@@ -465,6 +828,105 @@ onShow(() => {
 						line-height: 42rpx;
 						color: rgba(102, 102, 102, 1);
 					}
+=======
+
+			.service-list {
+				padding-bottom: 12px;
+			}
+
+			.grid-text {
+				font-size: 14px;
+				color: #909399;
+				padding: 10rpx 0 20rpx 0rpx;
+				/* #ifndef APP-PLUS */
+				box-sizing: border-box;
+				/* #endif */
+			}
+
+			.grid-box {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				flex-direction: column;
+				position: relative;
+
+				.item-badge {
+					position: absolute;
+				}
+			}
+
+			.price-box {
+				display: flex;
+				align-content: center;
+				justify-content: space-between;
+				// padding: 12px;
+
+				.price-item {
+					width: 50%;
+					padding: 12px;
+
+					.price-name {
+						font-size: 16px;
+						font-weight: 700;
+						line-height: 23.17px;
+						color: rgba(51, 51, 51, 1);
+						margin-bottom: 12px;
+					}
+
+					.price-data {
+						font-size: 20px;
+						font-weight: 700;
+						line-height: 23.44px;
+						color: rgba(51, 51, 51, 1);
+					}
+
+					.grid-min-price {
+						font-size: 12px;
+						font-weight: 500;
+						line-height: 17.38px;
+						color: rgba(153, 153, 153, 1);
+						margin-top: 4px;
+					}
+				}
+
+				.price-item:first-child {
+					border-right: 1px solid #dcdfe6;
+
+				}
+
+			}
+
+		}
+
+		.rate-box {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.rate-left {
+				font-size: 14px;
+				font-weight: 500;
+				letter-spacing: 0px;
+				line-height: 20.27px;
+				color: rgba(0, 0, 0, 1);
+
+				display: flex;
+				align-items: center;
+				justify-content: left;
+
+				flex: 1;
+			}
+
+			.rate-rigth {
+				font-size: 14px;
+				font-weight: 500;
+				letter-spacing: 0px;
+				line-height: 20.27px;
+				color: rgba(0, 0, 0, 1);
+
+				.rate-count {
+					color: rgba(237, 123, 47, 1);
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
 				}
 			}
 		}
@@ -497,6 +959,7 @@ onShow(() => {
 		}
 
 	}
+<<<<<<< HEAD
 }
 
 .mine-card {
@@ -514,4 +977,6 @@ onShow(() => {
 	color: rgba(51, 51, 51, 1);
 	margin-bottom: 32rpx;
 }
+=======
+>>>>>>> 3e2be9f (fetch:详情tabs/用户新增地址)
 </style>