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.
2 lines
3.7 KiB
2 lines
3.7 KiB
"use strict";const e=require("../../common/vendor.js"),t=require("../../sheep/config/index.js");require("../../sheep/index.js");require("../../sheep/url/index.js");require("../../sheep/store/index.js");require("../../sheep/store/app.js");require("../../sheep/platform/index.js");require("../../sheep/platform/provider/wechat/index.js");require("../../sheep/platform/provider/wechat/miniProgram.js");require("../../sheep/api/member/auth.js");require("../../sheep/request/index.js");require("../../sheep/helper/index.js");require("../../sheep/helper/test.js");require("../../sheep/helper/digit.js");require("../../sheep/api/member/social.js");require("../../sheep/api/member/user.js");require("../../sheep/platform/provider/apple/index.js");require("../../sheep/platform/share.js");require("../../sheep/router/index.js");require("../../sheep/hooks/useModal.js");require("../../sheep/helper/throttle.js");require("../../sheep/platform/pay.js");require("../../sheep/api/pay/order.js");require("../../sheep/store/user.js");require("../../sheep/store/cart.js");require("../../sheep/api/trade/cart.js");require("../../sheep/api/pay/wallet.js");require("../../sheep/api/trade/order.js");require("../../sheep/store/sys.js");require("../../sheep/store/modal.js");require("../../sheep/config/zIndex.js");Array||e.resolveComponent("uni-nav-bar")();const m=()=>"../../uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.js";Math||(q+m)();const q=()=>"../components/header_tops_tips.js",f={__name:"updatepassword",setup(v){const r=e.ref({code:"",password:""}),d=e.ref("修改绑定手机号"),l=e.ref("请输入新手机号"),u=e.ref("获取验证码"),s=e.ref(!1),c=e.ref(""),n=e.ref(1);e.onLoad(a=>{let o=JSON.parse(a.date);console.log(a,"options"),n.value=a.type,c.value=o.mobile,a.type==2&&(d.value="修改密码",l.value="请输入新密码")});function p(){n.value==1?e.index.request({url:`${t.baseUrl+t.apiPath}/member/user/update-mobile`,method:"PUT",data:{code:r.value.code,mobile:r.value.password},header:{"tenant-id":1,Authorization:e.index.getStorageSync("token")},success:a=>{a.data.code==0?(e.index.showToast({icon:"success",title:"修改成功"}),e.index.removeStorageSync("token"),e.index.reLaunch({url:"/pages/subpackages/login"})):(e.index.showToast({title:a.data.msg,icon:"error"}),e.index.navigateBack())},fail:a=>{console.log(a,"error")}}):e.index.request({url:`${t.baseUrl+t.apiPath}/member/user/update-password`,method:"PUT",data:{code:r.value.code,password:r.value.password},header:{"tenant-id":1,Authorization:e.index.getStorageSync("token")},success:a=>{a.data.code==0?(e.index.showToast({icon:"success",title:"修改成功"}),e.index.navigateBack()):(e.index.showToast({title:a.data.msg,icon:"error"}),e.index.navigateBack())},fail:a=>{console.log(a,"error")}})}function _(){s.value==!1&&r.value.phone!=""&&e.index.request({url:`${t.baseUrl+t.apiPath}/member/auth/send-sms-code`,method:"POST",data:{mobile:n.value==1?r.value.password:c.value,scene:n.value==1?"2":"3"},header:{"tenant-id":1,Authorization:e.index.getStorageSync("token")},success:a=>{if(a.data.code==0){s.value=!0;let o=10;const i=setInterval(()=>{o--,u.value=o+"s",o==0&&(clearInterval(i),u.value="获取验证码",s.value=!1)},1e3)}else e.index.showToast({icon:"error",title:a.data.msg})}})}function g(){e.index.navigateBack()}return(a,o)=>({a:e.o(g),b:e.p({["left-icon"]:"left",title:d.value,backgroundColor:"#e6eafa"}),c:l.value,d:r.value.password,e:e.o(i=>r.value.password=i.detail.value),f:r.value.code,g:e.o(i=>r.value.code=i.detail.value),h:e.t(u.value),i:e.n(s.value==!1?"getCode":"getCode dis_code"),j:e.o(_),k:e.o(p)})}},h=e._export_sfc(f,[["__scopeId","data-v-32962dc2"],["__file","D:/xiangmu/佰安出行/app/s-applet/pages/home/updatepassword.vue"]]);wx.createPage(h);
|