Browse Source

feat: 完成医生端小程序基础功能开发与样式优化

1.  新增医生端登录页自定义toast组件替换van-popup
2.  完善医生个人信息、出诊信息管理逻辑
3.  优化首页、医院页、医生详情页UI展示与数据绑定
4.  调整登录校验逻辑,医生登录后直接跳转医生端首页
5.  新增医生端退出切换页面与样式
6.  新增医生端接口文档
7.  修复多处样式bug与布局问题
master
kola-web 3 weeks ago
parent
commit
c76fe319f3
  1. 11
      project.private.config.json
  2. 1
      src/app.ts
  3. 2
      src/components/toast/index.scss
  4. 35
      src/doctor/pages/d_trans/index.scss
  5. 6
      src/doctor/pages/d_trans/index.wxml
  6. 6
      src/doctor/pages/d_userInfo/index.scss
  7. 40
      src/doctor/pages/d_userInfo/index.ts
  8. 8
      src/pages/doctorDetail/index.scss
  9. 2
      src/pages/doctorDetail/index.wxml
  10. 3
      src/pages/hospital/index.scss
  11. 4
      src/pages/hospital/index.wxml
  12. 40
      src/pages/index/index.scss
  13. 2
      src/pages/index/index.ts
  14. 40
      src/pages/index/index.wxml
  15. 2
      src/pages/login/index.json
  16. 49
      src/pages/login/index.scss
  17. 12
      src/pages/login/index.ts
  18. 13
      src/pages/login/index.wxml
  19. 2
      src/pages/mySave/index.wxml
  20. 8
      src/pages/start/index.ts
  21. 1155
      医生端-接口文档.md

11
project.private.config.json

@ -22,13 +22,20 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "患者-审核中", "name": "医生-切换患者端",
"pathName": "gift/pages/vipPending/index", "pathName": "doctor/pages/d_trans/index",
"query": "", "query": "",
"scene": null, "scene": null,
"launchMode": "default" "launchMode": "default"
}, },
{ {
"name": "患者-审核中",
"pathName": "gift/pages/vipPending/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "患者-认证用药身份", "name": "患者-认证用药身份",
"pathName": "gift/pages/vipCert/index", "pathName": "gift/pages/vipCert/index",
"query": "", "query": "",

1
src/app.ts

@ -244,6 +244,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)
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

2
src/components/toast/index.scss

@ -2459,7 +2459,7 @@
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
text-align: center; text-align: center;
line-height: 96rpx; line-height: 96rpx;
background: linear-gradient(to right, rgba(14, 182, 109, 1) 0%, rgba(0, 210, 119, 1) 100%); background: linear-gradient(90deg, #293b9f 0%, #1679cb 100%);
border-radius: 16rpx; border-radius: 16rpx;
} }
} }

35
src/doctor/pages/d_trans/index.scss

@ -1,35 +1,42 @@
.page { .page {
padding: 88rpx 60rpx; padding: 0 60rpx;
width: 100%; width: 100%;
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
.logo {
margin: 182rpx auto 0;
display: block;
width: 290rpx;
height: 362rpx;
}
.submit { .submit {
margin-top: 700rpx; margin-top: 36rpx;
height: 84rpx; height: 96rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 36rpx; font-size: 36rpx;
color: rgba(255, 255, 255, 1); color: #1679cb;
background: #67baca; border-radius: 12rpx 12rpx 12rpx 12rpx;
border-radius: 64rpx 64rpx 64rpx 64rpx; border: 2rpx solid #1679cb;
box-sizing: border-box;
} }
.back { .back {
margin-top: 36rpx; margin-top: 112rpx;
height: 84rpx; height: 96rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 36rpx; font-size: 36rpx;
color: rgba(103, 186, 202, 1); color: #ffffff;
background: rgba(103, 186, 202, 0.12); background: linear-gradient(90deg, #293b9f 0%, #1679cb 100%);
border-radius: 64rpx 64rpx 64rpx 64rpx; border-radius: 12rpx;
} }
.tip{ .tip {
margin-top: 82rpx; margin-top: 82rpx;
font-size: 32rpx; font-size: 32rpx;
color: rgba(194, 201, 202, 1); color: rgba(33, 33, 32, 0.7);
line-height: 48rpx; line-height: 64rpx;
text-align: center; text-align: center;
} }
} }

6
src/doctor/pages/d_trans/index.wxml

@ -1,9 +1,9 @@
<view <view
class="page" class="page"
style="padding-top: {{bottom}}px;background: url({{imageUrl}}/doctor/trans-bg.png?t={{Timestamp}}) no-repeat top center / 100% 786rpx"
> >
<view class="submit" bind:tap="handleLoginOut">随便看看</view> <image class="logo" src="/images/bg19.png"></image>
<view class="back" bind:tap="handleBackHome">回到医生端</view> <view class="back" bind:tap="handleLoginOut">随便看看</view>
<view class="submit" bind:tap="handleBackHome">回到医生端</view>
<view class="tip"> <view class="tip">
您当前登录的为医生身份 您当前登录的为医生身份
<view></view> <view></view>

6
src/doctor/pages/d_userInfo/index.scss

@ -181,13 +181,13 @@ page {
} }
.submit { .submit {
margin-top: 32rpx; margin-top: 32rpx;
height: 84rpx; height: 96rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: #67baca; background: linear-gradient( 90deg, #293B9F 0%, #1679CB 100%);
font-size: 36rpx; font-size: 36rpx;
color: #fff; color: #fff;
border-radius: 64rpx 64rpx 64rpx 64rpx; border-radius: 12rpx;
} }
} }

