Browse Source

我的报修我的报事页面

epass
mk 2 months ago
parent
commit
bc9e18f6b3
  1. 14
      api/index.js
  2. 4
      app.json
  3. BIN
      images/icon/event.png
  4. BIN
      images/icon/repair.png
  5. BIN
      images/icon_2.png
  6. 4
      pages/mine/mine.js
  7. 128
      subpages/bsPage/bsPage/bsPage.js
  8. 23
      subpages/bsPage/bsPage/bsPage.wxml
  9. 22
      subpages/bsPage/bsPage/bsPage.wxss
  10. 22
      subpages/eventAdd/add/add.js
  11. 4
      subpages/eventAdd/add/add.wxml
  12. 96
      subpages/mine/eventList/eventList.js
  13. 5
      subpages/mine/eventList/eventList.json
  14. 39
      subpages/mine/eventList/eventList.wxml
  15. 16
      subpages/mine/eventList/eventList.wxss
  16. 102
      subpages/mine/repairList/repairList.js
  17. 4
      subpages/mine/repairList/repairList.json
  18. 43
      subpages/mine/repairList/repairList.wxml
  19. 18
      subpages/mine/repairList/repairList.wxss
  20. 2
      subpages/signingCompleted/signingCompleted/signingCompleted.wxml

14
api/index.js

