| | |
| | | prop="photo" |
| | | label-position="top" |
| | | > |
| | | <Uploader v-model:file-list="form.lifeCircleImgUrlList" :maximum="6" class="bole-uploader"> |
| | | </Uploader> |
| | | <Uploader v-model:file-list="form.photos" :maximum="6" class="bole-uploader"> </Uploader> |
| | | </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 * as userResumeServices from '@12333/services/apiV2/userResume'; |
| | | import { convertApiPath2Url, Message } from '@12333/utils'; |
| | | import { FileItem } from '@nutui/nutui-taro/dist/types/__VUE/uploader/type'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | |
| | | name: 'InnerPage', |
| | | }); |
| | | |
| | | const { refetch: userResumeRefetch } = useUserResume(); |
| | | |
| | | const { |
| | | isLoading, |
| | | isError, |
| | | 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((x) => convertApiPath2Url(x)) : []; |
| | | }, |
| | | }); |
| | | |
| | | const form = reactive({ |
| | | height: '', |
| | | weight: '', |
| | | lifeCircleImgUrlList: [] as FileItem[], |
| | | height: 0, |
| | | weight: 0, |
| | | photos: [] 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) |
| | | : [], |
| | | photos: form.photos?.length ? form.photos.map((x) => x.path) : [], |
| | | }; |
| | | let res = await userResumeServices.saveUserResumeDetailInfo(params); |
| | | let res = await userResumeServices.saveUserResumeDetail(params); |
| | | if (res) { |
| | | Message.success('保存成功', { |
| | | onClosed() { |
| | | goBack(); |
| | | userResumeRefetch({ type: 'inactive' }); |
| | | }, |
| | | }); |
| | | } |