|
|
|
|
@ -5,6 +5,7 @@ Page({
@@ -5,6 +5,7 @@ Page({
|
|
|
|
|
data: { |
|
|
|
|
popupShow: false, |
|
|
|
|
popupType: 'popup4', // 登录失败弹窗
|
|
|
|
|
// popupType: 'popup11', // 隐私协议二级确认弹窗
|
|
|
|
|
popupParams: { |
|
|
|
|
close: true, |
|
|
|
|
} as any, |
|
|
|
|
@ -28,7 +29,8 @@ Page({
@@ -28,7 +29,8 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getCode() { |
|
|
|
|
if (timer) return |
|
|
|
|
if (timer) |
|
|
|
|
return |
|
|
|
|
const mobile = this.data.mobile |
|
|
|
|
if (!mobile) { |
|
|
|
|
wx.showToast({ |
|
|
|
|
@ -78,21 +80,24 @@ Page({
@@ -78,21 +80,24 @@ Page({
|
|
|
|
|
check1: !this.data.check1, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleDocRule() { |
|
|
|
|
handleDocRule(customPhone = false) { |
|
|
|
|
const { check1 } = this.data |
|
|
|
|
return new Promise((resolve) => { |
|
|
|
|
if (check1) { |
|
|
|
|
return resolve(true) |
|
|
|
|
} |
|
|
|
|
wx.showToast({ |
|
|
|
|
title: '请同意相关协议', |
|
|
|
|
icon: 'none', |
|
|
|
|
this.setData({ |
|
|
|
|
popupShow: true, |
|
|
|
|
popupType: 'popup11', |
|
|
|
|
popupParams: { |
|
|
|
|
close: false, |
|
|
|
|
customPhone, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
async handleSubmit() { |
|
|
|
|
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorLogin' }) |
|
|
|
|
await this.handleDocRule() |
|
|
|
|
const { mobile, code } = this.data |
|
|
|
|
if (!mobile) { |
|
|
|
|
wx.showToast({ |
|
|
|
|
@ -108,6 +113,7 @@ Page({
@@ -108,6 +113,7 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
await this.handleDocRule(true) |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'POST', |
|
|
|
|
url: '?r=xd/login/reg-login', |
|
|
|
|
@ -123,7 +129,8 @@ Page({
@@ -123,7 +129,8 @@ Page({
|
|
|
|
|
.catch((err) => { |
|
|
|
|
if (err.data.code == 100) { |
|
|
|
|
this.handleShowPopup() |
|
|
|
|
} else if (err.data.msg) { |
|
|
|
|
} |
|
|
|
|
else if (err.data.msg) { |
|
|
|
|
wx.showToast({ |
|
|
|
|
title: err.data.msg, |
|
|
|
|
icon: 'none', |
|
|
|
|
@ -138,6 +145,7 @@ Page({
@@ -138,6 +145,7 @@ Page({
|
|
|
|
|
handleWxSubmit(e: WechatMiniprogram.CustomEvent) { |
|
|
|
|
app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorQuickLogin' }) |
|
|
|
|
const { iv, encryptedData } = e.detail |
|
|
|
|
this.handlePopupCancel() |
|
|
|
|
if (iv && encryptedData) { |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'POST', |
|
|
|
|
@ -154,7 +162,8 @@ Page({
@@ -154,7 +162,8 @@ Page({
|
|
|
|
|
.catch((err) => { |
|
|
|
|
if (err.data.code == 100) { |
|
|
|
|
this.handleShowPopup() |
|
|
|
|
} else if (err.data.msg) { |
|
|
|
|
} |
|
|
|
|
else if (err.data.msg) { |
|
|
|
|
wx.showToast({ |
|
|
|
|
title: err.data.msg, |
|
|
|
|
icon: 'none', |
|
|
|
|
@ -170,10 +179,12 @@ Page({
@@ -170,10 +179,12 @@ Page({
|
|
|
|
|
wx.reLaunch({ |
|
|
|
|
url: '/pages/home/index', |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.handleShowPopup() |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.handleShowPopup() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
@ -210,6 +221,17 @@ Page({
@@ -210,6 +221,17 @@ Page({
|
|
|
|
|
url: '/doc/pages/doc1/index', |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handlePopupOk() { |
|
|
|
|
const { popupType } = this.data |
|
|
|
|
if (popupType == 'popup11') { |
|
|
|
|
this.setData({ |
|
|
|
|
check1: true, |
|
|
|
|
popupShow: false, |
|
|
|
|
}) |
|
|
|
|
this.handleSubmit() |
|
|
|
|
this.handlePopupCancel() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handlePopupCancel() { |
|
|
|
|
this.setData({ |
|
|
|
|
popupShow: false, |
|
|
|
|
|