| | |
| | | fixed-verification-code: ${GUIDE_LOGIN_FIXED_CODE:} |
| | | order: |
| | | # 临时跳过微信支付;恢复真实支付时将默认值改为 false。 |
| | | skip-payment: ${TOURGUIDE_ORDER_SKIP_PAYMENT:true} |
| | | skip-payment: ${TOURGUIDE_ORDER_SKIP_PAYMENT:false} |
| | | |
| | | logging: |
| | | level: |
| | |
| | | "use strict";const e=require("../../common/vendor.js"),o=require("../../common/assets.js"),n={components:{GuideDialog:()=>"../../components/guide-dialog/guide-dialog.js"},data:()=>({phone:"",code:"123456",countdown:0,countdownTimer:null,codeSending:!1,loginLoading:!1,agreed:!1,showAgreementModal:!1,showDisabledModal:!1}),computed:{canLogin(){return/^1\d{10}$/.test(this.phone)&&/^\d{4,6}$/.test(this.code)},codeText(){return this.codeSending?"发送中...":this.countdown>0?`${this.countdown}s后重试`:"获取验证码"}},onLoad(){e.isLoggedIn()&&e.routeTo("/pages/workbench/index","reLaunch")},onUnload(){this.clearCountdown()},methods:{sendCode(){/^1\d{10}$/.test(this.phone)?this.codeSending||this.countdown>0||(this.codeSending=!0,e.sendLoginCode(this.phone).then(({resendSeconds:o})=>{this.startCountdown(o||30),e.index.showToast({title:"验证码已发送",icon:"none"})}).catch(this.handleLoginError).finally(()=>{this.codeSending=!1})):e.index.showToast({title:"请输入正确手机号",icon:"none"})},startCountdown(e){this.clearCountdown(),this.countdown=Number(e)||30,this.countdownTimer=setInterval(()=>{this.countdown-=1,this.countdown<=0&&this.clearCountdown()},1e3)},clearCountdown(){this.countdownTimer&&clearInterval(this.countdownTimer),this.countdownTimer=null,this.countdown<0&&(this.countdown=0)},toggleAgreement(){this.agreed=!this.agreed},closeAgreementModal(){this.showAgreementModal=!1},confirmAgreement(){this.agreed=!0,this.showAgreementModal=!1,this.submitLogin()},handleLogin(){this.canLogin?this.agreed?this.submitLogin():this.showAgreementModal=!0:e.index.showToast({title:"请填写正确手机号和验证码",icon:"none"})},openAgreement(o){e.routeTo(`/pages/agreement-detail/index?type=${o}`)},submitLogin(){this.loginLoading||(this.loginLoading=!0,e.loginByPhone({phone:this.phone,code:this.code}).then(()=>e.routeTo("/pages/workbench/index","reLaunch")).catch(this.handleLoginError).finally(()=>{this.loginLoading=!1}))},handleLoginError(o){40301!==Number(o.code)?e.index.showToast({title:o.message,icon:"none"}):this.showDisabledModal=!0},showRegisterTip(){e.routeTo("/pages/register-phone/index")}}};if(!Array){e.resolveComponent("guide-dialog")()}Math;const t=e._export_sfc(n,[["render",function(n,t,i,d,s,r){return e.e({a:o._imports_0$1,b:o._imports_0,c:s.phone,d:e.o(e=>s.phone=e.detail.value,"63"),e:o._imports_1,f:s.code,g:e.o(e=>s.code=e.detail.value,"7d"),h:e.t(r.codeText),i:s.codeSending||s.countdown>0,j:e.o((...e)=>r.sendCode&&r.sendCode(...e),"dc"),k:s.agreed},(s.agreed,{}),{l:s.agreed?1:"",m:e.o(e=>r.openAgreement("user"),"92"),n:e.o(e=>r.openAgreement("service"),"db"),o:e.o((...e)=>r.toggleAgreement&&r.toggleAgreement(...e),"e8"),p:e.t(s.loginLoading?"登录中...":"登录"),q:!r.canLogin||s.loginLoading?1:"",r:s.loginLoading,s:e.o((...e)=>r.handleLogin&&r.handleLogin(...e),"a9"),t:e.o((...e)=>r.showRegisterTip&&r.showRegisterTip(...e),"14"),v:e.o(r.confirmAgreement,"cd"),w:e.o(e=>s.showAgreementModal=e,"e1"),x:e.p({title:"提示",content:"请确认已同意《用户协议》和《讲解服务合作协议》",visible:s.showAgreementModal}),y:e.o(e=>s.showDisabledModal=e,"8c"),z:e.p({title:"账号已禁用",content:"您的账号已被禁用,暂时无法登录。如有疑问,请联系后台工作人员。","confirm-text":"我知道了","show-cancel":!1,visible:s.showDisabledModal})})}]]);wx.createPage(t); |
| | | "use strict";const e=require("../../common/vendor.js"),o=require("../../common/assets.js"),n={components:{GuideDialog:()=>"../../components/guide-dialog/guide-dialog.js"},data:()=>({phone:"",code:"",countdown:0,countdownTimer:null,codeSending:!1,loginLoading:!1,agreed:!1,showAgreementModal:!1,showDisabledModal:!1}),computed:{canLogin(){return/^1\d{10}$/.test(this.phone)&&/^\d{4,6}$/.test(this.code)},codeText(){return this.codeSending?"发送中...":this.countdown>0?`${this.countdown}s后重试`:"获取验证码"}},onLoad(){e.isLoggedIn()&&e.routeTo("/pages/workbench/index","reLaunch")},onUnload(){this.clearCountdown()},methods:{sendCode(){/^1\d{10}$/.test(this.phone)?this.codeSending||this.countdown>0||(this.codeSending=!0,e.sendLoginCode(this.phone).then(({resendSeconds:o})=>{this.startCountdown(o||30),e.index.showToast({title:"验证码已发送",icon:"none"})}).catch(this.handleLoginError).finally(()=>{this.codeSending=!1})):e.index.showToast({title:"请输入正确手机号",icon:"none"})},startCountdown(e){this.clearCountdown(),this.countdown=Number(e)||30,this.countdownTimer=setInterval(()=>{this.countdown-=1,this.countdown<=0&&this.clearCountdown()},1e3)},clearCountdown(){this.countdownTimer&&clearInterval(this.countdownTimer),this.countdownTimer=null,this.countdown<0&&(this.countdown=0)},toggleAgreement(){this.agreed=!this.agreed},closeAgreementModal(){this.showAgreementModal=!1},confirmAgreement(){this.agreed=!0,this.showAgreementModal=!1,this.submitLogin()},handleLogin(){this.canLogin?this.agreed?this.submitLogin():this.showAgreementModal=!0:e.index.showToast({title:"请填写正确手机号和验证码",icon:"none"})},openAgreement(o){e.routeTo(`/pages/agreement-detail/index?type=${o}`)},submitLogin(){this.loginLoading||(this.loginLoading=!0,e.loginByPhone({phone:this.phone,code:this.code}).then(()=>e.routeTo("/pages/workbench/index","reLaunch")).catch(this.handleLoginError).finally(()=>{this.loginLoading=!1}))},handleLoginError(o){40301!==Number(o.code)?e.index.showToast({title:o.message,icon:"none"}):this.showDisabledModal=!0},showRegisterTip(){e.routeTo("/pages/register-phone/index")}}};if(!Array){e.resolveComponent("guide-dialog")()}Math;const t=e._export_sfc(n,[["render",function(n,t,i,d,s,r){return e.e({a:o._imports_0$1,b:o._imports_0,c:s.phone,d:e.o(e=>s.phone=e.detail.value,"63"),e:o._imports_1,f:s.code,g:e.o(e=>s.code=e.detail.value,"7d"),h:e.t(r.codeText),i:s.codeSending||s.countdown>0,j:e.o((...e)=>r.sendCode&&r.sendCode(...e),"dc"),k:s.agreed},(s.agreed,{}),{l:s.agreed?1:"",m:e.o(e=>r.openAgreement("user"),"92"),n:e.o(e=>r.openAgreement("service"),"db"),o:e.o((...e)=>r.toggleAgreement&&r.toggleAgreement(...e),"e8"),p:e.t(s.loginLoading?"登录中...":"登录"),q:!r.canLogin||s.loginLoading?1:"",r:s.loginLoading,s:e.o((...e)=>r.handleLogin&&r.handleLogin(...e),"a9"),t:e.o((...e)=>r.showRegisterTip&&r.showRegisterTip(...e),"14"),v:e.o(r.confirmAgreement,"cd"),w:e.o(e=>s.showAgreementModal=e,"e1"),x:e.p({title:"提示",content:"请确认已同意《用户协议》和《讲解服务合作协议》",visible:s.showAgreementModal}),y:e.o(e=>s.showDisabledModal=e,"8c"),z:e.p({title:"账号已禁用",content:"您的账号已被禁用,暂时无法登录。如有疑问,请联系后台工作人员。","confirm-text":"我知道了","show-cancel":!1,visible:s.showDisabledModal})})}]]);wx.createPage(t); |
| | |
| | | data() { |
| | | return { |
| | | phone: '', |
| | | code: '123456', |
| | | code: '', |
| | | countdown: 0, |
| | | countdownTimer: null, |
| | | codeSending: false, |