40
src/doctor/pages/d_userInfo/index.ts

@ -104,20 +104,36 @@ Page({
}, },
handleChangeClinicType(e) { handleChangeClinicType(e) {
const value = e.detail.value const value = e.detail.value
if (value) { const newType = value ? 2 : 1
this.setData({ this.setData({
'doctor.ClinicType': 2, 'doctor.ClinicType': newType,
'doctor.Clinic': '', })
'doctor.weekName': '', const { doctor, PopupClinic, ClinicList } = this.data
}) let Clinic = ''
if (newType == 2) {
Clinic = PopupClinic
} else { } else {
this.setData({ Clinic = ClinicList.reduce((pre, cur) => {
'doctor.ClinicType': 1, if (cur.timeTypeActive1) {
'doctor.Clinic': [], pre.push({ weekday: cur.weekday, timeType: 1 })
'doctor.weekName': '', }
}) if (cur.timeTypeActive2) {
pre.push({ weekday: cur.weekday, timeType: 2 })
}
return pre
}, [] as any)
} }
this.handleWeekIntroduceSubmit() wx.ajax({
method: 'POST',
url: '?r=igg4/doctor/account/update-info',
data: {
Introduce: doctor.Introduce,
Clinic,
ClinicType: newType,
},
}).then(() => {
this.getDetail()
})
}, },
handleChangePhone() { handleChangePhone() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPERSONALINFOCHANGEPHONE' }) app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPERSONALINFOCHANGEPHONE' })

8
src/pages/doctorDetail/index.scss

@ -148,4 +148,12 @@ page {
} }
} }
} }
.row {
.label {
background: linear-gradient(270deg, #5956e9 0%, #b384f4 100%);
}
.week-name {
background-color: rgba(245, 244, 255, 1);
}
}
} }

2
src/pages/doctorDetail/index.wxml

@ -7,7 +7,7 @@
<view class="wrap"> <view class="wrap">
<view class="name"> <view class="name">
{{detail.Name}} {{detail.Name}}
<view class="label">主任医生 | 眼科</view> <view class="label">{{detail.JobTitle}}<text wx:if="{{detail.JobTitle && detail.Department}}"> | </text>{{detail.Department}}</view>
</view> </view>
<view class="content"> <view class="content">
{{detail.hospital.Name}} {{detail.hospital.Name}}

3
src/pages/hospital/index.scss

@ -251,4 +251,7 @@ page {
.site { .site {
background: linear-gradient(270deg, #b384f4 0%, #5956e9 100%); background: linear-gradient(270deg, #b384f4 0%, #5956e9 100%);
} }
.week-name{
background-color: rgba(245, 244, 255, 1);
}
} }

4
src/pages/hospital/index.wxml

@ -13,7 +13,7 @@
<view class="content"> <view class="content">
<view class="row" bind:tap="handleOpenMap"> <view class="row" bind:tap="handleOpenMap">
<image class="icon" src="{{imageUrl}}{{theme === 'DRUG' ? 'icon68' : 'icon42'}}.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}{{theme === 'DRUG' ? 'icon68' : 'icon42'}}.png?t={{Timestamp}}"></image>
{{detail.ProvinceName}}{{detail.CityName}}{{detail.CountyName}}{{detail.Address}}{{detail.dist}} {{detail.ProvinceName}}{{detail.CityName}}{{detail.CountyName}}{{detail.Address}}
</view> </view>
<view class="row" bind:tap="handlePhone" wx:if="{{detail.Telephone}}"> <view class="row" bind:tap="handlePhone" wx:if="{{detail.Telephone}}">
<image class="icon" src="{{imageUrl}}{{theme === 'DRUG' ? 'icon70' : 'icon46'}}.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}{{theme === 'DRUG' ? 'icon70' : 'icon46'}}.png?t={{Timestamp}}"></image>
@ -36,7 +36,7 @@
<image class="avatar" mode="aspectFill" src="{{item.Img}}"></image> <image class="avatar" mode="aspectFill" src="{{item.Img}}"></image>
<view class="wrap"> <view class="wrap">
<view class="name">{{item.Name}}</view> <view class="name">{{item.Name}}</view>
<view class="p ellipsis">{{item.Introduce}}</view> <view class="p ellipsis">{{item.JobTitle}}<text wx:if="{{item.JobTitle && item.Department}}"> | </text>{{item.Department}}</view>
</view> </view>
</view> </view>
<view class="content" wx:if="{{item.weekName.length || item.ClinicType==2 && item.weekName}}"> <view class="content" wx:if="{{item.weekName.length || item.ClinicType==2 && item.weekName}}">

