Browse Source

bugfix

master
kola-web 2 weeks ago
parent
commit
08c9c71221
  1. 15
      src/app.ts
  2. 15
      src/pages/index/index.ts
  3. 2
      src/pages/index/index.wxml
  4. 1
      src/pages/my/index.ts
  5. 9
      src/pages/qaFormDetail/index.ts

15
src/app.ts

@ -17,16 +17,15 @@ App<IAppOption>({
globalData: { globalData: {
// dev // dev
// appid:wxc3cdb3c4d4f62cea // appid:wxc3cdb3c4d4f62cea
// url: 'https://m.igg4.hbraas.com', url: 'https://m.igg4.hbraas.com',
// upFileUrl: 'https://m.igg4.hbraas.com/', upFileUrl: 'https://m.igg4.hbraas.com/',
// imageUrl: 'https://m.igg4.hbraas.com/igg4/', imageUrl: 'https://m.igg4.hbraas.com/igg4/',
// pro // pro
// appid:wx346254575bd711a7 // appid:wx346254575bd711a7
url: 'https://m.igg4.hbsaas.com', // url: 'https://m.igg4.hbsaas.com',
upFileUrl: 'https://m.igg4.hbsaas.com/', // upFileUrl: 'https://m.igg4.hbsaas.com/',
imageUrl: 'https://m.igg4.hbsaas.com/igg4/', // imageUrl: 'https://m.igg4.hbsaas.com/igg4/',
//login //login
registrationSource: 0, registrationSource: 0,
registChannel: 0, registChannel: 0,
@ -249,7 +248,7 @@ App<IAppOption>({
verifySys(pub = false) { verifySys(pub = false) {
// 1:患者 2:医生 // 1:患者 2:医生
const { loginType, isLogin, anyWhere } = this.globalData const { loginType, isLogin, anyWhere } = this.globalData
console.log("DEBUGPRINT[229]: app.ts:246: loginType=", loginType) console.log('DEBUGPRINT[229]: app.ts:246: loginType=', loginType)
const pages = getCurrentPages() const pages = getCurrentPages()
const currentPage = pages[pages.length - 1] const currentPage = pages[pages.length - 1]
const url = currentPage.route const url = currentPage.route

15
src/pages/index/index.ts

@ -111,10 +111,21 @@ Page({
updateNextVisitDays(userInfo: any) { updateNextVisitDays(userInfo: any) {
if (userInfo.NextVisitDate) { if (userInfo.NextVisitDate) {
const date = dayjs(userInfo.NextVisitDate) const date = dayjs(userInfo.NextVisitDate)
const diffMs = date.diff(dayjs()) const diffMs = Math.ceil(date.diff(dayjs()) / (24 * 60 * 60 * 1000))
const weekNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] const weekNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
let nextVisitDays = ''
if (diffMs < 0) {
nextVisitDays = '延期'
} else if (diffMs === 0) {
nextVisitDays = '0'
} else if (diffMs > 999) {
nextVisitDays = '999⁺'
} else {
nextVisitDays = String(diffMs)
}
this.setData({ this.setData({
nextVisitDays: diffMs <= 0 ? 0 : Math.ceil(diffMs / (24 * 60 * 60 * 1000)), nextVisitDays,
nextVisitYearPrefix: date.format('YYYY').substring(0, 2), nextVisitYearPrefix: date.format('YYYY').substring(0, 2),
nextVisitYearSuffix: date.format('YYYY').substring(2), nextVisitYearSuffix: date.format('YYYY').substring(2),
nextVisitMonth: date.format('MM'), nextVisitMonth: date.format('MM'),

2
src/pages/index/index.wxml

@ -22,7 +22,7 @@
style="background: url('{{imageUrl}}{{theme === 'DRUG' ? 'bg22' : 'bg15'}}.png?t={{Timestamp}}') no-repeat top center/100%" style="background: url('{{imageUrl}}{{theme === 'DRUG' ? 'bg22' : 'bg15'}}.png?t={{Timestamp}}') no-repeat top center/100%"
> >
<view class="a-num">{{nextVisitDays === 0 ? '今天' : nextVisitDays}}</view> <view class="a-num">{{nextVisitDays === 0 ? '今天' : nextVisitDays}}</view>
<text wx:if="{{nextVisitDays !== 0}}">天</text> <text wx:if="{{nextVisitDays > 0}}">天</text>
</view> </view>
<view class="wrap"> <view class="wrap">
<view class="title"> <view class="title">

1
src/pages/my/index.ts

@ -89,6 +89,7 @@ Page({
url: '?r=igg4/health-question/get-patient-questionnaire', url: '?r=igg4/health-question/get-patient-questionnaire',
data: {}, data: {},
showMsg: false, showMsg: false,
loading: true,
}).then((res: any) => { }).then((res: any) => {
const answers = res.questions || [] const answers = res.questions || []
if (answers.length) { if (answers.length) {

9
src/pages/qaFormDetail/index.ts

@ -35,16 +35,13 @@ Page({
hasData: false, hasData: false,
}, },
onLoad() { onLoad() {},
onShow() {
this.setData({ questions: [], hasData: false })
app.waitLogin({}).then(() => { app.waitLogin({}).then(() => {
this.loadData() this.loadData()
}) })
}, },
onShow() {
if (this.data.questions.length) {
this.loadData()
}
},
loadData() { loadData() {
wx.ajax({ wx.ajax({

Loading…
Cancel
Save