Files
hnxdcount-uniapp/unpackage/dist/build/mp-weixin/pages/mine/phone.js
PC-202306242200\Administrator dac42e3b0c first commit
2026-03-28 23:09:02 +08:00

2 lines
2.4 KiB
JavaScript

"use strict";const e=require("../../common/vendor.js"),o=require("../../api/api.js");if(!Array){(e.resolveComponent("up-input")+e.resolveComponent("up-code")+e.resolveComponent("up-button"))()}Math||((()=>"../../uni_modules/uview-plus/components/u-input/u-input.js")+(()=>"../../uni_modules/uview-plus/components/u-code/u-code.js")+(()=>"../../uni_modules/uview-plus/components/u-button/u-button.js"))();const n={__name:"phone",setup(n){let t=e.ref({}),u=e.ref(""),r=e.ref(""),d=e.ref(null),s=e.ref(null),a=e.reactive({newPhone:"",newPhoneSmsCode:"",oldPhoneSmsCode:""});e.onLoad((async e=>{t.value=await o.userInfo()}));let i=async()=>{await o.updatePhone(a),e.index.showToast({title:"修改成功",icon:"none"}),setTimeout((()=>{e.index.navigateBack()}),1500)},l=e=>{u.value=e},p=e=>{r.value=e},f=n=>{if(!n)return e.index.showToast({title:"请输入手机号",icon:"none"});d.value.canGetCode?(e.index.showLoading({title:"正在获取验证码"}),o.smsCode({phone:n}).then((o=>{e.index.hideLoading(),e.index.$u.toast("验证码已发送"),d.value.start()}))):e.index.$u.toast("倒计时结束后再发送")},h=n=>{if(!n)return e.index.showToast({title:"请输入手机号",icon:"none"});s.value.canGetCode?(e.index.showLoading({title:"正在获取验证码"}),o.smsCode({phone:n}).then((o=>{e.index.hideLoading(),e.index.$u.toast("验证码已发送"),s.value.start()}))):e.index.$u.toast("倒计时结束后再发送")};return(o,n)=>({a:e.o((o=>e.unref(t).phone=o)),b:e.p({border:!1,disabledColor:"#fff",placeholder:"请输入",disabled:!0,modelValue:e.unref(t).phone}),c:e.o((o=>e.unref(a).oldPhoneSmsCode=o)),d:e.p({border:!1,placeholder:"请输入",modelValue:e.unref(a).oldPhoneSmsCode}),e:e.sr(d,"08b7825f-2",{k:"uCode1"}),f:e.o(e.unref(l)),g:e.p({"keep-running":!0,"start-text":"点我获取验证码"}),h:e.t(e.unref(u)),i:e.o((o=>e.unref(f)(e.unref(t).phone))),j:e.p({color:"#4874e5"}),k:e.o((o=>e.unref(a).newPhone=o)),l:e.p({border:!1,placeholder:"请输入",modelValue:e.unref(a).newPhone}),m:e.o((o=>e.unref(a).newPhoneSmsCode=o)),n:e.p({border:!1,placeholder:"请输入",modelValue:e.unref(a).newPhoneSmsCode}),o:e.sr(s,"08b7825f-6",{k:"uCode2"}),p:e.o(e.unref(p)),q:e.p({"keep-running":!0,"start-text":"点我获取验证码"}),r:e.t(e.unref(r)),s:e.o((o=>e.unref(h)(e.unref(a).newPhone))),t:e.p({color:"#4874e5"}),v:e.o(((...o)=>e.unref(i)&&e.unref(i)(...o)))})}},t=e._export_sfc(n,[["__scopeId","data-v-08b7825f"]]);wx.createPage(t);