After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
{ |
||||
"navigationStyle": "custom", |
||||
"usingComponents": { |
||||
"van-loading": "@vant/weapp/loading/index", |
||||
"navbar": "/components/navbar/index" |
||||
} |
||||
} |
@ -0,0 +1,545 @@
@@ -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; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,251 @@
@@ -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() |
||||
}, |
||||
}) |
@ -0,0 +1,137 @@
@@ -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> |
@ -1,8 +1,19 @@
@@ -1,8 +1,19 @@
|
||||
const _app = getApp<IAppOption>(); |
||||
const _app = getApp<IAppOption>() |
||||
|
||||
Page({ |
||||
data: {}, |
||||
data: { |
||||
popupShow: false, |
||||
popupType: 'selectIdentity', |
||||
// popupType: 'bindDoctorReject',
|
||||
// popupType: 'bindDoctor',
|
||||
popupParams: {}, |
||||
}, |
||||
onLoad() {}, |
||||
}); |
||||
handleAskPatient() { |
||||
wx.navigateTo({ |
||||
url: '/patient/pages/askPatient/index', |
||||
}) |
||||
}, |
||||
}) |
||||
|
||||
export {} |
||||
|