diff --git a/project.config.json b/project.config.json index 91b8ed6..5f59496 100644 --- a/project.config.json +++ b/project.config.json @@ -3,7 +3,10 @@ "miniprogramRoot": "src/", "compileType": "miniprogram", "setting": { - "useCompilerPlugins": ["typescript", "sass"], + "useCompilerPlugins": [ + "typescript", + "sass" + ], "urlCheck": true, "coverView": true, "es6": true, @@ -61,14 +64,13 @@ "type": "glob" } ], - "include": [] }, - "appid": "wxa4ece062e60e93a5", + "appid": "wx96104303877e3fd9", "scripts": { "beforeCompile": "pnpm run beforeCompile", "beforePreview": "pnpm run beforeCompile", "beforeUpload": "pnpm run beforeCompile" }, "libVersion": "3.5.8" -} +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index fbdf45e..b3dfdc3 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -23,11 +23,18 @@ "miniprogram": { "list": [ { + "name": "患者-问医生", + "pathName": "patient/pages/askPatient/index", + "query": "", + "scene": null, + "launchMode": "default" + }, + { "name": "知识夸详情-文章", "pathName": "pages/knowledgeDetail/index", "query": "id=15", - "scene": null, - "launchMode": "default" + "launchMode": "default", + "scene": null }, { "name": "知识库详情-视频", diff --git a/src/app.json b/src/app.json index 2f2ae13..09e6b4c 100644 --- a/src/app.json +++ b/src/app.json @@ -15,7 +15,13 @@ "subPackages": [ { "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", diff --git a/src/app.ts b/src/app.ts index bd21151..d4ff8c6 100644 --- a/src/app.ts +++ b/src/app.ts @@ -17,15 +17,15 @@ App({ globalData: { // dev // appid:wxa4ece062e60e93a5 - url: 'https://m.wtx.hbraas.com', - upFileUrl: 'https://m.wtx.hbraas.com/', - imageUrl: 'https://m.wtx.hbraas.com/GeneB/', + // url: 'https://m.wtx.hbraas.com', + // upFileUrl: 'https://m.wtx.hbraas.com/', + // imageUrl: 'https://m.wtx.hbraas.com/GeneB/', // pro - // appid:wx96f45ca4f1fa36ec - // url: 'https://m.wtx.hbsaas.com', - // upFileUrl: 'https://m.wtx.hbsaas.com/', - // imageUrl: 'https://m.wtx.hbsaas.com/GeneB/', + // appid:wx96104303877e3fd9 + url: 'https://m.gene.hbsaas.com', + upFileUrl: 'https://m.gene.hbsaas.com/', + imageUrl: 'https://m.gene.hbsaas.com/GeneB/', Timestamp: new Date().getTime(), scene: {}, diff --git a/src/components/popup/index.scss b/src/components/popup/index.scss index 25b7784..763b04d 100644 --- a/src/components/popup/index.scss +++ b/src/components/popup/index.scss @@ -28,7 +28,7 @@ .checkbox { transform: scale(0.8); } - .c-content{ + .c-content { padding-top: 5rpx; line-height: 48rpx; } @@ -58,6 +58,7 @@ .popup2 { padding: 36rpx 34rpx 58rpx; + background-color: #fff; .photo { width: 492rpx; height: 492rpx; @@ -68,3 +69,189 @@ 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; +} diff --git a/src/components/popup/index.wxml b/src/components/popup/index.wxml index be87ddf..45a2860 100644 --- a/src/components/popup/index.wxml +++ b/src/components/popup/index.wxml @@ -3,8 +3,10 @@ round z-index="{{100000}}" show="{{ show }}" + custom-style="background:transparent;" position="{{params.position || 'center'}}" safe-area-inset-bottom="{{false}}" + root-portal > @@ -15,7 +17,12 @@ ,请您仔细阅读。一旦您开始使用,即表示您已充分理解并同意协议内容。 - + 我特此同意 《个人信息及隐私政策》 @@ -26,11 +33,61 @@ 不同意 - + 努力建设中 敬请期待 + + + + + + + + 王青 + + 北京积水潭医院龙泽院区 + 三甲 + + + + 确定 + + + + + + + 请检查网络后重试 + 重新扫码 + + + + + + + + + 还未开启基因治疗 + 随便看看 + + + + + + + 还未开启基因治疗 + 随便看看 + + + + + + diff --git a/src/images/icon23.png b/src/images/icon23.png new file mode 100644 index 0000000..4feab12 Binary files /dev/null and b/src/images/icon23.png differ diff --git a/src/images/icon24.png b/src/images/icon24.png new file mode 100644 index 0000000..ee6987f Binary files /dev/null and b/src/images/icon24.png differ diff --git a/src/images/icon25.png b/src/images/icon25.png new file mode 100644 index 0000000..07e3851 Binary files /dev/null and b/src/images/icon25.png differ diff --git a/src/images/icon26.png b/src/images/icon26.png new file mode 100644 index 0000000..3eb853b Binary files /dev/null and b/src/images/icon26.png differ diff --git a/src/images/icon27.png b/src/images/icon27.png new file mode 100644 index 0000000..10b58fa Binary files /dev/null and b/src/images/icon27.png differ diff --git a/src/images/title1.png b/src/images/title1.png new file mode 100644 index 0000000..04cc4b6 Binary files /dev/null and b/src/images/title1.png differ diff --git a/src/images/title2.png b/src/images/title2.png new file mode 100644 index 0000000..f0ca8d3 Binary files /dev/null and b/src/images/title2.png differ diff --git a/src/images/title3.png b/src/images/title3.png new file mode 100644 index 0000000..4f430cf Binary files /dev/null and b/src/images/title3.png differ diff --git a/src/patient/pages/askPatient/index.json b/src/patient/pages/askPatient/index.json new file mode 100644 index 0000000..4dba397 --- /dev/null +++ b/src/patient/pages/askPatient/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "custom", + "usingComponents": { + "van-loading": "@vant/weapp/loading/index", + "navbar": "/components/navbar/index" + } +} diff --git a/src/patient/pages/askPatient/index.scss b/src/patient/pages/askPatient/index.scss new file mode 100644 index 0000000..9291e35 --- /dev/null +++ b/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; + } + } + } +} diff --git a/src/patient/pages/askPatient/index.ts b/src/patient/pages/askPatient/index.ts new file mode 100644 index 0000000..812b770 --- /dev/null +++ b/src/patient/pages/askPatient/index.ts @@ -0,0 +1,251 @@ +import dayjs from 'dayjs' +const licia = require('miniprogram-licia') + +const app = getApp() + +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() + }, +}) diff --git a/src/patient/pages/askPatient/index.wxml b/src/patient/pages/askPatient/index.wxml new file mode 100644 index 0000000..2812186 --- /dev/null +++ b/src/patient/pages/askPatient/index.wxml @@ -0,0 +1,137 @@ + + + + + + + + + + + + 王青 + + + + 刘湖飞 + + + + 查看医生介绍 + + + + + 你好王青,有什么问题我们可以帮助到您? + + {{item.Question}} + + + + + {{message.msgCreateTimeName}} + + + + + + + {{message.welcomeMsg.title}} + {{message.welcomeMsg.questionDes}} + + + {{index+1}} + {{item.question}} + + + + {{message.welcomeMsg.guideClick}} + + + + + {{message.msgContent }} + {{message.Reference}} + + + + + {{message.LikeTimes}} + + + + + + + + {{message.msgContent}} + + + + + + + + + + + + + 我要提问 + + + + {{item.Name}} + + + + + {{index+1}} + {{item.Question}} + + + + + + diff --git a/src/patient/pages/home/index.json b/src/patient/pages/home/index.json index 1ff5996..5d24582 100644 --- a/src/patient/pages/home/index.json +++ b/src/patient/pages/home/index.json @@ -2,6 +2,7 @@ "navigationStyle": "custom", "usingComponents": { "patient-tab-bar": "/patient/components/patient-tab-bar/index", - "navbar": "/components/navbar/index" + "navbar": "/components/navbar/index", + "popup": "/components/popup/index" } } diff --git a/src/patient/pages/home/index.ts b/src/patient/pages/home/index.ts index 067b6bb..ebe35de 100644 --- a/src/patient/pages/home/index.ts +++ b/src/patient/pages/home/index.ts @@ -1,8 +1,19 @@ -const _app = getApp(); +const _app = getApp() Page({ - data: {}, + data: { + popupShow: false, + popupType: 'selectIdentity', + // popupType: 'bindDoctorReject', + // popupType: 'bindDoctor', + popupParams: {}, + }, onLoad() {}, -}); + handleAskPatient() { + wx.navigateTo({ + url: '/patient/pages/askPatient/index', + }) + }, +}) export {} diff --git a/src/patient/pages/home/index.wxml b/src/patient/pages/home/index.wxml index 0f622cb..2059083 100644 --- a/src/patient/pages/home/index.wxml +++ b/src/patient/pages/home/index.wxml @@ -46,7 +46,7 @@ 随时随地您可以联系专属医生团队 - 问医生 + 问医生 @@ -112,3 +112,11 @@ + +