2 lines
1.7 KiB
JavaScript
2 lines
1.7 KiB
JavaScript
"use strict";const e=require("../../../common/vendor.js"),t=require("../../../utils/http.js"),a=require("../../../utils/commUtils.js");if(!Array){e.resolveComponent("layout-default-uni")()}const l={__name:"pet-sitter",setup(l){const n=["宠托师","宠物营养师","宠物陪伴师","宠物心理健康指导员","宠物达人","其他宠物师"],s=e.ref({typeIndex:0,content:"",imageUrls:[]}),o=e=>{s.value.typeIndex=e.detail.value},i=()=>{e.index.chooseImage({count:6-s.value.imageUrls.length,success:e=>{s.value.imageUrls.push(...e.tempFilePaths)}})},u=()=>{return l=this,o=null,i=function*(){try{s.value.imageUrls=yield t.httpUploadMultipleFiles("/file/upload",s.value.imageUrls),s.value.type=n[s.value.typeIndex];const l=yield t.httpPost("/petInfo/apply",s.value);200==l.code?(e.index.showToast({title:"申请已提交",icon:"none"}),s.value={typeIndex:0,content:"",imageUrls:[]}):(e.index.showToast({title:"提交失败 "+l.message,icon:"none"}),l.message.includes("未实名认证")&&(yield new Promise((e=>setTimeout(e,500))),a.toPath("/modules/pet/permission/real-name-auth")))}catch(l){e.index.showToast({title:"提交失败",icon:"none"})}},new Promise(((e,t)=>{var a=e=>{try{s(i.next(e))}catch(a){t(a)}},n=e=>{try{s(i.throw(e))}catch(a){t(a)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(a,n);s((i=i.apply(l,o)).next())}));var l,o,i};return(t,a)=>e.e({a:e.t(n[s.value.typeIndex]||"请选择职位"),b:n,c:s.value.typeIndex,d:e.o(o),e:s.value.content,f:e.o((e=>s.value.content=e.detail.value)),g:e.f(s.value.imageUrls,((e,t,a)=>({a:e,b:t}))),h:s.value.imageUrls.length<6},s.value.imageUrls.length<6?{i:e.o(i)}:{},{j:e.o(u)})}},n=e._export_sfc(l,[["__scopeId","data-v-8f865dae"]]);wx.createPage(n);
|