2 lines
18 KiB
JavaScript
2 lines
18 KiB
JavaScript
import{r as e,a as l,o as a,c as t,w as i,b as u,d as s,n as o,R as d,i as n,e as r,j as c,t as p,C as m,P as f,aX as h,aY as _,aR as v,au as g,aZ as b,h as y,m as x,f as w,$ as V,y as k,a_ as S,u as D,k as C,a$ as z,b0 as F,b1 as j,ai as $,aU as U}from"./index-8146d74e.js";import{_ as N}from"./u-image.2676d4c0.js";import{_ as A}from"./u-icon.58b55f5a.js";import{_ as I}from"./u-button.88325869.js";import{_ as P}from"./u-select.2fbb182f.js";import{e as R}from"./examine.38231f47.js";import{E as B,_ as E}from"./u-input.3d21ba1d.js";import{_ as L}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as q}from"./file-upload.vue_vue_type_script_setup_true_lang.0619ef69.js";import"./u-popup.5aaa2bdd.js";const K=L({name:"u-radio",emits:["change"],props:{name:{type:[String,Number],default:""},size:{type:[String,Number],default:34},shape:{type:String,default:""},disabled:{type:[String,Boolean],default:""},labelDisabled:{type:[String,Boolean],default:""},activeColor:{type:String,default:""},iconSize:{type:[String,Number],default:""},labelSize:{type:[String,Number],default:""}},data:()=>({parentData:{iconSize:null,labelDisabled:null,disabled:null,shape:null,activeColor:null,size:null,width:null,height:null,value:null,wrap:null}}),created(){this.parent=!1,this.updateParentData(),this.parent.children.push(this)},computed:{elDisabled(){return""!==this.disabled?this.disabled:null!==this.parentData.disabled&&this.parentData.disabled},elLabelDisabled(){return""!==this.labelDisabled?this.labelDisabled:null!==this.parentData.labelDisabled&&this.parentData.labelDisabled},elSize(){return this.size?this.size:this.parentData.size?this.parentData.size:34},elIconSize(){return this.iconSize?this.iconSize:this.parentData.iconSize?this.parentData.iconSize:20},elActiveColor(){return this.activeColor?this.activeColor:this.parentData.activeColor?this.parentData.activeColor:"primary"},elShape(){return this.shape?this.shape:this.parentData.shape?this.parentData.shape:"circle"},iconStyle(){let e={};return this.elActiveColor&&this.parentData.value===this.name&&!this.elDisabled&&(e.borderColor=this.elActiveColor,e.backgroundColor=this.elActiveColor),e.width=this.$u.addUnit(this.elSize),e.height=this.$u.addUnit(this.elSize),e},iconColor(){return this.name===this.parentData.value?"#ffffff":"transparent"},iconClass(){let e=[];return e.push("u-radio__icon-wrap--"+this.elShape),this.name===this.parentData.value&&e.push("u-radio__icon-wrap--checked"),this.elDisabled&&e.push("u-radio__icon-wrap--disabled"),this.name===this.parentData.value&&this.elDisabled&&e.push("u-radio__icon-wrap--disabled--checked"),e.join(" ")},radioStyle(){let e={};return this.parentData.width&&(e.width=this.$u.addUnit(this.parentData.width),e.flex=`0 0 ${this.$u.addUnit(this.parentData.width)}`),this.parentData.wrap&&(e.width="100%",e.flex="0 0 100%"),e}},methods:{updateParentData(){this.getParentData("u-radio-group")},onClickLabel(){this.elLabelDisabled||this.elDisabled||this.setRadioCheckedStatus()},toggle(){this.elDisabled||this.setRadioCheckedStatus()},emitEvent(){this.parentData.value!=this.name&&this.$emit("change",this.name)},setRadioCheckedStatus(){this.emitEvent(),this.parent&&(this.parent.setValue(this.name),this.parentData.value=this.name)}}},[["render",function(r,c,p,m,f,h){const _=e(l("u-icon"),A),v=n;return a(),t(v,{class:"u-radio",style:o([h.radioStyle])},{default:i(()=>[u(v,{class:s(["u-radio__icon-wrap",[h.iconClass]]),onClick:h.toggle,style:o([h.iconStyle])},{default:i(()=>[u(_,{class:"u-radio__icon-wrap__icon",name:"checkbox-mark",size:h.elIconSize,color:h.iconColor},null,8,["size","color"])]),_:1},8,["onClick","class","style"]),u(v,{class:"u-radio__label",onClick:h.onClickLabel,style:o({fontSize:r.$u.addUnit(p.labelSize)})},{default:i(()=>[d(r.$slots,"default",{},void 0,!0)]),_:3},8,["onClick","style"])]),_:3},8,["style"])}],["__scopeId","data-v-65c0e1b1"]]);const X=L({name:"u-radio-group",emits:["update:modelValue","input","change"],mixins:[B],props:{value:{type:[String,Number],default:""},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},activeColor:{type:String,default:"#2979ff"},size:{type:[String,Number],default:34},labelDisabled:{type:Boolean,default:!1},shape:{type:String,default:"circle"},iconSize:{type:[String,Number],default:20},width:{type:[String,Number],default:"auto"},wrap:{type:Boolean,default:!1}},data:()=>({uFromData:{inputAlign:"left"}}),created(){this.children=[]},mounted(){let e=this.$u.$parent.call(this,"u-form");e&&Object.keys(this.uFromData).map(l=>{this.uFromData[l]=e[l]})},watch:{parentData(){this.children.length&&this.children.map(e=>{"function"==typeof e.updateParentData&&e.updateParentData()})}},computed:{valueCom(){return this.modelValue},parentData(){return[this.valueCom,this.disabled,this.activeColor,this.size,this.labelDisabled,this.shape,this.iconSize,this.width,this.wrap]}},methods:{setValue(e){this.children.map(l=>{l.parentData.value!=e&&(l.parentData.value="")}),this.$emit("input",e),this.$emit("update:modelValue",e),this.$emit("change",e),setTimeout(()=>{this.dispatch("u-form-item","onFieldChange",e)},60)}}},[["render",function(e,l,u,o,r,c){const p=n;return a(),t(p,{class:s(["u-radio-group u-clearfix","right"==r.uFromData.inputAlign?"flex-end":""])},{default:i(()=>[d(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"])}],["__scopeId","data-v-5c6ccee1"]]),Z=r({__name:"form-item",props:{title:{type:String,default:""}},setup:e=>(l,s)=>{const o=n;return a(),t(o,{class:"mb-4"},{default:i(()=>[u(o,null,{default:i(()=>[c(p(e.title),1)]),_:1}),u(o,{class:"mt-2"},{default:i(()=>[d(l.$slots,"default")]),_:3})]),_:3})}}),O=r({__name:"base",props:{modelValue:{default:{}}},emits:["update:modelValue"],setup(s,{emit:o}){const d=s,r=m({set(e){o("update:modelValue",e)},get:()=>d.modelValue});return f(async e=>{h("choiceAddress",async e=>{var l;r.value.longitude=e.longitude,r.value.latitude=e.latitude;try{const e=await _({location:`${r.value.latitude},${r.value.longitude}`});if(0==e.status){let a=e.result.ad_info.city_code.substr(3,6);11e4!=a&&31e4!=a&&21e4!=a&&41e4!=a||(a*=1,a+=100),r.value.city_id=a+"",r.value.province_id=r.value.city_id.substr(0,3)+"000",r.value.region_id=e.result.ad_info.adcode,r.value.address_detail=(null==(l=e.result.address_component.street_number)?void 0:l.length)>0?e.result.address_component.street_number:e.result.address_component.street,r.value.regionStr=`${e.result.ad_info.province} ${e.result.ad_info.city} ${e.result.ad_info.district}`}else v({title:e.message,icon:"none"})}catch(a){console.log("逆解析地址错误:",a)}})}),g(()=>{b(["choiceAddress"])}),(s,o)=>{const d=e(l("u-input"),E),m=n,f=e(l("u-radio"),K),h=e(l("u-radio-group"),X),_=e(l("u-icon"),A);return a(),t(m,{class:"pb-4 px-[30rpx]"},{default:i(()=>[u(Z,{title:"姓名"},{default:i(()=>[u(m,{class:"flex items-center"},{default:i(()=>[u(m,{class:"bg-[#F8F9F9] p-2 rounded-lg"},{default:i(()=>[u(d,{modelValue:y(r).name,"onUpdate:modelValue":o[0]||(o[0]=e=>y(r).name=e),placeholder:"请输入您的姓名"},null,8,["modelValue"])]),_:1}),u(m,{class:"ml-4"},{default:i(()=>[u(h,{modelValue:y(r).gender,"onUpdate:modelValue":o[1]||(o[1]=e=>y(r).gender=e)},{default:i(()=>[u(f,{name:1},{default:i(()=>[c("男士")]),_:1}),u(f,{name:2},{default:i(()=>[c("女士")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(Z,{title:"年龄/岁"},{default:i(()=>[u(m,{class:"w-full"},{default:i(()=>[u(m,{class:"bg-[#F8F9F9] p-2 rounded-lg"},{default:i(()=>[u(d,{modelValue:y(r).age,"onUpdate:modelValue":o[2]||(o[2]=e=>y(r).age=e),placeholder:"请输入您的年龄/岁",type:"number"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(Z,{title:"身份证号码"},{default:i(()=>[u(m,{class:""},{default:i(()=>[u(m,{class:"bg-[#F8F9F9] p-2 rounded-lg"},{default:i(()=>[u(d,{modelValue:y(r).id_card,"onUpdate:modelValue":o[3]||(o[3]=e=>y(r).id_card=e),placeholder:"请输入身份证号码"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u(Z,{title:"身份证照片(人像面)"},{default:i(()=>[u(m,{class:""},{default:i(()=>[u(q,{modelValue:y(r).id_card_back,"onUpdate:modelValue":o[4]||(o[4]=e=>y(r).id_card_back=e),"max-count":1,width:"203",height:"203"},null,8,["modelValue"])]),_:1})]),_:1}),u(Z,{title:"身份证照片(国徽面)"},{default:i(()=>[u(m,{class:""},{default:i(()=>[u(q,{modelValue:y(r).id_card_front,"onUpdate:modelValue":o[5]||(o[5]=e=>y(r).id_card_front=e),"max-count":1,width:"203",height:"203"},null,8,["modelValue"])]),_:1})]),_:1}),u(Z,{title:"实拍照片(正面免冠素颜照)"},{default:i(()=>[u(m,{class:""},{default:i(()=>[u(q,{modelValue:y(r).portrait_shooting,"onUpdate:modelValue":o[6]||(o[6]=e=>y(r).portrait_shooting=e),"max-count":1,width:"203",height:"203"},null,8,["modelValue"])]),_:1})]),_:1}),u(Z,{title:"地址"},{default:i(()=>[u(m,{onClick:o[7]||(o[7]=e=>{x({url:"/packages/pages/location/index"})}),class:"bg-[#F8F9F9] p-3 rounded-lg text-info flex items-center justify-between"},{default:i(()=>[u(m,null,{default:i(()=>[c(p(y(r).regionStr||"请选择详细地址"),1)]),_:1}),u(m,null,{default:i(()=>[u(_,{name:"arrow-right",size:"22"})]),_:1})]),_:1})]),_:1}),u(Z,{title:"详细地址"},{default:i(()=>[u(m,{class:"bg-[#F8F9F9] p-2 rounded-lg text-info"},{default:i(()=>[u(d,{modelValue:y(r).address_detail,"onUpdate:modelValue":o[8]||(o[8]=e=>y(r).address_detail=e),type:"textarea",placeholder:"请输入详细地址"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})}}}),T=r({__name:"skill",props:{modelValue:{default:{}}},emits:["update:modelValue"],setup(s,{emit:o}){const d=s,r=k(),f=w(!1),_=w([]),v=w(""),g=m({set(e){o("update:modelValue",e)},get:()=>d.modelValue}),b=()=>{g.value.skill_id?r.navigate({path:"/packages/pages/select_project/select_project",query:{id:g.value.skill_id,title:v.value,ids:null==g?void 0:g.value.goods_ids.join(",")}}):uni.$u.toast("请选择技能")},x=e=>{g.value.goods_ids=[],g.value.skill_id=e[0].value,v.value=e[0].label};return h("selectProject",e=>{console.log("选择了哦",e),g.value.goods_ids=e}),V(()=>(async()=>{const e=await S();_.value=e.map(e=>({value:e.id,label:e.name})),g.value.skill_id&&(v.value=_.value.find(e=>e.value==g.value.skill_id).label)})()),(s,o)=>{const d=n,r=e(l("u-icon"),A),m=e(l("u-select"),P);return a(),t(d,{class:"pb-4 px-[30rpx]"},{default:i(()=>[u(Z,{title:"服务技能"},{default:i(()=>[u(d,{onClick:o[0]||(o[0]=e=>f.value=!0),class:"bg-[#F8F9F9] p-3 rounded-lg text-info flex items-center justify-between"},{default:i(()=>[u(d,null,{default:i(()=>[c(p(v.value?v.value:"请选择你的服务技能"),1)]),_:1}),u(r,{name:"arrow-right",size:"22"})]),_:1})]),_:1}),u(Z,{title:"服务项目"},{default:i(()=>[u(d,{onClick:b,class:"bg-[#F8F9F9] p-3 rounded-lg text-info flex items-center justify-between"},{default:i(()=>[u(d,null,{default:i(()=>{var e,l;return[c(p(0!=(null==(e=y(g))?void 0:e.goods_ids.length)?`已选${null==(l=y(g))?void 0:l.goods_ids.length}项`:"请选择你的服务项目"),1)]}),_:1}),u(r,{name:"arrow-right",size:"22"})]),_:1})]),_:1}),u(m,{modelValue:f.value,"onUpdate:modelValue":o[1]||(o[1]=e=>f.value=e),"z-index":9999,list:_.value,"safe-area-inset-bottom":"",onConfirm:x},null,8,["modelValue","list"])]),_:1})}}}),Y=r({__name:"personal-data",props:{modelValue:{default:{}}},emits:["update:modelValue","educationShow","nationShow"],setup(s,{emit:o}){const d=s,r=m({set(e){o("update:modelValue",e)},get:()=>d.modelValue});return(s,d)=>{const m=n,f=e(l("u-icon"),A);return a(),t(m,{class:"pb-4 px-[30rpx]"},{default:i(()=>[u(Z,{title:"工装照(头像)"},{default:i(()=>[u(m,{class:""},{default:i(()=>[u(q,{modelValue:y(r).work_photo,"onUpdate:modelValue":d[0]||(d[0]=e=>y(r).work_photo=e),"max-count":1,width:"203",height:"203"},null,8,["modelValue"])]),_:1})]),_:1}),u(Z,{title:"生活照(用于个人详情页可上传多张)"},{default:i(()=>[u(m,{class:""},{default:i(()=>[u(q,{modelValue:y(r).life_photo,"onUpdate:modelValue":d[1]||(d[1]=e=>y(r).life_photo=e),"max-count":4,width:"203",height:"203"},null,8,["modelValue"])]),_:1})]),_:1}),u(Z,{title:"学历"},{default:i(()=>[u(m,{onClick:d[2]||(d[2]=e=>o("educationShow")),class:"bg-[#F8F9F9] p-3 rounded-lg text-info flex items-center justify-between"},{default:i(()=>[u(m,null,{default:i(()=>[c(p(y(r).education?y(r).education:"请选择你的学历程度"),1)]),_:1}),u(f,{name:"arrow-right",size:"22"})]),_:1})]),_:1}),u(Z,{title:"民族"},{default:i(()=>[u(m,{onClick:d[3]||(d[3]=e=>o("nationShow")),class:"bg-[#F8F9F9] p-3 rounded-lg text-info flex items-center justify-between"},{default:i(()=>[u(m,null,{default:i(()=>[c(p(y(r).nation?y(r).nation:"请选择你的名族"),1)]),_:1}),u(f,{name:"arrow-right",size:"22"})]),_:1})]),_:1})]),_:1})}}}),G=L(r({__name:"apply",setup(s){var o,d,r;console.log(12);const p=D(),m=w(!1),h=w(!1),_=w([]),x=w([]),V=w({name:"",age:null,gender:1,mobile:"",id_card:"",education:"",nation:"",province_id:"",city_id:"",region_id:"",address_detail:"",skill_id:"",goods_ids:[],id_card_back:"",id_card_front:"",portrait_shooting:"",work_photo:"",work_status:1,server_status:1,life_photo:[],regionStr:"",longitude:"",latitude:""});V.value.regionStr=V.value.province_id?(null==(o=V.value)?void 0:o.province_name)+" "+(null==(d=V.value)?void 0:d.city_name)+" "+(null==(r=V.value)?void 0:r.region_name):"";const k=w(0),S=()=>{0!=k.value&&k.value--},B=()=>{2!=k.value&&k.value++},E=e=>{V.value.education=e[0].label},L=e=>{V.value.nation=e[0].label},q=async()=>Number(V.value.age)?V.value.portrait_shooting?(await j(V.value),await p.getUser(),void(await $())):v({title:"请上传实拍照片",icon:"none"}):v({title:"请输入年龄",icon:"none"});return f(async()=>{await(async()=>{var e,l;const a=await z();Array.isArray(a)||Reflect.ownKeys(a).length<=1||(Reflect.ownKeys(V.value).forEach(e=>{V.value[e]=a[e]}),V.value.regionStr=a.region_desc,V.value.goods_ids=null==(e=a.goods_lists)?void 0:e.map(e=>e.id),V.value.life_photo=null==(l=a.life_photo)?void 0:l.map(e=>e.uri))})(),await(async()=>{var e,l;const a=await F();_.value=null==(e=a.education_lists)?void 0:e.map((e,l)=>({value:l,label:e})),x.value=null==(l=a.nation_lists)?void 0:l.map((e,l)=>({value:l,label:e}))})()}),g(()=>b(["selectProject"])),(s,o)=>{const d=e(l("u-image"),N),r=n,p=e(l("u-icon"),A),f=U,v=e(l("u-button"),I),g=e(l("u-select"),P);return a(),t(r,{class:"flex flex-col w-full h-full"},{default:i(()=>[u(r,{class:"pt-[30rpx] pb-[80rpx] px-[20rpx] text-white topBg"},{default:i(()=>[u(r,{class:"flex"},{default:i(()=>[u(d,{width:"120rpx",height:"120rpx",src:y(R)},null,8,["src"]),u(r,{class:"flex flex-col justify-between ml-2"},{default:i(()=>[u(r,{class:"text-5xl"},{default:i(()=>[c("填写个人信息")]),_:1}),u(r,null,{default:i(()=>[c("快来获得入驻资格吧!")]),_:1})]),_:1})]),_:1}),u(r,{style:{"background-color":"rgba(255, 255, 255, 0.1)"},class:"flex justify-between mt-4 p-[20rpx] rounded-lg"},{default:i(()=>[u(r,{class:"flex flex-col items-center progressItem"},{default:i(()=>[u(r,{style:{"background-color":"rgba(255, 255, 255, 0.1)"},class:"rounded-full w-[44rpx] h-[44rpx] flex items-center justify-center"},{default:i(()=>[0==k.value?(a(),t(r,{key:0,class:"w-[22rpx] h-[22rpx] bg-white rounded-full"})):(a(),t(r,{key:1,class:"flex justify-center items-center w-full h-full bg-white rounded-full"},{default:i(()=>[u(p,{name:"checkmark",color:s.$theme.primaryColor},null,8,["color"])]),_:1}))]),_:1}),u(r,{class:"mt-2"},{default:i(()=>[c("基本信息")]),_:1})]),_:1}),u(r,{class:"flex flex-col items-center progressItem"},{default:i(()=>[u(r,{style:{"background-color":"rgba(255, 255, 255, 0.1)"},class:"rounded-full w-[44rpx] h-[44rpx] flex items-center justify-center"},{default:i(()=>[k.value<1?(a(),t(r,{key:0,class:"font-medium"},{default:i(()=>[c("2")]),_:1})):C("",!0),1==k.value?(a(),t(r,{key:1,class:"w-[22rpx] h-[22rpx] bg-white rounded-full"})):C("",!0),k.value>1?(a(),t(r,{key:2,class:"flex justify-center items-center w-full h-full bg-white rounded-full"},{default:i(()=>[u(p,{name:"checkmark",color:s.$theme.primaryColor},null,8,["color"])]),_:1})):C("",!0)]),_:1}),u(r,{class:"mt-2"},{default:i(()=>[c("服务技能")]),_:1})]),_:1}),u(r,{class:"flex flex-col items-center progressItem"},{default:i(()=>[u(r,{style:{"background-color":"rgba(255, 255, 255, 0.1)"},class:"rounded-full w-[44rpx] h-[44rpx] flex items-center justify-center"},{default:i(()=>[k.value<2?(a(),t(r,{key:0},{default:i(()=>[c("3")]),_:1})):C("",!0),2==k.value?(a(),t(r,{key:1,class:"w-[22rpx] h-[22rpx] bg-white rounded-full"})):C("",!0),k.value>2?(a(),t(r,{key:2,class:"flex justify-center items-center w-full h-full bg-white rounded-full"},{default:i(()=>[u(p,{name:"checkmark",color:s.$theme.primaryColor},null,8,["color"])]),_:1})):C("",!0)]),_:1}),u(r,{class:"mt-2"},{default:i(()=>[c("个人资料")]),_:1})]),_:1})]),_:1})]),_:1}),u(f,{class:"w-full h-full rounded-t-2xl min-h-0 pt-[40rpx] mt-[-30rpx] bg-white box-border relative z-50","scroll-y":""},{default:i(()=>[0==k.value?(a(),t(O,{key:0,modelValue:V.value,"onUpdate:modelValue":o[0]||(o[0]=e=>V.value=e)},null,8,["modelValue"])):C("",!0),1==k.value?(a(),t(T,{key:1,modelValue:V.value,"onUpdate:modelValue":o[1]||(o[1]=e=>V.value=e)},null,8,["modelValue"])):C("",!0),2==k.value?(a(),t(Y,{key:2,modelValue:V.value,"onUpdate:modelValue":o[2]||(o[2]=e=>V.value=e),onEducationShow:o[3]||(o[3]=e=>m.value=!0),onNationShow:o[4]||(o[4]=e=>h.value=!0)},null,8,["modelValue"])):C("",!0)]),_:1}),u(r,{class:"px-[20rpx] py-[10rpx] bottom flex bg-white relative"},{default:i(()=>[0!=k.value?(a(),t(v,{key:0,onClick:S,class:"w-full",type:"primary",plain:""},{default:i(()=>[c(" 上一步 ")]),_:1})):C("",!0),2!=k.value?(a(),t(v,{key:1,onClick:B,class:"w-full ml-2",type:"primary"},{default:i(()=>[c(" 下一步 ")]),_:1})):C("",!0),2==k.value?(a(),t(v,{key:2,onClick:q,class:"w-full ml-2",type:"primary"},{default:i(()=>[c(" 提交 ")]),_:1})):C("",!0)]),_:1}),u(g,{modelValue:m.value,"onUpdate:modelValue":o[5]||(o[5]=e=>m.value=e),"z-index":9999,list:_.value,"safe-area-inset-bottom":"",onConfirm:E},null,8,["modelValue","list"]),u(g,{modelValue:h.value,"onUpdate:modelValue":o[6]||(o[6]=e=>h.value=e),"z-index":9999,list:x.value,"safe-area-inset-bottom":"",onConfirm:L},null,8,["modelValue","list"])]),_:1})}}}),[["__scopeId","data-v-86ea50c7"]]);export{G as default};
|