Browse Source

2.0bug处理

2.0
kola-web 2 weeks ago
parent
commit
34eefab0bb
  1. 34
      src/app.ts
  2. 1
      src/components/popup/index.scss
  3. 17
      src/components/popup/index.wxml
  4. 2
      src/components/popupDoctor/index.scss
  5. 2
      src/doctor/pages/changeTel/index.wxml
  6. 2
      src/doctor/pages/login/index.ts
  7. 2
      src/doctor/pages/my/index.ts
  8. BIN
      src/images/icon22.png
  9. 6
      src/pages/applyFrom/index.wxml
  10. 2
      src/pages/my/index.ts
  11. 6
      src/pages/start/index.ts
  12. 6
      src/patient/pages/askPatient/index.scss
  13. 19
      src/patient/pages/askPatient/index.ts
  14. 2
      src/patient/pages/askPatient/index.wxml
  15. 4
      src/patient/pages/bindDoctor/index.ts
  16. 2
      src/patient/pages/changeTel/index.wxml
  17. 7
      src/patient/pages/doctorList/index.ts
  18. 2
      src/patient/pages/doctorList/index.wxml
  19. 3
      src/patient/pages/entryInfo/index.json
  20. 3
      src/patient/pages/entryInfo/index.ts
  21. 11
      src/patient/pages/entryInfo/index.wxml
  22. 3
      src/patient/pages/family/index.scss
  23. 2
      src/patient/pages/familyList/index.scss
  24. 2
      src/patient/pages/familyList/index.ts
  25. 6
      src/patient/pages/familyList/index.wxml
  26. 14
      src/patient/pages/familyScan/index.ts
  27. 4
      src/patient/pages/familyScan/index.wxml
  28. 9
      src/patient/pages/index/index.scss
  29. 10
      src/patient/pages/index/index.ts
  30. 13
      src/patient/pages/index/index.wxml
  31. 4
      src/patient/pages/login/index.json
  32. 5
      src/patient/pages/login/index.scss
  33. 17
      src/patient/pages/login/index.ts
  34. 18
      src/patient/pages/login/index.wxml
  35. 2
      src/patient/pages/my/index.ts
  36. 12
      src/patient/pages/my/index.wxml
  37. 9
      src/patient/pages/userInfo/index.ts
  38. 2
      typings/index.d.ts

34
src/app.ts

