|
@@ -75,9 +75,7 @@ Page({
|
|
|
|
|
|
onShow () {
|
|
onShow () {
|
|
if (!this.data.isFirstGetCount) {
|
|
if (!this.data.isFirstGetCount) {
|
|
- this.getAccountNmberFn()
|
|
|
|
- this.appointmentListFn()
|
|
|
|
- this.getAppGetConfigImg()
|
|
|
|
|
|
+ this.initMyPage()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -94,22 +92,28 @@ Page({
|
|
appHeadImg: headImg,
|
|
appHeadImg: headImg,
|
|
appUserName: userName
|
|
appUserName: userName
|
|
})
|
|
})
|
|
- this.getAccountNmberFn()
|
|
|
|
- this.appointmentListFn()
|
|
|
|
- this.getAppGetConfigImg()
|
|
|
|
|
|
+ this.initMyPage()
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ async initMyPage () {
|
|
|
|
+ await this.getAccountNmberFn()
|
|
|
|
+ await this.appointmentListFn()
|
|
|
|
+ await this.getAppGetConfigImg()
|
|
},
|
|
},
|
|
|
|
|
|
getAppGetConfigImg() {
|
|
getAppGetConfigImg() {
|
|
const that = this
|
|
const that = this
|
|
wx.showNavigationBarLoading()
|
|
wx.showNavigationBarLoading()
|
|
// 类型 【1.关于我的 2.用户协议 3.我的 4.实体卡兑换说明 】
|
|
// 类型 【1.关于我的 2.用户协议 3.我的 4.实体卡兑换说明 】
|
|
- appGetConfigImg({
|
|
|
|
- 'imgType': '3'
|
|
|
|
- }).then(configRes => {
|
|
|
|
- wx.hideNavigationBarLoading()
|
|
|
|
- console.log(configRes, 'configRes my')
|
|
|
|
- that.setData({
|
|
|
|
- imageList: configRes.data || []
|
|
|
|
|
|
+ return new Promise((reslove,rej) => {
|
|
|
|
+ appGetConfigImg({
|
|
|
|
+ 'imgType': '3'
|
|
|
|
+ }).then(configRes => {
|
|
|
|
+ wx.hideNavigationBarLoading()
|
|
|
|
+ that.setData({
|
|
|
|
+ imageList: configRes.data || []
|
|
|
|
+ })
|
|
|
|
+ reslove(configRes)
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -155,18 +159,21 @@ Page({
|
|
// 获取用户预约信息
|
|
// 获取用户预约信息
|
|
appointmentListFn () {
|
|
appointmentListFn () {
|
|
wx.showNavigationBarLoading()
|
|
wx.showNavigationBarLoading()
|
|
- appointmentList({
|
|
|
|
- status: 1,
|
|
|
|
- currentPage: 1
|
|
|
|
- }).then(res => {
|
|
|
|
- wx.hideNavigationBarLoading()
|
|
|
|
- if (res.data.vos.length !== 0) {
|
|
|
|
- app.globalData.hasAppointment = true
|
|
|
|
- } else {
|
|
|
|
- app.globalData.hasAppointment = false
|
|
|
|
- }
|
|
|
|
- }).catch(e => {
|
|
|
|
- wx.hideNavigationBarLoading()
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ appointmentList({
|
|
|
|
+ status: 1,
|
|
|
|
+ currentPage: 1
|
|
|
|
+ }).then(res => {
|
|
|
|
+ wx.hideNavigationBarLoading()
|
|
|
|
+ if (res.data.vos.length !== 0) {
|
|
|
|
+ app.globalData.hasAppointment = true
|
|
|
|
+ } else {
|
|
|
|
+ app.globalData.hasAppointment = false
|
|
|
|
+ }
|
|
|
|
+ resolve(res)
|
|
|
|
+ }).catch(e => {
|
|
|
|
+ wx.hideNavigationBarLoading()
|
|
|
|
+ })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
@@ -174,15 +181,18 @@ Page({
|
|
getAccountNmberFn () {
|
|
getAccountNmberFn () {
|
|
var that = this
|
|
var that = this
|
|
wx.showNavigationBarLoading()
|
|
wx.showNavigationBarLoading()
|
|
- getAccountNmber({}).then(res => {
|
|
|
|
- wx.hideNavigationBarLoading()
|
|
|
|
- that.setData({
|
|
|
|
- count: res.data,
|
|
|
|
- isFirstGetCount: false
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ getAccountNmber({}).then(res => {
|
|
|
|
+ wx.hideNavigationBarLoading()
|
|
|
|
+ that.setData({
|
|
|
|
+ count: res.data,
|
|
|
|
+ isFirstGetCount: false
|
|
|
|
+ })
|
|
|
|
+ app.globalData.useNumber = res.data
|
|
|
|
+ resolve(res)
|
|
|
|
+ }).catch(e => {
|
|
|
|
+ wx.hideNavigationBarLoading()
|
|
})
|
|
})
|
|
- app.globalData.useNumber = res.data
|
|
|
|
- }).catch(e => {
|
|
|
|
- wx.hideNavigationBarLoading()
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|