mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-22 05:29:37 +08:00

完成以下修改: 首页消息提醒,点击直接到维修界面 我要报修上传图片后图片不展示 我要报修->故障描述输入框点击没反应 维修员在报修查询里面看到别人的报修记录 报修人姓名和联系电话移至故障类型上面 报修记录查询里,加入搜索和切换(我的数据、全部数据) 维修入口查看数据后提示红点消失 退回工单提示的tip显示错位 报修详情页,维修中时加入维修员姓名和电话 消息提示文字 消息通知批量清除 维修入口点击上方统计圆圈也可以切换tab 分享时的标题为null
147 lines
3.3 KiB
JavaScript
147 lines
3.3 KiB
JavaScript
const app = getApp()
|
||
|
||
import Notify from '@vant/weapp/notify/notify';
|
||
|
||
Page({
|
||
|
||
/**
|
||
* 页面的初始数据
|
||
*/
|
||
data: {
|
||
IMG_NAME: app.IMG_NAME,
|
||
userDetail: {},
|
||
menuList: [{
|
||
type: "report",
|
||
name: "我要报修",
|
||
img: "/profile/static/repair/index/my.png",
|
||
path: "/pages/reportRepair/report/report",
|
||
visible: true
|
||
}, {
|
||
type: "query",
|
||
name: "报修查询",
|
||
img: "/profile/static/repair/index/query.png",
|
||
path: "/pages/reportRepair/query/record/record",
|
||
visible: true
|
||
}, {
|
||
type: "assign",
|
||
name: "派单入口",
|
||
img: "/profile/static/repair/index/case.png",
|
||
path: "/pages/reportRepair/assign/record/record",
|
||
visible: false
|
||
}, {
|
||
type: "repair",
|
||
name: "维修入口",
|
||
img: "/profile/static/repair/index/repair.png",
|
||
path: "/pages/reportRepair/repair/index/index",
|
||
visible: false
|
||
}]
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面加载
|
||
*/
|
||
onLoad(options) {
|
||
let _this = this
|
||
let userDetail = wx.getStorageSync('user')
|
||
_this.setData({
|
||
userDetail
|
||
})
|
||
// 展示模块
|
||
_this.visibleBlock()
|
||
},
|
||
|
||
// 跳转菜单
|
||
jumpMenu(e) {
|
||
console.log('jumpMenu', e);
|
||
let obj = e.currentTarget.dataset.obj
|
||
if (obj.visible) {
|
||
wx.navigateTo({
|
||
url: obj.path,
|
||
})
|
||
} else {
|
||
app.vantNotifyErrTop(Notify, `"${obj.name}"无权限访问!`)
|
||
return
|
||
}
|
||
},
|
||
|
||
// 展示模块
|
||
visibleBlock() {
|
||
let _this = this
|
||
let userDetail = _this.data.userDetail
|
||
let dataType = userDetail.dataType
|
||
let menuList = _this.data.menuList
|
||
// 角色类型 1.普通用户,3派单员,5维修工,7管理员 , 9楼层
|
||
if (dataType == 3 || dataType == 7) { // 展示-派单入口,仅有派单员、管理员能进
|
||
menuList = menuList.map(item => {
|
||
if (item.type == 'assign') {
|
||
item.visible = true
|
||
}
|
||
return item
|
||
})
|
||
}
|
||
if (dataType == 5) { // 展示-维修入口
|
||
menuList = menuList.map(item => {
|
||
if (item.type == 'repair') {
|
||
item.visible = true
|
||
}
|
||
return item
|
||
})
|
||
}
|
||
_this.setData({
|
||
menuList
|
||
})
|
||
},
|
||
|
||
back() {
|
||
wx.navigateBack()
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面初次渲染完成
|
||
*/
|
||
onReady() {
|
||
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面显示
|
||
*/
|
||
onShow() {
|
||
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面隐藏
|
||
*/
|
||
onHide() {
|
||
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面卸载
|
||
*/
|
||
onUnload() {
|
||
|
||
},
|
||
|
||
/**
|
||
* 页面相关事件处理函数--监听用户下拉动作
|
||
*/
|
||
onPullDownRefresh() {
|
||
|
||
},
|
||
|
||
/**
|
||
* 页面上拉触底事件的处理函数
|
||
*/
|
||
onReachBottom() {
|
||
|
||
},
|
||
|
||
/**
|
||
* 用户点击右上角分享
|
||
*/
|
||
onShareAppMessage() {
|
||
|
||
}
|
||
}) |