123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366 |
- <template>
- <view class="details-main">
- <view class="status-box">
- <img src="/static/serverImg/home/no.png" alt="" style="width: 160rpx;height: 160rpx;margin-bottom: 36rpx;" v-if="details.appStatus === '3'">
- <img src="/static/serverImg/home/ok.png" alt="" style="width: 160rpx;height: 160rpx;margin-bottom: 36rpx;" v-if="['1','2'].includes(details.appStatus)">
- <text class="status-text">{{ statusData.text }}</text>
- <text v-if="statusData.rejectReason" class="text2">失败原因:{{ statusData.rejectReason }}</text>
- </view>
- <view class="status-main">
- <view class="status-card">
- <view class="card-title">基本信息</view>
- <view class="card-item" v-for="item in list" :key="item.key">
- <view class="card-lable">{{ item.label }}</view>
- <view class="card-text"> {{ item.key === 'sex' ? sex_status[details[item.key]] || '-' :
- details[item.key] || '-'}} </view>
- </view>
- </view>
- <view class="status-card">
- <view class="card-title">服务信息</view>
- <view class="card-item" v-for="item in serveslist" :key="item.key">
- <view class="card-lable">{{ item.label }}</view>
- <view class="card-text"> {{ details[item.key] || '-'}}{{item.dese}} </view>
- </view>
- </view>
- <view class="status-card">
- <view class="card-title">技能简介</view>
- <view class="card-text"> {{ details.skillDescribe }} </view>
- </view>
- <view class="status-card">
- <view class="card-title">用户头像</view>
- <view class="card-imgs">
- <img class="upload-img" v-for="(item, index) in volunteerPicture_img" :key="index + 'userimg'"
- :src="item" :alt="item.fileName" srcset="">
- </view>
- </view>
- <view class="status-card">
- <view class="card-title">身份证</view>
- <view class="card-imgs">
- <img class="upload-img" v-for="(item, index) in idCardPicture_img" :key="index + 'card'" :src="item"
- :alt="item.fileName" srcset="">
- </view>
- </view>
- <view class="status-card">
- <view class="card-title">资格证书</view>
- <view class="card-imgs">
- <view v-for="(item, index) in certificationPicture_img" :key="index + 'cer'">
- <img class="upload-img" :src="item" :alt="item.fileName" srcset="">
- </view>
- </view>
- </view>
- <view class="status-btn" v-if="details.appStatus === '3'" @click="startSubmit">重新提交</view>
- </view>
- <Picker :columnData="options" ref="pickerRef" />
- </view>
- </template>
- <script setup>
- import { ref, reactive, onMounted, nextTick, computed } from 'vue';
- import { onLoad } from '@dcloudio/uni-app';
- import { add, getVolunteerInfo } from "@/api/volunteer";
- import Picker from '@/pages_home/components/picker/index.vue'
- import { getTreeList } from '@/api/volunteer'
- import { useDict } from '@/utils/dict.js';
- const details = ref({});
- const data = ref({});
- const options = ref([])
- const pickerRef = ref(null);
- // const {
- // volunteer_app_status
- // } = useDict('volunteer_app_status');
- const list = [
- {
- label: "姓名",
- key: "name",
- },
- {
- label: "性别",
- key: "sex",
- },
- {
- label: "年龄",
- key: "age",
- },
- {
- label: "手机号",
- key: "phonenumber",
- },
- // {
- // label: "服务项目",
- // key: "businessManagementId",
- // },
- {
- label: "地区",
- key: "city",
- },
- {
- label: "详细地址",
- key: "address",
- },
- ]
- const serveslist =[
- {
- label: "服务项目",
- key: "businessManagementId",
- },
- {
- label: "服务时长",
- key: "businessDuration",
- dese:'分钟'
- },
- {
- label: "服务价格",
- key: "businessPrice",
- dese:'元'
- },
- ]
- const sex_status = {
- 0: '男',
- 1: '女'
- }
- //头像
- const volunteerPicture_img = computed(() => {
- return details.value.volunteerPicture ? details.value.volunteerPicture.split(',') : []
- })
- //个人身份证
- const idCardPicture_img = computed(() => {
- return details.value.idCardPicture ? details.value.idCardPicture.split(',') : []
- })
- //职业、资质证书
- const certificationPicture_img = computed(() => {
- return details.value.certificationPicture ? details.value.certificationPicture.split(',') : []
- })
- const status_e = {
- 1: '申请成功',
- 2: '注册成功',
- 3: '申请失败'
- }
- const statusData = computed(() => {
- // console.log('volunteer_app_status',volunteer_app_status.value);
- // const parmas = volunteer_app_status.value.find(item => item.value === details.value.appStatus)
-
- if (details.value.appStatus === '3') {
- return {
- img: '/static/serverImg/home/no.png',
- text: status_e[details.value.appStatus],
- rejectReason: details.value.rejectReason
- }
- }
- return {
- img: '/static/serverImg/home/yes.png',
- text: status_e[details.value.appStatus],
- }
- })
- function idToIndexs(array, targetId, path = []) {
- for (let i = 0; i < array.length; i++) {
- const item = array[i];
- const currentPath = path.concat(i);
- if (item.id === targetId) {
- return item.businessTierName
- }
- if (item.children) {
- const result = idToIndexs(item.children, targetId, currentPath);
- if (result) {
- return result;
- }
- }
- }
- return null; // 如果没有找到对应的项,返回 null
- }
- async function getRegister() {
- try {
- uni.showLoading({
- title: '数据加载中...'
- });
- const op_res = await getTreeList({ parentId: data.value.key });
- const res = await getVolunteerInfo({ serviceCategory: data.value.key });
- if (res.data) {
- const names = idToIndexs(op_res.data, res.data.businessManagementId + '')
- console.log('res', res, names);
- details.value = {
- ...res.data,
- businessManagementId: names
- };
- }
- getTreeList({ parentId: data.value.key }).then(res => {
- options.value = res.data;
- })
- } catch (error) {
- console.log('error', error);
- uni.showToast({
- title: error.msg,
- icon: 'error',
- });
- } finally {
- uni.hideLoading();
- }
- }
- const startSubmit = () => {
- uni.redirectTo({
- url: `/pages_home/pages/register/index?data=${encodeURIComponent(JSON.stringify(data.value))}`
- })
- }
- onLoad((options) => {
- const option = JSON.parse(decodeURIComponent(options.data));
- data.value = option;
- console.log("option", option);
- uni.setNavigationBarTitle({
- title: option.name + '详情' // 根据业务逻辑调整
- });
- setTimeout(() => {
- getRegister();
- }, 500);
- })
- </script>
- <style lang="scss" scoped>
- .details-main {
- position: fixed;
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- display: flex;
- flex-direction: column;
- overflow-y: auto;
- }
- .status-box {
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- padding: 64rpx 0;
- .status-text {
- font-size: 40rpx;
- font-weight: 400;
- letter-spacing: 0rpx;
- line-height: 56rpx;
- color: rgba(17, 24, 39, 1);
- }
- .text2 {
- font-size: 28rpx;
- font-weight: 400;
- letter-spacing: 0rpx;
- line-height: 40rpx;
- color: rgba(107, 114, 128, 1);
- }
- }
- .status-main {
- flex: 1;
- background: whitesmoke;
- padding: 32rpx;
- .status-card {
- padding: 32rpx;
- border-radius: 24rpx;
- background: rgba(255, 255, 255, 1);
- box-shadow: 0rpx 0rpx 0rpx rgba(0, 0, 0, 0), 0rpx 0rpx 0rpx rgba(0, 0, 0, 0), 0rpx 2rpx 4rpx rgba(0, 0, 0, 0.05);
- margin-bottom: 32rpx;
- .card-title {
- font-size: 32rpx;
- font-weight: 400;
- line-height: 48rpx;
- color: rgba(17, 24, 39, 1);
- margin-bottom: 32rpx;
- }
- .card-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 24rpx;
- }
- .card-lable {
- font-size: 28rpx;
- font-weight: 400;
- letter-spacing: 0rpx;
- line-height: 40rpx;
- color: rgba(107, 114, 128, 1);
- }
- .card-text {
- font-size: 28rpx;
- font-weight: 400;
- letter-spacing: 0rpx;
- line-height: 40rpx;
- color: rgba(17, 24, 39, 1);
- }
- }
- .status-btn {
- // width: 716rpx;
- height: 96rpx;
- border-radius: 16rpx;
- background: rgba(221, 94, 69, 1);
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 32rpx;
- font-weight: 400;
- color: rgba(255, 255, 255, 1);
- margin-bottom: 88rpx;
- }
- .card-imgs {
- display: flex;
- flex-wrap: wrap;
- margin-right: 32rpx;
- }
- .upload-img {
- height: 136rpx;
- width: 136rpx;
- margin-right: 24rpx;
- }
- }
- </style>
|