41 changed files with 1583 additions and 2 deletions
@ -0,0 +1,16 @@ |
|||
var fly = require('../utils/request.js') |
|||
module.exports = { |
|||
submitConflict: submitConflict, |
|||
getHistory:getHistory, |
|||
getHistoryById:getHistoryById |
|||
} |
|||
|
|||
function submitConflict(param) { |
|||
return fly.post('work/property/conflict/submit', param) |
|||
} |
|||
function getHistory(param) { |
|||
return fly.get('work/property/conflict/listHistory', param) |
|||
} |
|||
function getHistoryById(id) { |
|||
return fly.get('work/property/conflict/getById/'+id) |
|||
} |
@ -0,0 +1,18 @@ |
|||
var fly = require('../utils/request.js') |
|||
module.exports = { |
|||
getQuestionList: getQuestionList, |
|||
getMyQuestionList:getMyQuestionList, |
|||
submitAnswer:submitAnswer |
|||
} |
|||
// 工作端--待解答的心理咨询问题列表
|
|||
function getQuestionList(param) { |
|||
return fly.get('work/property/psychology/listQuestion', param) |
|||
} |
|||
// 工作端--我解答的心理咨询问题列表
|
|||
function getMyQuestionList(param) { |
|||
return fly.get('work/property/psychology/listMyQuestion', param) |
|||
} |
|||
// 工作端--心理咨询-提交问题的回答
|
|||
function submitAnswer(param) { |
|||
return fly.post('work/property/psychology/submitAnswer', param) |
|||
} |
@ -0,0 +1,14 @@ |
|||
Component({ |
|||
data: { |
|||
}, |
|||
properties: { |
|||
loadMoreVisible: { |
|||
type: Boolean, |
|||
value: false |
|||
}, |
|||
loadMoreType: { |
|||
type: String, |
|||
value: 'loading' |
|||
} |
|||
} |
|||
}) |
@ -0,0 +1,3 @@ |
|||
{ |
|||
"component": true |
|||
} |
@ -0,0 +1,7 @@ |
|||
<view class="load-more" style="visibility: {{loadMoreVisible ? 'visible' : 'hidden'}}"> |
|||
<block wx:if="{{loadMoreType == 'loading'}}"> |
|||
<image class="load-image" src="../../images/loading.gif" /> |
|||
<view class="load-text">正在加载中...</view> |
|||
</block> |
|||
<view wx:else class="load-text">没有更多了~</view> |
|||
</view> |
@ -0,0 +1,18 @@ |
|||
.load-more { |
|||
width: 100%; |
|||
height: 100rpx; |
|||
background: #f7f7f7; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
.load-more .load-text { |
|||
color: #999; |
|||
font-size: 26rpx; |
|||
} |
|||
.load-more .load-image { |
|||
width: 30rpx; |
|||
height: 30rpx; |
|||
object-fit: cover; |
|||
margin-right: 10rpx; |
|||
} |
@ -0,0 +1,70 @@ |
|||
Component({ |
|||
data: { |
|||
lastY: '', |
|||
translateHeight: 0, |
|||
state: -1, |
|||
scrollTop: 0, |
|||
enablePulldownFresh: false |
|||
}, |
|||
options: { |
|||
multipleSlots: true |
|||
}, |
|||
properties: { |
|||
upperDistance: { |
|||
type: Number, |
|||
value: 80 |
|||
} |
|||
}, |
|||
methods: { |
|||
onPageScroll (e) { |
|||
this.data.scrollTop = e.scrollTop |
|||
this.data.enablePulldownFresh = false |
|||
}, |
|||
touchstart (e) { |
|||
this.data.lastY = e.touches[0].clientY |
|||
if (this.data.scrollTop === 0) { |
|||
this.data.enablePulldownFresh = true |
|||
} else { |
|||
this.data.enablePulldownFresh = false |
|||
} |
|||
}, |
|||
touchmove (e) { |
|||
let clientY = e.touches[0].clientY |
|||
let offset = clientY - this.data.lastY |
|||
if (this.data.scrollTop > 0 || offset < 0) { |
|||
return false |
|||
} |
|||
this.data.translateHeight = offset |
|||
this.data.state = 1 |
|||
|
|||
if (this.data.enablePulldownFresh) { |
|||
if (this.data.translateHeight > this.data.upperDistance) { |
|||
this.data.state = 2 |
|||
} |
|||
this.setData({ |
|||
translateHeight: this.data.translateHeight > 100 ? 100 : this.data.translateHeight, |
|||
state: this.data.state |
|||
}) |
|||
} |
|||
}, |
|||
touchend (e) { |
|||
if (this.data.translateHeight > this.data.upperDistance) { |
|||
if (this.data.enablePulldownFresh) { |
|||
this.setData({ |
|||
translateHeight: 100, |
|||
state: 3 |
|||
}) |
|||
this.triggerEvent('pullDownRefresh') |
|||
} |
|||
} else if (this.data.scrollTop <= 0) { |
|||
this.stopRefresh() |
|||
} |
|||
}, |
|||
stopRefresh () { |
|||
this.setData({ |
|||
translateHeight: 0, |
|||
state: -1 |
|||
}) |
|||
} |
|||
} |
|||
}) |
@ -0,0 +1,3 @@ |
|||
{ |
|||
"component": true |
|||
} |
@ -0,0 +1,9 @@ |
|||
<view class="pulldown-refresh" bindtouchstart="touchstart" bindtouchmove="touchmove" bindtouchend="touchend"> |
|||
<view class="pulldown-state"> |
|||
<image class="loading" src="../../images/loading.gif" /> |
|||
<view class="loading-state">{{state == 1 ? '下拉刷新' : state == 2 ? '松开刷新' : '刷新中...'}}</view> |
|||
</view> |
|||
<view class="pulldown-content" style="transform: translateY({{translateHeight}}rpx)"> |
|||
<slot name="content"></slot> |
|||
</view> |
|||
</view> |
@ -0,0 +1,27 @@ |
|||
.pulldown-refresh { |
|||
width:100%; |
|||
background: #f7f7f7; |
|||
} |
|||
.pulldown-refresh .pulldown-state { |
|||
width:100%; |
|||
height: 100rpx; |
|||
display:flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
margin-bottom: -100rpx; |
|||
} |
|||
.pulldown-refresh .pulldown-state .loading { |
|||
width: 30rpx; |
|||
height: 30rpx; |
|||
margin-right: 10rpx; |
|||
} |
|||
.pulldown-refresh .pulldown-state .loading-state { |
|||
font-size: 25rpx; |
|||
color:#666; |
|||
} |
|||
|
|||
.pulldown-refresh .pulldown-content { |
|||
width:100%; |
|||
height:auto; |
|||
transition: transform 0.05s linear; |
|||
} |
After Width: | Height: | Size: 896 B |
After Width: | Height: | Size: 3.8 KiB |
@ -0,0 +1,28 @@ |
|||
const app = getApp() |
|||
const api = require('../../../../api/conflict') |
|||
Page({ |
|||
data: { |
|||
detail:{} |
|||
}, |
|||
onHide:function(){ |
|||
|
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
let id = options.id; |
|||
api.getHistoryById(id).then(res=>{ |
|||
this.setData({ |
|||
detail:res.data |
|||
}) |
|||
}) |
|||
}, |
|||
// this.getRecommend();
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
}) |
@ -0,0 +1,5 @@ |
|||
{ |
|||
"navigationBarTitleText": "详情", |
|||
"usingComponents": { |
|||
} |
|||
} |
@ -0,0 +1,42 @@ |
|||
<view class="edit"> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">矛盾纠纷类型</view> |
|||
<textarea class="textarea" disabled="{{true}}" value="{{detail.conflictType}}" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">形成原因</view> |
|||
<textarea class="textarea" disabled="{{true}}" value="{{detail.conflictReason}}" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">涉及人数</view> |
|||
<textarea class="textarea" disabled="{{true}}" value="{{detail.involvedNum}}" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">挑头骨干人员</view> |
|||
<textarea class="textarea"disabled="{{true}}" value="{{detail.mainstayLeader}}" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">责任单位</view> |
|||
<textarea class="textarea" disabled="{{true}}" value="{{detail.responsibleDept}}" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">责任人</view> |
|||
<textarea class="textarea" disabled="{{true}}" value="{{detail.responsiblePeople}}" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">主要采取措施</view> |
|||
<textarea class="textarea" disabled="{{true}}" value="{{detail.majorMeasures}}" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">目前稳控情况</view> |
|||
<textarea class="textarea" disabled="{{true}}" value="{{detail.currentSituation}}" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">备注</view> |
|||
<textarea class="textarea" disabled="{{true}}" value="{{detail.remark}}" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
</view> |
|||
<view class="edit-item" style="margin-bottom:15rpx"> |
|||
<view class="title" style="{{'color:#c1c1c1'}}">提报时间</view> |
|||
<textarea class="textarea" disabled="{{true}}" value="{{detail.submitTime}}" auto-height="{{true}}" ></textarea> |
|||
</view> |
|||
</view> |
@ -0,0 +1,55 @@ |
|||
page { |
|||
width: 100%; |
|||
height: auto; |
|||
overflow-y: scroll; |
|||
background: #f7f7f7; |
|||
} |
|||
.toptabs{ |
|||
border-bottom: 1px solid #EDEFF0; |
|||
position: fixed; |
|||
top: 0; |
|||
z-index: 999999; |
|||
width: 100%; |
|||
background: #ffffff; |
|||
} |
|||
.wux-tabs__tab { |
|||
font-size:32rpx!important; |
|||
color: #8393A0!important; |
|||
} |
|||
.wux-tabs__tab--current { |
|||
color:#333333!important; |
|||
font-weight: bold; |
|||
font-size: 40rpx!important; |
|||
} |
|||
.wux-tabs__tab-bar{ |
|||
background: #ffffff!important; |
|||
} |
|||
.newhot-tabs{ |
|||
display: flex; |
|||
width: 100%; |
|||
margin: 10px; |
|||
height: 50rpx; |
|||
} |
|||
.edit{ |
|||
width: 100%; |
|||
} |
|||
.edit .edit-item{ |
|||
width: 100%; |
|||
background-color: #fff; |
|||
margin-top: 15rpx; |
|||
} |
|||
.edit .edit-item .title{ |
|||
color: #333333; |
|||
font-size: 32rpx; |
|||
margin:0 20rpx; |
|||
padding: 20rpx 0; |
|||
border-bottom: 0.5px solid #E7EEEE; |
|||
} |
|||
.edit .edit-item .textarea{ |
|||
color: #333333; |
|||
font-size: 32rpx; |
|||
margin:0 20rpx; |
|||
padding: 20rpx 0; |
|||
border-bottom: 0.5px solid #E7EEEE; |
|||
width: 96%; |
|||
} |
@ -0,0 +1,278 @@ |
|||
const api = require('../../../../api/conflict') |
|||
import { formatTimestamp } from '../../../../utils/util' |
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
loadMoreType: 'loading', |
|||
loadMoreVisible: true, |
|||
tabList:['编辑上报','历史上报'],//tab列表
|
|||
currentTabIndex:0, |
|||
pageNo: 1, // 分页页码
|
|||
pageSize: 20, // 分页页长
|
|||
isLoading: true, |
|||
timestamp:'', |
|||
conflictType:'', |
|||
reason:'', |
|||
peopleNumber:'', |
|||
peopleLeader:'', |
|||
dutyUnit:'', |
|||
dutyPerson:'', |
|||
mainMeasure:'', |
|||
statusNow:'', |
|||
remark:'', |
|||
temp_datetime:[], |
|||
datetime:'', |
|||
historyList:[], |
|||
pickerVisible:false |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
let date=new Date(); |
|||
this.setData({ |
|||
temp_datetime:[date.getFullYear().toString(),date.getMonth().toString(),date.getDate().toString()] |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
if(this.data.currentTabIndex ==='1' && !this.data.isLoading && this.data.loadMoreType!='none'){ |
|||
this.setData({ |
|||
loadMoreType:'loading', |
|||
loadMoreVisible:true, |
|||
pageNo:this.data.pageNo+1, |
|||
isLoading:true |
|||
}) |
|||
let param = { |
|||
pageIndex:this.data.pageNo, |
|||
pageSize:this.data.pageSize, |
|||
timestamp:this.data.timestamp |
|||
} |
|||
this.getHistory(param) |
|||
} |
|||
}, |
|||
onConfirmDatetime(e){ |
|||
console.log(e.detail) |
|||
this.setData({ |
|||
datetime:e.detail.label, |
|||
pickerVisible:false |
|||
}) |
|||
}, |
|||
changeTab(e){ |
|||
this.setData({ |
|||
currentTabIndex:e.detail.key |
|||
}) |
|||
if(e.detail.key==="1"){ |
|||
this.setData({ |
|||
loadMoreType:'loading', |
|||
loadMoreVisible:true, |
|||
pageNo:1, |
|||
historyList:[], |
|||
isLoading:true, |
|||
timestamp:formatTimestamp(new Date()) |
|||
}) |
|||
let param = { |
|||
pageIndex:this.data.pageNo, |
|||
pageSize:this.data.pageSize, |
|||
timestamp:this.data.timestamp |
|||
} |
|||
this.getHistory(param) |
|||
} |
|||
}, |
|||
getHistory(param){ |
|||
api.getHistory(param).then((res)=>{ |
|||
this.setData({ |
|||
historyList:this.data.historyList.concat(res.data), |
|||
isLoading:false |
|||
}) |
|||
if(res.data.length<20){ |
|||
this.setData({ |
|||
loadMoreType:'none', |
|||
loadMoreVisible:true, |
|||
}) |
|||
}else{ |
|||
this.setData({ |
|||
loadMoreType:"more", |
|||
loadMoreVisible:false |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
handleConflictType(e){ |
|||
this.setData({ |
|||
conflictType:e.detail.value |
|||
}) |
|||
}, |
|||
handleReason(e){ |
|||
this.setData({ |
|||
reason:e.detail.value |
|||
}) |
|||
}, |
|||
handlePeopleNumber(e){ |
|||
this.setData({ |
|||
peopleNumber:e.detail.value |
|||
}) |
|||
}, |
|||
handlePeopleLeader(e){ |
|||
this.setData({ |
|||
peopleLeader:e.detail.value |
|||
}) |
|||
} |
|||
, |
|||
handleDutyUnit(e){ |
|||
this.setData({ |
|||
dutyUnit:e.detail.value |
|||
}) |
|||
}, |
|||
handleDutyPerson(e){ |
|||
this.setData({ |
|||
dutyPerson:e.detail.value |
|||
}) |
|||
}, |
|||
handleMainMeasure(e){ |
|||
this.setData({ |
|||
mainMeasure:e.detail.value |
|||
}) |
|||
}, |
|||
handleStatusNow(e){ |
|||
this.setData({ |
|||
statusNow:e.detail.value |
|||
}) |
|||
}, |
|||
handleRemark(e){ |
|||
this.setData({ |
|||
remark:e.detail.value |
|||
}) |
|||
}, |
|||
showPicker(){ |
|||
this.setData({ |
|||
pickerVisible:!this.data.pickerVisible |
|||
}) |
|||
}, |
|||
navigateToDetail(e){ |
|||
wx.navigateTo({ |
|||
url: '../historyDetail/historyDetail?id='+e.currentTarget.dataset.id, |
|||
}) |
|||
}, |
|||
submit(){ |
|||
if(this.data.conflictType===''){ |
|||
wx.showToast({ |
|||
title: '请输入矛盾纠纷类型', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
if(this.data.reason===''){ |
|||
wx.showToast({ |
|||
title: '请输入形成原因', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
if(this.data.peopleNumber===''){ |
|||
wx.showToast({ |
|||
title: '请输入涉及人数', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
if(this.data.peopleLeader===''){ |
|||
wx.showToast({ |
|||
title: '请输入挑头骨干人员', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
if(this.data.dutyUnit===''){ |
|||
wx.showToast({ |
|||
title: '请输入责任单位', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
if(this.data.dutyPerson===''){ |
|||
wx.showToast({ |
|||
title: '请输入责任人', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
if(this.data.mainMeasure===''){ |
|||
wx.showToast({ |
|||
title: '请输入主要采取措施', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
if(this.data.statusNow===''){ |
|||
wx.showToast({ |
|||
title: '请输入目前稳控状况', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
if(this.data.datetime===''){ |
|||
wx.showToast({ |
|||
title: '请选择提报时间', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
let num = new Number(this.data.peopleNumber) |
|||
if(isNaN(num)||num<0 || this.data.peopleNumber.indexOf('.')!=-1){ |
|||
wx.showToast({ |
|||
title: '请输入正确的人数', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
let param = { |
|||
conflictType:this.data.conflictType, |
|||
conflictReason:this.data.reason, |
|||
involvedNum:parseInt(this.data.peopleNumber), |
|||
mainstayLeader:this.data.peopleLeader, |
|||
responsibleDept:this.data.dutyUnit, |
|||
responsiblePeople:this.data.dutyPerson, |
|||
majorMeasures:this.data.mainMeasure, |
|||
currentSituation:this.data.statusNow, |
|||
remark:this.data.remark, |
|||
submitTime:this.data.datetime |
|||
} |
|||
wx.showLoading({ |
|||
title:'提交中' |
|||
}) |
|||
api.submitConflict(param).then(()=>{ |
|||
this.setData({ |
|||
conflictType:'', |
|||
reason:'', |
|||
peopleNumber:'', |
|||
peopleLeader:'', |
|||
dutyUnit:'', |
|||
dutyPerson:'', |
|||
mainMeasure:'', |
|||
statusNow:'', |
|||
remark:'', |
|||
datetime:'' |
|||
}) |
|||
wx.hideLoading({ |
|||
complete: (res) => { |
|||
wx.showToast({ |
|||
title: '上报成功', |
|||
icon:'none' |
|||
})}, |
|||
}) |
|||
|
|||
}).catch(err=>{ |
|||
wx.hideLoading({ |
|||
|
|||
}) |
|||
}) |
|||
} |
|||
}) |
@ -0,0 +1,11 @@ |
|||
{ |
|||
"navigationBarTitleText": "综治矛调", |
|||
"usingComponents": { |
|||
"load-more": "../../components/loadMore/loadMore", |
|||
"pulldown-refresh": "../../components/pullDownRefresh/pullDownRefresh", |
|||
"wux-tabs": "../../../../dist/tabs/index", |
|||
"wux-tab": "../../dist/tab/index", |
|||
"wux-date-picker":"../../../../dist/date-picker/index", |
|||
"wux-cell":"../../../../dist/cell/index" |
|||
} |
|||
} |
@ -0,0 +1,80 @@ |
|||
<view class="home"> |
|||
<view class="toptabs"> |
|||
<wux-tabs controlled scroll current="{{ currentTabIndex }}" bindchange="changeTab"> |
|||
<wux-tab wx:for="{{tabList}}" wx:key="index" key="{{index}}" title="{{item}}"></wux-tab> |
|||
<!-- <wux-tab key="tab1" title="待处理"></wux-tab> |
|||
<wux-tab key="tab2" title="已结案"></wux-tab> |
|||
<wux-tab key="tab3" title="已关闭"></wux-tab> --> |
|||
</wux-tabs> |
|||
</view> |
|||
<scroll-view scroll-y class="edit" wx:if="{{currentTabIndex==0}}"> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{conflictType===''?'color:#333':'color:#c1c1c1'}}">矛盾纠纷类型</view> |
|||
<textarea disabled="{{pickerVisible}}" maxlength="50" class="textarea" value="{{conflictType}}" placeholder="{{pickerVisible?'':'请输入内容'}}" bindinput="handleConflictType" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
<text class="text-limit">{{util.length(conflictType)}}/50</text> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{reason===''?'color:#333':'color:#c1c1c1'}}">形成原因</view> |
|||
<textarea disabled="{{pickerVisible}}" maxlength="200" class="textarea" value="{{reason}}" placeholder="{{pickerVisible?'':'请输入内容'}}" bindinput="handleReason" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
<text class="text-limit">{{util.length(reason)}}/200</text> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{peopleNumber===''?'color:#333':'color:#c1c1c1'}}">涉及人数</view> |
|||
<input class="textarea" style="padding-bottom:20rpx" type="number" value="{{peopleNumber}}" placeholder="{{pickerVisible?'':'请输入内容'}}" bindinput="handlePeopleNumber" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></input> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{peopleLeader===''?'color:#333':'color:#c1c1c1'}}">挑头骨干人员</view> |
|||
<textarea disabled="{{pickerVisible}}" maxlength="100" class="textarea" value="{{peopleLeader}}" placeholder="{{pickerVisible?'':'请输入内容'}}" bindinput="handlePeopleLeader" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
<text class="text-limit">{{util.length(peopleLeader)}}/100</text> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{dutyUnit===''?'color:#333':'color:#c1c1c1'}}">责任单位</view> |
|||
<textarea disabled="{{pickerVisible}}" maxlength="150" class="textarea" value="{{dutyUnit}}" placeholder="{{pickerVisible?'':'请输入内容'}}" bindinput="handleDutyUnit" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
<text class="text-limit">{{util.length(dutyUnit)}}/150</text> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{dutyPerson===''?'color:#333':'color:#c1c1c1'}}">责任人</view> |
|||
<textarea disabled="{{pickerVisible}}" maxlength="50" class="textarea" value="{{dutyPerson}}" placeholder="{{pickerVisible?'':'请输入内容'}}" bindinput="handleDutyPerson" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
<text class="text-limit">{{util.length(dutyPerson)}}/150</text> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{mainMeasure===''?'color:#333':'color:#c1c1c1'}}">主要采取措施</view> |
|||
<textarea disabled="{{pickerVisible}}" maxlength="500" class="textarea" value="{{mainMeasure}}" placeholder="{{pickerVisible?'':'请输入内容'}}" bindinput="handleMainMeasure" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
<text class="text-limit">{{util.length(mainMeasure)}}/500</text> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{statusNow===''?'color:#333':'color:#c1c1c1'}}">目前稳控情况</view> |
|||
<textarea disabled="{{pickerVisible}}" class="textarea" maxlength="500" value="{{statusNow}}" placeholder="{{pickerVisible?'':'请输入内容'}}" bindinput="handleStatusNow" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
<text class="text-limit">{{util.length(statusNow)}}/500</text> |
|||
</view> |
|||
<view class="edit-item"> |
|||
<view class="title" style="{{remark===''?'color:#333':'color:#c1c1c1'}}">备注</view> |
|||
<textarea disabled="{{pickerVisible}}" maxlength="500" class="textarea" value="{{pickerVisible?'':remark}}" placeholder="{{pickerVisible?'':'请输入内容'}}" bindinput="handleRemark" auto-height="{{true}}" placeholder-style="color:#c1c1c1;font-size:28rpx"></textarea> |
|||
<text class="text-limit">{{util.length(remark)}}/500</text> |
|||
</view> |
|||
<view class="edit-item" style="z-index:777"> |
|||
<wux-date-picker controlled mode="date" visible="{{pickerVisible}}" value="{{ temp_datetime }}" data-index="1" data-mode="datetime" bind:confirm="onConfirmDatetime" bind:cancel='showPicker'> |
|||
</wux-date-picker> |
|||
<view style="z-index:888" class="title" style="{{datetime===''?'color:#333':'color:#c1c1c1'}}">提报时间</view> |
|||
<view style="z-index:888" bindtap="showPicker"><input placeholder-style="color:#c1c1c1;font-size:28rpx" style="padding-bottom:20rpx" class="textarea" placeholder="请选择时间" disabled="{{true}}" value="{{datetime}}" auto-height="{{true}}" ></input> |
|||
</view> |
|||
</view> |
|||
<view class="submit" bindtap="submit">提交</view> |
|||
</scroll-view> |
|||
<view class="history" wx:else> |
|||
<view class="history-item" wx:for="{{historyList}}" wx:key="index" wx:for-item="item"> |
|||
<view class="title" data-id="{{item.id}}" bindtap="navigateToDetail">上报时间:{{item.submitTime}}</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<load-more wx:if="{{currentTabIndex==1}}" loadMoreVisible="{{loadMoreVisible}}" loadMoreType="{{loadMoreType}}"></load-more> |
|||
<wxs module="util"> |
|||
function length(str){ |
|||
return str.length |
|||
} |
|||
module.exports = { |
|||
length: length |
|||
} |
|||
</wxs> |
|||
|
@ -0,0 +1,93 @@ |
|||
page { |
|||
width: 100%; |
|||
height: auto; |
|||
overflow-y: scroll; |
|||
background: #f7f7f7; |
|||
} |
|||
.toptabs{ |
|||
border-bottom: 1px solid #EDEFF0; |
|||
position: fixed; |
|||
top: 0; |
|||
z-index: 999999; |
|||
width: 100%; |
|||
background: #ffffff; |
|||
} |
|||
.wux-tabs__tab { |
|||
font-size:32rpx!important; |
|||
color: #8393A0!important; |
|||
} |
|||
.wux-tabs__tab--current { |
|||
color:#333333!important; |
|||
font-weight: bold; |
|||
font-size: 40rpx!important; |
|||
} |
|||
.wux-tabs__tab-bar{ |
|||
background: #ffffff!important; |
|||
} |
|||
.newhot-tabs{ |
|||
display: flex; |
|||
width: 100%; |
|||
margin: 10px; |
|||
height: 50rpx; |
|||
} |
|||
.edit{ |
|||
margin-top: 100rpx; |
|||
width: 100%; |
|||
height: calc(100vh - 100rpx); |
|||
} |
|||
.edit .edit-item{ |
|||
width: 100%; |
|||
background-color: #fff; |
|||
margin-bottom: 15rpx; |
|||
} |
|||
.edit .edit-item .title{ |
|||
color: #333333; |
|||
font-size: 32rpx; |
|||
margin:0 20rpx; |
|||
padding: 20rpx 0; |
|||
border-bottom: 0.5px solid #E7EEEE; |
|||
} |
|||
.edit .edit-item .textarea{ |
|||
color: #333333; |
|||
font-size: 32rpx; |
|||
margin:0 20rpx; |
|||
padding: 20rpx 0; |
|||
border-bottom: 0.5px solid #E7EEEE; |
|||
padding-bottom: 45rpx; |
|||
width: 96%; |
|||
} |
|||
.history{ |
|||
margin-top: 100rpx; |
|||
width: 100%; |
|||
} |
|||
.history .history-item{ |
|||
width: 100%; |
|||
background-color: #fff; |
|||
margin-top: 15rpx; |
|||
height: 80rpx; |
|||
line-height: 80rpx; |
|||
} |
|||
.history .history-item .title{ |
|||
color: #333333; |
|||
font-size: 32rpx; |
|||
margin:0 20rpx; |
|||
} |
|||
|
|||
.submit{ |
|||
width: 70%; |
|||
height: 100rpx; |
|||
margin: 30rpx auto; |
|||
background-color: #fa2626; |
|||
border-radius: 36rpx; |
|||
line-height: 100rpx; |
|||
text-align: center; |
|||
font-size: 34rpx; |
|||
color: #FFF; |
|||
} |
|||
.text-limit{ |
|||
float:right; |
|||
margin-top:-48rpx; |
|||
margin-right:20rpx; |
|||
font-size:30rpx; |
|||
color:#999; |
|||
} |
@ -0,0 +1,14 @@ |
|||
Component({ |
|||
data: { |
|||
}, |
|||
properties: { |
|||
loadMoreVisible: { |
|||
type: Boolean, |
|||
value: false |
|||
}, |
|||
loadMoreType: { |
|||
type: String, |
|||
value: 'loading' |
|||
} |
|||
} |
|||
}) |
@ -0,0 +1,3 @@ |
|||
{ |
|||
"component": true |
|||
} |
@ -0,0 +1,7 @@ |
|||
<view class="load-more" style="visibility: {{loadMoreVisible ? 'visible' : 'hidden'}}"> |
|||
<block wx:if="{{loadMoreType == 'loading'}}"> |
|||
<image class="load-image" src="../../images/loading.gif" /> |
|||
<view class="load-text">正在加载中...</view> |
|||
</block> |
|||
<view wx:else class="load-text">没有更多了~</view> |
|||
</view> |
@ -0,0 +1,18 @@ |
|||
.load-more { |
|||
width: 100%; |
|||
height: 100rpx; |
|||
background: #f7f7f7; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
.load-more .load-text { |
|||
color: #999; |
|||
font-size: 26rpx; |
|||
} |
|||
.load-more .load-image { |
|||
width: 30rpx; |
|||
height: 30rpx; |
|||
object-fit: cover; |
|||
margin-right: 10rpx; |
|||
} |
@ -0,0 +1,70 @@ |
|||
Component({ |
|||
data: { |
|||
lastY: '', |
|||
translateHeight: 0, |
|||
state: -1, |
|||
scrollTop: 0, |
|||
enablePulldownFresh: false |
|||
}, |
|||
options: { |
|||
multipleSlots: true |
|||
}, |
|||
properties: { |
|||
upperDistance: { |
|||
type: Number, |
|||
value: 80 |
|||
} |
|||
}, |
|||
methods: { |
|||
onPageScroll (e) { |
|||
this.data.scrollTop = e.scrollTop |
|||
this.data.enablePulldownFresh = false |
|||
}, |
|||
touchstart (e) { |
|||
this.data.lastY = e.touches[0].clientY |
|||
if (this.data.scrollTop === 0) { |
|||
this.data.enablePulldownFresh = true |
|||
} else { |
|||
this.data.enablePulldownFresh = false |
|||
} |
|||
}, |
|||
touchmove (e) { |
|||
let clientY = e.touches[0].clientY |
|||
let offset = clientY - this.data.lastY |
|||
if (this.data.scrollTop > 0 || offset < 0) { |
|||
return false |
|||
} |
|||
this.data.translateHeight = offset |
|||
this.data.state = 1 |
|||
|
|||
if (this.data.enablePulldownFresh) { |
|||
if (this.data.translateHeight > this.data.upperDistance) { |
|||
this.data.state = 2 |
|||
} |
|||
this.setData({ |
|||
translateHeight: this.data.translateHeight > 100 ? 100 : this.data.translateHeight, |
|||
state: this.data.state |
|||
}) |
|||
} |
|||
}, |
|||
touchend (e) { |
|||
if (this.data.translateHeight > this.data.upperDistance) { |
|||
if (this.data.enablePulldownFresh) { |
|||
this.setData({ |
|||
translateHeight: 100, |
|||
state: 3 |
|||
}) |
|||
this.triggerEvent('pullDownRefresh') |
|||
} |
|||
} else if (this.data.scrollTop <= 0) { |
|||
this.stopRefresh() |
|||
} |
|||
}, |
|||
stopRefresh () { |
|||
this.setData({ |
|||
translateHeight: 0, |
|||
state: -1 |
|||
}) |
|||
} |
|||
} |
|||
}) |
@ -0,0 +1,3 @@ |
|||
{ |
|||
"component": true |
|||
} |
@ -0,0 +1,9 @@ |
|||
<view class="pulldown-refresh" bindtouchstart="touchstart" bindtouchmove="touchmove" bindtouchend="touchend"> |
|||
<view class="pulldown-state"> |
|||
<image class="loading" src="../../images/loading.gif" /> |
|||
<view class="loading-state">{{state == 1 ? '下拉刷新' : state == 2 ? '松开刷新' : '刷新中...'}}</view> |
|||
</view> |
|||
<view class="pulldown-content" style="transform: translateY({{translateHeight}}rpx)"> |
|||
<slot name="content"></slot> |
|||
</view> |
|||
</view> |
@ -0,0 +1,27 @@ |
|||
.pulldown-refresh { |
|||
width:100%; |
|||
background: #f7f7f7; |
|||
} |
|||
.pulldown-refresh .pulldown-state { |
|||
width:100%; |
|||
height: 100rpx; |
|||
display:flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
margin-bottom: -100rpx; |
|||
} |
|||
.pulldown-refresh .pulldown-state .loading { |
|||
width: 30rpx; |
|||
height: 30rpx; |
|||
margin-right: 10rpx; |
|||
} |
|||
.pulldown-refresh .pulldown-state .loading-state { |
|||
font-size: 25rpx; |
|||
color:#666; |
|||
} |
|||
|
|||
.pulldown-refresh .pulldown-content { |
|||
width:100%; |
|||
height:auto; |
|||
transition: transform 0.05s linear; |
|||
} |
@ -0,0 +1,59 @@ |
|||
Component({ |
|||
/** |
|||
* 组件的属性列表 |
|||
*/ |
|||
properties: { |
|||
questionList:{ |
|||
type:Array |
|||
}, |
|||
currentTab:{ |
|||
type:Number |
|||
}, |
|||
currentQuestion:{ |
|||
type:String |
|||
} |
|||
}, |
|||
/** |
|||
* 组件的初始数据 |
|||
*/ |
|||
data: { |
|||
answerInput:'' |
|||
}, |
|||
|
|||
/** |
|||
* 组件的方法列表 |
|||
*/ |
|||
methods: { |
|||
clearInput(){ |
|||
this.setData({ |
|||
answerInput:'' |
|||
}) |
|||
}, |
|||
handleInput(e){ |
|||
this.setData({ |
|||
answerInput:e.detail.value |
|||
}) |
|||
}, |
|||
openInput(e){ |
|||
if(this.data.currentQuestion != e.currentTarget.dataset.index){ |
|||
this.setData({ |
|||
answerInput:'' |
|||
}) |
|||
} |
|||
this.triggerEvent("changeCurrentQuestion",e.currentTarget.dataset.index); |
|||
}, |
|||
submitAnswer(e){ |
|||
if(this.data.answerInput===''){ |
|||
wx.showToast({ |
|||
title: '请输入回答', |
|||
icon:"none" |
|||
}) |
|||
return false |
|||
} |
|||
this.triggerEvent("submitAnswer",{id:e.currentTarget.dataset.questionid,answer:this.data.answerInput}); |
|||
}, |
|||
changeCollapse(e){ |
|||
this.triggerEvent("changeCollapse",e); |
|||
}, |
|||
} |
|||
}) |
@ -0,0 +1,4 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": {} |
|||
} |
@ -0,0 +1,49 @@ |
|||
<view class="home"> |
|||
<view wx:for="{{questionList}}" |
|||
wx:for-item="item" |
|||
wx:for-index="index" |
|||
wx:key="index" |
|||
class="list-item"> |
|||
<view class="item-header"> |
|||
<view class="question"> |
|||
<text id="questionContent" style="font-weight: bold;" class="text {{item.collapse?'text-collapse':''}}">{{item.questionContent}}</text> |
|||
<text style="float:right" bindtap="changeCollapse" data-index="{{index}}" wx:if="{{item.showCollapse}}" class='coll-p'>{{item.collapse?'全文':'收起'}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="item-button"> |
|||
<view class="time">{{item.questionTime}}</view> |
|||
<view class="reply" bindtap="openInput" data-index="{{index}}" wx:if="{{currentTab===1 || currentTab===0}}"> |
|||
<image src="../../images/input.png" class="button-img"></image> |
|||
<view class="button-text">回复</view> |
|||
</view> |
|||
</view> |
|||
<view class="item-reply" wx:if="{{currentQuestion===tools.toString(index) && (currentTab===1 || currentTab===0)}}"> |
|||
<textarea auto-height="{{true}}" class="textarea" maxlength="500" bindinput="handleInput"></textarea> |
|||
</view> |
|||
<view class="item-button" wx:if="{{currentQuestion===tools.toString(index)}}" style="margin-top:20rpx"> |
|||
<text style="font-size:30rpx;color:#999;line-height:60rpx">{{tools.length(answerInput)|0}}/500</text> |
|||
<view class="reply-button" data-questionid="{{item.id}}" bindtap="submitAnswer">确定</view> |
|||
</view> |
|||
<view class="item-answer" style="" wx:for="{{item.answerList}}" wx:for-item="answer" wx:if="{{currentTab===2}}" wx:for-index="answerIndex"> |
|||
<view class="answer-content"> |
|||
<text id="answerContent" data-question="{{index}}" class="text {{answer.collapse?'text-collapse':''}}">{{answer.answerContent}}</text> |
|||
<text style="float:right" bindtap="changeCollapse" data-questionIndex="{{index}}" data-index="{{answerIndex}}" wx:if="{{answer.showCollapse}}" class='coll-p'>{{answer.collapse?'全文':'收起'}}</text> |
|||
</view> |
|||
<view class="item-header"> |
|||
<view class="answer-footer">{{answer.psychologistName + ' | 心理咨询师 ' +answer.answerTime}}</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<wxs module='tools'> |
|||
function toString(a){ |
|||
return a.toString(); |
|||
} |
|||
function length(str){ |
|||
return str.length; |
|||
} |
|||
module.exports = { |
|||
toString: toString, |
|||
length:length |
|||
} |
|||
</wxs> |
@ -0,0 +1,117 @@ |
|||
/* subpages/consult/components/questionList.wxss */ |
|||
.home{ |
|||
width: 100%; |
|||
} |
|||
.list-item{ |
|||
background-color: #fff; |
|||
margin-top: 20rpx; |
|||
padding: 0 20rpx; |
|||
} |
|||
.list-item .item-header{ |
|||
display: inline-block; |
|||
width: 100%; |
|||
} |
|||
.list-item .item-header .index{ |
|||
display: inline-block; |
|||
width: 4%; |
|||
height: 100rpx; |
|||
line-height: 100rpx; |
|||
font-size: 30rpx; |
|||
} |
|||
.list-item .item-header .question{ |
|||
display: inline-block; |
|||
line-height: 50rpx; |
|||
font-size: 35rpx; |
|||
letter-spacing: 2rpx; |
|||
} |
|||
.list-item .item-button .time{ |
|||
display: inline-block; |
|||
width: 40%; |
|||
font-size: 25rpx; |
|||
color: #AAA; |
|||
} |
|||
.list-item .item-button{ |
|||
height: 60rpx; |
|||
width: 100%; |
|||
padding-top: 20rpx; |
|||
} |
|||
|
|||
.list-item .item-button .reply{ |
|||
height: 50rpx; |
|||
width: 20%; |
|||
font-size: 30rpx; |
|||
line-height: 50rpx; |
|||
text-align: center; |
|||
float: right; |
|||
} |
|||
.list-item .item-button .reply .button-img{ |
|||
height: 25rpx; |
|||
width: 25rpx; |
|||
margin-left: -5rpx; |
|||
} |
|||
.list-item .item-button .reply .button-text{ |
|||
color: #F71A1A; |
|||
font-size: 30rpx; |
|||
display: inline-block; |
|||
margin-left: 10rpx; |
|||
} |
|||
.item-reply{ |
|||
width: 100%; |
|||
min-height: 300rpx; |
|||
} |
|||
.item-reply .textarea{ |
|||
width: 100%; |
|||
min-height: 300rpx; |
|||
background-color: #f2f2f2; |
|||
} |
|||
.answer-content{ |
|||
width: 100%; |
|||
font-size: 30rpx; |
|||
color: #777; |
|||
} |
|||
.reply-button{ |
|||
border-radius: 35rpx; |
|||
background-color: #e02d22; |
|||
height: 55rpx; |
|||
width: 120rpx; |
|||
color: #fff; |
|||
line-height: 50rpx; |
|||
text-align: center; |
|||
margin-right: 20rpx; |
|||
float: right; |
|||
font-size: 30rpx; |
|||
} |
|||
.answer-footer{ |
|||
padding: 20rpx 0; |
|||
font-size: 30rpx; |
|||
color: #c3c3c3; |
|||
} |
|||
.answer-content text{ |
|||
line-height: 50rpx; |
|||
display: block; |
|||
} |
|||
.question text{ |
|||
line-height: 50rpx; |
|||
} |
|||
|
|||
.answer-content text.text-collapse{ |
|||
display:-webkit-box; |
|||
-webkit-box-orient:vertical; |
|||
-webkit-line-clamp:3; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
} |
|||
.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; |
|||
margin-right: 20rpx; |
|||
} |
After Width: | Height: | Size: 896 B |
After Width: | Height: | Size: 3.8 KiB |
@ -0,0 +1,234 @@ |
|||
const app = getApp() |
|||
const api = require('../../../../api/consult') |
|||
import { formatTimestamp } from '../../../../utils/util' |
|||
Page({ |
|||
data: { |
|||
loadMoreType: 'loading', |
|||
loadMoreVisible: true, |
|||
tabList:['我的待回答','公共待回答','已经回答'],//tab列表
|
|||
currentTabIndex:0, |
|||
currentQuestion:'', |
|||
pageNo: 1, // 分页页码
|
|||
pageSize: 10, // 分页页长
|
|||
isLoading: true, |
|||
timestamp:'', |
|||
answerInput:'', |
|||
questionList:[], |
|||
}, |
|||
onHide:function(){ |
|||
|
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
this.setData({ |
|||
timestamp:formatTimestamp(new Date()) |
|||
}) |
|||
let param = { |
|||
pageIndex:this.data.pageNo, |
|||
pageSize:this.data.pageSize, |
|||
timestamp:this.data.timestamp, |
|||
designatedFlag:this.data.currentTabIndex==0?'1':'0' |
|||
} |
|||
this.getQuestionList(param) |
|||
}, |
|||
getQuestionList(param){ |
|||
api.getQuestionList(param).then((res)=>{ |
|||
this.setData({ |
|||
questionList:this.data.questionList.concat(res.data), |
|||
isLoading:false |
|||
}) |
|||
this.setCollapse(); |
|||
if(res.data.length<10){ |
|||
this.setData({ |
|||
loadMoreType:'none', |
|||
loadMoreVisible:true, |
|||
}) |
|||
}else{ |
|||
this.setData({ |
|||
loadMoreType:"more", |
|||
loadMoreVisible:false |
|||
}) |
|||
} |
|||
}).catch(err=>{ |
|||
this.setData({ |
|||
questionList:[], |
|||
isLoading:false, |
|||
loadMoreType:'none', |
|||
loadMoreVisible:true |
|||
}) |
|||
}) |
|||
}, |
|||
getMyQuestionList(param){ |
|||
api.getMyQuestionList(param).then((res)=>{ |
|||
this.setData({ |
|||
questionList:this.data.questionList.concat(res.data), |
|||
isLoading:false |
|||
}) |
|||
this.setCollapse(); |
|||
if(res.data.length<10){ |
|||
this.setData({ |
|||
loadMoreType:'none', |
|||
loadMoreVisible:true, |
|||
}) |
|||
}else{ |
|||
this.setData({ |
|||
loadMoreType:"more", |
|||
loadMoreVisible:false |
|||
}) |
|||
} |
|||
}).catch(err=>{ |
|||
this.setData({ |
|||
questionList:[], |
|||
isLoading:false, |
|||
loadMoreType:'none', |
|||
loadMoreVisible:true |
|||
}) |
|||
}) |
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
onReachBottom(){ |
|||
if(!this.data.isLoading && this.data.loadMoreType!='none'){ |
|||
this.setData({ |
|||
isLoading:true, |
|||
loadMoreVisible:true, |
|||
loadMoreType:'loading', |
|||
pageNo:this.data.pageNo+1 |
|||
}) |
|||
if(this.data.currentTabIndex!=2){ |
|||
let param = { |
|||
pageIndex:this.data.pageNo, |
|||
pageSize:this.data.pageSize, |
|||
timestamp:this.data.timestamp, |
|||
designatedFlag:this.data.currentTabIndex==0?'1':'0' |
|||
} |
|||
this.getQuestionList(param) |
|||
}else{ |
|||
let param = { |
|||
pageIndex:this.data.pageNo, |
|||
pageSize:this.data.pageSize, |
|||
timestamp:this.data.timestamp, |
|||
} |
|||
this.getMyQuestionList(param) |
|||
} |
|||
} |
|||
}, |
|||
handleInput(e){ |
|||
this.setData({ |
|||
answerInput:e.detail.value |
|||
}) |
|||
}, |
|||
changeTab(e){ |
|||
if(this.data.isLoading){ |
|||
return false; |
|||
} |
|||
this.setData({ |
|||
questionList:[], |
|||
currentQuestion:'', |
|||
answerInput:'', |
|||
currentTabIndex:e.detail.key, |
|||
loadMoreType:'loading', |
|||
loadMoreVisible:true, |
|||
isLoading:true, |
|||
pageSize:10, |
|||
pageNo:1, |
|||
timestamp:formatTimestamp(new Date()) |
|||
}) |
|||
this.selectComponent("#question-list").clearInput(); |
|||
if(e.detail.key!=2){ |
|||
let param = { |
|||
pageIndex:this.data.pageNo, |
|||
pageSize:this.data.pageSize, |
|||
timestamp:this.data.timestamp, |
|||
designatedFlag:this.data.currentTabIndex==0?'1':'0' |
|||
} |
|||
this.getQuestionList(param) |
|||
}else{ |
|||
let param = { |
|||
pageIndex:this.data.pageNo, |
|||
pageSize:this.data.pageSize, |
|||
timestamp:this.data.timestamp, |
|||
} |
|||
this.getMyQuestionList(param) |
|||
} |
|||
}, |
|||
openInput(e){ |
|||
this.setData({ |
|||
currentQuestion:e.detail, |
|||
answerInput:'' |
|||
}) |
|||
}, |
|||
submitAnswer(e){ |
|||
let param = { |
|||
questionId:e.detail.id, |
|||
answerContent:e.detail.answer |
|||
} |
|||
api.submitAnswer(param).then(()=>{ |
|||
this.data.questionList.splice(this.data.currentQuestion,1); |
|||
this.selectComponent("#question-list").clearInput(); |
|||
wx.showToast({ |
|||
title: '回复成功', |
|||
icon:"none" |
|||
}) |
|||
this.setData({ |
|||
questionList:this.data.questionList, |
|||
currentQuestion:'' |
|||
}) |
|||
}).catch(err=>{ |
|||
|
|||
}) |
|||
}, |
|||
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"; |
|||
console.log(set) |
|||
this.setData({ |
|||
[set]: !this.data.questionList[questionIndex].answerList[0].collapse |
|||
}) |
|||
} |
|||
} |
|||
}) |
@ -0,0 +1,10 @@ |
|||
{ |
|||
"navigationBarTitleText": "心理咨询", |
|||
"usingComponents": { |
|||
"load-more": "../../components/loadMore/loadMore", |
|||
"pulldown-refresh": "../../components/pullDownRefresh/pullDownRefresh", |
|||
"wux-tabs": "../../../../dist/tabs/index", |
|||
"wux-tab": "../../dist/tab/index", |
|||
"question-list":"../../components/questionList/questionList" |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
<view class="home"> |
|||
<!-- <scroll-view class="tab"> |
|||
<view wx:for="{{tabList}}"wx:for-item="item" wx:for-index="index" wx:key="index" data-index="{{index}}" bindtap="changeTab" class="tab-item"> |
|||
<view class="tab-name{{index == currentTabIndex? ' active' : ''}}">{{item}}</view> |
|||
<view class="tab-line{{index == currentTabIndex? ' active' : ''}}"></view> |
|||
</view> |
|||
</scroll-view> --> |
|||
<view class="toptabs"> |
|||
<wux-tabs controlled scroll current="{{ currentTabIndex }}" bindchange="changeTab"> |
|||
<wux-tab wx:for="{{tabList}}" key="{{index}}" title="{{item}}"></wux-tab> |
|||
<!-- <wux-tab key="tab1" title="待处理"></wux-tab> |
|||
<wux-tab key="tab2" title="已结案"></wux-tab> |
|||
<wux-tab key="tab3" title="已关闭"></wux-tab> --> |
|||
</wux-tabs> |
|||
</view> |
|||
<view class="list"> |
|||
<question-list id="question-list" class="questionList" questionList="{{questionList}}" currentTab="{{currentTabIndex}}" bind:submitAnswer="submitAnswer" bind:changeCurrentQuestion="openInput" currentQuestion="{{currentQuestion}}" bind:changeCollapse="changeCollapse"></question-list> |
|||
</view> |
|||
</view> |
|||
<!-- <view wx:if="{{tabList.length == 0 && isLoading == false}}" class="nothing-to-show"> |
|||
<image src="../../images/property/nothing.png" class="nothing-img"></image> |
|||
<view style="color: #BCBCBC;">管理员暂未添加物业项目信息~</view> |
|||
</view> --> |
|||
<load-more loadMoreVisible="{{loadMoreVisible}}" loadMoreType="{{loadMoreType}}"></load-more> |
|||
|
@ -0,0 +1,128 @@ |
|||
page { |
|||
width: 100%; |
|||
height: auto; |
|||
overflow-y: scroll; |
|||
background: #f7f7f7; |
|||
} |
|||
.toptabs{ |
|||
border-bottom: 1px solid #EDEFF0; |
|||
position: fixed; |
|||
top: 0; |
|||
z-index: 999999; |
|||
width: 100%; |
|||
background: #ffffff; |
|||
} |
|||
.wux-tabs__tab { |
|||
font-size:32rpx!important; |
|||
color: #8393A0!important; |
|||
} |
|||
.wux-tabs__tab--current { |
|||
color:#333333!important; |
|||
font-weight: bold; |
|||
font-size: 40rpx!important; |
|||
} |
|||
.wux-tabs__tab-bar{ |
|||
background: #ffffff!important; |
|||
} |
|||
.newhot-tabs{ |
|||
display: flex; |
|||
width: 100%; |
|||
margin: 10px; |
|||
height: 50rpx; |
|||
} |
|||
.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-y: scroll; |
|||
} |
|||
.nothing-to-show{ |
|||
width: 100%; |
|||
height: 100vh; |
|||
background: #f7f7f7; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
.nothing-img{ |
|||
width: 500rpx; |
|||
height:245rpx; |
|||
object-fit: cover; |
|||
|
|||
} |
|||
.tab{ |
|||
width: 100%; |
|||
height: 100rpx; |
|||
background: #fff; |
|||
overflow-x: scroll; |
|||
display: inline-block; |
|||
white-space: nowrap; |
|||
margin:0 auto; |
|||
-webkit-overflow-scrolling: touch; |
|||
position: fixed; |
|||
top: 0; |
|||
} |
|||
.tab-item{ |
|||
height: 100%; |
|||
min-width: 33%; |
|||
margin:0 auto; |
|||
display: inline-block; |
|||
box-sizing: border-box; |
|||
} |
|||
.tab-name{ |
|||
text-align: center; |
|||
margin:0 auto; |
|||
height: 80%; |
|||
font-size: 25rpx; |
|||
line-height: 100rpx; |
|||
padding: 0 20rpx; |
|||
color: #999; |
|||
} |
|||
.tab-name.active{ |
|||
text-align: center; |
|||
margin:0 auto; |
|||
height: 80%; |
|||
font-size: 30rpx; |
|||
line-height: 100rpx; |
|||
padding: 0 20rpx; |
|||
color: #BB0300; |
|||
} |
|||
.tab-line.active{ |
|||
border-top: 4rpx solid #BB0300; |
|||
width: 30%; |
|||
margin: 0 auto; |
|||
margin-top: 10rpx; |
|||
} |
|||
.list{ |
|||
margin: 0 auto; |
|||
margin-top: 120rpx; |
|||
} |
|||
.questionList{ |
|||
width: 100%; |
|||
} |
|||
|
|||
|
Loading…
Reference in new issue