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

1
src/app.ts

@ -244,6 +244,7 @@ App<IAppOption>({ @@ -244,6 +244,7 @@ App<IAppOption>({
verifySys(pub = false) {
// 1:患者 2:医生
const { loginType, isLogin, anyWhere } = this.globalData
console.log("DEBUGPRINT[229]: app.ts:246: loginType=", loginType)
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const url = currentPage.route

2
src/components/toast/index.scss

@ -2459,7 +2459,7 @@ @@ -2459,7 +2459,7 @@
color: rgba(255, 255, 255, 1);
text-align: center;
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;
}
}

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

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

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

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
<view
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>
<view class="back" bind:tap="handleBackHome">回到医生端</view>
<image class="logo" src="/images/bg19.png"></image>
<view class="back" bind:tap="handleLoginOut">随便看看</view>
<view class="submit" bind:tap="handleBackHome">回到医生端</view>
<view class="tip">
您当前登录的为医生身份
<view></view>

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

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

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

@ -104,20 +104,36 @@ Page({ @@ -104,20 +104,36 @@ Page({
},
handleChangeClinicType(e) {
const value = e.detail.value
if (value) {
const newType = value ? 2 : 1
this.setData({
'doctor.ClinicType': 2,
'doctor.Clinic': '',
'doctor.weekName': '',
'doctor.ClinicType': newType,
})
const { doctor, PopupClinic, ClinicList } = this.data
let Clinic = ''
if (newType == 2) {
Clinic = PopupClinic
} else {
this.setData({
'doctor.ClinicType': 1,
'doctor.Clinic': [],
'doctor.weekName': '',
})
Clinic = ClinicList.reduce((pre, cur) => {
if (cur.timeTypeActive1) {
pre.push({ weekday: cur.weekday, timeType: 1 })
}
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() {
app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORPERSONALINFOCHANGEPHONE' })

8
src/pages/doctorDetail/index.scss

@ -148,4 +148,12 @@ page { @@ -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 @@ @@ -7,7 +7,7 @@
<view class="wrap">
<view class="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 class="content">
{{detail.hospital.Name}}

3
src/pages/hospital/index.scss

@ -251,4 +251,7 @@ page { @@ -251,4 +251,7 @@ page {
.site {
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 @@ @@ -13,7 +13,7 @@
<view class="content">
<view class="row" bind:tap="handleOpenMap">
<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 class="row" bind:tap="handlePhone" wx:if="{{detail.Telephone}}">
<image class="icon" src="{{imageUrl}}{{theme === 'DRUG' ? 'icon70' : 'icon46'}}.png?t={{Timestamp}}"></image>
@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
<image class="avatar" mode="aspectFill" src="{{item.Img}}"></image>
<view class="wrap">
<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 class="content" wx:if="{{item.weekName.length || item.ClinicType==2 && item.weekName}}">

40
src/pages/index/index.scss

@ -71,19 +71,21 @@ page { @@ -71,19 +71,21 @@ page {
}
}
}
}
.page-container {
margin-top: -38rpx;
width: 100%;
box-sizing: border-box;
padding-bottom: 180rpx;
.kkd {
margin: 28rpx $page-margin 0;
margin: 0 $page-margin 80rpx;
display: flex;
gap: 30rpx;
.k-item {
height: 172rpx;
}
}
}
.page-container {
width: 100%;
box-sizing: border-box;
padding-bottom: 180rpx;
.module-title {
margin: 48rpx $page-margin 0;
display: flex;
@ -209,6 +211,32 @@ page { @@ -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 {
margin: 32rpx 40rpx 0;
.item {

2
src/pages/index/index.ts

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

40
src/pages/index/index.wxml

@ -21,15 +21,6 @@ @@ -21,15 +21,6 @@
</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 class="page-container">
<block wx:if="{{userInfo.ExclusiveDoctorId}}">
@ -72,6 +63,27 @@ @@ -72,6 +63,27 @@
</view>
</view>
</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}}">
<view class="module-title">
<view class="title">大咖说</view>
@ -158,6 +170,16 @@ @@ -158,6 +170,16 @@
</swiper>
</view>
</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 class="reg" wx:if="{{regGuide && anyWhere && userInfo.UserType==1}}" bind:tap="handleReg">

2
src/pages/login/index.json

@ -3,6 +3,6 @@ @@ -3,6 +3,6 @@
"usingComponents": {
"van-icon": "@vant/weapp/icon/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 { @@ -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({ @@ -12,7 +12,9 @@ Page({
codeText: '发送验证码',
page: '',
popupShow: false,
toastShow: false,
toastType: '',
toastParams: {} as any,
},
onLoad(options: any) {
this.setData({
@ -107,7 +109,8 @@ Page({ @@ -107,7 +109,8 @@ Page({
},
handleWxCheck() {
this.setData({
popupShow: true,
toastShow: true,
toastType: 'popup11',
})
},
submitCallback() {
@ -165,9 +168,10 @@ Page({ @@ -165,9 +168,10 @@ Page({
[key]: !this.data[key],
})
},
handlePopupCancel() {
handleToastCancel() {
this.setData({
popupShow: false,
toastShow: false,
toastType: '',
})
},
})

13
src/pages/login/index.wxml

@ -71,15 +71,4 @@ @@ -71,15 +71,4 @@
</view>
</view>
<van-popup show="{{ popupShow }}" round bind:close="onClose">
<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>
<toast show="{{toastShow}}" type="{{toastType}}" params="{{toastParams}}" bind:cancel="handleToastCancel" bind:phone="handleWxSubmit"></toast>

2
src/pages/mySave/index.wxml

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

8
src/pages/start/index.ts

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

1155
医生端-接口文档.md

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