diff --git a/epdc-resident-mp-yushan/app.json b/epdc-resident-mp-yushan/app.json index 10efa24..5002f4f 100644 --- a/epdc-resident-mp-yushan/app.json +++ b/epdc-resident-mp-yushan/app.json @@ -117,7 +117,12 @@ "name": "safety", "pages": [ "pages/index/index", - "pages/newsDetail/newsDetail" + "pages/newsDetail/newsDetail", + "pages/consultIndex/consultIndex", + "pages/consultantDetail/consultantDetail", + "pages/consultantList/consultantList", + "pages/myQuestion/myQuestion", + "pages/addQuestion/addQuestion" ] } ], diff --git a/epdc-resident-mp-yushan/pages/property/property.wxml b/epdc-resident-mp-yushan/pages/property/property.wxml index 2a7778f..5047e0b 100644 --- a/epdc-resident-mp-yushan/pages/property/property.wxml +++ b/epdc-resident-mp-yushan/pages/property/property.wxml @@ -48,9 +48,9 @@ 我的物业评分: - + - {{projectInfo.userScore==''?'打分':'修改'}} + {{projectInfo.userScore===''?'打分':'修改'}} 确定 @@ -68,7 +68,7 @@ - + + + + + + {{item.questionContent}} + {{item.collapse?'全文':'收起'}} + + + + {{item.userName}} + + + + {{answer.answerContent}} + {{answer.collapse?'全文':'收起'}} + + + {{answer.psychologistName+" | 心理咨询师"}} + + + + + + + + + + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/consultIndex/consultIndex.wxss b/epdc-resident-mp-yushan/subpages/safety/pages/consultIndex/consultIndex.wxss new file mode 100644 index 0000000..2ff2537 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/consultIndex/consultIndex.wxss @@ -0,0 +1,224 @@ +page { + width: 100%; + height: auto; + overflow-y: auto; + background: #f7f7f7; +} +.header { + position: fixed; + width: 100%; + top: 0; + left: 0; + z-index: 1000; +} +.header .header-bg { + width: 100%; + height: 100%; + position: absolute; + z-index: 10; + left: 0; + top: 0; +} +.header .navigation { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255,255,255, 0.9); + font-size: 32rpx; + position: relative; + z-index: 100; +} +.home { + width: 100%; +} +.header-back{ + height: 33rpx; + width: 18rpx; + position: fixed; + margin-left: 30rpx; + z-index: 101; +} +.list{ + width: 100%; + background-color: #fff; + padding:20rpx 0; +} +.list-header{ + width: 94%; + height: 50rpx; + margin: 0 auto; +} +.list-header .title{ + display: inline-block; + font-size: 35rpx; + width: 80%; + line-height: 50rpx; +} +.list-header .more{ + display: inline-block; + float: right; + width: 15%; + line-height: 50rpx; + font-size: 25rpx; + color: #999; + text-align: right; +} +.list-content{ + width: 100%; + display: inline-block; + padding: 20rpx 0; +} +.list-content .content{ + width: 25%; + display: inline-block; +} +.list-content .content .avatar{ + width: 80%; + margin-left: 40rpx; +} +.list-content .content .avatar .avatar-img{ + width: 70%; + height: 110rpx; + border-radius: 50%; +} +.list-content .content .avatar .avatar-mark{ + width: 25%; + height: 35rpx; + margin-left: -30rpx; +} +.list-content .content .name{ + width: 100%; + font-size: 30rpx; + text-align: center; +} +.footer{ + width: 100%; + height: 98rpx; + background: #fff; + position: fixed; + bottom: 0; + left: 0; + display: flex; + align-items: center; + justify-content: flex-end; +} +.addQuestionBtn { + width: 50%; + height: 100%; + line-height: 98rpx; + text-align: center; + background: #FE4646; + font-size: 32rpx; + color: #fff; + border-radius: 0px; + border:none +} +.myQuestionBtn { + width: 50%; + height: 100%; + line-height: 98rpx; + text-align: center; + background: #FFB000; + font-size: 32rpx; + color: #fff; + border-radius: 0px; + border:none +} +button::after{ + border: none; +} +.question-list{ + width: 100%; + margin-top: 20rpx; + margin-bottom: 98rpx; + background-color: #fff; +} +.question-item{ + width: 94%; + margin-top: 20rpx; + border-bottom: 0.5px solid #E7EDED; + margin: 0 auto; +} +.question-item .question-header{ + width: 100%; + height: 80rpx; + display: inline-flex; +} +.question-item .question-header .avatar{ + width: 7%; + display: inline-flex; + height: 85rpx; +} +.question-item .question-header .avatar .avatar-img{ + width: 100%; + height: 45rpx; + border-radius: 50%; + border:0.5px solid grey; + display: inline-flex; +} +.question-item .question-header .name{ + width: 70%; + margin-left: 10rpx; + display: inline-flex; + font-size: 30rpx; + line-height: 45rpx; + color: #999; +} +.question-item .question-content{ + font-size: 40rpx; + padding: 20rpx 0; + font-weight: bold; + letter-spacing: 2rpx; + color: #333; +} +.question-answer{ + width: 100%; + margin-top: 20rpx; +} +.question-answer .name{ + font-size: 25rpx; + margin-top: 20rpx; + color: #c3c3c3; + padding-bottom: 20rpx; +} +.answer-content{ + font-size: 30rpx; + color: #777; +} +.home::-webkit-scrollbar { + width: 0; + height: 0; + color: transparent; +} +.answer-content text{ + font-size: 28rpx; + line-height: 40rpx; + display: block; +} +.question-content text{ + font-size: 28rpx; + line-height: 50rpx; + display: block; +} + +.answer-content text.text-collapse{ + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:3; + overflow: hidden; + text-overflow: ellipsis; +} +.question-content text.text-collapse{ + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:2; + overflow: hidden; + text-overflow: ellipsis; +} + +.coll-p{ + font-size: 30rpx; + color: #5064A3; + margin-top: 10rpx; +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.js b/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.js new file mode 100644 index 0000000..a5cab8a --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.js @@ -0,0 +1,36 @@ +const api = require('../../utils/api') +import { getTimestamp } from '../../../../utils/common' +import util from '../../../../utils/util' +const app = getApp() +Page({ + data: { + consultantInfo:{} + }, + onLoad (options) { + this.setData({ + statusHeight: app.globalData.deviceInfo.statusHeight, + navigationHeight: app.globalData.deviceInfo.navigationHeight, + sudokuHeight:app.globalData.deviceInfo.statusHeight+app.globalData.deviceInfo.navigationHeight, + }) + this.setData({ + consultantId:options.id + }) + api.getConsultantInfo(options.id).then((res)=>{ + this.setData({ + consultantInfo:res.data + }) + }).catch((err)=>{ + console.log(err) + }); + } , + naviBack(){ + wx.navigateBack({ + delta:-1, + }) + }, + navigateToAsk(){ + wx.navigateTo({ + url: '../addQuestion/addQuestion?toConsultant='+this.data.consultantId, + }) + } +}) \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.json b/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.json new file mode 100644 index 0000000..20af2c5 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "completeInfo-dialog": "../../../../../components/completeInfoDialog/completeInfoDialog" + }, + "navigationBarTitleText": "咨询师详情", + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.wxml b/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.wxml new file mode 100644 index 0000000..f464f4e --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.wxml @@ -0,0 +1,29 @@ + + + + + + + 详情 + + + + + + + {{consultantInfo.name}} + {{consultantInfo.motto!==''?consultantInfo.motto:'暂无座右铭'}} + + + + 头衔 + {{item}} + + + 简介 + {{consultantInfo.briefIntroduction}} + + + + + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.wxss b/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.wxss new file mode 100644 index 0000000..75c5f90 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/consultantDetail/consultantDetail.wxss @@ -0,0 +1,118 @@ +page { + width: 100%; + height: auto; + overflow-y: auto; + background: #f7f7f7; +} + +.header { + position: fixed; + width: 100%; + top: 0; + left: 0; + z-index: 1000; +} +.header .header-bg { + width: 100%; + height: 100%; + position: absolute; + z-index: 10; + left: 0; + top: 0; +} +.header .navigation { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255,255,255, 0.9); + font-size: 32rpx; + position: relative; + z-index: 100; +} +.home { + width: 100%; + padding-bottom: 160rpx; + overflow-x: hidden; +} +.header-back{ + height: 33rpx; + width: 18rpx; + position: fixed; + margin-left: 30rpx; + z-index: 101; +} +.home .consultant-header{ + background-color: #fff; + width: 100%; + padding: 0 20rpx; + line-height: 100rpx; + margin-top: 20rpx; +} +.consultant-pic{ + width: 120rpx; + height: 120rpx; + border-radius: 60px; + margin-top: 20rpx; +} +.consultant-detail{ + width: 68%; + display: inline-block; + padding-left: 40rpx; + height: 120rpx; +} +.consultant-name{ + font-size: 30rpx; + font-weight: bold; + height: 75rpx; + word-break: break-all; + line-height: 50rpx; +} +.consultant-number{ + font-size: 25rpx; + color: #999; + line-height: 45rpx; +} +.title{ + width: 100%; + background-color: #fff; + margin-top: 20rpx; +} +.title-header{ + width: 94%; + margin:0 auto; + color: #999999; + height: 100rpx; + line-height: 100rpx; + font-size: 28rpx; + border-bottom: 0.5px solid #E7EDED; +} +.title-content{ + width: 94%; + margin:0 auto; + height: 80rpx; + line-height: 80rpx; + color: #333; + font-size: 32rpx; +} +.footer{ + width: 100%; + height: 98rpx; + position: fixed; + bottom: 5%; + left: 0; + display: flex; + align-items: center; + justify-content: flex-end; +} +.askBtn { + width: 70%; + height: 100%; + line-height: 98rpx; + text-align: center; + background: #cc1200; + font-size: 32rpx; + color: #fff; + border-radius: 40px; + border:none +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.js b/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.js new file mode 100644 index 0000000..4d0a518 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.js @@ -0,0 +1,50 @@ +const api = require('../../../../utils/api') +import { getTimestamp } from '../../../../utils/common' +import util from '../../../../utils/util' +const app = getApp() +Page({ + data: { + isLoading:true, + loadMoreType: 'loading', + loadMoreVisible: true, + consultantList:[] + }, + onLoad (options) { + this.setData({ + statusHeight: app.globalData.deviceInfo.statusHeight, + navigationHeight: app.globalData.deviceInfo.navigationHeight, + sudokuHeight:app.globalData.deviceInfo.statusHeight+app.globalData.deviceInfo.navigationHeight, + }) + this.getConsultantList(); + }, + onReachBottom(){ + // if(!this.data.isLoading && this.data.loadMoreType!='none'){ + // this.setData({ + // isLoading:true, + // loadMoreVisible:true, + // loadMoreType:"loading" + // }) + // } + }, + naviBack(){ + wx.navigateBack({ + delta:-1, + }) + }, + navigateToConsultDetail(e){ + console.log(e); + wx.navigateTo({ + url: '/subpages/safety/pages/consultantDetail/consultantDetail?id='+e.currentTarget.dataset.id, + }) + }, + getConsultantList(){ + api.getConsultantList('1').then(res=>{ + this.setData({ + isLoading:false, + consultantList:this.data.consultantList.concat(res.data), + loadMoreType:'none', + loadMoreVisible:false + }) + }) + } +}) \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.json b/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.json new file mode 100644 index 0000000..2803fd2 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.json @@ -0,0 +1,9 @@ +{ + "usingComponents": { + "completeInfo-dialog": "../../../../../components/completeInfoDialog/completeInfoDialog", + "load-more":"../../components/loadMore/loadMore" + }, + "navigationBarTitleText": "咨询师列表", + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.wxml b/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.wxml new file mode 100644 index 0000000..55c5f23 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.wxml @@ -0,0 +1,33 @@ + + + + + + + 列表 + + + + + + + + + + + + {{item.name}} + {{item.motto}} + + + + + + + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.wxss b/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.wxss new file mode 100644 index 0000000..542559a --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/consultantList/consultantList.wxss @@ -0,0 +1,85 @@ +page { + width: 100%; + height: auto; + overflow-y: auto; + background: #f7f7f7; +} + +.header { + position: fixed; + width: 100%; + top: 0; + left: 0; + z-index: 1000; +} +.header .header-bg { + width: 100%; + height: 100%; + position: absolute; + z-index: 10; + left: 0; + top: 0; +} +.header .navigation { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255,255,255, 0.9); + font-size: 32rpx; + position: relative; + z-index: 100; +} +.home { + width: 100%; + overflow-x: hidden; +} +.header-back{ + height: 33rpx; + width: 18rpx; + position: fixed; + margin-left: 30rpx; + z-index: 101; +} +.list{ + width: 100%; +background-color: #fff; +} +.list-content{ + display: inline-block; + width: 100%; +} +.list-content .content{ + width: 100%; + display: flex; + margin-top: 20rpx; + border-bottom: 0.5px solid #E7EEEE; + padding-bottom: 20rpx; +} +.list-content .content .avatar{ + width: 150rpx; + margin-left: 20rpx; +} +.list-content .content .avatar .avatar-img{ + width: 120rpx; + height: 120rpx; + border-radius: 50%; +} +.list-content .content .avatar .avatar-mark{ + width: 35rpx; + height: 35rpx; + margin-left: -30rpx; +} +.list-content .content .name{ + width: 100%; + font-size: 32rpx; +} +.list-content .content .detail{ + width: 94%; + font-size: 28rpx; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + color: #999; + margin-top: 40rpx; +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/index/index.js b/epdc-resident-mp-yushan/subpages/safety/pages/index/index.js index 55d656c..1c4a958 100644 --- a/epdc-resident-mp-yushan/subpages/safety/pages/index/index.js +++ b/epdc-resident-mp-yushan/subpages/safety/pages/index/index.js @@ -249,4 +249,10 @@ Page({ url: `/subpages/safety/pages/newsDetail/newsDetail?id=${id}` }) }, + //跳转心理咨询 + navigateToConsult(){ + wx.navigateTo({ + url: '/subpages/safety/pages/consultIndex/consultIndex', + }) + } }) \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/index/index.wxml b/epdc-resident-mp-yushan/subpages/safety/pages/index/index.wxml index 36943d8..cd172d3 100644 --- a/epdc-resident-mp-yushan/subpages/safety/pages/index/index.wxml +++ b/epdc-resident-mp-yushan/subpages/safety/pages/index/index.wxml @@ -1,6 +1,8 @@ - + + + 平安榆山 @@ -11,6 +13,9 @@ bind:navigatetoBannerDetail="navigatetoBannerDetail" bannerList="{{bannerList}}"> + + + { + this.setData({ + isLoading:false, + questionList:this.data.questionList.concat(res.data), + }) + this.setCollapse(); + if(res.data.length<10){ + this.setData({ + loadMoreType:'none', + loadMoreVisible:true, + }) + }else{ + this.setData({ + loadMoreType:"more", + loadMoreVisible:false + }) + } + }) + }, + setCollapse: function() { + var query = wx.createSelectorQuery(); + var that = this; + query.in(this.selectComponent('#question-list')).selectAll('#questionContent').boundingClientRect(function (rect) { + rect.forEach((v, i) => { + if (v.height > 60) { //判断高度,根据各种高度取折中 + var set = "questionList[" + i + "].collapse"; + var set1 = "questionList[" + i + "].showCollapse"; + that.setData({ + [set]: true, + [set1]: true, + }) + } + }) + }).exec(); + query.in(this.selectComponent('#question-list')).selectAll('#answerContent').boundingClientRect(function (rect) { + rect.forEach((v, i) => { + console.log(v) + console.log(v.dataset.question) + if (v.height > 70) { + var set = "questionList[" + v.dataset.question + "].answerList[0].collapse"; + var set1 = "questionList[" + v.dataset.question + "].answerList[0].showCollapse"; + that.setData({ + [set]: true, + [set1]: true, + }) + } + }) + }).exec(); + }, + //点击全文收起 + changeCollapse: function(e){ + var index = e.detail.currentTarget.dataset.index; + var questionIndex=e.detail.currentTarget.dataset.questionindex; + if(questionIndex===undefined){ + var set = "questionList[" + index + "].collapse"; + this.setData({ + [set]: !this.data.questionList[index].collapse + }) + }else{ + var set = "questionList[" + questionIndex + "].answerList[0].collapse"; + this.setData({ + [set]: !this.data.questionList[questionIndex].answerList[0].collapse + }) + } + } +}) \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/myQuestion/myQuestion.json b/epdc-resident-mp-yushan/subpages/safety/pages/myQuestion/myQuestion.json new file mode 100644 index 0000000..a5ead54 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/myQuestion/myQuestion.json @@ -0,0 +1,10 @@ +{ + "usingComponents": { + "completeInfo-dialog": "../../../../../components/completeInfoDialog/completeInfoDialog", + "question-list":"../../components/questionList/questionList", + "load-more":"../../components/loadMore/loadMore" + }, + "navigationBarTitleText": "我的提问", + "navigationStyle": "custom", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/myQuestion/myQuestion.wxml b/epdc-resident-mp-yushan/subpages/safety/pages/myQuestion/myQuestion.wxml new file mode 100644 index 0000000..dd6c8d6 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/myQuestion/myQuestion.wxml @@ -0,0 +1,16 @@ + + + + + + + 我的问题 + + + + + + \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/pages/myQuestion/myQuestion.wxss b/epdc-resident-mp-yushan/subpages/safety/pages/myQuestion/myQuestion.wxss new file mode 100644 index 0000000..600f2a5 --- /dev/null +++ b/epdc-resident-mp-yushan/subpages/safety/pages/myQuestion/myQuestion.wxss @@ -0,0 +1,42 @@ +page { + width: 100%; + height: auto; + overflow-y: auto; + background: #f7f7f7; +} + +.header { + position: fixed; + width: 100%; + top: 0; + left: 0; + z-index: 1000; +} +.header .header-bg { + width: 100%; + height: 100%; + position: absolute; + z-index: 10; + left: 0; + top: 0; +} +.header .navigation { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255,255,255, 0.9); + font-size: 32rpx; + position: relative; + z-index: 100; +} +.home { + width: 100%; +} +.header-back{ + height: 33rpx; + width: 18rpx; + position: fixed; + margin-left: 30rpx; + z-index: 101; +} \ No newline at end of file diff --git a/epdc-resident-mp-yushan/subpages/safety/utils/api.js b/epdc-resident-mp-yushan/subpages/safety/utils/api.js index b0dd3cb..af2133b 100644 --- a/epdc-resident-mp-yushan/subpages/safety/utils/api.js +++ b/epdc-resident-mp-yushan/subpages/safety/utils/api.js @@ -246,4 +246,10 @@ export function getMyTopicList ({ pageIndex , pageSize , groupId}) { pageSize, groupId }) -} \ No newline at end of file +} + /** + * 心理咨询师详细信息 + */ + export function getConsultantInfo (id) { + return request.get('property/psychology/psychologistInfo/'+id) + } diff --git a/epdc-resident-mp-yushan/utils/api.js b/epdc-resident-mp-yushan/utils/api.js index 00dff76..4ad7edc 100644 --- a/epdc-resident-mp-yushan/utils/api.js +++ b/epdc-resident-mp-yushan/utils/api.js @@ -53,7 +53,12 @@ module.exports = { getPropertyProjectDetail:getPropertyProjectDetail, applyForGroup:applyForGroup, submitScore:submitScore, - getStartupPageV2:getStartupPageV2 + getStartupPageV2:getStartupPageV2, + getConsultantList:getConsultantList, + getQuestionList:getQuestionList, + submitQuestion:submitQuestion, + getMyQuestion:getMyQuestion, + getConsultantDetail:getConsultantDetail } function getToken(wxCode) { @@ -444,4 +449,28 @@ function applyForGroup(groupId){ export function getStartupPageV2() { return fly.get('startup/v2/getStartupPage') + } + /********心理咨询-心理咨询师列表*******/ + export function getConsultantList(allFlag) { + return fly.get('property/psychology/listPsychiatrist',{ + 'allFlag':allFlag + }) + } + /********心理咨询-居民端-心理咨询-问题列表*******/ + export function getQuestionList(param) { + return fly.get('property/psychology/listQuestion',param) + } + /********心理咨询-提交心理咨询问题*******/ + export function submitQuestion(param) { + return fly.post('property/psychology/submitQuestion',param) + } + /********心理咨询-心理咨询师详细信息*******/ + export function getConsultantDetail(id) { + return fly.get('property/psychology/psychologistInfo',{ + "psychologistId":id + }) + } + /********心理咨询-居民端-心理咨询-我的问题列表*******/ + export function getMyQuestion(param) { + return fly.get('property/psychology/listUserQuestion',param) } \ No newline at end of file