40
src/pages/index/index.scss

@ -71,19 +71,21 @@ page {
} }
} }
} }
}
.page-container {
margin-top: -38rpx;
width: 100%;
box-sizing: border-box;
padding-bottom: 180rpx;
.kkd { .kkd {
margin: 28rpx $page-margin 0; margin: 0 $page-margin 80rpx;
display: flex; display: flex;
gap: 30rpx; gap: 30rpx;
.k-item { .k-item {
height: 172rpx; height: 172rpx;
} }
} }
}
.page-container {
width: 100%;
box-sizing: border-box;
padding-bottom: 180rpx;
.module-title { .module-title {
margin: 48rpx $page-margin 0; margin: 48rpx $page-margin 0;
display: flex; display: flex;
@ -209,6 +211,32 @@ page {
} }
} }
} }
.banner {
margin: 32rpx $page-margin 0;
.swiper {
width: 100%;
height: 214rpx;
.swiper-item {
display: block;
width: 100%;
height: 224rpx;
box-sizing: border-box;
border-radius: 20rpx;
.swiper-item-img {
width: 100%;
height: 100%;
}
}
.wx-swiper-dot-active {
width: 30rpx !important;
}
.wx-swiper-dot {
width: 9rpx;
height: 6rpx;
border-radius: 2rpx;
}
}
}
.live { .live {
margin: 32rpx 40rpx 0; margin: 32rpx 40rpx 0;
.item { .item {

2
src/pages/index/index.ts

@ -5,6 +5,7 @@ const licia = require('miniprogram-licia')
Page({ Page({
data: { data: {
configList: [], configList: [],
bannerList: [] as any[],
infoList: [] as any[], infoList: [] as any[],
storyList: [] as any[], storyList: [] as any[],
userInfo: {} as any, userInfo: {} as any,
@ -170,6 +171,7 @@ Page({
}) })
this.setData({ this.setData({
configList: res, configList: res,
bannerList: res.find((item: any) => item.code == 'spread1' && item.showStatus == 1)?.subList || [],
}) })
res.forEach((item) => { res.forEach((item) => {
if (item.code == 'article') { if (item.code == 'article') {

40
src/pages/index/index.wxml

@ -21,15 +21,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="kkd">
<image
class="k-item"
src="{{imageUrl}}{{theme === 'DRUG' ? 'kkd3' : 'kkd1'}}.png?t={{Timestamp}}"
bind:tap="routerTo"
data-url="/pages/doctor/index"
></image>
<image class="k-item" src="{{imageUrl}}{{theme === 'DRUG' ? 'kkd4' : 'kkd2'}}.png?t={{Timestamp}}"></image>
</view>
</view> </view>
<view class="page-container"> <view class="page-container">
<block wx:if="{{userInfo.ExclusiveDoctorId}}"> <block wx:if="{{userInfo.ExclusiveDoctorId}}">
@ -72,6 +63,27 @@
</view> </view>
</view> </view>
</block> </block>
<view class="banner" wx:if="{{bannerList.length}}" bind:tap="handleMp" data-code="spread1">
<swiper
class="swiper"
indicator-active-color="rgba(39, 58, 101, 0.5)"
indicator-color="rgba(39, 58, 101, 0.2)"
indicator-dots="{{bannerList.length > 1}}"
autoplay
interval="{{3000}}"
circular
>
<swiper-item class="swiper-item" wx:for="{{bannerList}}" wx:key="index">
<image
class="swiper-item-img"
mode="aspectFill"
src="{{item.img}}"
bind:tap="routerTo"
data-url="{{item.linkUrl}}"
></image>
</swiper-item>
</swiper>
</view>
<block wx:if="{{liveList.length}}"> <block wx:if="{{liveList.length}}">
<view class="module-title"> <view class="module-title">
<view class="title">大咖说</view> <view class="title">大咖说</view>
@ -158,6 +170,16 @@
</swiper> </swiper>
</view> </view>
</block> </block>
<view class="kkd">
<image
class="k-item"
src="{{imageUrl}}{{theme === 'DRUG' ? 'kkd3' : 'kkd1'}}.png?t={{Timestamp}}"
bind:tap="routerTo"
data-url="/pages/doctor/index"
></image>
<image class="k-item" src="{{imageUrl}}{{theme === 'DRUG' ? 'kkd4' : 'kkd2'}}.png?t={{Timestamp}}"></image>
</view>
</view> </view>
<view class="reg" wx:if="{{regGuide && anyWhere && userInfo.UserType==1}}" bind:tap="handleReg"> <view class="reg" wx:if="{{regGuide && anyWhere && userInfo.UserType==1}}" bind:tap="handleReg">

2
src/pages/login/index.json

@ -3,6 +3,6 @@
"usingComponents": { "usingComponents": {
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",
"van-divider": "@vant/weapp/divider/index", "van-divider": "@vant/weapp/divider/index",
"van-popup": "@vant/weapp/popup/index" "toast": "/components/toast/index"
} }
} }

49
src/pages/login/index.scss

@ -86,52 +86,3 @@ pgae {
} }
} }
} }
.popup {
padding: 64rpx 40rpx 0;
width: 630rpx;
height: 332rpx;
background: linear-gradient(180deg, #ffedf3 0%, #ffffff 40%, #ffffff 100%);
border-radius: 24rpx 24rpx 24rpx 24rpx;
border: 2rpx solid #ffffff;
box-sizing: border-box;
.p-title {
font-size: 36rpx;
color: #333333;
font-weight: bold;
text-align: center;
}
.p-content {
margin-top: 10rpx;
font-size: 32rpx;
text-align: center;
.link {
color: #cf5375;
}
}
.p-footer {
margin-top: 32rpx;
display: flex;
align-items: center;
gap: 30rpx;
.p-cancel {
flex: 1;
height: 80rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
border: 2px solid rgba(240, 184, 201, 0.2);
font-size: 32rpx;
color: #cf5375;
display: flex;
align-items: center;
justify-content: center;
}
.p-submit {
flex: 1;
height: 84rpx;
background: #cf5375;
border-radius: 24rpx 24rpx 24rpx 24rpx;
font-size: 32rpx;
color: #ffffff;
}
}
}

12
src/pages/login/index.ts

@ -12,7 +12,9 @@ Page({
codeText: '发送验证码', codeText: '发送验证码',
page: '', page: '',
popupShow: false, toastShow: false,
toastType: '',
toastParams: {} as any,
}, },
onLoad(options: any) { onLoad(options: any) {
this.setData({ this.setData({
@ -107,7 +109,8 @@ Page({
}, },
handleWxCheck() { handleWxCheck() {
this.setData({ this.setData({
popupShow: true, toastShow: true,
toastType: 'popup11',
}) })
}, },
submitCallback() { submitCallback() {
@ -165,9 +168,10 @@ Page({
[key]: !this.data[key], [key]: !this.data[key],
}) })
}, },
handlePopupCancel() { handleToastCancel() {
this.setData({ this.setData({
popupShow: false, toastShow: false,
toastType: '',
}) })
}, },
}) })

13
src/pages/login/index.wxml

@ -71,15 +71,4 @@
</view> </view>
</view> </view>
<van-popup show="{{ popupShow }}" round bind:close="onClose"> <toast show="{{toastShow}}" type="{{toastType}}" params="{{toastParams}}" bind:cancel="handleToastCancel" bind:phone="handleWxSubmit"></toast>
<view class="popup">
<view class="p-title">阅读并同意</view>
<view class="p-content">
<text class="link" bind:tap="handleLink" data-url="/doc/pages/doc2/index">《个人信息及隐私保护政策》</text>
</view>
<view class="p-footer">
<view class="p-cancel" bind:tap="handlePopupCancel">取消</view>
<button class="p-submit" open-type="getPhoneNumber" bindgetphonenumber="handleWxSubmit">同意并继续</button>
</view>
</view>
</van-popup>

2
src/pages/mySave/index.wxml

@ -1,5 +1,5 @@
<view class="page" id="{{theme === 'DRUG' && 'drug-page'}}"> <view class="page" id="{{theme === 'DRUG' && 'drug-page'}}">
<view class="info-list" wx:if="{{list.length}}"> <view class="info-list">
<view <view
class="list-item" class="list-item"
wx:for="{{list}}" wx:for="{{list}}"

8
src/pages/start/index.ts

@ -4,8 +4,14 @@ Page({
data: {}, data: {},
onLoad() { onLoad() {
app.waitLogin().then((_res) => { app.waitLogin().then((_res) => {
const { isLogin, anyWhere } = app.globalData const { isLogin, anyWhere, loginType } = app.globalData
if (isLogin) { if (isLogin) {
if (loginType == 2) {
wx.reLaunch({
url: '/doctor/pages/d_trans/index',
})
return
}
const url = { const url = {
1: '/pages/index/index', 1: '/pages/index/index',
2: '/doctor/pages/d_home/index', 2: '/doctor/pages/d_home/index',

1155
医生端-接口文档.md

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save