Browse Source

正式环境

master
kola-web 2 days ago
parent
commit
9847192192
  1. 8
      project.config.json
  2. 11
      project.private.config.json
  3. 8
      src/app.json
  4. 14
      src/app.ts
  5. 187
      src/components/popup/index.scss
  6. 61
      src/components/popup/index.wxml
  7. BIN
      src/images/icon23.png
  8. BIN
      src/images/icon24.png
  9. BIN
      src/images/icon25.png
  10. BIN
      src/images/icon26.png
  11. BIN
      src/images/icon27.png
  12. BIN
      src/images/title1.png
  13. BIN
      src/images/title2.png
  14. BIN
      src/images/title3.png
  15. 7
      src/patient/pages/askPatient/index.json
  16. 545
      src/patient/pages/askPatient/index.scss
  17. 251
      src/patient/pages/askPatient/index.ts
  18. 137
      src/patient/pages/askPatient/index.wxml
  19. 3
      src/patient/pages/home/index.json
  20. 17
      src/patient/pages/home/index.ts
  21. 10
      src/patient/pages/home/index.wxml

8
project.config.json

@ -3,7 +3,10 @@
"miniprogramRoot": "src/", "miniprogramRoot": "src/",
"compileType": "miniprogram", "compileType": "miniprogram",
"setting": { "setting": {
"useCompilerPlugins": ["typescript", "sass"], "useCompilerPlugins": [
"typescript",
"sass"
],
"urlCheck": true, "urlCheck": true,
"coverView": true, "coverView": true,
"es6": true, "es6": true,
@ -61,10 +64,9 @@
"type": "glob" "type": "glob"
} }
], ],
"include": [] "include": []
}, },
"appid": "wxa4ece062e60e93a5", "appid": "wx96104303877e3fd9",
"scripts": { "scripts": {
"beforeCompile": "pnpm run beforeCompile", "beforeCompile": "pnpm run beforeCompile",
"beforePreview": "pnpm run beforeCompile", "beforePreview": "pnpm run beforeCompile",

11
project.private.config.json

@ -23,11 +23,18 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "患者-问医生",
"pathName": "patient/pages/askPatient/index",
"query": "",
"scene": null,
"launchMode": "default"
},
{
"name": "知识夸详情-文章", "name": "知识夸详情-文章",
"pathName": "pages/knowledgeDetail/index", "pathName": "pages/knowledgeDetail/index",
"query": "id=15", "query": "id=15",
"scene": null, "launchMode": "default",
"launchMode": "default" "scene": null
}, },
{ {
"name": "知识库详情-视频", "name": "知识库详情-视频",

8
src/app.json

@ -15,7 +15,13 @@
"subPackages": [ "subPackages": [
{ {
"root": "patient", "root": "patient",
"pages": ["pages/protocol/index", "pages/login/index", "pages/entryInfo/index", "pages/home/index"] "pages": [
"pages/protocol/index",
"pages/login/index",
"pages/entryInfo/index",
"pages/home/index",
"pages/askPatient/index"
]
}, },
{ {
"root": "doc", "root": "doc",

14
src/app.ts

@ -17,15 +17,15 @@ App<IAppOption>({
globalData: { globalData: {
// dev // dev
// appid:wxa4ece062e60e93a5 // appid:wxa4ece062e60e93a5
url: 'https://m.wtx.hbraas.com', // url: 'https://m.wtx.hbraas.com',
upFileUrl: 'https://m.wtx.hbraas.com/', // upFileUrl: 'https://m.wtx.hbraas.com/',
imageUrl: 'https://m.wtx.hbraas.com/GeneB/', // imageUrl: 'https://m.wtx.hbraas.com/GeneB/',
// pro // pro
// appid:wx96f45ca4f1fa36ec // appid:wx96104303877e3fd9
// url: 'https://m.wtx.hbsaas.com', url: 'https://m.gene.hbsaas.com',
// upFileUrl: 'https://m.wtx.hbsaas.com/', upFileUrl: 'https://m.gene.hbsaas.com/',
// imageUrl: 'https://m.wtx.hbsaas.com/GeneB/', imageUrl: 'https://m.gene.hbsaas.com/GeneB/',
Timestamp: new Date().getTime(), Timestamp: new Date().getTime(),
scene: {}, scene: {},

187
src/components/popup/index.scss

@ -58,6 +58,7 @@
.popup2 { .popup2 {
padding: 36rpx 34rpx 58rpx; padding: 36rpx 34rpx 58rpx;
background-color: #fff;
.photo { .photo {
width: 492rpx; width: 492rpx;
height: 492rpx; height: 492rpx;
@ -68,3 +69,189 @@
text-align: center; text-align: center;
} }
} }
.popup3 {
.icon {
position: relative;
z-index: 1;
margin: 0 auto;
display: block;
width: 144rpx;
height: 144rpx;
}
.container {
margin-top: -94rpx;
padding: 124rpx 32rpx 32rpx;
width: 604rpx;
background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%);
border-radius: 24rpx 24rpx 24rpx 24rpx;
box-sizing: border-box;
.title {
display: block;
margin: 0 auto;
width: 146rpx;
height: 40rpx;
}
.card {
position: relative;
margin-top: 32rpx;
padding: 32rpx;
background: #ffffff;
display: flex;
gap: 16rpx;
justify-content: space-between;
box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.05);
border-radius: 24rpx 24rpx 24rpx 24rpx;
&::after {
position: absolute;
bottom: -24rpx;
left: 32rpx;
content: '';
width: 476rpx;
height: 24rpx;
background: #ffebea;
border-radius: 0 0 24rpx 24rpx;
}
.avatar {
flex-shrink: 0;
width: 92rpx;
height: 92rpx;
border-radius: 50%;
}
.wrap {
flex: 1;
.name {
font-size: 32rpx;
color: rgba(1, 1, 5, 1);
font-weight: bold;
}
.hostipal {
margin-top: 16rpx;
line-height: 28rpx;
.content {
margin-right: 8rpx;
display: inline-block;
font-size: 28rpx;
color: rgba(161, 164, 172, 1);
}
.tag {
display: inline-block;
font-size: 20rpx;
color: rgba(255, 255, 255, 1);
padding: 0 8rpx;
background-color: rgba(255, 186, 1, 1);
border-radius: 6rpx;
}
}
}
}
.btn {
margin-top: 66rpx;
height: 88rpx;
line-height: 88rpx;
font-size: 32rpx;
color: rgba(255, 255, 255, 1);
text-align: center;
background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%);
border-radius: 84rpx 84rpx 84rpx 84rpx;
}
}
}
.popup4 {
.icon {
position: relative;
z-index: 1;
margin: 0 auto;
display: block;
width: 144rpx;
height: 144rpx;
}
.container {
margin-top: -94rpx;
padding: 124rpx 32rpx 32rpx;
width: 604rpx;
background: linear-gradient(7deg, #ffffff 19%, #ffe8e4 100%);
border-radius: 24rpx 24rpx 24rpx 24rpx;
box-sizing: border-box;
.title {
display: block;
margin: 0 auto;
width: 146rpx;
height: 40rpx;
}
.content {
margin-top: 16rpx;
font-size: 32rpx;
color: rgba(161, 164, 172, 1);
text-align: center;
}
.btn {
margin-top: 32rpx;
height: 88rpx;
line-height: 88rpx;
font-size: 32rpx;
color: rgba(255, 255, 255, 1);
text-align: center;
background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%);
border-radius: 84rpx 84rpx 84rpx 84rpx;
}
}
}
.popup5 {
.container {
padding: 36rpx 32rpx 32rpx;
width: 604rpx;
background: linear-gradient(4deg, #f7f7fa 19%, #ffe8e4 100%);
border-radius: 24rpx 24rpx 24rpx 24rpx;
box-sizing: border-box;
.title {
display: block;
margin: 0 auto;
width: 242rpx;
height: 38rpx;
}
.row {
margin-top: 32rpx;
padding: 26rpx 32rpx;
display: flex;
gap: 22rpx;
align-items: center;
background: #ffffff;
border-radius: 16rpx 16rpx 16rpx 16rpx;
&:last-of-type {
margin-top: 24rpx;
}
.avatar {
flex-shrink: 0;
width: 96rpx;
height: 103rpx;
}
.wrap {
flex: 1;
line-height: 44rpx;
.name {
font-size: 32rpx;
color: rgba(1, 1, 5, 1);
font-weight: bold;
}
.content {
font-size: 32rpx;
color: rgba(161, 164, 172, 1);
}
}
.icon {
width: 40rpx;
height: 40rpx;
}
}
}
}
.close {
margin: 32rpx auto 0;
display: block;
width: 64rpx;
height: 64rpx;
}

61
src/components/popup/index.wxml

@ -3,8 +3,10 @@
round round
z-index="{{100000}}" z-index="{{100000}}"
show="{{ show }}" show="{{ show }}"
custom-style="background:transparent;"
position="{{params.position || 'center'}}" position="{{params.position || 'center'}}"
safe-area-inset-bottom="{{false}}" safe-area-inset-bottom="{{false}}"
root-portal
> >
<view class="popup1" wx:if="{{type==='argument'}}"> <view class="popup1" wx:if="{{type==='argument'}}">
<image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image> <image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image>
@ -15,7 +17,12 @@
,请您仔细阅读。一旦您开始使用,即表示您已充分理解并同意协议内容。 ,请您仔细阅读。一旦您开始使用,即表示您已充分理解并同意协议内容。
</view> </view>
<view class="check"> <view class="check">
<checkbox class="checkbox" model:checked="{{popup1Check1}}" bind:tap="handlePopup1Check1" color="#f23a2f"></checkbox> <checkbox
class="checkbox"
model:checked="{{popup1Check1}}"
bind:tap="handlePopup1Check1"
color="#f23a2f"
></checkbox>
<view class="c-content"> <view class="c-content">
我特此同意 我特此同意
<text class="link" bind:tap="routerTo" data-url="/doc/pages/doc1/index">《个人信息及隐私政策》</text> <text class="link" bind:tap="routerTo" data-url="/doc/pages/doc1/index">《个人信息及隐私政策》</text>
@ -26,11 +33,61 @@
<view class="btn2" bind:tap="handleCancel">不同意</view> <view class="btn2" bind:tap="handleCancel">不同意</view>
</view> </view>
<view class="popup2" wx:if="{{type==='stayTuned'}}"> <view class="popup2" wx:elif="{{type==='stayTuned'}}">
<image class="photo" src="{{imageUrl}}stayTuned.png?t={{Timestamp}}"></image> <image class="photo" src="{{imageUrl}}stayTuned.png?t={{Timestamp}}"></image>
<view class="content"> <view class="content">
<view>努力建设中</view> <view>努力建设中</view>
<view>敬请期待</view> <view>敬请期待</view>
</view> </view>
</view> </view>
<view class="popup3" wx:elif="{{type==='bindDoctor'}}">
<image class="icon" src="/images/icon23.png"></image>
<view class="container">
<image class="title" src="/images/title1.png"></image>
<view class="card">
<image
class="avatar"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
<view class="wrap">
<view class="name">王青</view>
<view class="hostipal">
<view class="content">北京积水潭医院龙泽院区</view>
<view class="tag">三甲</view>
</view>
</view>
</view>
<view class="btn">确定</view>
</view>
</view>
<view class="popup4" wx:elif="{{type==='bindDoctorReject'}}">
<image class="icon" src="/images/icon24.png"></image>
<view class="container">
<image class="title" src="/images/title2.png"></image>
<view class="content">请检查网络后重试</view>
<view class="btn">重新扫码</view>
</view>
</view>
<view class="popup5" wx:elif="{{type==='selectIdentity'}}">
<view class="container">
<image class="title" src="/images/title3.png"></image>
<view class="row">
<image class="avatar" src="/images/icon26.png"></image>
<view class="wrap">
<view class="name">还未开启基因治疗</view>
<view class="content">随便看看</view>
</view>
<image class="icon" src="/images/icon12.png"></image>
</view>
<view class="row">
<image class="avatar" src="/images/icon27.png"></image>
<view class="wrap">
<view class="name">还未开启基因治疗</view>
<view class="content">随便看看</view>
</view>
<image class="icon" src="/images/icon12.png"></image>
</view>
</view>
</view>
<image wx:if="{{params.position === 'cenetr'}}" class="close" src="/images/icon25.png" bind:tap="handleCancel"></image>
</van-popup> </van-popup>

BIN
src/images/icon23.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
src/images/icon24.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src/images/icon25.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/images/icon26.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
src/images/icon27.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
src/images/title1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
src/images/title2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
src/images/title3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

7
src/patient/pages/askPatient/index.json

@ -0,0 +1,7 @@
{
"navigationStyle": "custom",
"usingComponents": {
"van-loading": "@vant/weapp/loading/index",
"navbar": "/components/navbar/index"
}
}

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

@ -0,0 +1,545 @@
page {
background-color: rgba(242, 244, 245, 1);
}
.page {
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
.page-container {
flex: 1;
overflow: hidden;
.scroll-view {
height: 100%;
.first-ask {
margin-bottom: 32rpx;
padding: 0 32rpx;
.f-header {
padding: 32rpx;
display: flex;
justify-content: space-between;
.doctor-list {
display: flex;
.doctor-item {
.avatar {
width: 116rpx;
height: 116rpx;
border-radius: 50%;
}
}
}
}
.f-list {
padding: 32rpx;
border-radius: 32rpx;
background: linear-gradient(12deg, #fff2db 0%, #fdc1bd 100%);
border: 2rpx solid #ffffff;
.content {
font-size: 32rpx;
color: rgba(1, 1, 5, 1);
line-height: 48rpx;
}
.l-item {
margin-top: 24rpx;
font-size: 32rpx;
color: rgba(1, 1, 5, 1);
line-height: 48rxp;
padding: 20rpx 32rpx;
background-color: #fff;
border-radius: 84rpx;
}
}
}
.date {
padding-top: 20rpx;
font-size: 28rpx;
color: rgba(173, 179, 180, 1);
text-align: center;
}
.doctor {
padding: 15rpx 30rpx;
display: flex;
.avatar {
padding-right: 16rpx;
flex-shrink: 0;
.a-img {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
}
.d-container {
flex: 1;
margin-right: 74rpx;
display: flex;
flex-direction: column;
align-items: start;
.guide {
margin-bottom: 32rpx;
padding: 32rpx 30rpx;
border-radius: 0 32rpx 32rpx;
background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%);
border: 2rpx solid #ffffff;
.title {
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
font-weight: bold;
}
.sub-title {
font-size: 28rpx;
color: rgba(154, 161, 162, 1);
margin-bottom: 30rpx;
}
.list {
.l-item {
display: flex;
align-items: center;
gap: 16rpx;
margin-bottom: 30rpx;
.order {
flex-shrink: 0;
width: 28rpx;
height: 28rpx;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: center;
color: rgba(255, 255, 255, 1);
border-radius: 6rpx;
background: #67baca;
}
.content {
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
}
}
}
.tip {
font-size: 28rpx;
color: rgba(103, 113, 114, 1);
display: flex;
align-items: center;
.icon {
width: 44rpx;
height: 44rpx;
}
}
}
.message {
margin-bottom: 32rpx;
padding: 26rpx 32rpx;
background: linear-gradient(13deg, #ffffff 58.17%, #ffcdca 156.6%);
border-radius: 32rpx;
font-size: 32rpx;
color: rgba(1, 1, 5, 1);
line-height: 48rpx;
white-space: pre-line;
.reference {
margin-top: 24rpx;
font-size: 24rpx;
color: rgba(1, 1, 5, 0.5);
line-height: 32rpx;
}
.m-footer {
border-top: 1px solid rgba(0, 0, 0, 0.04);
margin-top: 32rpx;
padding-top: 24rpx;
display: flex;
align-items: center;
justify-content: flex-end;
.icon {
width: 36rpx;
height: 36rpx;
}
.num {
margin-left: 12rpx;
font-size: 32rpx;
color: rgba(1, 1, 5, 0.4);
line-height: 1px;
&.active {
color: rgba(242, 58, 47, 1);
}
}
}
}
.week {
margin-bottom: 32rpx;
padding: 26rpx 32rpx;
background-color: #fff;
border-radius: 0 32rpx 32rpx;
.w-title {
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
}
.w-container {
margin-top: 24rpx;
.w-content {
padding: 32rpx;
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
line-height: 48rpx;
border-radius: 24rpx;
background-color: rgba(247, 248, 249, 1);
}
.row {
display: flex;
.label {
width: 156rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: rgba(255, 255, 255, 1);
background-color: rgba(103, 186, 202, 1);
}
.content {
width: 156rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
background-color: rgba(242, 244, 245, 1);
}
&:first-of-type {
.label {
border-radius: 24rpx 0 0 0;
}
.content {
border-radius: 0 24rpx 0 0;
}
}
&:last-of-type {
.label {
border-radius: 0 0 0 24rpx;
}
.content {
border-radius: 0 0 24rpx 0;
}
}
&:not(:last-of-type) {
border-bottom: 2rpx solid #fff;
}
}
}
}
.adl {
margin-bottom: 32rpx;
padding: 32rpx 156rpx 34rpx 30rpx;
border-radius: 0 32rpx 32rpx;
background: linear-gradient(141deg, #edfcff 0%, #d4f3f9 100%);
border: 2rpx solid #fff;
.title {
width: 324rpx;
height: 40rpx;
}
.sub-title {
margin-top: 18rpx;
line-height: 1;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.8);
}
.btn {
margin-top: 20rpx;
width: 220rpx;
height: 56rpx;
text-align: center;
line-height: 56rpx;
font-size: 28rpx;
color: #e04775;
background: #ffffff;
border-radius: 102rpx 102rpx 102rpx 102rpx;
}
.tip {
margin-top: 10rpx;
font-size: 24rpx;
color: #fff;
}
}
.audio {
margin-bottom: 32rpx;
padding: 22rpx 24rpx;
border-radius: 0 32rpx 32rpx;
background-color: #fff;
min-width: 218rpx;
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
display: flex;
align-items: center;
gap: 12rpx;
box-sizing: border-box;
.icon {
width: 32rpx;
height: 40rpx;
}
}
.info {
margin-bottom: 32rpx;
padding: 26rpx 32rpx;
background-color: #fff;
border-radius: 0 32rpx 32rpx 32rpx;
.content {
font-size: 28rpx;
color: #283031;
}
.btn {
margin-top: 24rpx;
padding: 22rpx;
font-size: 32rpx;
color: #283031;
line-height: 40rpx;
text-align: center;
background: #67baca;
color: #ffffff;
border-radius: 104rpx 104rpx 104rpx 104rpx;
border: 1rpx solid #f8f9f9;
}
}
.referral {
margin-bottom: 32rpx;
width: 502rpx;
height: 262rpx;
background: linear-gradient(223deg, #59b0c2 0%, #94e2f1 100%);
box-shadow: 0rpx 4rpx 24rpx 0rpx rgba(0, 0, 0, 0.07);
border-radius: 24rpx 24rpx 24rpx 24rpx;
.r-header {
padding: 20rpx 24rpx 0 32rpx;
display: flex;
.title {
font-size: 32rpx;
color: #ffffff;
line-height: 48rpx;
}
.icon {
flex-shrink: 0;
width: 138rpx;
height: 122rpx;
}
}
.r-footer {
padding: 32rpx;
background: linear-gradient(11deg, #ffffff 8%, rgba(255, 255, 255, 0.79) 100%);
border-radius: 24rpx 24rpx 24rpx 24rpx;
border: 2rpx solid #ffffff;
.btn {
width: 438rpx;
height: 64rpx;
font-size: 32rpx;
color: #fff;
text-align: center;
line-height: 64rpx;
background: #67baca;
border-radius: 104rpx 104rpx 104rpx 104rpx;
}
}
}
}
}
.patient {
padding: 15rpx 30rpx;
display: flex;
justify-content: flex-end;
.avatar {
padding-left: 16rpx;
flex-shrink: 0;
.a-img {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
}
.p-container {
flex: 1;
margin-left: 74rpx;
display: flex;
flex-direction: column;
align-items: flex-end;
.guide {
margin-bottom: 32rpx;
padding: 32rpx 30rpx;
border-radius: 32rpx 0 32rpx 32rpx;
background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%);
border: 2rpx solid #ffffff;
.title {
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
font-weight: bold;
}
.sub-title {
font-size: 28rpx;
color: rgba(154, 161, 162, 1);
margin-bottom: 30rpx;
}
.list {
.l-item {
display: flex;
align-items: center;
gap: 16rpx;
margin-bottom: 30rpx;
.order {
flex-shrink: 0;
width: 28rpx;
height: 28rpx;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: center;
color: rgba(255, 255, 255, 1);
border-radius: 6rpx;
background: #67baca;
}
.content {
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
}
}
}
.tip {
font-size: 28rpx;
color: rgba(103, 113, 114, 1);
display: flex;
align-items: center;
.icon {
width: 44rpx;
height: 44rpx;
}
}
}
.message {
margin-bottom: 32rpx;
padding: 26rpx 32rpx;
background: linear-gradient(180deg, #fc684f 0%, #f33d31 100%);
border-radius: 40rpx;
font-size: 32rpx;
color: #fff;
white-space: pre-line;
}
}
}
.place {
height: 10vh;
}
}
}
.page-footer {
position: relative;
flex-shrink: 0;
padding: 18rpx 30rpx calc(env(safe-area-inset-bottom) + 30rpx);
border-radius: 24rpx 24rpx 0 0;
background-color: rgba(255, 255, 255, 1);
transition: all 0.3s;
height: calc(124rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
box-shadow: 0rpx 2rpx 28rpx 0rpx rgba(0, 0, 0, 0.08);
.unread {
position: absolute;
top: -80rpx;
left: 50%;
transform: translateX(-50%);
padding: 12rpx 32rpx;
border-radius: 138rpx;
font-size: 24rpx;
color: rgba(103, 113, 114, 1);
background-color: #fff;
}
&.expend {
height: 50vh;
}
.title {
margin-top: 26rpx;
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
display: flex;
align-items: center;
justify-content: center;
gap: 10rpx;
font-weight: bold;
.icon {
width: 36rpx;
height: 36rpx;
}
}
.tabs {
margin-top: 12rpx;
padding: 24rpx 0;
display: flex;
align-items: center;
gap: 22rpx;
overflow-x: auto;
&::-webkit-scrollbar {
display: none;
}
.tab {
flex-shrink: 0;
padding: 14rpx 32rpx;
font-size: 28rpx;
color: rgba(1, 1, 5, 0.6);
border-radius: 129rpx;
background-color: rgba(247, 247, 250, 1);
display: flex;
align-items: center;
gap: 8rpx;
line-height: 1;
.icon {
width: 32rpx;
height: 32rpx;
}
.icon-active {
width: 32rpx;
height: 32rpx;
display: none;
}
&.active {
color: #fff;
background: linear-gradient(180deg, #fc684f 0%, #f33d31 100%);
.icon {
display: none;
}
.icon-active {
display: block;
}
}
}
}
.list {
max-height: 35vh;
overflow-y: auto;
.l-item {
padding: 20rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
.order {
width: 28rpx;
height: 28rpx;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: center;
color: rgba(255, 255, 255, 1);
border-radius: 6rpx;
background: linear-gradient(180deg, #fc684f 0%, #f33d31 100%);
}
.content {
padding: 0 16rpx;
flex: 1;
font-size: 32rpx;
color: rgba(40, 48, 49, 1);
}
.icon {
color: rgba(40, 48, 49, 1);
}
}
.none {
display: block;
margin: 30rpx auto;
width: 344rpx;
max-height: 302rpx;
}
}
}
}

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

@ -0,0 +1,251 @@
import dayjs from 'dayjs'
const licia = require('miniprogram-licia')
const app = getApp<IAppOption>()
interface IMessageItem {
msgId: string
msgContentType: '1' // 1: 文本
msgContent: any
msgVisitTime: string
msgFromType: '1' | '2' // 1: 患者 2: 医生
msgCreateTime: string // 消息创建时间
msgCreateTimeName?: string // 消息创建时间
showTime?: boolean
questionId?: string // 问题ID
Reference?: string // 参考资料
LikeTimes?: number // 点赞次数
IsLike?: boolean // 是否点赞
HasAnswer?: boolean // 是否有答案
}
Page({
data: {
expend: false,
scrollTop: 0,
scrollIntoView: '',
doctorDetail: {} as any,
questionActive: 0,
questionList: [] as any,
questionActiveList: [] as any[],
headerQuestionList: [] as any,
isLoad: false,
isFinish: false,
messageList: [] as IMessageItem[],
nextMsgId: '',
unReadCount: 0,
firstNotReadMsgId: 0,
isVisitAdl: 2,
adlMsgId: 0,
LikeTimes: 0,
userInfo: {},
},
onLoad(options) {
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_FAQ' })
app.getUserInfo().then((userInfo) => {
this.setData({
userInfo,
})
})
this.getQuestionList()
this.getHeaderQuestionList()
if (options.id) {
this.getDetail(options.id)
}
})
},
handleView(index = -1) {
this.setData({
scrollIntoView: index > -1 ? `view${index}` : `place`,
})
},
getHeaderQuestionList() {
wx.ajax({
method: 'GET',
url: '?r=wtx/common-question/concerned-list',
data: {},
}).then((res) => {
this.setData({
headerQuestionList: res.list,
})
})
},
getDetail(Id: string) {
wx.ajax({
method: 'GET',
url: '?r=wtx/common-question/detail',
data: { Id },
}).then((res) => {
this.handleSendQuestion(res)
})
},
getQuestionList() {
wx.ajax({
method: 'GET',
url: '?r=wtx/common-question/type-list',
data: {},
}).then((res) => {
this.setData({
questionList: res.list,
})
this.getQuestionCommonList(this.data.questionActive)
})
},
getQuestionCommonList(questionActive: number) {
const QuestionTypeId = this.data.questionList[questionActive].Id
wx.ajax({
method: 'GET',
url: '?r=wtx/common-question/list',
data: {
QuestionTypeId,
count: 0,
},
}).then((res) => {
if (this.data.questionActive === questionActive) {
this.setData({
questionActiveList: res.list,
})
}
})
},
handleHeaderQuestion(e: any) {
const { index } = e.currentTarget.dataset
const { headerQuestionList } = this.data
const question = headerQuestionList[index]
this.handleQuestionClick(question.Id)
this.handleSendQuestion(question)
},
handleQuestion(e: any) {
const { index } = e.currentTarget.dataset
const { questionActiveList } = this.data
const question = questionActiveList[index]
this.handleQuestionClick(question.Id)
this.handleSendQuestion(question)
},
handleSendQuestion(questionItem: any) {
const { messageList } = this.data
this.setData({
messageList: [
...messageList,
{
msgId: new Date().getTime().toString(),
msgContentType: '1',
msgContent: questionItem.Question,
msgVisitTime: '',
msgFromType: '1',
msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
},
{
msgId: new Date().getTime().toString(),
msgContentType: '1',
msgContent: questionItem.Answer,
questionId: questionItem.Id,
Reference: questionItem.Reference,
LikeTimes: questionItem.LikeTimes,
IsLike: questionItem.IsLike,
HasAnswer: questionItem.HasAnswer,
msgVisitTime: '',
msgFromType: '2',
msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
},
],
})
this.handleView()
},
handleQuestionClick(Id) {
wx.ajax({
method: 'POST',
url: '?r=wtx/common-question/click',
data: { Id },
})
},
handleLike(e) {
const { index } = e.currentTarget.dataset
const { messageList, LikeTimes } = this.data
const item = messageList[index]
const LikeTimesKey = `messageList[${index}].LikeTimes`
const IsLikeKey = `messageList[${index}].IsLike`
this.setData({
[LikeTimesKey]: Number(item.LikeTimes) + 1,
[IsLikeKey]: true,
LikeTimes: LikeTimes + 1,
})
this.likePost(item.questionId)
},
likePost: licia.debounce(function (this: any, Id) {
const { LikeTimes } = this.data
this.setData({
LikeTimes: 0,
})
wx.ajax({
method: 'POST',
url: '?r=wtx/common-question/like',
data: {
Id,
LikeTimes,
},
})
}, 1000),
formatTime(date: string) {
let msgCreateTimeName = ''
if (dayjs().format('YYYY-MM-DD') === dayjs(date).format('YYYY-MM-DD')) {
msgCreateTimeName = dayjs(date).format('HH:mm')
} else if (dayjs().format('YYYY-MM-DD') === dayjs(date).add(1, 'day').format('YYYY-MM-DD')) {
msgCreateTimeName = `昨天 ${dayjs(date).format('HH:mm')}`
} else if (dayjs().diff(date, 'day') < 7) {
msgCreateTimeName = dayjs(date).format(`dddd HH:mm`)
} else {
msgCreateTimeName = dayjs(date).format('YYYY-MM-DD HH:mm')
}
return msgCreateTimeName
},
filterCreateTime() {
const gapTime = 5 * 60 * 1000
const { messageList } = this.data
let preTime = 0
messageList.forEach((item, index) => {
if (index === 0) {
item.showTime = true
preTime = dayjs(item.msgCreateTime).valueOf()
item.msgCreateTimeName = this.formatTime(item.msgCreateTime)
} else {
const curTime = dayjs(item.msgCreateTime).valueOf()
if (curTime - preTime > gapTime) {
item.showTime = true
item.msgCreateTimeName = this.formatTime(item.msgCreateTime)
preTime = dayjs(item.msgCreateTime).valueOf()
}
}
})
this.setData({
messageList,
})
},
handleQuestionTab(e) {
const { index } = e.currentTarget.dataset
this.setData({
questionActive: index,
})
this.getQuestionCommonList(index)
},
handleFooter() {
this.setData({
expend: !this.data.expend,
})
if (this.data.expend) {
// this.getQuestionList()
setTimeout(() => {
this.handleView()
}, 300)
}
},
handleBack() {
wx.navigateBack()
},
})

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

@ -0,0 +1,137 @@
<navbar fixed title="大家都在问" custom-style="background:{{background}}" back>
<van-icon name="arrow-left" slot="left" size="18px" color="#000" bind:tap="handleBack" />
</navbar>
<view
class="page"
style="background: url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 602rpx;padding-top:{{pageTop+21}}px;"
>
<view class="page-container" id="page-container">
<scroll-view
class="scroll-view"
scroll-y="{{true}}"
scroll-top="{{scrollTop}}"
scroll-into-view="{{scrollIntoView}}"
scroll-with-animation
bindscrolltoupper="scrolltoupper"
>
<view class="first-ask" wx:if="{{headerQuestionList.length}}">
<view class="f-header">
<view class="doctor-list">
<view class="doctor">
<image
class="avatar"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
<view class="name">王青</view>
</view>
<view class="doctor">
<image
class="avatar"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
<view class="name">刘湖飞</view>
</view>
</view>
<view class="more">
查看医生介绍
<van-icon name="arrow" />
</view>
</view>
<view class="f-list">
<view class="content">你好王青,有什么问题我们可以帮助到您?</view>
<view
class="l-item"
wx:for="{{headerQuestionList}}"
wx:key="Id"
bind:tap="handleHeaderQuestion"
data-index="{{index}}"
>
{{item.Question}}
</view>
</view>
</view>
<view wx:for="{{messageList}}" wx:key="msgId" wx:for-item="message" wx:for-index="mIndex" id="view{{mIndex}}">
<view class="date" wx:if="{{message.showTime}}">{{message.msgCreateTimeName}}</view>
<view class="doctor" wx:if="{{message.msgFromType==='2'}}">
<view class="avatar">
<image class="a-img" mode="aspectFill" src="{{imageUrl}}avatar1.png?t={{Timestamp}}"></image>
</view>
<view class="d-container">
<view class="guide" wx:if="{{message.msgContentType==='5'}}">
<view class="title">{{message.welcomeMsg.title}}</view>
<view class="sub-title">{{message.welcomeMsg.questionDes}}</view>
<view class="list">
<view
class="l-item"
wx:for="{{message.welcomeMsg.hotQuestion}}"
wx:key="questionId"
bind:tap="handleHot"
data-mindex="{{mIndex}}"
data-index="{{index}}"
>
<view class="order">{{index+1}}</view>
<view class="content">{{item.question}}</view>
</view>
</view>
<view class="tip">
{{message.welcomeMsg.guideClick}}
<image class="icon" src="{{imageUrl}}/doctor/icon-down1.png?t={{Timestamp}}"></image>
</view>
</view>
<view class="message" wx:elif="{{message.msgContentType==='1'}}">
<view>{{message.msgContent }}</view>
<view class="reference" wx:if="{{message.Reference}}">{{message.Reference}}</view>
<view class="m-footer" wx:if="{{message.HasAnswer}}" bind:tap="handleLike" data-index="{{mIndex}}">
<image wx:if="{{message.IsLike}}" class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
<image wx:else class="icon" src="{{imageUrl}}icon10.png?t={{Timestamp}}"></image>
<view class="num {{detail.IsLike && 'active'}}" wx:if="{{message.LikeTimes>0}}">
{{message.LikeTimes}}
</view>
</view>
</view>
</view>
</view>
<view class="patient" wx:if="{{message.msgFromType==='1'}}">
<view class="p-container">
<view class="message" wx:if="{{message.msgContentType==='1'}}">{{message.msgContent}}</view>
</view>
<view class="avatar">
<image class="a-img" mode="aspectFill" src="{{userInfo.Avatar}}"></image>
</view>
</view>
</view>
<view id="place" class="place"></view>
</scroll-view>
</view>
<view class="page-footer {{expend && 'expend'}}" catch:tap="handleFooter">
<view class="title">
<image class="icon" src="{{imageUrl}}icon11.png?t={{Timestamp}}"></image>
我要提问
</view>
<view class="tabs" wx:if="{{expend}}">
<view
class="tab {{questionActive === index && 'active'}}"
wx:for="{{questionList}}"
wx:key="typeId"
catch:tap="handleQuestionTab"
data-index="{{index}}"
>
{{item.Name}}
</view>
</view>
<view class="list" wx:if="{{expend}}">
<view
class="l-item"
wx:for="{{questionActiveList}}"
wx:key="questionId"
bind:tap="handleQuestion"
data-index="{{index}}"
>
<view class="order">{{index+1}}</view>
<view class="content">{{item.Question}}</view>
<van-icon color="#ADB3B4" name="arrow" />
</view>
<image class="none" src="{{imageUrl}}none.png" mode="widthFix" wx:if="{{!questionActiveList.length}}"></image>
</view>
</view>
</view>

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

@ -2,6 +2,7 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"patient-tab-bar": "/patient/components/patient-tab-bar/index", "patient-tab-bar": "/patient/components/patient-tab-bar/index",
"navbar": "/components/navbar/index" "navbar": "/components/navbar/index",
"popup": "/components/popup/index"
} }
} }

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

@ -1,8 +1,19 @@
const _app = getApp<IAppOption>(); const _app = getApp<IAppOption>()
Page({ Page({
data: {}, data: {
popupShow: false,
popupType: 'selectIdentity',
// popupType: 'bindDoctorReject',
// popupType: 'bindDoctor',
popupParams: {},
},
onLoad() {}, onLoad() {},
}); handleAskPatient() {
wx.navigateTo({
url: '/patient/pages/askPatient/index',
})
},
})
export {} export {}

10
src/patient/pages/home/index.wxml

@ -46,7 +46,7 @@
</view> </view>
<view class="content">随时随地您可以联系专属医生团队</view> <view class="content">随时随地您可以联系专属医生团队</view>
</view> </view>
<view class="btn">问医生</view> <view class="btn" bind:tap="handleAskPatient">问医生</view>
</view> </view>
</view> </view>
<view class="process"> <view class="process">
@ -112,3 +112,11 @@
</view> </view>
<patient-tab-bar></patient-tab-bar> <patient-tab-bar></patient-tab-bar>
<popup
show="{{popupShow}}"
type="{{popupType}}"
params="{{popupParams}}"
bind:ok="handlePopupOk"
bind:cancel="handlePopupCancel"
></popup>

Loading…
Cancel
Save