|
|
|
@ -3,12 +3,14 @@ const app = getApp<IAppOption>()
@@ -3,12 +3,14 @@ const app = getApp<IAppOption>()
|
|
|
|
|
Page({ |
|
|
|
|
data: { |
|
|
|
|
popupShow: false, |
|
|
|
|
popupType: '', |
|
|
|
|
// popupType: 'selectIdentity', // 选择您的身份
|
|
|
|
|
// popupType: 'bindDoctorReject', // 绑定失败
|
|
|
|
|
// popupType: 'bindDoctor', // 绑定成功
|
|
|
|
|
// popupType: 'bindDoctorQuestion', // 为什么绑定医生
|
|
|
|
|
// popupType: 'conformBindDoctorQuestion', // 确认绑定曾经扫码医生
|
|
|
|
|
ptrueopupType: 'conformBindDoctorConform', // 注册后绑定医生码
|
|
|
|
|
// ptrueopupType: 'conformBindDoctorConform', // 注册后绑定医生码
|
|
|
|
|
// popupType: 'publicCard', // 关注公众号
|
|
|
|
|
popupParams: {}, |
|
|
|
|
|
|
|
|
|
doctorList: [], |
|
|
|
@ -32,9 +34,12 @@ Page({
@@ -32,9 +34,12 @@ Page({
|
|
|
|
|
guide: 0, |
|
|
|
|
guideShow: false, |
|
|
|
|
guideList: ['1', '2', '3'], |
|
|
|
|
|
|
|
|
|
isPublicCard: false, |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
app.waitLogin({ type: 1 }).then(() => { |
|
|
|
|
app.mpBehavior({ PageName: 'PG_PATHOME' }) |
|
|
|
|
app.getUserInfo(1).then((userInfo) => { |
|
|
|
|
this.setData({ |
|
|
|
|
userInfo, |
|
|
|
@ -47,6 +52,7 @@ Page({
@@ -47,6 +52,7 @@ Page({
|
|
|
|
|
this.getKnowledge() |
|
|
|
|
this.getBindDoctorList() |
|
|
|
|
this.getTeratmentInfo() |
|
|
|
|
this.getPublicCard() |
|
|
|
|
const waitBindDoctorId = app.globalData.waitBindDoctorId |
|
|
|
|
if (waitBindDoctorId) { |
|
|
|
|
this.handleWaitBindDoctor(waitBindDoctorId) |
|
|
|
@ -57,12 +63,26 @@ Page({
@@ -57,12 +63,26 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.handleSwiperChange({ detail: { current: 0 } }) |
|
|
|
|
if (this.data.isLoad) { |
|
|
|
|
this.getBindDoctorList() |
|
|
|
|
this.getTeratmentInfo() |
|
|
|
|
this.handleSwiperChange({ detail: { current: this.data.progress } }) |
|
|
|
|
this.getPublicCard() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getPublicCard() { |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'GET', |
|
|
|
|
url: '?r=wtx/popup/get-user-record', |
|
|
|
|
data: { |
|
|
|
|
type: 2, |
|
|
|
|
}, |
|
|
|
|
}).then((res) => { |
|
|
|
|
this.setData({ |
|
|
|
|
isPublicCard: res == 2, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getBindDoctorList() { |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'GET', |
|
|
|
@ -84,6 +104,7 @@ Page({
@@ -84,6 +104,7 @@ Page({
|
|
|
|
|
treatment: res, |
|
|
|
|
progress: res.period - 1, |
|
|
|
|
}) |
|
|
|
|
this.handleSwiperChange({ detail: { current: res.period - 1 } }) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getKnowledge() { |
|
|
|
@ -97,12 +118,53 @@ Page({
@@ -97,12 +118,53 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onChooseAvatar(e) { |
|
|
|
|
const { avatarUrl } = e.detail |
|
|
|
|
const url = `${app.globalData.upFileUrl}?r=file-service/upload-img` |
|
|
|
|
wx.showLoading({ |
|
|
|
|
title: '上传中', |
|
|
|
|
}) |
|
|
|
|
wx.uploadFile({ |
|
|
|
|
url, |
|
|
|
|
filePath: avatarUrl, |
|
|
|
|
name: 'file', |
|
|
|
|
success: (res) => { |
|
|
|
|
const data = JSON.parse(res.data) |
|
|
|
|
const avatarUrl = data.data.Url |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'POST', |
|
|
|
|
url: '?r=wtx/user/update-avatar', |
|
|
|
|
data: { |
|
|
|
|
Avatar: avatarUrl, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
wx.hideLoading() |
|
|
|
|
wx.showToast({ |
|
|
|
|
title: '头像更新成功!', |
|
|
|
|
icon: 'none', |
|
|
|
|
}) |
|
|
|
|
this.setData({ |
|
|
|
|
'userInfo.Avatar': avatarUrl, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
wx.hideLoading() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
fail() { |
|
|
|
|
wx.hideLoading() |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleInfoMore() { |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PATKNOWLEDGEBASECARDALL' }) |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: '/patient/pages/knowledge/index', |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleInfoDetail(e) { |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PATKNOWLEDGEBASECARD' }) |
|
|
|
|
const { index } = e.currentTarget.dataset |
|
|
|
|
const params = this.data.knowledgeList[index] |
|
|
|
|
if (params.Type == 1) { |
|
|
|
@ -120,7 +182,6 @@ Page({
@@ -120,7 +182,6 @@ Page({
|
|
|
|
|
query.select(`#process${e.detail.current}`).boundingClientRect() |
|
|
|
|
query.exec((res) => { |
|
|
|
|
this.setData({ |
|
|
|
|
progress: e.detail.current, |
|
|
|
|
swiperHeight: res[0].height + 22, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
@ -183,37 +244,59 @@ Page({
@@ -183,37 +244,59 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleBindDoctor() { |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PATSCANBIND' }) |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: '/patient/pages/bindDoctor/index', |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleProgress(e: any) { |
|
|
|
|
const { index } = e.currentTarget.dataset |
|
|
|
|
this.setData({ |
|
|
|
|
progress: index, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleAskPatient() { |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PATASKDOCTOR' }) |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: '/patient/pages/askPatient/index', |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleCourse() { |
|
|
|
|
const { progress } = this.data |
|
|
|
|
handleCourse(e) { |
|
|
|
|
const { current } = e.currentTarget.dataset |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PATTREATMENTPROCESS' }) |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: `/patient/pages/course/index?current=${progress}`, |
|
|
|
|
url: `/patient/pages/course/index?current=${current}`, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleColtStat() { |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PATCLOTTINGFACTORCARD' }) |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: '/patient/pages/coltStat/index', |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleBleed() { |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PATBLEEDINGCARD' }) |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: '/patient/pages/blood/index', |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handlePublicCard() { |
|
|
|
|
this.setData({ |
|
|
|
|
popupShow: true, |
|
|
|
|
popupType: 'publicCard', |
|
|
|
|
popupParams: { |
|
|
|
|
close: true, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
this.handleClosePublicCard() |
|
|
|
|
}, |
|
|
|
|
handleClosePublicCard() { |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'POST', |
|
|
|
|
url: '?r=wtx/popup/add-visit-record', |
|
|
|
|
data: { |
|
|
|
|
type: 2, |
|
|
|
|
}, |
|
|
|
|
}).then(() => { |
|
|
|
|
this.setData({ |
|
|
|
|
isPublicCard: false, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handlePopupOk() { |
|
|
|
|
const { popupType, userInfo } = this.data |
|
|
|
|
if (popupType === 'bindDoctorReject') { |
|
|
|
@ -244,6 +327,13 @@ Page({
@@ -244,6 +327,13 @@ Page({
|
|
|
|
|
data: {}, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if (popupType === 'publicCard') { |
|
|
|
|
this.setData({ |
|
|
|
|
popupShow: false, |
|
|
|
|
popupType: '', |
|
|
|
|
popupParams: {}, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.setData({ |
|
|
|
|
popupShow: false, |
|
|
|
|
popupType: '', |
|
|
|
|