You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/assets/pages-dealer-apply.a2e721b4.js

1 lines
4.7 KiB

import{$ as e,o as l,c as s,w as a,e as t,i,a as d,f as o,t as n,k as f,g as c,l as r,U as u,I as m,a4 as p,j as _,y as x}from"./index-4ddb689d.js";import{_ as b}from"./u-modal.9219359e.js";import{r as g}from"./uni-app.es.24af5d4f.js";import{S as h}from"./Setting.15a9e6ae.js";import{_ as y}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-loading.7bd69747.js";import"./u-popup.37b3343e.js";import"./u-icon.e981d1c2.js";const v="dealer.apply/status",w="dealer.apply/submit";const k=y({data:()=>({isLoading:!0,isDealer:void 0,isApplying:void 0,refereeName:void 0,words:void 0,background:void 0,license:void 0,isRead:!1,showLicense:!1,disabled:!1}),onLoad(e){this.getSetting(),this.getApplyStatus()},methods:{getSetting(){const e=this;h.data().then((l=>{e.words=l.words.apply.words,e.background=l.background.apply,e.license=l.license.license,e.setPageTitle(l.words.apply.title)}))},getApplyStatus(){const l=this;var s;l.isLoading=!0,e.get(v,s).then((e=>{const s=e.data;l.isDealer=s.isDealer,l.isApplying=s.isApplying,l.refereeName=s.refereeName})).finally((()=>l.isLoading=!1))},setPageTitle(e){uni.setNavigationBarTitle({title:e.value})},handleChecked(e){this.payment=e},handleShowLicense(){this.showLicense=!0},handleSubmit({detail:l}){const s=this;if(!s.onValidation(l.value))return!1;var a;s.disabled=!0,(a={form:l.value},e.post(w,a)).then((e=>{s.$toast(e.message),setTimeout((()=>uni.navigateBack()),1200)})).finally((()=>s.disabled=!1))},onValidation(e){const l=this;return e.name?/^\+?\d[\d -]{8,12}\d/.test(e.mobile)?!!l.isRead||(l.$error("请先阅读分销商申请协议"),!1):(l.$error("手机号格式不正确"),!1):(l.$error("请填写姓名"),!1)}}},[["render",function(e,h,y,v,w,k){const S=c,L=i,j=r,A=u,T=m,V=p,$=_,N=g(x("u-modal"),b);return w.isLoading?t("",!0):(l(),s(L,{key:0,class:"container b-f"},{default:a((()=>[d(L,{class:"dealer-bg"},{default:a((()=>[d(S,{class:"image",mode:"widthFix",src:w.background},null,8,["src"])])),_:1}),w.isApplying?(l(),s(L,{key:0,class:"dealer-boot dis-flex flex-dir-column flex-y-center"},{default:a((()=>[d(L,{class:"boot__msg f-30 dis-flex flex-dir-column flex-y-center"},{default:a((()=>[d(j,{class:"msg__icon iconfont icon-shenhezhong"}),d(j,{class:"msg__content m-top20 f-29 col-80"},{default:a((()=>[o(n(w.words.wait_audit.value),1)])),_:1})])),_:1}),d(L,{class:"boot__submit form-submit dis-flex flex-x-center"},{default:a((()=>[d(A,{class:"button",onClick:h[0]||(h[0]=l=>e.$navTo("pages/index/index"))},{default:a((()=>[o(n(w.words.goto_mall.value),1)])),_:1})])),_:1})])),_:1})):(l(),s(L,{key:1,class:"dis-flex flex-dir-column flex-y-center"},{default:a((()=>[d(L,{class:"widget-form b-f m-top20 dis-flex flex-dir-column"},{default:a((()=>[d(L,{class:"form-title f-30"},{default:a((()=>[o(n(w.words.title.value),1)])),_:1}),d(L,{class:"form-box dis-flex flex-dir-column"},{default:a((()=>[d(V,{onSubmit:k.handleSubmit},{default:a((()=>[d(L,{class:"form-field dis-flex flex-y-center"},{default:a((()=>[d(L,{class:"field-label"},{default:a((()=>[o("邀请人")])),_:1}),d(L,{class:"field-input"},{default:a((()=>[d(j,null,{default:a((()=>[o(n(w.refereeName)+"(请核对)",1)])),_:1})])),_:1})])),_:1}),d(L,{class:"form-field dis-flex flex-y-center"},{default:a((()=>[d(L,{class:"field-label"},{default:a((()=>[o("姓名")])),_:1}),d(L,{class:"field-input flex-box"},{default:a((()=>[d(T,{class:"input",name:"name",placeholder:"请输入真实姓名"})])),_:1})])),_:1}),d(L,{class:"form-field dis-flex flex-y-center"},{default:a((()=>[d(L,{class:"field-label"},{default:a((()=>[o("手机号")])),_:1}),d(L,{class:"field-input flex-box"},{default:a((()=>[d(T,{class:"input",name:"mobile",placeholder:"请输入手机号"})])),_:1})])),_:1}),d(L,{class:"form-license dis-flex flex-x-center flex-y-center"},{default:a((()=>[d(L,{class:"license-radio dis-flex flex-y-center",onClick:h[1]||(h[1]=e=>w.isRead=!w.isRead)},{default:a((()=>[d(j,{class:f(["license-icon f-38 iconfont icon-radio",[w.isRead?"c-violet":"col-bb"]])},null,8,["class"]),d(j,{class:"f-28 col-80"},{default:a((()=>[o("我已阅读并了解")])),_:1})])),_:1}),d(j,{onClick:h[2]||(h[2]=e=>k.handleShowLicense()),class:"f-28 c-violet"},{default:a((()=>[o("【"+n(w.words.license.value)+"】",1)])),_:1})])),_:1}),d(L,{class:"form-submit dis-flex flex-x-center"},{default:a((()=>[d(A,{formType:"submit",disabled:w.disabled},{default:a((()=>[o(n(w.words.submit.value),1)])),_:1},8,["disabled"])])),_:1})])),_:1},8,["onSubmit"])])),_:1})])),_:1})])),_:1})),d(N,{modelValue:w.showLicense,"onUpdate:modelValue":h[3]||(h[3]=e=>w.showLicense=e),title:"申请协议"},{default:a((()=>[d($,{class:"pops-content","scroll-y":!0},{default:a((()=>[d(j,null,{default:a((()=>[o(n(w.license),1)])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1}))}],["__scopeId","data-v-4cdf6b4c"]]);export{k as default};