mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-24 05:46:04 +08:00
优化报修查询页面功能
This commit is contained in:
parent
5cf3592390
commit
2877370be3
@ -83,6 +83,9 @@ const listActivitiess = baseUrl + "/app/activities.listActivitiess";
|
||||
//查询小区广告
|
||||
const listAdvertPhoto = baseUrl +"/app/advert.listAdvertPhoto";
|
||||
|
||||
//查询报修单
|
||||
const listMyRepair = baseUrl + "/app/ownerRepair.listOwnerRepairs";
|
||||
|
||||
|
||||
module.exports = {
|
||||
baseUrl: baseUrl,
|
||||
@ -114,5 +117,6 @@ module.exports = {
|
||||
listCommunitys: listCommunitys,
|
||||
listActivitiess: listActivitiess,
|
||||
filePath: filePath,
|
||||
listAdvertPhoto: listAdvertPhoto
|
||||
listAdvertPhoto: listAdvertPhoto,
|
||||
listMyRepair: listMyRepair
|
||||
};
|
||||
@ -28,8 +28,5 @@
|
||||
button-text="添加成员"
|
||||
bind:submit="goAdd"
|
||||
>
|
||||
<view slot="tip">
|
||||
|
||||
</view>
|
||||
</van-submit-bar>
|
||||
</view>
|
||||
@ -1,17 +1,53 @@
|
||||
// pages/myRepair/myRepair.js
|
||||
const context = require('../../context/Java110Context.js');
|
||||
const factory = context.factory;
|
||||
const constant = context.constant;
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
active:0,
|
||||
ownerId:'',
|
||||
roomId:'',
|
||||
communityId:'',
|
||||
waitRepair:[],
|
||||
doingRepair:[],
|
||||
repaired:[]
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
let that = this;
|
||||
context.getRooms().then(function (res) {
|
||||
let _owner = res.data.owner;
|
||||
|
||||
let _rooms = res.data.rooms;
|
||||
if(_rooms == null || _rooms == undefined || _rooms.length == 0){
|
||||
return ;
|
||||
}
|
||||
|
||||
let _roomId = '';
|
||||
|
||||
_rooms.forEach(function(_item){
|
||||
_roomId += (_item.roomId+',');
|
||||
});
|
||||
|
||||
if(_roomId != ''){
|
||||
_roomId = _roomId.substring(0,_roomId.length-1);
|
||||
}
|
||||
|
||||
that.setData({
|
||||
communityId: _owner.communityId,
|
||||
ownerId: _owner.memberId,
|
||||
roomId: _roomId
|
||||
});
|
||||
that._loadRepair(that.data.active);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
@ -62,5 +98,72 @@ Page({
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
/**
|
||||
* 加载我的报修
|
||||
*/
|
||||
_loadRepair:function(_active){
|
||||
let that = this;
|
||||
|
||||
let _state = '';
|
||||
if (_active == 0){
|
||||
_state = '1000';
|
||||
}else if(_active == 1){
|
||||
_state = '1100';
|
||||
}else{
|
||||
_state = '1200';
|
||||
}
|
||||
|
||||
let _paramIn = {
|
||||
"communityId": that.data.communityId,
|
||||
"ownerId": that.data.ownerId,
|
||||
"roomId":that.data.roomId,
|
||||
"state":_state,
|
||||
"page":1,
|
||||
"row":10
|
||||
};
|
||||
context.request({
|
||||
url: constant.url.listMyRepair,
|
||||
header: context.getHeaders(),
|
||||
method: "GET",
|
||||
data: _paramIn,
|
||||
success: function (res) {
|
||||
if (res.statusCode == 200) {
|
||||
let _ownerRepairs = res.data.ownerRepairs;
|
||||
if (_active == 0){
|
||||
that.setData({
|
||||
waitRepair: _ownerRepairs
|
||||
});
|
||||
} else if (_active == 1){
|
||||
that.setData({
|
||||
doingRepair: _ownerRepairs
|
||||
});
|
||||
}else{
|
||||
that.setData({
|
||||
repaired: _ownerRepairs
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
wx.showToast({
|
||||
title: "查询报修单失败",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
},
|
||||
fail: function (e) {
|
||||
wx.showToast({
|
||||
title: "服务器异常了",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange:function(e){
|
||||
console.log(e);
|
||||
|
||||
this._loadRepair(e.detail.index);
|
||||
}
|
||||
})
|
||||
@ -1,9 +1,93 @@
|
||||
<view>
|
||||
|
||||
<van-tabs active="{{ active }}" bind:change="onChange">
|
||||
<van-tab title="待处理">内容 1</van-tab>
|
||||
<van-tab title="接单中">内容 2</van-tab>
|
||||
<van-tab title="完成">内容 3</van-tab>
|
||||
</van-tabs>
|
||||
<van-tabs active="{{ active }}" bind:change="onChange">
|
||||
<van-tab title="待处理">
|
||||
<view class="ppfl_c" wx:for="{{waitRepair}}" wx:for-index="idx" wx:for-item="item">
|
||||
<van-panel title="{{item.repairId}}" desc="" status="{{item.tel}}">
|
||||
<view class="ppfl_context">
|
||||
<van-row>
|
||||
<van-col span="8">报修类型:</van-col>
|
||||
<van-col span="16">{{item.repairTypeName}}</van-col>
|
||||
</van-row>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">报修人:</van-col>
|
||||
<van-col span="16">{{item.repairName}}</van-col>
|
||||
</van-row>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">报修房间:</van-col>
|
||||
<van-col span="16">{{item.roomId}}</van-col>
|
||||
</van-row>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">预约时间:</van-col>
|
||||
<van-col span="16">{{item.appointmentTime }}</van-col>
|
||||
</van-row>
|
||||
|
||||
</view>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">报修内容:</van-col>
|
||||
<van-col span="16">{{item.context}}</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</van-panel>
|
||||
</view>
|
||||
</van-tab>
|
||||
<van-tab title="接单中">
|
||||
<view class="ppfl_c" wx:for="{{doingRepair}}" wx:for-index="idx" wx:for-item="item">
|
||||
<van-panel title="{{item.repairId}}" desc="" status="{{item.tel}}">
|
||||
<view class="ppfl_context">
|
||||
<van-row>
|
||||
<van-col span="8">报修类型:</van-col>
|
||||
<van-col span="16">{{item.repairTypeName}}</van-col>
|
||||
</van-row>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">报修人:</van-col>
|
||||
<van-col span="16">{{item.repairName}}</van-col>
|
||||
</van-row>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">报修房间:</van-col>
|
||||
<van-col span="16">{{item.roomId}}</van-col>
|
||||
</van-row>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">预约时间:</van-col>
|
||||
<van-col span="16">{{item.appointmentTime }}</van-col>
|
||||
</van-row>
|
||||
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">报修内容:</van-col>
|
||||
<van-col span="16">{{item.context}}</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</van-panel>
|
||||
</view>
|
||||
</van-tab>
|
||||
<van-tab title="完成">
|
||||
<view class="ppfl_c" wx:for="{{repaired}}" wx:for-index="idx" wx:for-item="item">
|
||||
<van-panel title="{{item.repairId}}" desc="" status="{{item.tel}}">
|
||||
<view class="ppfl_context">
|
||||
<van-row>
|
||||
<van-col span="8">报修类型:</van-col>
|
||||
<van-col span="16">{{item.repairTypeName}}</van-col>
|
||||
</van-row>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">报修人:</van-col>
|
||||
<van-col span="16">{{item.repairName}}</van-col>
|
||||
</van-row>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">报修房间:</van-col>
|
||||
<van-col span="16">{{item.roomId}}</van-col>
|
||||
</van-row>
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">预约时间:</van-col>
|
||||
<van-col span="16">{{item.appointmentTime }}</van-col>
|
||||
</van-row>
|
||||
|
||||
<van-row class="ppfl_context_row">
|
||||
<van-col span="8">报修内容:</van-col>
|
||||
<van-col span="16">{{item.context}}</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</van-panel>
|
||||
</view>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
|
||||
</view>
|
||||
@ -1 +1,31 @@
|
||||
/* pages/myRepair/myRepair.wxss */
|
||||
.ppfl_c{
|
||||
padding: 0rpx 20rpx 0rpx 20rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.block__title {
|
||||
margin: 0;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color: rgba(69,90,100,.6);
|
||||
padding: 40rpx 30rpx 20rpx;
|
||||
}
|
||||
|
||||
.ppfl_context{
|
||||
padding: 20rpx 40rpx 40rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
color: #8a8a8a;
|
||||
}
|
||||
|
||||
.ppfl_context .ppfl_context_row{
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
|
||||
.button_up_blank{
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.block__bottom{
|
||||
height: 160rpx;
|
||||
}
|
||||
@ -178,7 +178,6 @@ Page({
|
||||
data:obj, //动态数据
|
||||
success: function(res) {
|
||||
if (res.statusCode == 200) {
|
||||
|
||||
wx.redirectTo({
|
||||
url: '/pages/myRepair/myRepair',
|
||||
});
|
||||
@ -189,6 +188,13 @@ Page({
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
fail:function(e){
|
||||
wx.showToast({
|
||||
title: "服务器异常了",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
<van-field value="{{ typeName }}" label="报修类型" placeholder="请选择报修类型" catchtap="chooseType" required readonly icon="arrow" />
|
||||
<van-field value="{{ bindRepairName }}" bindinput="bindInput" data-name="bindRepairName" label="报修人" placeholder="请输入报修人" required />
|
||||
<van-field value="{{ bindTel }}" bindinput="bindInput" data-name="bindTel" type="number" label="手机号" placeholder="请输入手机号" required />
|
||||
<van-field value="{{ bindDate }}" bindinput="bindInput" data-name="bindDate" catchtap="chooseDate" label="预约日期" placeholder="请选择日期" required icon="arrow"/>
|
||||
<van-field value="{{ bindTime }}" bindinput="bindInput" data-name="bindTime" catchtap="chooseTime" label="预约时间" placeholder="请选择时间" required icon="arrow" />
|
||||
<van-field value="{{ bindDate }}" bindinput="bindInput" data-name="bindDate" catchtap="chooseDate" label="预约日期" placeholder="请选择日期" required readonly icon="arrow"/>
|
||||
<van-field value="{{ bindTime }}" bindinput="bindInput" data-name="bindTime" catchtap="chooseTime" label="预约时间" placeholder="请选择时间" required readonly icon="arrow" />
|
||||
<van-field value="{{ context }}" bindinput="bindInput" data-name="context" label="报修内容" type="textarea" placeholder="请输入报修内容" autosize border="{{ false }}" required />
|
||||
</van-cell-group>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user