描述:目录修改

This commit is contained in:
SelfRidicule 2024-07-29 11:37:22 +08:00
parent 63b773dd56
commit 6f051773c8
15 changed files with 643 additions and 8 deletions

View File

@ -5,7 +5,6 @@ App({
tenantId : '12', // 地区
parkId : '26', // 园区id
parkName : '长阳智会云控', // 园区名称
ownership : 'Copyrights@2019淮安市行政中心报修版权所有',
// 本地测试
// DOMAIN_NAME_PREFIX: 'http://192.168.0.11',
// DOMAIN_NAME: 'http://192.168.0.11:9227', //接口域名

View File

@ -73,8 +73,9 @@
"pages/meeting/reservationRecord/exhibitionRecord/list/list",
"pages/meeting/reservationRecord/exhibitionRecord/detail/detail",
"pages/meeting/meetingRoom/meetingService/meetingService",
"pages/reportRepair/reportRepair",
"pages/reportRepair/repairAdd/repairAdd"
"pages/reportRepair/repairIndex/index",
"pages/reportRepair/repairAdd/add",
"pages/reportRepair/repairRecord/reportPerson/record"
],
"window": {
"backgroundTextStyle": "light",

View File

@ -111,7 +111,7 @@ Page({
{
name: "随手拍",
img: "/profile/static/index/menu-bxfw.png",
path: "/pages/reportRepair/reportRepair"
path: "/pages/reportRepair/repairIndex/index"
},
// {
// name: "展厅预约",

View File

@ -7,15 +7,14 @@ Page({
*/
data: {
IMG_NAME: app.IMG_NAME,
ownership: app.ownership,
menuList: [{
name: "我要报修",
img: "/profile/static/index/menu-bxfw.png",
path: "/pages/reportRepair/repairAdd/repairAdd"
path: "/pages/reportRepair/repairAdd/add"
}, {
name: "报修查询",
img: "/profile/static/index/menu-ztyy.png",
path: "/pages/reportRepair/reportRepair"
path: "/pages/reportRepair/repairRecord/reportPerson/record"
}, {
name: "维修入口",
img: "/profile/static/index/menu-bxfw.png",

View File

@ -20,6 +20,6 @@
</view>
</view>
<view class="ownership">{{ownership}}</view>
<!-- <view class="ownership">{{ownership}}</view> -->
</view>

View File

@ -0,0 +1,419 @@
const app = getApp()
import Dialog from '@vant/weapp/dialog/dialog';
import Notify from '@vant/weapp/notify/notify';
import {
selfFormatTimeYMD,
selfFormatTimeHM
} from "../../../../utils/util.js"
import {
selectReservationListByUserIdRq,
selectVisitorInvitationRecordRq,
cancelOrderRq
} from "../../../../api/meeting/meetingRoom.js"
Page({
/**
* 页面的初始数据
*/
data: {
IMG_NAME: app.IMG_NAME,
userData: null,
dataChange: false,
tabTitle: '预约记录',
// 预约记录参数
reservationPageNum: 1,
reservationPageSize: 10,
reservationDataList: [],
reservationIsDataAll: false,
// 参与记录参数
participatePageNum: 1,
participatePageSize: 10,
participateDataList: [],
participateIsDataAll: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let _this = this;
_this.setData({
userData: wx.getStorageSync('user'),
})
// 获取数据
let userId = _this.data.userData.id
// 获取预约数据
_this.getReservationData({
userId,
pageNum: _this.data.reservationPageNum,
pageSize: _this.data.reservationPageSize,
})
// 获取参与数据
_this.getParticipateData({
userId,
pageNum: _this.data.participatePageNum,
pageSize: _this.data.participatePageSize
})
},
// 获取数据
getDataList() {
// 获取参数
let _this = this;
let tabTitle = _this.data.tabTitle
let userId = _this.data.userData.id
let isDataAll = null
let pageNum = null
let pageSize = null
if (tabTitle == '预约记录') {
// 预约记录参数
isDataAll = _this.data.reservationIsDataAll
pageNum = _this.data.reservationPageNum
pageSize = _this.data.reservationPageSize
} else if (tabTitle == '预约记录') {
// 参与记录参数
isDataAll = _this.data.participateIsDataAll
pageNum = _this.data.participatePageNum
pageSize = _this.data.participatePageSize
} else {
wx.showToast({
title: `tab 切换错误(${tabTitle})`,
icon: 'none',
});
return;
}
// 判断数据是否已全部加载
if (isDataAll) {
return;
}
// 传递参数
let param = {
userId,
pageNum,
pageSize
}
if (tabTitle == '预约记录') {
// 获取预约数据
_this.getReservationData(param)
} else if (tabTitle == '预约记录') {
// 获取参与数据
_this.getParticipateData(param)
}
},
// 获取预约数据
getReservationData(param) {
let _this = this;
let {
pageNum,
pageSize,
userId
} = param
// 查询数据
selectReservationListByUserIdRq({
pageNum,
pageSize,
userId
}).then(res => {
console.log('selectReservationListByUserIdRq', res);
// 判断数据是否全部查询
let queryDataList = res.page.records;
if (queryDataList && queryDataList.length > 0) {
// 更新参数
let reservationDataList = _this.data.reservationDataList.concat(_this.formartData(queryDataList));
let reservationPageNum = _this.data.reservationPageNum + 1;
_this.setData({
reservationPageNum,
reservationDataList,
})
} else {
_this.setData({
reservationIsDataAll: true
})
}
})
},
// 获取参与数据
getParticipateData(param) {
let _this = this;
let {
pageNum,
pageSize,
userId
} = param
// 查询数据
selectVisitorInvitationRecordRq({
pageNum,
pageSize,
userId
}).then(res => {
console.log('selectVisitorInvitationRecordRq', res);
// 判断数据是否全部查询
let queryDataList = res.page.records;
if (queryDataList && queryDataList.length > 0) {
// 更新参数
let participateDataList = _this.data.participateDataList.concat(_this.formartData(queryDataList));
let participatePageNum = _this.data.participatePageNum + 1;
_this.setData({
participatePageNum,
participateDataList,
})
} else {
_this.setData({
participateIsDataAll: true
})
}
})
},
// 格式化数据
formartData(queryDataList) {
// 格式化数据
return queryDataList.map(item => {
item.timeSlot = selfFormatTimeYMD(item.startTime) + ' ' + selfFormatTimeHM(item.startTime) + '~' + selfFormatTimeHM(item.endDate);
// 状态字体颜色
let statusColor = "#FFB119";
// 按钮是否显示
let statusValue = item.statusValue;
let showPay = false;
let showInvite = false;
let showCancel = false;
let showDetail = false;
// 待支付 0 :去支付、取消订单、查看详情
if (statusValue == 0) {
showPay = true;
showCancel = true;
showDetail = true;
// 状态字体颜色
statusColor = "#FFB119";
}
// 待使用 1去邀请、取消订单、查看详情
if (statusValue == 1) {
showInvite = true;
showCancel = true;
showDetail = true;
// 状态字体颜色
statusColor = "#3794FF";
// 待使用 修改为 预约成功
item.statusName = '预约成功'
}
// 进行中 2去邀请、查看详情
if (statusValue == 2) {
showInvite = true;
showDetail = true;
// 状态字体颜色
statusColor = "#FF4040";
}
// 已结束 3查看详情
if (statusValue == 3) {
showDetail = true;
// 状态字体颜色
statusColor = "#333333";
}
// 已取消 4查看详情
if (statusValue == 4) {
showDetail = true;
// 状态字体颜色
statusColor = "#7F7F7F";
}
//
// 赋值
item.showPay = showPay;
item.showInvite = showInvite;
item.showCancel = showCancel;
item.showDetail = showDetail;
// 状态字体颜色
item.statusColor = statusColor;
// 图片
if (item.roomContent.indoorPicUrl) {
try {
item.roomContent.indoorPicUrlFirst = JSON.parse(item.roomContent.indoorPicUrl)[0].url
} catch (error) {
console.log(`JSON error : ${error}`);
}
}
return item;
})
},
// 跳转-支付
jumpPay(e) {
console.log('jumpPay', e);
wx.navigateTo({
url: "/pages/meeting/pay/waitPay/waitPay?id=" + e.currentTarget.dataset.id + "&type=meetingRoom"
})
},
// 跳转-预约详情
jumpMeetingDetail(e) {
console.log('jumpMeetingDetail', e);
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: "/pages/meeting/reservationRecord/meetingRecord/meetingDetail/meetingDetail?id=" + id,
})
},
// 跳转-参与详情
jumpParticipateDetail(e) {
console.log('jumpParticipateDetail', e);
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: "/pages/meeting/invite/invite?id=" + id,
})
},
// tab 点击切换
tabClickSwitch(event) {
console.log('tabClickSwitch', event);
let _this = this;
_this.setData({
tabTitle: event.detail.title
})
},
// 取消订单
cancelOrder(e) {
console.log('cancelOrder', e);
let _this = this;
let id = e.currentTarget.dataset.id
const beforeClose = (action) => {
console.log('action', action);
return new Promise((resolve) => {
if (action === 'confirm') {
cancelOrderRq({
id,
cancelResaon: ""
}).then(res => {
console.log('cancelOrderRq', res);
if (res.code == 0) {
// 刷新预约数据
_this.setData({
reservationPageNum: 1,
reservationDataList: [],
reservationIsDataAll: false,
})
_this.getDataList()
} else {
// 危险通知
Notify({
type: 'danger',
message: res.msg
});
}
resolve(true);
})
} else {
// 拦截取消操作
resolve(true);
}
});
}
Dialog.confirm({
title: '提示',
message: '是否取消预约!',
beforeClose,
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
let _this = this;
// 数据是否变化
if (_this.data.dataChange) {
// 刷新数据
_this.setData({
dataChange: false,
// 预约记录参数
reservationPageNum: 1,
reservationDataList: [],
reservationIsDataAll: false,
// 参与记录参数
participatePageNum: 1,
participateDataList: [],
participateIsDataAll: false,
})
// 获取数据
let userId = _this.data.userData.id
// 获取预约数据
_this.getReservationData({
userId,
pageNum: _this.data.reservationPageNum,
pageSize: _this.data.reservationPageSize,
})
// 获取参与数据
_this.getParticipateData({
userId,
pageNum: _this.data.participatePageNum,
pageSize: _this.data.participatePageSize
})
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
console.log('onPullDownRefresh', '页面相关事件处理函数--监听用户下拉动作');
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
console.log('onReachBottom', '页面上拉触底事件的处理函数');
let _this = this;
// 获取数据
_this.getDataList()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage(e) {
console.log('onShareAppMessage', e);
let _this = this;
let id = e.target.dataset.id;
let detail = _this.data.reservationDataList.find(item => item.id == id)
//
let param = {
title: detail.title,
path: "/pages/meeting/invite/invite?id=" + id,
imageUrl: app.IMG_NAME + detail.roomContent.indoorPicUrlFirst,
}
console.log('onShareAppMessage', param);
return param;
}
})

View File

@ -0,0 +1,11 @@
{
"navigationBarTitleText": "报修记录",
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-divider": "@vant/weapp/divider/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-notify": "@vant/weapp/notify/index"
},
"onReachBottomDistance": 100
}

View File

@ -0,0 +1,70 @@
<view class="containerView public">
<van-tabs bind:click="tabClickSwitch" color="#4e96f8" border animated title-active-color="black" title-inactive-color="gray">
<van-tab title="全部">
<view class="itemView" wx:for="{{reservationDataList}}" wx:for-item="item" wx:key="*this">
<view class="headView">
<view class="number">{{item.title}}</view>
<view class="status" style="color: {{item.statusColor}};">{{item.statusName}}</view>
</view>
<view class="contentView" bind:tap="jumpMeetingDetail" data-id="{{item.id}}">
<image class="img" src="{{IMG_NAME + item.roomContent.indoorPicUrlFirst}}" mode="aspectFill"></image>
<view class="msgView">
<view class="title">{{item.roomContent.capacityNum}}人间 | {{item.roomContent.roomName}} | {{item.roomContent.buildingName}}</view>
<view class="name">预约人: {{item.createBy}}</view>
<view class="time">{{item.timeSlot}}</view>
</view>
</view>
<view class="priceView">
<view class="cancelContent" wx:if="{{item.statusValue == 4 && item.cancelResaon}}">取消原因: {{item.cancelResaon}}</view>
<!-- <view class="priceContent">
<view class="name">总价:</view>
<view class="price">¥{{item.orderMoney}}</view>
</view> -->
</view>
<view class="btnView">
<!-- <view class="btn" wx:if="{{item.showPay}}" bind:tap="jumpPay" data-id="{{item.id}}">去支付</view> -->
<view class="btn" wx:if="{{item.showInvite}}">去邀请
<button class="shareBtn" open-type="share" data-id="{{item.id}}">转发</button>
</view>
<view class="btn" wx:if="{{item.showCancel}}" bind:tap="cancelOrder" data-id="{{item.id}}">取消预约</view>
<view class="btn" wx:if="{{item.showDetail}}" bind:tap="jumpMeetingDetail" data-id="{{item.id}}">查看详情</view>
</view>
</view>
<view class="loadAllLine" wx:if="{{reservationIsDataAll}}">
<van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>
</view>
</van-tab>
<van-tab title="处理中">
<view class="itemView" wx:for="{{participateDataList}}" wx:for-item="item" wx:key="*this" bind:tap="jumpParticipateDetail" data-id="{{item.id}}">
<view class="headView">
<view class="number">{{item.title}}</view>
<view class="status" style="color: {{item.statusColor}};">{{item.statusName}}</view>
</view>
<view class="contentView">
<image class="img" src="{{IMG_NAME + item.roomContent.indoorPicUrlFirst}}" mode="aspectFill"></image>
<view class="msgView">
<view class="title">{{item.roomContent.capacityNum}}人间 | {{item.roomContent.roomName}} | {{item.roomContent.buildingName}}</view>
<view class="name">预约人: {{item.createBy}}</view>
<view class="time">{{item.timeSlot}}</view>
</view>
</view>
</view>
<view class="loadAllLine" wx:if="{{participateIsDataAll}}">
<van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>
</view>
</van-tab>
<van-tab title="待评价">
</van-tab>
<van-tab title="已评价">
</van-tab>
</van-tabs>
<!-- 提示框 -->
<van-dialog id="van-dialog" />
<!-- 提示框 -->
<van-notify id="van-notify" />
</view>

View File

@ -0,0 +1,136 @@
.containerView.public {
background: none;
height: auto;
}
.itemView {
background: white;
margin: 30rpx 20rpx;
padding: 30rpx 20rpx;
/* box-shadow: rgba(210,210,210,0.5) 0px 3.752px 3.752px 0px; */
}
.itemView .headView {
display: flex;
justify-content: space-between;
align-items: center;
}
.itemView .headView .number {
flex: 1;
margin-right: 30rpx;
font-size: 26rpx;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
white-space: nowrap;
}
.itemView .headView .status {
font-size: 26rpx;
color: #4e96f8;
margin-right: 20rpx;
}
.itemView .contentView {
box-sizing: border-box;
border-radius: 10rpx;
width: 100%;
margin-top: 20rpx;
padding: 30rpx 20rpx;
display: flex;
justify-content: flex-start;
align-items: center;
background: #f2f2f2;
}
.itemView .contentView .img {
border-radius: 10rpx;
width: 200rpx;
height: 110rpx;
}
.itemView .contentView .msgView {
flex: 1;
margin-left: 20rpx;
word-break: break-all;
}
.itemView .contentView .msgView .title {
font-size: 28rpx;
}
.itemView .contentView .msgView .name,
.itemView .contentView .msgView .time {
font-size: 24rpx;
color: gray;
margin-top: 6rpx;
}
.itemView .priceView {
display: flex;
justify-content: flex-end;
align-items: center;
margin: 30rpx 0;
}
.itemView .priceView .cancelContent {
flex: 1;
margin-right: 40rpx;
font-size: 26rpx;
color: #7F7F7F;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
white-space: nowrap;
}
.itemView .priceView .priceContent {
display: flex;
justify-content: flex-start;
align-items: center;
}
.itemView .priceView .priceContent .name {
font-size: 26rpx;
}
.itemView .priceView .priceContent .price {
font-size: 28rpx;
font-weight: bold;
color: red;
margin-left: 10rpx;
}
.itemView .btnView {
display: flex;
justify-content: flex-end;
align-items: center;
}
.itemView .btnView .btn {
border: 1px solid #4e96f8;
position: relative;
border-radius: 10rpx;
margin-left: 16rpx;
padding: 10rpx 24rpx;
font-size: 24rpx;
color: #4e96f8;
}
.shareBtn {
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
left: 0;
top: 0;
opacity: 0;
}
.loadAllLine {
margin-top: 80rpx;
}