@ -115,20 +115,30 @@ App<IAppOption>({
}) })
}, },
checkLoginType(type: 0 | 1 | 2) { checkLoginType(type: 0 | 1 | 2) {
const { loginType, isLogin } = this.globalData.initLoginInfo const { loginType, isLogin, isReg } = this.globalData.initLoginInfo
if (!isLogin) {
if (type === 0) { if (type === 0) {
return true return true
} else { }
if (isLogin !== 1) {
wx.reLaunch({ wx.reLaunch({
url: '/pages/index/index', url: '/pages/index/index',
}) })
}
return false return false
} }
if (loginType === type) { if (isReg !== 1) {
return true const typePageUrl = {
1: '/patient/pages/entryInfo/index',
2: '/doctor/pages/login/index',
}[loginType as 1 | 2]
wx.reLaunch({
url: typePageUrl,
})
return false
} }
if (loginType !== type) {
const typePageUrl = { const typePageUrl = {
1: '/patient/pages/index/index', 1: '/patient/pages/index/index',
2: '/doctor/pages/index/index', 2: '/doctor/pages/index/index',
@ -136,7 +146,9 @@ App<IAppOption>({
wx.reLaunch({ wx.reLaunch({
url: typePageUrl, url: typePageUrl,
}) })
return false }
return true
}, },
mpBehavior(data: { PageName: string }) { mpBehavior(data: { PageName: string }) {
wx.ajax({ wx.ajax({
@ -150,11 +162,11 @@ App<IAppOption>({
}) })
}, },
getUserInfo(type: 1 | 2 | 3 = 1) { getUserInfo(type: 0 | 1 | 2 = 0) {
const url = { const url = {
1: '?r=wtx/user/userinfo', 0: '?r=wtx/user/userinfo',
2: '?r=wtx/account/info', 1: '?r=wtx/account/info',
3: '?r=wtx/doctor/account/info', 2: '?r=wtx/doctor/account/info',
}[type] }[type]
return wx.ajax({ return wx.ajax({
method: 'GET', method: 'GET',

1
src/components/popup/index.scss

@ -898,6 +898,7 @@
color: rgba(161, 164, 172, 1); color: rgba(161, 164, 172, 1);
} }
.tag { .tag {
vertical-align: 2rpx;
display: inline-block; display: inline-block;
font-size: 20rpx; font-size: 20rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);

17
src/components/popup/index.wxml

@ -235,7 +235,7 @@
</view> </view>
<view class="footer"> <view class="footer">
<view class="cancel" bind:tap="handleCancel">取消</view> <view class="cancel" bind:tap="handleCancel">取消</view>
<view class="submit" bind:tap="handleOk">提交</view> <view class="submit" bind:tap="handleOk">确定</view>
</view> </view>
</view> </view>
</view> </view>
@ -256,15 +256,12 @@
<view class="container"> <view class="container">
<image class="title" src="{{imageUrl}}title10.png?t={{Timestamp}}"></image> <image class="title" src="{{imageUrl}}title10.png?t={{Timestamp}}"></image>
<view class="card"> <view class="card">
<image <image class="avatar" src="{{params.avatar}}"></image>
class="avatar"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
<view class="wrap"> <view class="wrap">
<view class="name">王青</view> <view class="name">{{params.name}}</view>
<view class="hostipal"> <view class="hostipal">
<view class="content">北京积水潭医院龙泽院区</view> <view class="content">{{params.hostipal}}</view>
<view class="tag">三甲</view> <view class="tag">{{params.className}}{{params.levelName}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -296,8 +293,8 @@
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<view class="cancel">取消</view> <view class="cancel" bind:tap="handleCancel">取消</view>
<view class="submit">确定</view> <view class="submit" bind:tap="handleOk">确定</view>
</view> </view>
</view> </view>
</view> </view>

2
src/components/popupDoctor/index.scss

@ -56,7 +56,7 @@
.col { .col {
.content { .content {
margin-right: 8rpx; margin-right: 8rpx;
display: inline-block; display: inline;
font-size: 32rpx; font-size: 32rpx;
color: rgba(1, 1, 5, 1); color: rgba(1, 1, 5, 1);
max-height: 30vh; max-height: 30vh;

2
src/doctor/pages/changeTel/index.wxml

@ -26,5 +26,5 @@
</view> </view>
</view> </view>
</view> </view>
<view class="login-out">提交</view> <view class="login-out" bind:tap="handleSubmit">提交</view>
</view> </view>

2
src/doctor/pages/login/index.ts

@ -100,7 +100,7 @@ Page({
} }
}, },
submitCallback() { submitCallback() {
app.getUserInfo(3).then(() => { app.getUserInfo(2).then(() => {
wx.reLaunch({ wx.reLaunch({
url: `/doctor/pages/index/index`, url: `/doctor/pages/index/index`,
}) })

2
src/doctor/pages/my/index.ts

@ -11,7 +11,7 @@ Page({
}, },
onLoad() { onLoad() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.getUserInfo(3).then((userInfo) => { app.getUserInfo(2).then((userInfo) => {
this.setData({ this.setData({
userInfo, userInfo,
// 数字变红 // 数字变红

BIN
src/images/icon22.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

6
src/pages/applyFrom/index.wxml

@ -24,7 +24,7 @@
class="input" class="input"
placeholder-class="place-input" placeholder-class="place-input"
type="text" type="text"
placeholder="如何称呼您" placeholder="如何称呼{{Relation == 1 ? '的' : '患者'}}"
/> />
</view> </view>
</view> </view>
@ -34,7 +34,7 @@
<picker mode="date" model:value="{{BirthMonth}}" fields="month"> <picker mode="date" model:value="{{BirthMonth}}" fields="month">
<view class="picker"> <view class="picker">
<view class="picker-content"> <view class="picker-content">
<view class="picker-text" data-place="请选择您的出生月">{{BirthMonth}}</view> <view class="picker-text" data-place="请选择{{Relation == 1 ? '的' : '患者'}}的出生月">{{BirthMonth}}</view>
<van-icon name="arrow-down" color="rgba(51,51,51,0.73)" /> <van-icon name="arrow-down" color="rgba(51,51,51,0.73)" />
</view> </view>
</view> </view>
@ -48,7 +48,7 @@
<view class="picker"> <view class="picker">
<view class="picker-content"> <view class="picker-content">
<!-- prettier-ignore --> <!-- prettier-ignore -->
<view class="picker-text" data-place="请选择您的所在地区">{{ProvinceName ? ProvinceName+ '/' : ProvinceName }}{{CityName}}</view> <view class="picker-text" data-place="请选择{{Relation == 1 ? '的' : '患者'}}的所在地区">{{ProvinceName ? ProvinceName+ '/' : ProvinceName }}{{CityName}}</view>
<van-icon name="arrow-down" color="rgba(51,51,51,0.73)" /> <van-icon name="arrow-down" color="rgba(51,51,51,0.73)" />
</view> </view>
</view> </view>

2
src/pages/my/index.ts

@ -8,7 +8,7 @@ Page({
showPatient: false, showPatient: false,
}, },
onLoad() { onShow() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'BTN_MY_NAV' }) app.mpBehavior({ PageName: 'BTN_MY_NAV' })
app.getUserInfo().then((userInfo) => { app.getUserInfo().then((userInfo) => {

6
src/pages/start/index.ts

@ -16,9 +16,15 @@ Page({
}) })
} }
if (initLoginInfo.loginType === 1) { if (initLoginInfo.loginType === 1) {
if (initLoginInfo.isReg === 1) {
wx.reLaunch({ wx.reLaunch({
url: '/patient/pages/index/index', url: '/patient/pages/index/index',
}) })
return
}
wx.reLaunch({
url: '/patient/pages/entryInfo/login',
})
} }
if (initLoginInfo.loginType === 2) { if (initLoginInfo.loginType === 2) {
wx.reLaunch({ wx.reLaunch({

6
src/patient/pages/askPatient/index.scss

@ -45,14 +45,20 @@ page {
} }
.name { .name {
margin: -20rpx auto 0; margin: -20rpx auto 0;
padding: 0 0.5em;
width: 116rpx; width: 116rpx;
height: 36rpx; height: 36rpx;
line-height: 36rpx; line-height: 36rpx;
font-size: 24rpx; font-size: 24rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
text-align: center; text-align: center;
box-sizing: border-box;
background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%);
border-radius: 35rpx 35rpx 35rpx 35rpx; border-radius: 35rpx 35rpx 35rpx 35rpx;
max-width: 5em;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
} }
} }

19
src/patient/pages/askPatient/index.ts

@ -56,7 +56,7 @@ Page({
userInfo: {}, userInfo: {},
}, },
onLoad() { onLoad() {
app.waitLogin().then(() => { app.waitLogin({ type: 1 }).then(() => {
app.mpBehavior({ PageName: 'PG_FAQ' }) app.mpBehavior({ PageName: 'PG_FAQ' })
app.getUserInfo().then((userInfo) => { app.getUserInfo().then((userInfo) => {
this.setData({ this.setData({
@ -68,6 +68,11 @@ Page({
this.getMessageList() this.getMessageList()
}) })
}, },
onShow() {
if (app.globalData.loginState) {
this.getBindDoctorList()
}
},
getBindDoctorList() { getBindDoctorList() {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
@ -266,6 +271,13 @@ Page({
messageList, messageList,
}) })
}, },
handleSendDate() {
this.setData({
popupShow: true,
popupType: 'selectDoctor',
popupParams: {},
})
},
handleQuestionTab(e) { handleQuestionTab(e) {
const { index } = e.currentTarget.dataset const { index } = e.currentTarget.dataset
this.setData({ this.setData({
@ -288,6 +300,11 @@ Page({
url: '/patient/pages/doctorList/index', url: '/patient/pages/doctorList/index',
}) })
}, },
handlePopupCancel() {
this.setData({
popupShow: false,
})
},
handleBack() { handleBack() {
wx.navigateBack() wx.navigateBack()
}, },

2
src/patient/pages/askPatient/index.wxml

@ -124,7 +124,7 @@
<image class="icon" src="{{imageUrl}}icon11.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon11.png?t={{Timestamp}}"></image>
我要提问 我要提问
</view> </view>
<view class="title"> <view class="title" catch:tap="handleSendDate">
<image class="icon" src="{{imageUrl}}icon86.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon86.png?t={{Timestamp}}"></image>
出诊时间 出诊时间
</view> </view>

4
src/patient/pages/bindDoctor/index.ts

@ -73,6 +73,10 @@ Page({
}) })
}, },
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data
if (popupType === 'bindDoctor') {
wx.navigateBack()
}
this.handlePopupCancel() this.handlePopupCancel()
}, },
handlePopupCancel() { handlePopupCancel() {

2
src/patient/pages/changeTel/index.wxml

@ -26,5 +26,5 @@
</view> </view>
</view> </view>
</view> </view>
<view class="login-out">提交</view> <view class="login-out" bind:tap="handleSubmit">提交</view>
</view> </view>

7
src/patient/pages/doctorList/index.ts

@ -3,6 +3,12 @@ const app = getApp<IAppOption>()
Page({ Page({
data: { data: {
doctorList: [], doctorList: [],
pagination: {
page: 1,
pages: 1,
count: 1,
},
}, },
onShow() { onShow() {
app.waitLogin({ type: 1 }).then(() => { app.waitLogin({ type: 1 }).then(() => {
@ -17,6 +23,7 @@ Page({
}).then((res) => { }).then((res) => {
this.setData({ this.setData({
doctorList: res, doctorList: res,
['pagination.count']: res.length,
}) })
}) })
}, },

2
src/patient/pages/doctorList/index.wxml

@ -20,5 +20,7 @@
<view class="content">{{item.introduce}}</view> <view class="content">{{item.introduce}}</view>
</view> </view>
<pagination pagination="{{pagination}}"></pagination>
<image class="add" src="{{imageUrl}}icon53.png?t={{Timestamp}}" bind:tap="handleAdd"></image> <image class="add" src="{{imageUrl}}icon53.png?t={{Timestamp}}" bind:tap="handleAdd"></image>
</view> </view>

3
src/patient/pages/entryInfo/index.json

@ -1,6 +1,7 @@
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"pickerArea": "/components/pickerArea/index" "pickerArea": "/components/pickerArea/index",
"navbar": "/components/navbar/index"
} }
} }

3
src/patient/pages/entryInfo/index.ts

@ -95,6 +95,9 @@ Page({
}) })
}) })
}, },
handleBack() {
wx.navigateBack()
},
}) })
export {} export {}

11
src/patient/pages/entryInfo/index.wxml

@ -1,3 +1,6 @@
<navbar fixed title="" custom-style="background:{{background}}" back>
<van-icon name="arrow-left" slot="left" size="18px" color="#000" bind:tap="handleBack" />
</navbar>
<view <view
class="page" class="page"
style="padding-top: {{pageTop + 60}}px;background:url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 976rpx;" style="padding-top: {{pageTop + 60}}px;background:url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 976rpx;"
@ -25,14 +28,14 @@
model:value="{{name}}" model:value="{{name}}"
placeholder-class="place-input" placeholder-class="place-input"
type="text" type="text"
placeholder="请输入您的姓名" placeholder="请输入{{relationType == 1 ? '' : '亲友'}}的姓名"
/> />
</view> </view>
</view> </view>
<view class="form-row"> <view class="form-row">
<picker mode="date" model:value="{{birthMonth}}" fields="month"> <picker mode="date" model:value="{{birthMonth}}" fields="month">
<view class="picker-content"> <view class="picker-content">
<view class="value" data-place="请选择您的出生年月">{{birthMonth}}</view> <view class="value" data-place="请选择{{relationType == 1 ? '' : '亲友'}}的出生年月">{{birthMonth}}</view>
<view class="tril"></view> <view class="tril"></view>
</view> </view>
</picker> </picker>
@ -41,12 +44,12 @@
<pickerArea mode="region" value="{{CityId}}" level="city" level="{{2}}" bind:change="handleAreaChange"> <pickerArea mode="region" value="{{CityId}}" level="city" level="{{2}}" bind:change="handleAreaChange">
<view class="picker-content"> <view class="picker-content">
<!-- prettier-ignore --> <!-- prettier-ignore -->
<view class="value" data-place="请选择您的所住地">{{provinceName ? provinceName+ '/' : provinceName }}{{cityName}}</view> <view class="value" data-place="请选择{{relationType == 1 ? '' : '亲友'}}的所住地">{{provinceName ? provinceName+ '/' : provinceName }}{{cityName}}</view>
<view class="tril"></view> <view class="tril"></view>
</view> </view>
</pickerArea> </pickerArea>
</view> </view>
</view> </view>
<view class="submit" bind:tap="handleSubmit">立即加入</view> <view class="submit" bind:tap="handleSubmit">立即加入</view>
<view class="cancel">取消</view> <view class="cancel" bind:tap="handleBack">取消</view>
</view> </view>

3
src/patient/pages/family/index.scss

@ -7,7 +7,7 @@ page {
.container { .container {
margin-top: 184rpx; margin-top: 184rpx;
position: relative; position: relative;
background: linear-gradient(292deg, #ffffff 0%, #fff3f2 100%); background: linear-gradient( 291deg, #FFFFFF 0%, #FFFCFC 55%, #FFF7F7 100%);
border-radius: 24rpx 24rpx 24rpx 24rpx; border-radius: 24rpx 24rpx 24rpx 24rpx;
border: 2rpx solid #ffffff; border: 2rpx solid #ffffff;
padding: 136rpx 40rpx 48rpx; padding: 136rpx 40rpx 48rpx;
@ -43,6 +43,7 @@ page {
display: block; display: block;
width: 296rpx; width: 296rpx;
height: 296rpx; height: 296rpx;
border-radius: 50%;
} }
.tip { .tip {
margin-top: 22rpx; margin-top: 22rpx;

2
src/patient/pages/familyList/index.scss

@ -13,6 +13,8 @@ page {
justify-content: space-between; justify-content: space-between;
.wrap { .wrap {
.w-header { .w-header {
display: flex;
align-items: center;
.name { .name {
display: inline; display: inline;
font-size: 32rpx; font-size: 32rpx;

2
src/patient/pages/familyList/index.ts

@ -8,7 +8,7 @@ Page({
onLoad() { onLoad() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
this.getList() this.getList()
app.getUserInfo(2).then((res) => { app.getUserInfo(1).then((res) => {
this.setData({ this.setData({
userInfo: res, userInfo: res,
}) })

6
src/patient/pages/familyList/index.wxml

@ -2,9 +2,9 @@
<view class="card" wx:for="{{list}}" wx:key="UserId"> <view class="card" wx:for="{{list}}" wx:key="UserId">
<view class="wrap"> <view class="wrap">
<view class="w-header"> <view class="w-header">
<view class="name" wx:if="{{item.RelationType === '1'}}">ID:{{userInfo.PatientId}}</view> <view class="name" wx:if="{{item.RelationType === '1'}}">{{userInfo.PatientName}}</view>
<view class="name" wx:else>ID:{{userInfo.PatientId}}亲友</view> <view class="name" wx:else>{{userInfo.PatientName}}亲友</view>
<view class="tag">{{item.RelationType === '1' ? '本人': '亲友'}}</view> <view class="tag" wx:if="{{item.RelationType === '1'}}">本人</view>
</view> </view>
<view class="date">绑定时间:{{item.BindPatientTime}}</view> <view class="date">绑定时间:{{item.BindPatientTime}}</view>
</view> </view>

14
src/patient/pages/familyScan/index.ts

@ -20,6 +20,12 @@ Page({
}, },
onShow() { onShow() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
if (app.globalData.initLoginInfo.loginType === 2) {
wx.reLaunch({
url: '/doctor/pages/index/index',
})
return
}
app.getUserInfo().then(() => { app.getUserInfo().then(() => {
this.getMpPatientInfo() this.getMpPatientInfo()
}) })
@ -35,13 +41,11 @@ Page({
loading: true, loading: true,
}).then((res) => { }).then((res) => {
let RelationType = res.HasSelf == 1 ? '2' : '' let RelationType = res.HasSelf == 1 ? '2' : ''
if (!res.PatientId) { if (!res.isLogin) {
if (!this.data.ignoreAgreement) {
wx.navigateTo({ wx.navigateTo({
url: `/patient/pages/login/index?page=/patient/pages/familyScan/index`, url: `/patient/pages/login/index?back=1`,
}) })
} }
}
this.setData({ this.setData({
mpPatientInfo: res, mpPatientInfo: res,
RelationType: res.HasSelf ? '2' : RelationType, RelationType: res.HasSelf ? '2' : RelationType,
@ -59,7 +63,7 @@ Page({
resetBind: true, resetBind: true,
}) })
}, },
handleSwitchRType(e) { handleSwitchType(e) {
const { type } = e.currentTarget.dataset const { type } = e.currentTarget.dataset
this.setData({ this.setData({
RelationType: type, RelationType: type,

4
src/patient/pages/familyScan/index.wxml

@ -55,7 +55,7 @@
<view class="title">请选择您的身份?</view> <view class="title">请选择您的身份?</view>
<view class="identity"> <view class="identity">
<view <view
bind:tap="handleSwitchRType" bind:tap="handleSwitchType"
class="item {{RelationType == 1 && 'active' }}" class="item {{RelationType == 1 && 'active' }}"
data-type="1" data-type="1"
wx:if="{{!mpPatientInfo.HasSelf}}" wx:if="{{!mpPatientInfo.HasSelf}}"
@ -64,7 +64,7 @@
<image class="icon-active" src="{{imageUrl}}icon79.png?t={{Timestamp}}"></image> <image class="icon-active" src="{{imageUrl}}icon79.png?t={{Timestamp}}"></image>
<view class="name">本人</view> <view class="name">本人</view>
</view> </view>
<view bind:tap="handleSwitchRType" class="item {{RelationType > 1 && 'active' }}" data-type="2"> <view bind:tap="handleSwitchType" class="item {{RelationType > 1 && 'active' }}" data-type="2">
<image class="icon" src="{{imageUrl}}icon80.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon80.png?t={{Timestamp}}"></image>
<image class="icon-active" src="{{imageUrl}}icon81.png?t={{Timestamp}}"></image> <image class="icon-active" src="{{imageUrl}}icon81.png?t={{Timestamp}}"></image>
<view class="name">亲友</view> <view class="name">亲友</view>

9
src/patient/pages/index/index.scss

@ -105,13 +105,14 @@ page {
} }
.name { .name {
margin: -20rpx auto 0; margin: -20rpx auto 0;
padding: 4rpx 20rpx; padding: 4rpx 0.5em;
font-size: 20rpx; font-size: 20rpx;
color: #fff; color: #fff;
line-height: 24rpx; line-height: 24rpx;
background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%);
border-radius: 28rpx 28rpx 28rpx 28rpx; border-radius: 28rpx 28rpx 28rpx 28rpx;
max-width: 4em; max-width: 5em;
box-sizing: border-box;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -127,8 +128,10 @@ page {
} }
.name { .name {
margin: -20rpx auto 0; margin: -20rpx auto 0;
padding: 4rpx 20rpx; padding: 4rpx 0.5em;
width: 5em;
font-size: 20rpx; font-size: 20rpx;
box-sizing: border-box;
color: rgba(161, 164, 172, 1); color: rgba(161, 164, 172, 1);
line-height: 24rpx; line-height: 24rpx;
} }

10
src/patient/pages/index/index.ts

@ -20,7 +20,7 @@ Page({
}, },
onLoad() { onLoad() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.getUserInfo(2).then((userInfo) => { app.getUserInfo(1).then((userInfo) => {
this.setData({ this.setData({
userInfo, userInfo,
Days: userInfo.Days.replace( Days: userInfo.Days.replace(
@ -38,6 +38,11 @@ Page({
}) })
}) })
}, },
onShow() {
if (app.globalData.loginState) {
this.getBindDoctorList()
}
},
getBindDoctorList() { getBindDoctorList() {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
@ -152,6 +157,9 @@ Page({
}, },
handlePopupCancel() { handlePopupCancel() {
const { popupType } = this.data const { popupType } = this.data
if (popupType === 'bindDoctor') {
this.getBindDoctorList()
}
if (popupType === 'conformBindDoctorQuestion') { if (popupType === 'conformBindDoctorQuestion') {
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',

13
src/patient/pages/index/index.wxml

@ -7,10 +7,7 @@
> >
<view class="user"> <view class="user">
<view class="avatar"> <view class="avatar">
<image <image class="avatar-img" src="{{userInfo.Avatar}}"></image>
class="avatar-img"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
</view> </view>
<view class="wrap"> <view class="wrap">
<view class="name">Hi!{{userInfo.PatientName}}</view> <view class="name">Hi!{{userInfo.PatientName}}</view>
@ -24,7 +21,13 @@
<view class="container" wx:if="{{doctorList.length}}"> <view class="container" wx:if="{{doctorList.length}}">
<view class="wrap"> <view class="wrap">
<view class="bind-list"> <view class="bind-list">
<popupDoctor class="item" wx:for="{{doctorList}}" wx:key="index" did="{{item.doctorId}}" bind:update="getBindDoctorList"> <popupDoctor
class="item"
wx:for="{{doctorList}}"
wx:key="index"
did="{{item.doctorId}}"
bind:update="getBindDoctorList"
>
<image class="avatar-img" src="{{item.doctorAvatar}}"></image> <image class="avatar-img" src="{{item.doctorAvatar}}"></image>
<view class="name">{{item.doctorName}}</view> <view class="name">{{item.doctorName}}</view>
</popupDoctor> </popupDoctor>

4
src/patient/pages/login/index.json

@ -1,6 +1,8 @@
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"van-divider": "@vant/weapp/divider/index" "van-divider": "@vant/weapp/divider/index",
"navbar": "/components/navbar/index",
"van-checkbox": "@vant/weapp/checkbox/index"
} }
} }

5
src/patient/pages/login/index.scss

@ -106,6 +106,11 @@
margin-top: -8rpx; margin-top: -8rpx;
transform: scale(0.8); transform: scale(0.8);
} }
.wx-checkbox-input.wx-checkbox-input-checked {
background: rgba(246, 74, 58, 1);
border-color: rgba(246, 74, 58, 1);
color: #ffffff;
}
} }
.link { .link {
color: rgba(246, 74, 58, 1); color: rgba(246, 74, 58, 1);

17
src/patient/pages/login/index.ts

@ -12,8 +12,14 @@ Page({
check1: false, check1: false,
check2: false, check2: false,
check3: false, check3: false,
backPage: false,
},
onLoad(options) {
this.setData({
backPage: options.back === '1',
})
}, },
onLoad() {},
getCode() { getCode() {
if (timer) return if (timer) return
const mobile = this.data.mobile const mobile = this.data.mobile
@ -101,8 +107,10 @@ Page({
} }
}, },
submitCallback() { submitCallback() {
app.getUserInfo(2).then((res) => { app.getUserInfo(1).then((res) => {
if (res.PatientId) { if (this.data.backPage) {
wx.navigateBack()
} else if (res.PatientId) {
wx.reLaunch({ wx.reLaunch({
url: `/patient/pages/index/index`, url: `/patient/pages/index/index`,
}) })
@ -118,6 +126,9 @@ Page({
showTel: !this.data.showTel, showTel: !this.data.showTel,
}) })
}, },
handleBack() {
wx.navigateBack()
},
}) })
export {} export {}

18
src/patient/pages/login/index.wxml

@ -1,10 +1,20 @@
<navbar fixed title="" custom-style="background:{{background}}" back>
<van-icon name="arrow-left" slot="left" size="18px" color="#000" bind:tap="handleBack" />
</navbar>
<view <view
class="page" class="page"
style="padding-top: {{pageTop + 60}}px;background:url('{{imageUrl}}bg12.png?t={{Timestamp}}') no-repeat top center/100% 618rpx;" style="padding-top: {{pageTop + 60}}px;background:url('{{imageUrl}}bg12.png?t={{Timestamp}}') no-repeat top center/100% 618rpx;"
> >
<image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image> <image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image>
<view class="title">欢迎加入愈见守护</view> <view class="title">欢迎加入愈见守护</view>
<button wx:if="{{check1 && check2 && check3}}" class="phone" open-type="getPhoneNumber" bindgetphonenumber="handleWxSubmit">手机号一键登录</button> <button
wx:if="{{check1 && check2 && check3}}"
class="phone"
open-type="getPhoneNumber"
bindgetphonenumber="handleWxSubmit"
>
手机号一键登录
</button>
<button wx:else class="phone" bind:tap="handleDocRule">手机号一键登录</button> <button wx:else class="phone" bind:tap="handleDocRule">手机号一键登录</button>
<view class="divider"> <view class="divider">
<van-divider class="van-divider" contentPosition="center">或者</van-divider> <van-divider class="van-divider" contentPosition="center">或者</van-divider>
@ -39,7 +49,7 @@
</view> </view>
<view class="signature"> <view class="signature">
<view class="row"> <view class="row">
<checkbox model:checked="{{check1}}" class="checkbox" color="#e73e37"></checkbox> <checkbox model:checked="{{check1}}" class="checkbox" color="#fff"></checkbox>
<view class="r-content"> <view class="r-content">
我特此同意 我特此同意
<text class="link">《个人信息及隐私协议政策》</text> <text class="link">《个人信息及隐私协议政策》</text>
@ -47,7 +57,7 @@
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<checkbox model:checked="{{check2}}" class="checkbox" color="#e73e37"></checkbox> <checkbox model:checked="{{check2}}" class="checkbox" color="#fff"></checkbox>
<view class="r-content"> <view class="r-content">
我特此同意 我特此同意
<text class="link">《用户协议》</text> <text class="link">《用户协议》</text>
@ -55,7 +65,7 @@
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<checkbox model:checked="{{check3}}" class="checkbox" color="#e73e37"></checkbox> <checkbox model:checked="{{check3}}" class="checkbox" color="#fff"></checkbox>
<view class="r-content"> <view class="r-content">
我特此同意 我特此同意
<text class="link">《个人信息共享知情同意书》</text> <text class="link">《个人信息共享知情同意书》</text>

2
src/patient/pages/my/index.ts

@ -11,7 +11,7 @@ Page({
}, },
onLoad() { onLoad() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.getUserInfo().then((userInfo) => { app.getUserInfo(1).then((userInfo) => {
this.setData({ this.setData({
userInfo, userInfo,
// 数字变红 // 数字变红

12
src/patient/pages/my/index.wxml

@ -8,7 +8,7 @@
</button> </button>
<view class="wrap"> <view class="wrap">
<view class="name"> <view class="name">
<text class="nickname">你好</text> <text class="nickname">{{userInfo.PatientName}}</text>
</view> </view>
<view class="day"> <view class="day">
今天是陪伴您的第 今天是陪伴您的第
@ -27,6 +27,11 @@
<view class="content">个人信息</view> <view class="content">个人信息</view>
<van-icon class="more" name="arrow" /> <van-icon class="more" name="arrow" />
</view> </view>
<view class="item" bind:tap="handleFamily">
<image class="icon" src="{{imageUrl}}icon69.png?t={{Timestamp}}"></image>
<view class="content">我的亲友</view>
<van-icon class="more" name="arrow" />
</view>
<view class="item" bind:tap="handleDoctor"> <view class="item" bind:tap="handleDoctor">
<image class="icon" src="{{imageUrl}}icon68.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon68.png?t={{Timestamp}}"></image>
<view class="content"> <view class="content">
@ -35,11 +40,6 @@
</view> </view>
<van-icon class="more" name="arrow" /> <van-icon class="more" name="arrow" />
</view> </view>
<view class="item" bind:tap="handleFamily">
<image class="icon" src="{{imageUrl}}icon69.png?t={{Timestamp}}"></image>
<view class="content">我的亲友</view>
<van-icon class="more" name="arrow" />
</view>
</view> </view>
</view> </view>
</view> </view>

9
src/patient/pages/userInfo/index.ts

@ -16,7 +16,7 @@ Page({
}, },
onLoad() { onLoad() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
app.getUserInfo(2).then((userInfo) => { app.getUserInfo(1).then((userInfo) => {
this.setData({ this.setData({
name: userInfo.PatientName, name: userInfo.PatientName,
birthMonth: userInfo.PatientBirth, birthMonth: userInfo.PatientBirth,
@ -51,8 +51,11 @@ Page({
provinceId, provinceId,
cityId, cityId,
}, },
}).then((res) => { }).then(() => {
console.log('res: ', res) wx.showToast({
icon: 'none',
title: '保存成功',
})
}) })
}, },
handleTel() { handleTel() {

2
typings/index.d.ts vendored

@ -44,7 +44,7 @@ interface IAppOption {
[propName: string]: any [propName: string]: any
} }
getUserInfo: (type?: 1 | 2 | 3) => Promise<any> getUserInfo: (type?: 0 | 1 | 2) => Promise<any>
startLogin: (callback?: () => void) => void startLogin: (callback?: () => void) => void
waitLogin: (params?: { type?: 0 | 1 | 2 | 'any' }) => Promise<void> waitLogin: (params?: { type?: 0 | 1 | 2 | 'any' }) => Promise<void>
checkLoginType: (type: 0 | 1 | 2) => boolean checkLoginType: (type: 0 | 1 | 2) => boolean

Loading…
Cancel
Save