mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 21:19:37 +08:00
1
This commit is contained in:
parent
f5b21e6bba
commit
938741f5c8
@ -17,12 +17,20 @@ Page({
|
||||
data: {
|
||||
IMG_NAME: app.IMG_NAME,
|
||||
title: '详情',
|
||||
userDetail: {},
|
||||
id: '',
|
||||
detail: {},
|
||||
files: {},
|
||||
currentLog: {},
|
||||
innerAudioContext: null, // 音频对象
|
||||
innerAudioContextIsPlay: false, // 音频对象-是否播放
|
||||
operatorBtn: {
|
||||
invalid: false, //无效申请
|
||||
affirm: false, // 确认损坏
|
||||
feedback: false, // 提交反馈
|
||||
again: false, // 重新派单
|
||||
evaluate: false, // 评价
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -31,8 +39,11 @@ Page({
|
||||
onLoad(options) {
|
||||
console.log('onLoad', options);
|
||||
let _this = this
|
||||
let userDetail = wx.getStorageSync('user')
|
||||
|
||||
_this.setData({
|
||||
...options
|
||||
...options,
|
||||
userDetail
|
||||
})
|
||||
_this.getDetail(options.id)
|
||||
},
|
||||
@ -85,11 +96,52 @@ Page({
|
||||
} else {
|
||||
detail.visibleImg = app.IMG_NAME + '/profile/static/repair/index/noneImg.png'
|
||||
}
|
||||
|
||||
//
|
||||
_this.setData({
|
||||
detail,
|
||||
files
|
||||
})
|
||||
// 初始化按钮
|
||||
_this.initOperatorBtn()
|
||||
})
|
||||
},
|
||||
|
||||
// 初始化按钮
|
||||
initOperatorBtn() {
|
||||
console.log('initOperatorBtn', 111);
|
||||
let _this = this
|
||||
let userDetail = _this.data.userDetail
|
||||
let detail = _this.data.detail
|
||||
let operatorBtn = _this.data.operatorBtn
|
||||
// 登录用户id
|
||||
let loginUserId = userDetail.id
|
||||
// 订单状态
|
||||
let status = detail.status
|
||||
// 角色类型
|
||||
let dataType = userDetail.dataType
|
||||
//
|
||||
// 角色类型 1.普通用户,3派单员,5维修工,7管理员
|
||||
// 订单状态 1 待派单,3 重新派单,5 已派单,7 处理中, 9已完成 待评价, 11 已关闭 13 已评价
|
||||
//
|
||||
if (status == 1) { // 1 待派单
|
||||
if ((dataType == 3) || dataType == 7) { // 派单员 or 管理员
|
||||
operatorBtn.invalid = true //无效申请
|
||||
operatorBtn.affirm = true // 确认损坏
|
||||
operatorBtn.feedback = true // 提交反馈
|
||||
}
|
||||
}
|
||||
if (status == 3) { // 3 重新派单
|
||||
if (dataType == 7) { // 管理员
|
||||
operatorBtn.again = true //重新派单
|
||||
}
|
||||
}
|
||||
if (status == 9) { // 9已完成 待评价
|
||||
if (loginUserId == detail.createBy) { // 创建报修单的人才能评价
|
||||
operatorBtn.evaluate = true //评价
|
||||
}
|
||||
}
|
||||
_this.setData({
|
||||
operatorBtn
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -156,14 +156,14 @@
|
||||
</view>
|
||||
|
||||
<view class="bottomFixView">
|
||||
<view class="btn red" bind:tap="jumpInvalid">无效申请</view>
|
||||
<view class="btn" bind:tap="jumpAffirm">确认损坏</view>
|
||||
<view class="btn" bind:tap="jumpFeedback">提交反馈</view>
|
||||
<view class="btn" bind:tap="jumpAgain">重新派单</view>
|
||||
<view class="btn red" bind:tap="jumpInvalid" wx:if="{{operatorBtn.invalid}}">无效申请</view>
|
||||
<view class="btn" bind:tap="jumpAffirm" wx:if="{{operatorBtn.affirm}}">确认损坏</view>
|
||||
<view class="btn" bind:tap="jumpFeedback" wx:if="{{operatorBtn.feedback}}">提交反馈</view>
|
||||
<view class="btn" bind:tap="jumpAgain" wx:if="{{operatorBtn.again}}">重新派单</view>
|
||||
<view class="btn">分享
|
||||
<button catch class="shareBtn" open-type="share" data-obj="{{item}}">转发</button>
|
||||
</view>
|
||||
<view class="btn red" bind:tap="jumpEvaluate">评价</view>
|
||||
<view class="btn red" bind:tap="jumpEvaluate" wx:if="{{operatorBtn.evaluate}}">评价</view>
|
||||
</view>
|
||||
|
||||
</view>
|
Loading…
x
Reference in New Issue
Block a user