@ -51,7 +51,19 @@ export function paySuccess(pamars) {
export function message(pamars) {
return fly.get(`/bysmp/message/page`,pamars)
}
// 提报
// 提报报修
export function repairSubmit(data) {
return fly.post(`/bysmp/repair/submit`,data)
}
// 提报报事
export function incidentsSubmit(data) {
return fly.post(`/bysmp/incidents/submit`,data)
}
// 报修记录
export function repairList(pamars) {
return fly.get(`/bysmp/repair/list`,pamars)
}
// 报事记录
export function incidentsList(pamars) {
return fly.get(`/bysmp/incidents/list`,pamars)
}

4
app.json

@ -26,7 +26,9 @@
"editUser/editUser",
"checkInRecord/checkInRecord",
"evaluate/evaluate",
"checkInEvaluate/checkInEvaluate"
"checkInEvaluate/checkInEvaluate",
"repairList/repairList",
"eventList/eventList"
]
},
{

BIN
images/icon/event.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icon/repair.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/icon_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

4
pages/mine/mine.js

@ -23,11 +23,11 @@ Page({
},
{
label:'我的报修',
url:''
url:'/subpages/mine/repairList/repairList'
},
{
label:'我的报事',
url:''
url:'/subpages/mine/eventList/eventList'
},
{
label:'共享空间',

128
subpages/bsPage/bsPage/bsPage.js

@ -2,6 +2,9 @@
const options = [
'安全问题','卫生问题','服务问题','噪音问题','体验问题','其它'
];
var config = require('../../../utils/config')
import {incidentsSubmit} from "../../../api/index"
const app = getApp()
Page({
/**
@ -11,22 +14,11 @@ Page({
show: false,
options,
fieldValue: '',
cascaderValue: '',
questionText: '',
fileList: [
// {
// url: 'https://img.yzcdn.cn/vant/leaf.jpg',
// name: '图片1',
// },
// // Uploader 根据文件后缀来判断是否为图片文件
// // 如果图片 URL 中不包含类型信息,可以添加 isImage 标记来声明
// {
// url: 'http://iph.href.lu/60x60?text=default',
// name: '图片2',
// isImage: true,
// // deletable: true,
// },
],
faultDescribe: '',
fileList: [],
feedbackType:'',
positionType:null,
position:''
},
onButtonTap() {
@ -35,6 +27,11 @@ Page({
icon: 'none'
});
},
onInputP(e){
this.setData({
position:e.detail.value
})
},
deleteData(event) {
// 删除
console.log(event.detail.index)
@ -48,26 +45,20 @@ Page({
const {
file
} = event.detail;
console.log(file, 66)
const _this = this
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
wx.uploadFile({
url: 'https://example.weixin.qq.com/upload', // 仅为示例,非真实的接口地址
url: `${config.BASEURL()}/common/upload`, // 仅为示例,非真实的接口地址
filePath: file.url,
name: 'file',
formData: {
user: 'test'
header: {
"Content-type": "multipart/form-data",
'Authorization': wx.getStorageSync('token')
},
success(res) {
// 上传完成需要更新 fileList
const {
fileList = []
} = this.data;
fileList.push({
...file,
url: res.data
});
this.setData({
fileList
const res1 = JSON.parse(res.data)
_this.setData({
fileList:_this.data.fileList.concat([{url:res1.url,name:new Date().getTime()}])
});
},
});
@ -81,9 +72,15 @@ Page({
},
onInput(e) {
this.setData({
questionText: e.detail.value,
faultDescribe: e.detail.value,
});
// console.log(this.data.questionText, 666)
// console.log(this.data.faultDescribe, 666)
},
onChangeRadio(e){
this.setData({
positionType:e.detail,
position:''
})
},
onClick() {
this.setData({
@ -96,17 +93,51 @@ Page({
});
},
onFinish(e) {
const {
selectedOptions,
value
} = e.detail;
const fieldValue = selectedOptions
.map((option) => option.text || option.name)
.join('/');
this.setData({
fieldValue,
cascaderValue: value,
submit(){
const {position,positionType,feedbackType,faultDescribe,fileList} = this.data
if(!feedbackType){
wx.showToast({
title: '反馈类型不能为空',
icon:'none'
})
return
}
if(!faultDescribe){
wx.showToast({
title: '问题描述不能为空',
icon:'none'
})
return
}
if(positionType === null){
wx.showToast({
title: '位置不能为空',
icon:'none'
})
return
}
let parms = {
position,
images:fileList,
positionType,
faultDescribe,
graduateName: app.globalData.userInfo.name,
telephone: app.globalData.userInfo.phone,
feedbackType
}
incidentsSubmit(parms).then(res=>{
if(res.code === 200){
wx.showToast({
title: '上报成功',
duration:2000,
success:()=>{
setTimeout(()=>{
wx.navigateBack()
},2000)
}
})
}
})
},
/**
@ -167,11 +198,16 @@ Page({
},
onconfirm(e){
const {
index,
value
} = e.detail;
console.log(index);
this.setData({
show:false,
fieldValue:e.detail.value
fieldValue:value,
feedbackType: (index + 1).toString(),
show:false
})
console.log(e);
},
oncancel(){
this.setData({

23
subpages/bsPage/bsPage/bsPage.wxml

@ -3,24 +3,27 @@
<image class="bsImg" src="../../images/bsBac.png" />
<view class="bsTitle">
<van-cell-group class="bsCon" border="{{false}}">
<van-cell title="反馈类型" border="{{false}}" value="{{fieldValue}}" is-link readonly bind:tap="onClick" />
<van-cell title="反馈类型" border="{{false}}" value="{{fieldValue}}" is-link readonly bind:tap="onClick" required/>
</van-cell-group>
<van-popup show="{{ show }}" round position="bottom">
<van-picker columns="{{ options }}" bind:confirm="onconfirm" bind:cancel="oncancel" show-toolbar />
</van-popup>
</view>
<view class="bsCon2">
<view class="bsSpan">问题描述</view>
<textarea class="question-input" placeholder="请输入内容" bindinput="onInput" value="{{questionText}}" maxlength="" />
<view class="bsSpan" style="margin-top: 15rpx;">上传图片/视频</view>
<van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" bind:before-read="beforeRead" bind:delete="deleteData" max-count="3" />
<view class="bsSpan"><text class="required">*</text>问题描述</view>
<textarea class="question-input" placeholder="请输入内容" bindinput="onInput" value="{{faultDescribe}}" maxlength="" />
<view class="bsSpan" style="margin-top: 15rpx;">上传图片</view>
<van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" bind:before-read="beforeRead" bind:delete="deleteData" max-count="3" />
</view>
<view class="bsCon3">
<view class="bsSpan1">位置</view>
<van-radio-group value="{{ radio }}" bind:change="onChange" direction="horizontal">
<van-radio name="1">所住房间</van-radio>
<van-radio name="2">公共区域</van-radio>
<view style="display: flex;">
<view class="bsSpan1"> <text class="required">*</text> 位置</view>
<van-radio-group value="{{positionType}}" bind:change="onChangeRadio" direction="horizontal">
<van-radio name="{{0}}">所住房间</van-radio>
<van-radio name="{{1}}">公共区域</van-radio>
</van-radio-group>
</view>
<textarea wx:if="{{positionType === 1}}" value="{{position}}" bind:input="onInputP" style="min-height: 100rpx;background-color:#f6f6f6;width: 100%;margin-top:50rpx;padding: 10rpx 10rpx 30rpx 10rpx;" placeholder="请输入位置信息"/>
</view>
<view class="bsBtn" bindtap="onButtonTap">提交</view>
<view class="bsBtn" bindtap="submit">提交</view>
</view>

22
subpages/bsPage/bsPage/bsPage.wxss

@ -58,18 +58,19 @@
}
.bsCon3 {
border-radius: 10rpx;
height: 100rpx;
height: 400rpx;
overflow-y: auto;
background-color: rgba(255, 255, 255, 1);
position: absolute;
width: 96%;
margin-left: 2%;
top: calc(7% + 900rpx);
top:calc(7% + 897rpx);
padding: 2%;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: column;
margin-bottom: 200rpx;
padding-bottom: 100rpx;
}
/* 输入框样式 */
.question-input {
@ -81,7 +82,6 @@
padding: 15rpx;
box-sizing: border-box;
background-color: rgba(246, 246, 246, 1);
color: rgba(203, 203, 203, 1);
font-size: 28rpx;
}
@ -111,7 +111,17 @@ van-uploader__upload {
color: rgba(255, 255, 255, 1);
font-size: 34rpx;
text-align: center;
bottom: 3%;
top: calc(7% + 1308rpx);
left: 50%;
transform: translateX(-50%);
}
.required{
color: #f10a24;
}
.bsSpan1 {
color: rgba(104, 117, 139, 1);
font-size: 30rpx;
margin-left: 20rpx;
display: inline-block;
width: 21%;
}

22
subpages/eventAdd/add/add.js

@ -12,15 +12,7 @@ Page({
radio: '1',
bxname: '',
fileList: [
// {
// url: 'https://img.yzcdn.cn/vant/leaf.jpg',
// name: '图片1',
// },
// {
// url: 'http://iph.href.lu/60x60?text=default',
// name: '图片2',
// isImage: true,
// },
],
positionType:null,
repairItem:'',
@ -101,7 +93,9 @@ Page({
images:fileList,
positionType,
repairItem,
faultDescribe
faultDescribe,
graduateName: app.globalData.userInfo.name,
telephone: app.globalData.userInfo.phone,
}
repairSubmit(parms).then(res=>{
if(res.code === 200){
@ -124,7 +118,13 @@ Page({
},
onChangeRadio(e){
this.setData({
positionType:e.detail
positionType:e.detail,
position:''
})
},
onInputP(e){
this.setData({
position:e.detail.value
})
},
/**

4
subpages/eventAdd/add/add.wxml

@ -15,7 +15,7 @@
</view>
<view class="bsSpan "><text class="required">*</text> 故障说明</view>
<textarea class="question-input" placeholder="请输入内容" bindinput="onInput" value="{{faultDescribe}}" maxlength="" />
<view class="bsSpan" style="margin-top: 15rpx;margin-left: 0rpx;">上传图片/视频</view>
<view class="bsSpan" style="margin-top: 15rpx;margin-left: 0rpx;">上传图片</view>
<van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" bind:before-read="beforeRead" bind:delete="deleteData" max-count="3" />
</view>
<view class="bsCon3">
@ -26,7 +26,7 @@
<van-radio name="{{1}}">公共区域</van-radio>
</van-radio-group>
</view>
<textarea wx:if="{{positionType === 1}}" value="{{position}}" style="min-height: 100rpx;background-color:#f6f6f6;width: 100%;margin-top:50rpx;padding: 10rpx 10rpx 30rpx 10rpx;" placeholder="请输入位置信息"/>
<textarea wx:if="{{positionType === 1}}" bind:input="onInputP" value="{{position}}" style="min-height: 100rpx;background-color:#f6f6f6;width: 100%;margin-top:50rpx;padding: 10rpx 10rpx 30rpx 10rpx;" placeholder="请输入位置信息"/>
</view>
<view class="bsBtn" bindtap="repairSubmit">提交</view>
</view>

96
subpages/mine/eventList/eventList.js

@ -0,0 +1,96 @@
// subpages/mine/repairList/repairList.js
import {
incidentsList
} from "../../../api/index"
Page({
/**
* 页面的初始数据
*/
data: {
},
repairList() {
incidentsList().then(res => {
if (res.code === 200) {
res.data.forEach(item => {
switch (item.state) {
case 0:
item.state = '待处理'
break;
case 1:
item.state = '处理中'
break;
case 2:
item.state = '已处理'
break;
case 3:
item.state = '不予处理'
break;
default:
state = ''
}
})
this.setData({
list: res.data
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.repairList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

5
subpages/mine/eventList/eventList.json

@ -0,0 +1,5 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的报事"
}

39
subpages/mine/eventList/eventList.wxml

@ -0,0 +1,39 @@
<!--subpages/mine/repairList/repairList.wxml-->
<view class="card mt-14" wx:for="{{list}}">
<view class="position flex">
<image src="../../../images/icon/event.png" mode="" class="icon-40 mr-10" />
<view wx:if="{{item.positionType === 1}}">{{item.position}}</view>
<view wx:if="{{item.positionType === 0}}">{{item.apartmentName}}{{item.position}}</view>
</view>
<view class="bg-gary mt-24">
<view class="m-top-16 flex items-center">
<view class="label mr-30">问题描述</view>
<view class="value">{{item.faultDescribe}}</view>
</view>
<view class="m-top-16 flex items-center">
<view class="label mr-30">图片</view>
<view class="flex flex-sa">
<image src="{{itemC.url}}" style="width: 140rpx;height: 140rpx;" mode="" wx:for="{{item.images}}" wx:for-item="itemC" wx:if="{{itemC.type != 'video'}}"/>
<!-- <video src="{{itemC.url}}" style="width: 140rpx;height: 140rpx;" wx:if="{{itemC.type === 'video'}}" wx:for="{{item.images}}" wx:for-item="itemC" /> -->
</view>
</view>
<view class="m-top-16 flex items-center">
<view class="label mr-30">提报时间</view>
<view class="value">{{item.createTime}}</view>
</view>
</view>
<view>
<view class="flex pl-16 mt-24">
<view class="mr-30">处理状态</view>
<view class="value" style="color:{{item.state === '待处理'?'#ff9f00':''}}" >{{item.state}}</view>
</view>
<view wx:if="{{item.handleImages.length != 0}}">
<view>图片视频</view>
<image src="{{itemC.url}}" style="width: 140rpx;height: 140rpx;" mode="" wx:for="{{item.handleImages}}" wx:for-item="itemC" />
</view>
<view wx:if="{{item.handleDescribe}}">
<view>处理说明</view>
<view class="value">{{item.handleDescribe}}</view>
</view>
</view>
</view>

16
subpages/mine/eventList/eventList.wxss

@ -0,0 +1,16 @@
page{
background-color: #f8f8f8;
}
.card{
margin: 8rpx auto;
width: calc(100% - 40rpx);
}
.label{
color: #a9afba;
font-size: 28rpx;
}
.bg-gary{
background-color: #f9f9f9;
border-radius: 20rpx;
padding:24rpx 32rpx ;
}

102
subpages/mine/repairList/repairList.js

@ -0,0 +1,102 @@
// subpages/mine/repairList/repairList.js
import {
repairList
} from "../../../api/index"
Page({
/**
* 页面的初始数据
*/
data: {
},
repairList() {
repairList().then(res => {
if (res.code === 200) {
res.data.forEach(item => {
switch (item.state) {
case 0:
item.state = '待处理'
break;
case 1:
item.state = '未维修'
break;
case 2:
item.state = '维修中'
break;
case 3:
item.state = '已维修'
break;
case 4:
item.state = '已报废'
break;
case 5:
item.state = '无需维修'
break;
default:
state = ''
}
})
this.setData({
list: res.data
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.repairList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

4
subpages/mine/repairList/repairList.json

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的报修"
}

43
subpages/mine/repairList/repairList.wxml

@ -0,0 +1,43 @@
<!--subpages/mine/repairList/repairList.wxml-->
<view class="card mt-14" wx:for="{{list}}">
<view class="position flex">
<image src="../../../images/icon/repair.png" mode="" class="icon-40 mr-10" />
<view wx:if="{{item.positionType === 1}}">{{item.position}}</view>
<view wx:if="{{item.positionType === 0}}">{{item.apartmentName}}{{item.position}}</view>
</view>
<view class="bg-gary mt-24">
<view class="m-top-16 flex items-center">
<view class="label mr-30">报修物品</view>
<view class="value">{{item.repairItem}}</view>
</view>
<view class="m-top-16 flex items-center">
<view class="label mr-30">故障问题</view>
<view class="value">{{item.faultDescribe}}</view>
</view>
<view class="m-top-16 flex items-center">
<view class="label mr-30">图片</view>
<view class="flex flex-sa">
<image src="{{itemC.url}}" style="width: 140rpx;height: 140rpx;" mode="" wx:for="{{item.images}}" wx:for-item="itemC" wx:if="{{itemC.type != 'video'}}"/>
<!-- <video src="{{itemC.url}}" style="width: 140rpx;height: 140rpx;" wx:if="{{itemC.type === 'video'}}" wx:for="{{item.images}}" wx:for-item="itemC" /> -->
</view>
</view>
<view class="m-top-16 flex items-center">
<view class="label mr-30">提报时间</view>
<view class="value">{{item.createTime}}</view>
</view>
</view>
<view>
<view class="flex pl-16 mt-24">
<view class="mr-30">处理状态</view>
<view class="value" style="color:{{item.state === '待处理'?'#ff9f00':''}}" >{{item.state}}</view>
</view>
<view wx:if="{{item.handleImages.length != 0}}">
<view>图片视频</view>
<image src="{{itemC.url}}" style="width: 140rpx;height: 140rpx;" mode="" wx:for="{{item.handleImages}}" wx:for-item="itemC" />
</view>
<view wx:if="{{item.handleDescribe}}">
<view>处理说明</view>
<view class="value">{{item.handleDescribe}}</view>
</view>
</view>
</view>

18
subpages/mine/repairList/repairList.wxss

@ -0,0 +1,18 @@
/* subpages/mine/repairList/repairList.wxss */
/* subpages/mine/eventList/eventList.wxss */
page{
background-color: #f8f8f8;
}
.card{
margin: 8rpx auto;
width: calc(100% - 40rpx);
}
.label{
color: #a9afba;
font-size: 28rpx;
}
.bg-gary{
background-color: #f9f9f9;
border-radius: 20rpx;
padding:24rpx 32rpx ;
}

2
subpages/signingCompleted/signingCompleted/signingCompleted.wxml

@ -1,6 +1,6 @@
<!--subpages/signingCompleted/signingCompleted/signingCompleted.wxml-->
<view class="card flex items-center flex-col" style="width: calc(100% - 40rpx);margin: 0 auto;padding-bottom: 130rpx;">
<image src="../../../images/icon_1.png" style="width: 188rpx;height: 188rpx;" mode=""/>
<image src="../../../images/icon_2.png" style="width: 188rpx;height: 188rpx;" mode=""/>
<view style="color: #000000;font-size: 40rpx;font-weight: 600;">您已完成入住办理</view>
<view style="color: #666666;font-size: 30rpx;margin-bottom: 36rpx;">祝您居住愉快~</view>
<van-button round type="info" color="#1ac5c5" bind:click="toHome">返回首页</van-button>

Loading…
Cancel
Save