17 changed files with 2982 additions and 14 deletions
@ -0,0 +1,123 @@ |
|||
// pages/user/myWhistle/index.js
|
|||
import { UserModel } from '../../../models/user.js' |
|||
let userModel = new UserModel() |
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
page:1, |
|||
pageSize:10, |
|||
next:true, |
|||
list:[] |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
var data = { |
|||
page:this.data.page, |
|||
pageSize:this.data.pageSize |
|||
|
|||
} |
|||
userModel.getWhistleList(data,res=>{ |
|||
if(res.result.length > 0){ |
|||
this.setData({ |
|||
list:res.result |
|||
}) |
|||
|
|||
}else{ |
|||
this.setData({ |
|||
next:false |
|||
}) |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
var th = this; |
|||
var next = th.data.next; |
|||
if(!next){ |
|||
return; |
|||
} |
|||
var page = th.data.page; |
|||
var nextPage = page + 1; |
|||
var data = { |
|||
page:nextPage, |
|||
pageSize:th.data.pageSize |
|||
|
|||
} |
|||
userModel.getWhistleList(data,res=>{ |
|||
if(res.result.length > 0){ |
|||
let list = this.data.list; |
|||
list = list.concat(res.result); |
|||
this.setData({ |
|||
list:list |
|||
}) |
|||
}else{ |
|||
this.setData({ |
|||
next:false |
|||
}) |
|||
} |
|||
|
|||
}); |
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
}, |
|||
detail:function(e){ |
|||
if (!e.currentTarget.dataset.id){ |
|||
return; |
|||
} |
|||
if (e.currentTarget.dataset.id) { |
|||
wx.navigateTo({ |
|||
url: '../myWhistle/whistleDetail/index?id=' + e.currentTarget.dataset.id |
|||
}) |
|||
} |
|||
} |
|||
|
|||
}) |
@ -0,0 +1,5 @@ |
|||
{ |
|||
"navigationBarTitleText": "我的吹哨", |
|||
"usingComponents": {}, |
|||
"onReachBottomDistance":50 |
|||
} |
@ -0,0 +1,17 @@ |
|||
<!--pages/user/myWhistle/index.wxml--> |
|||
<wxs module="whistle" src="whistle.wxs"></wxs> |
|||
<block wx:for="{{list}}"> |
|||
<view class="column" bindtap="detail" data-id="{{item.id}}"> |
|||
<view class="top"> |
|||
<view class="content"> |
|||
{{item.content}} |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="bottom"> |
|||
<view style="font-size:12px">{{item.createTime}}</view> |
|||
<view style="font-size:13px;color:{{whistle.getColor(item.status)}}">{{whistle.getStatus(item.status)}}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</block> |
@ -0,0 +1,42 @@ |
|||
/* pages/user/myWhistle/index.wxss */ |
|||
page{ |
|||
background-color: #fafafa; |
|||
width:100%; |
|||
height: 100%; |
|||
} |
|||
.column{ |
|||
width:100%; |
|||
height: 130px; |
|||
background-color: white; |
|||
margin-top:30rpx; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content:center; |
|||
} |
|||
|
|||
.content{ |
|||
width: 100%; |
|||
height:80%; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
-webkit-box-orient: vertical; |
|||
word-break: break-all; |
|||
font-size: 16px; |
|||
} |
|||
.top{ |
|||
width: 90%; |
|||
height: 70px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content:center; |
|||
} |
|||
.bottom{ |
|||
width:90%; |
|||
height: 30px; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content:space-between; |
|||
} |
@ -0,0 +1,42 @@ |
|||
var whistle = { |
|||
|
|||
getImage: function (str) { |
|||
var images = str.split(";"); |
|||
return images; |
|||
}, |
|||
|
|||
getStatus: function(status){ |
|||
if (status == '0'){ |
|||
status = '处理中'; |
|||
} else if (status == '1'){ |
|||
status = '已答复'; |
|||
} else if (status == '2'){ |
|||
status = '已驳回'; |
|||
} else if (status == '3') { |
|||
status = '已结束'; |
|||
} |
|||
return status; |
|||
}, |
|||
|
|||
getColor:function(status){ |
|||
|
|||
if (status == '0') { |
|||
var color = '#ff8a0e'; |
|||
} else if (status == '1') { |
|||
var color = '#f41414'; |
|||
} else if (status == '2') { |
|||
var color = '#1131e4'; |
|||
} else if (status == '3') { |
|||
var color = '#463c59'; |
|||
} |
|||
|
|||
return color; |
|||
} |
|||
|
|||
} |
|||
// 导出对外暴露的属性 |
|||
module.exports = { |
|||
getImage:whistle.getImage, |
|||
getStatus: whistle.getStatus, |
|||
getColor: whistle.getColor |
|||
} |
@ -0,0 +1,86 @@ |
|||
// pages/user/myWhistle/whistleDetail/index.js
|
|||
import { UserModel } from '../../../../models/user.js' |
|||
let userModel = new UserModel() |
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
detail:{}, |
|||
img:[] |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
var id = options.id; |
|||
userModel.getWhistleDetail(id,res=>{ |
|||
var img = res.result.picList.split(";"); |
|||
this.setData({ |
|||
detail:res.result, |
|||
img:img |
|||
}) |
|||
|
|||
}); |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
}, |
|||
previewImage:function(e){ |
|||
var current = e.target.dataset.src; |
|||
var th = this; |
|||
wx.previewImage({ |
|||
current: current, // 当前显示图片的http链接
|
|||
urls: th.data.img // 需要预览的图片http链接列表
|
|||
}) |
|||
} |
|||
}) |
@ -0,0 +1,4 @@ |
|||
{ |
|||
"usingComponents": { |
|||
} |
|||
} |
@ -0,0 +1,62 @@ |
|||
<!-- pages/user/myWhistle/whistleDetail/index.wxml --> |
|||
<wxs module="whistle" src="../whistle.wxs"></wxs> |
|||
|
|||
<view class="title"> |
|||
<view> |
|||
<view>{{detail.createTime}}</view> |
|||
<view>{{detail.departName}}</view> |
|||
</view> |
|||
<view>处理中</view> |
|||
</view> |
|||
|
|||
<view class="content"> |
|||
<view class="con">{{detail.content}}</view> |
|||
|
|||
<block wx:if="{{detail.picList}}"> |
|||
<view class="image-show"> |
|||
<block wx:for="{{img}}"> |
|||
<!-- <view class="img-box"> --> |
|||
<image class="img-box" src="{{item}}" data-src="{{item}}" bindtap="previewImage"></image> |
|||
<!-- </view> --> |
|||
</block> |
|||
</view> |
|||
</block> |
|||
|
|||
</view> |
|||
|
|||
<view class="process"> |
|||
|
|||
<!-- <view>处理进度</view> --> |
|||
<view class="table"> |
|||
<block wx:for="{{detail.list}}"> |
|||
<view class="tb"> |
|||
|
|||
<view class="timeline"> |
|||
<view class="line"></view> |
|||
<view class="circle"> |
|||
<!-- <text class="fa fa-dot-circle-o fa-lg"></text> --> |
|||
|
|||
<text class="fa fa-circle fa-lg"></text> |
|||
</view> |
|||
<view class="line"></view> |
|||
</view> |
|||
<view class="content-1"> |
|||
<view class="process-tit"><text style="font-size:16px">{{item.handleType}}</text><text style="font-size:13px">{{item.handleDate}}</text></view> |
|||
<text style="font-size:13px;color:#737373;">{{item.handleSuggestions}}</text> |
|||
<text style="font-size:13px">处理部门{{item.handleDepartName}}</text> |
|||
</view> |
|||
<!-- <view class="time">{{item.handleDate}}</view> --> |
|||
|
|||
</view> |
|||
</block> |
|||
|
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
|
|||
|
|||
<block wx:if="{{detail.status == 1}}"> |
|||
<button class="btn1" bindtap="evaluation">我要评价</button> |
|||
</block> |
|||
|
@ -0,0 +1,134 @@ |
|||
/* pages/user/myWhistle/whistleDetail/index.wxss */ |
|||
page{ |
|||
width:100%; |
|||
font-size: 28rpx; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
} |
|||
|
|||
.title{ |
|||
width: 90%; |
|||
height: 60px; |
|||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.116); |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
.content{ |
|||
width: 90%; |
|||
/* height: 200px; */ |
|||
margin-top: 5px; |
|||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.116); |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
|
|||
.con{ |
|||
width:90%; |
|||
margin-top:20rpx; |
|||
margin-bottom: 20rpx; |
|||
font-size: 26rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
|
|||
.image-show{ |
|||
height: 220rpx; |
|||
width:90%; |
|||
overflow-x:scroll; |
|||
white-space:nowrap; |
|||
margin-top:30rpx; |
|||
} |
|||
|
|||
.img-box{ |
|||
margin-right:15rpx; |
|||
width:220rpx; |
|||
height:180rpx; |
|||
display: inline-flex; |
|||
position: relative; |
|||
} |
|||
|
|||
.process{ |
|||
width: 100%; |
|||
margin-top:20px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
font-size: 27rpx; |
|||
} |
|||
|
|||
.table{ |
|||
/* background-color: #efeff4; */ |
|||
/* height: 100%; */ |
|||
width:90%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
} |
|||
|
|||
.tb{ |
|||
width:100%; |
|||
/* height:150rpx; */ |
|||
min-height: 100px; |
|||
display: flex; |
|||
/* border: 1px solid #000; */ |
|||
} |
|||
|
|||
/* .time{ |
|||
width: 30%; |
|||
display: flex; |
|||
justify-content:right; |
|||
font-size:13px; |
|||
} */ |
|||
.timeline{ |
|||
width: 15%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
} |
|||
|
|||
.content-1{ |
|||
width:85%; |
|||
/* height: 100%; */ |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content:center; |
|||
/* align-items: center; */ |
|||
/* word-wrap:break-word; |
|||
word-break:break-all; */ |
|||
} |
|||
|
|||
|
|||
.line{ |
|||
width:49%; |
|||
height: 40%; |
|||
border-right: 1px solid #cecdcb; |
|||
} |
|||
.circle{ |
|||
width:100%; |
|||
height: 20%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content:center; |
|||
color:#5677fc; |
|||
} |
|||
|
|||
.process-tit{ |
|||
display: flex; |
|||
justify-content: space-between; |
|||
} |
|||
text{ |
|||
margin-bottom: 5px; |
|||
} |
|||
|
|||
|
|||
.btn1{ |
|||
width:90%; |
|||
background-color: #fc6351; |
|||
color: white; |
|||
margin-top: 30px; |
|||
margin-bottom: 30px; |
|||
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue