|
@@ -21,13 +21,16 @@
|
|
|
<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="{ padding: '20rpx' }">
|
|
|
- <!-- 图标 -->
|
|
|
- <image :src="item.icon" class="service-img" mode="aspectFit" />
|
|
|
-
|
|
|
- <!-- 文本 -->
|
|
|
- <text class="grid-text">{{ item.name }}</text>
|
|
|
+ <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>
|
|
|
</up-grid>
|
|
|
|
|
@@ -55,7 +58,8 @@
|
|
|
// } from "@/api/volunteerDetailsApi/details.js"
|
|
|
import {
|
|
|
workDate,
|
|
|
- getDataTime
|
|
|
+ getDataTime,
|
|
|
+ getVolunteerInfo
|
|
|
} from '@/api/volunteer.js'
|
|
|
import {
|
|
|
volunteerSeachgetTreeList,
|
|
@@ -118,42 +122,48 @@
|
|
|
},
|
|
|
]);
|
|
|
//志愿者
|
|
|
- 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
|
|
|
- },
|
|
|
- ]);
|
|
|
+ const serviceList2 = ref([
|
|
|
+ {
|
|
|
+ icon: '/static/serverImg/home/icon/icon2.png',
|
|
|
+ name: '陪伴陪聊',
|
|
|
+ key: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: '/static/serverImg/home/icon/icon4.png',
|
|
|
+ name: '孩子陪护',
|
|
|
+ key: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: '/static/serverImg/home/icon/icon1.png',
|
|
|
+ name: '家庭助理',
|
|
|
+ key: 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: '/static/serverImg/home/icon/icon6.png',
|
|
|
+ name: '健康管理',
|
|
|
+ key: 4
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: '/static/serverImg/home/icon/icon2.png',
|
|
|
+ name: '家庭清洁',
|
|
|
+ key: 5
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: '/static/serverImg/home/icon/icon5.png',
|
|
|
+ name: '家务帮手',
|
|
|
+ key: 6
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: '/static/serverImg/home/icon/icon7.png',
|
|
|
+ name: '咨询服务',
|
|
|
+ key: 8
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: '/static/serverImg/home/icon/icon8.png',
|
|
|
+ name: '排班管理',
|
|
|
+ key: 7
|
|
|
+ },
|
|
|
+]);
|
|
|
|
|
|
const parentIdMap = {
|
|
|
'孩子陪护': 2,
|
|
@@ -195,19 +205,29 @@
|
|
|
}
|
|
|
// 志愿者
|
|
|
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'
|
|
|
+ // 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) {
|
|
|
+ //已有注册,跳转详情页面
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages_home/pages/details/index?data=${encodeURIComponent(JSON.stringify(data))}`
|
|
|
})
|
|
|
- return;
|
|
|
+ return
|
|
|
}
|
|
|
- init();
|
|
|
- calendar.value.open();
|
|
|
+ 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();
|
|
|
+
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
|
|
@@ -287,8 +307,9 @@
|
|
|
}
|
|
|
|
|
|
const init = () => {
|
|
|
- getDataTime().then(res => {
|
|
|
- console.log('res', res);
|
|
|
+ getDataTime().then(res => {
|
|
|
+ console.log('res', res);
|
|
|
+ if (res.code === 200) {
|
|
|
selected.value = res.data.map(item => {
|
|
|
return {
|
|
|
date: item.workDate,
|
|
@@ -299,9 +320,12 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ calendar.value.open();
|
|
|
+ }
|
|
|
|
|
|
- })
|
|
|
- }
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
@@ -311,22 +335,47 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
- .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;
|
|
|
- }
|
|
|
+.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;
|
|
|
+}
|
|
|
</style>
|