|  |  |  | 
|---|
|  |  |  | <nut-form-item | 
|---|
|  |  |  | label="个人生活照(单张照片不超过5m,最多不超过6张):" | 
|---|
|  |  |  | class="bole-form-item person-photo" | 
|---|
|  |  |  | prop="photo" | 
|---|
|  |  |  | prop="photos" | 
|---|
|  |  |  | label-position="top" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <Uploader v-model:file-list="form.lifeCircleImgUrlList" :maximum="6" class="bole-uploader"> | 
|---|
|  |  |  | <Uploader v-model:file-list="form.photos" :maximum="6" class="bole-uploader"> </Uploader> | 
|---|
|  |  |  | </nut-form-item> | 
|---|
|  |  |  | <nut-form-item | 
|---|
|  |  |  | label="个人视频:" | 
|---|
|  |  |  | class="bole-form-item person-photo" | 
|---|
|  |  |  | prop="videos" | 
|---|
|  |  |  | label-position="top" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <Uploader | 
|---|
|  |  |  | v-model:file-list="form.videos" | 
|---|
|  |  |  | :maximum="1" | 
|---|
|  |  |  | class="bole-uploader" | 
|---|
|  |  |  | :media-type="['video']" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template #item="{ item }"> | 
|---|
|  |  |  | <video class="editor-video" :src="item.url" /> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <template #upload-icon> | 
|---|
|  |  |  | <UploaderIcon color="#808080" /> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </Uploader> | 
|---|
|  |  |  | <div class="video-demo"> | 
|---|
|  |  |  | <div class="video-demo-title">视频模板</div> | 
|---|
|  |  |  | <video class="editor-video" :src="OssAssets.mine.UseResumeVideo" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </nut-form-item> | 
|---|
|  |  |  | </nut-form> | 
|---|
|  |  |  | </ContentScrollView> | 
|---|
|  |  |  | 
|---|
|  |  |  | <script setup lang="ts"> | 
|---|
|  |  |  | import { goBack } from '@/utils'; | 
|---|
|  |  |  | import { NumberInput } from '@12333/components'; | 
|---|
|  |  |  | import * as userResumeServices from '@12333/services/api/userResume'; | 
|---|
|  |  |  | import { convertApiPath2Url, Message } from '@12333/utils'; | 
|---|
|  |  |  | import { useUpdateResume } from '@12333/hooks'; | 
|---|
|  |  |  | import * as userResumeServices from '@12333/services/apiV2/userResume'; | 
|---|
|  |  |  | import { convertApiPath2Url, convertFormUrl2Api, Message } from '@12333/utils'; | 
|---|
|  |  |  | import { FileItem } from '@nutui/nutui-taro/dist/types/__VUE/uploader/type'; | 
|---|
|  |  |  | import { useQuery } from '@tanstack/vue-query'; | 
|---|
|  |  |  | import { Uploader as UploaderIcon } from '@nutui/icons-vue-taro'; | 
|---|
|  |  |  | import { OssAssets } from '@/constants'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'InnerPage', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { updateUserResume } = useUpdateResume(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | isLoading, | 
|---|
|  |  |  | 
|---|
|  |  |  | data: detail, | 
|---|
|  |  |  | refetch, | 
|---|
|  |  |  | } = useQuery({ | 
|---|
|  |  |  | queryKey: ['userResumeServices/getUserResumeDetailInfo'], | 
|---|
|  |  |  | queryKey: ['userResumeServices/getUserResumeDetail'], | 
|---|
|  |  |  | queryFn: async () => { | 
|---|
|  |  |  | return await userResumeServices.getUserResumeDetailInfo({ | 
|---|
|  |  |  | showLoading: false, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return await userResumeServices.getUserResumeDetail( | 
|---|
|  |  |  | {}, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | showLoading: false, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | placeholderData: () => ({} as API.UserResumeDetailInfoOutput), | 
|---|
|  |  |  | placeholderData: () => ({} as API.GetUserResumeDetailQueryResult), | 
|---|
|  |  |  | onSuccess(data) { | 
|---|
|  |  |  | form.height = data.height; | 
|---|
|  |  |  | form.weight = data.weight; | 
|---|
|  |  |  | form.lifeCircleImgUrlList = data.lifeCircleImgUrlList?.length | 
|---|
|  |  |  | ? data.lifeCircleImgUrlList.map((x) => convertApiPath2Url(x)) | 
|---|
|  |  |  | : []; | 
|---|
|  |  |  | form.photos = data.photos?.length ? data.photos.map(convertApiPath2Url) : []; | 
|---|
|  |  |  | form.videos = data.videos?.length ? data.videos.map(convertApiPath2Url) : []; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const form = reactive({ | 
|---|
|  |  |  | height: '', | 
|---|
|  |  |  | weight: '', | 
|---|
|  |  |  | lifeCircleImgUrlList: [] as FileItem[], | 
|---|
|  |  |  | height: 0, | 
|---|
|  |  |  | weight: 0, | 
|---|
|  |  |  | photos: [] as FileItem[], | 
|---|
|  |  |  | videos: [] as FileItem[], | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function handleConfirm() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.SaveUserResumeDetailInfoInput = { | 
|---|
|  |  |  | let params: API.SaveUserResumeDetailCommand = { | 
|---|
|  |  |  | weight: form.weight, | 
|---|
|  |  |  | height: form.weight, | 
|---|
|  |  |  | lifeCircleImgUrlList: form.lifeCircleImgUrlList?.length | 
|---|
|  |  |  | ? form.lifeCircleImgUrlList.map((x) => x.url) | 
|---|
|  |  |  | : [], | 
|---|
|  |  |  | height: form.height, | 
|---|
|  |  |  | photos: convertFormUrl2Api(form.photos), | 
|---|
|  |  |  | videos: convertFormUrl2Api(form.videos), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await userResumeServices.saveUserResumeDetailInfo(params); | 
|---|
|  |  |  | let res = await userResumeServices.saveUserResumeDetail(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | Message.success('保存成功', { | 
|---|
|  |  |  | onClosed() { | 
|---|
|  |  |  | goBack(); | 
|---|
|  |  |  | updateUserResume(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | page .nut-form .nut-cell.bole-form-item:not(.alignTop) { | 
|---|
|  |  |  | align-items: flex-start !important; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .editor-video { | 
|---|
|  |  |  | width: 200px; | 
|---|
|  |  |  | height: 200px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .video-demo { | 
|---|
|  |  |  | .video-demo-title { | 
|---|
|  |  |  | margin: 12px 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|