"use strict";const e=require("../../../../common/vendor.js"),r=require("../../../index.js"),o=require("../../../validate/form.js"),i=require("../../../hooks/useModal.js"),s=require("../../../api/member/user.js");if(require("../../../url/index.js"),require("../../../store/index.js"),require("../../../store/app.js"),require("../../../api/promotion/diy.js"),require("../../../request/index.js"),require("../../../config/index.js"),require("../../../platform/index.js"),require("../../../platform/provider/wechat/index.js"),require("../../../platform/provider/wechat/miniProgram.js"),require("../../../api/member/auth.js"),require("../../../api/member/social.js"),require("../../../platform/provider/apple/index.js"),require("../../../platform/share.js"),require("../../../router/index.js"),require("../../../helper/throttle.js"),require("../../../platform/pay.js"),require("../../../helper/index.js"),require("../../../helper/test.js"),require("../../../helper/digit.js"),require("../../../api/pay/order.js"),require("../../../store/user.js"),require("../../../store/cart.js"),require("../../../api/trade/cart.js"),require("../../../api/pay/wallet.js"),require("../../../api/trade/order.js"),require("../../../api/promotion/coupon.js"),require("../../../store/sys.js"),require("../../../store/modal.js"),require("../../../config/zIndex.js"),require("../../../api/member/signin.js"),!Array){(e.resolveComponent("uni-easyinput")+e.resolveComponent("uni-forms-item")+e.resolveComponent("uni-forms"))()}Math||((()=>"../../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js")+(()=>"../../../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.js")+(()=>"../../../../uni_modules/uni-forms/components/uni-forms/uni-forms.js"))();const n={__name:"change-mobile",setup(n){const u=e.ref(null),t=e.computed((()=>r.sheep.$store("user").userInfo)),a=e.reactive({isMobileEnd:!1,model:{mobile:"",code:""},rules:{code:o.code,mobile:o.mobile}});async function l(){if(!(await e.unref(u).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:o}=await s.UserApi.updateUserMobile(a.model);0===o&&(r.sheep.$store("user").getInfo(),i.closeAuthModal())}async function m(e){if("getPhoneNumber:ok"!==e.detail.errMsg)return;await r.sheep.$platform.useProvider().bindUserPhoneNumber(e.detail)&&(r.sheep.$store("user").getInfo(),i.closeAuthModal())}return(o,s)=>e.e({a:e.t(t.value.mobile?"更换手机号":"绑定手机号"),b:e.t(e.unref(i.getSmsTimer)("changeMobile")),c:a.isMobileEnd,d:a.isMobileEnd?1:"",e:e.o((r=>e.unref(i.getSmsCode)("changeMobile",a.model.mobile))),f:e.o((e=>a.model.mobile=e)),g:e.p({placeholder:"请输入手机号",inputBorder:!1,type:"number",modelValue:a.model.mobile}),h:e.p({name:"mobile",label:"手机号"}),i:e.o(l),j:e.o((e=>a.model.code=e)),k:e.p({placeholder:"请输入验证码",inputBorder:!1,type:"number",maxlength:"4",modelValue:a.model.code}),l:e.p({name:"code",label:"验证码"}),m:e.sr(u,"0241a05b-0",{k:"changeMobileRef"}),n:e.o((e=>a.model=e)),o:e.p({rules:a.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center",modelValue:a.model}),p:"WechatMiniProgram"===e.unref(r.sheep).$platform.name},"WechatMiniProgram"===e.unref(r.sheep).$platform.name?{q:e.o(m)}:{})}},u=e._export_sfc(n,[["__scopeId","data-v-0241a05b"]]);wx.createComponent(u);
