2 lines
3.1 KiB
JavaScript
2 lines
3.1 KiB
JavaScript
"use strict";var e=(e,o,t)=>new Promise(((a,s)=>{var n=e=>{try{u(t.next(e))}catch(o){s(o)}},r=e=>{try{u(t.throw(e))}catch(o){s(o)}},u=e=>e.done?a(e.value):Promise.resolve(e.value).then(n,r);u((t=t.apply(e,o)).next())}));const o=require("../../../../../common/vendor.js"),t=require("../../index.js"),a=require("../../hooks/useModal.js");if(!Array){o.resolveComponent("su-popup")()}Math||(s+n+r+u+l+p+(()=>"../../ui/su-popup/su-popup.js"))();const s=()=>"./components/account-login.js",n=()=>"./components/sms-login.js",r=()=>"./components/reset-password.js",u=()=>"./components/change-mobile.js",l=()=>"./components/change-password.js",p=()=>"./components/mp-authorization.js",i={__name:"s-auth-modal",setup(s){o.computed((()=>t.sheep.$store("app").info));const n=t.sheep.$store("modal"),r=o.computed((()=>n.auth)),u=o.reactive({protocol:!1}),l=o.ref(!1);function p(){u.protocol=!u.protocol}function i(e){a.closeAuthModal(),t.sheep.$router.go("/modules/mall/public/richtext",{title:e})}function c(e){l.value=e,setTimeout((()=>{l.value=!1}),1e3)}const h=o=>e(this,null,(function*(){if(!u.protocol)return l.value=!0,setTimeout((()=>{l.value=!1}),1e3),void t.sheep.$helper.toast("请勾选同意");(yield t.sheep.$platform.useProvider(o).login())&&(a.closeAuthModal(),a.showAuthModal("mpAuthorization"))})),m=o=>e(this,null,(function*(){if("getPhoneNumber:ok"!==o.detail.errMsg)return void t.sheep.$helper.toast("快捷登录失败");(yield t.sheep.$platform.useProvider().mobileLogin(o.detail))&&a.closeAuthModal()}));return(e,s)=>o.e({a:"accountLogin"===r.value},"accountLogin"===r.value?{b:o.o(c),c:o.p({agreeStatus:u.protocol})}:{},{d:"smsLogin"===r.value},"smsLogin"===r.value?{e:o.o(c),f:o.p({agreeStatus:u.protocol})}:{},{g:"resetPassword"===r.value},(r.value,{}),{h:"changeMobile"===r.value},(r.value,{}),{i:"changePassword"===r.value},(r.value,{}),{j:"mpAuthorization"===r.value},(r.value,{}),{k:["accountLogin","smsLogin"].includes(r.value)},["accountLogin","smsLogin"].includes(r.value)?o.e({l:"WechatMiniProgram"===o.unref(t.sheep).$platform.name},"WechatMiniProgram"===o.unref(t.sheep).$platform.name?{m:o.o(m)}:{},{n:["WechatOfficialAccount","WechatMiniProgram","App"].includes(o.unref(t.sheep).$platform.name)&&o.unref(t.sheep).$platform.isWechatInstalled},["WechatOfficialAccount","WechatMiniProgram","App"].includes(o.unref(t.sheep).$platform.name)&&o.unref(t.sheep).$platform.isWechatInstalled?{o:o.unref(t.sheep).$url.static("/static/img/shop/platform/wechat.png"),p:o.o((e=>h("wechat")))}:{},{q:"ios"===o.unref(t.sheep).$platform.os&&"App"===o.unref(t.sheep).$platform.name},"ios"===o.unref(t.sheep).$platform.os&&"App"===o.unref(t.sheep).$platform.name?{r:o.unref(t.sheep).$url.static("/static/img/shop/platform/apple.png"),s:o.o((e=>h("apple")))}:{}):{},{t:["accountLogin","smsLogin"].includes(r.value)},["accountLogin","smsLogin"].includes(r.value)?{v:u.protocol,w:o.o(p),x:o.o((e=>i("用户协议"))),y:o.o((e=>i("隐私协议"))),z:o.o(p),A:l.value?1:""}:{},{B:o.o(o.unref(a.closeAuthModal)),C:o.p({show:""!==r.value,round:"10",showClose:!0})})}},c=o._export_sfc(i,[["__scopeId","data-v-4377a86e"]]);wx.createComponent(c);
|