mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-22 04:19:36 +08:00
1
This commit is contained in:
parent
9e63e27468
commit
3331f1cbf8
@ -104,6 +104,14 @@ export function faultTypeListRq() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 评价
|
||||||
|
export function repairEvalRq(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/repair/eval`,
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 返回订单状态
|
// 返回订单状态
|
||||||
// 状态:1 待派单,3 重新派单,5 已派单,7 处理中, 9已完成 待评价, 11 已关闭 13 已评价
|
// 状态:1 待派单,3 重新派单,5 已派单,7 处理中, 9已完成 待评价, 11 已关闭 13 已评价
|
||||||
|
@ -332,4 +332,19 @@ App({
|
|||||||
vantNotifyErrTop(Notify, msg) {
|
vantNotifyErrTop(Notify, msg) {
|
||||||
this.vantNotify(Notify, msg, 'danger', 90)
|
this.vantNotify(Notify, msg, 'danger', 90)
|
||||||
},
|
},
|
||||||
|
// 自定义后退
|
||||||
|
selfBackPage(step) {
|
||||||
|
let currentPages = getCurrentPages();
|
||||||
|
// 大于就后退,否则直接跳转首页
|
||||||
|
if (currentPages.length > step) {
|
||||||
|
wx.navigateBack({
|
||||||
|
delta: step
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 跳转首页
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/pages/index/index',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
@ -175,9 +175,7 @@ Page({
|
|||||||
console.log('flowHandleRq', res);
|
console.log('flowHandleRq', res);
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
app.vantNotifySuccessTop(Notify, res.msg)
|
app.vantNotifySuccessTop(Notify, res.msg)
|
||||||
wx.navigateBack({
|
app.selfBackPage(2)
|
||||||
delta: 2
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
app.vantNotifyErrTop(Notify, res.msg)
|
app.vantNotifyErrTop(Notify, res.msg)
|
||||||
}
|
}
|
||||||
|
@ -197,9 +197,7 @@ Page({
|
|||||||
console.log('flowHandleRq', res);
|
console.log('flowHandleRq', res);
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
app.vantNotifySuccessTop(Notify, res.msg)
|
app.vantNotifySuccessTop(Notify, res.msg)
|
||||||
wx.navigateBack({
|
app.selfBackPage(2)
|
||||||
delta: 2
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
app.vantNotifyErrTop(Notify, res.msg)
|
app.vantNotifyErrTop(Notify, res.msg)
|
||||||
}
|
}
|
||||||
|
@ -38,17 +38,7 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
back() {
|
back() {
|
||||||
let currentPages = getCurrentPages();
|
app.selfBackPage(1)
|
||||||
console.log('currentPages', currentPages);
|
|
||||||
// 大于一个页面就后退,否则直接跳转首页
|
|
||||||
if (currentPages.length > 1) {
|
|
||||||
wx.navigateBack()
|
|
||||||
} else {
|
|
||||||
// 跳转首页
|
|
||||||
wx.reLaunch({
|
|
||||||
url: '/pages/index/index',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getDetail(id) {
|
getDetail(id) {
|
||||||
|
@ -1,66 +1,192 @@
|
|||||||
// pages/reportRepair/reportEvaluate/evaluate.js
|
const app = getApp()
|
||||||
|
|
||||||
|
import Notify from '@vant/weapp/notify/notify';
|
||||||
|
|
||||||
|
import {
|
||||||
|
repairAttachUpload,
|
||||||
|
} from "../../../../utils/util.js"
|
||||||
|
|
||||||
|
import {
|
||||||
|
repairEvalRq,
|
||||||
|
} from "../../../../api/repair/repair.js"
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
|
IMG_NAME: app.IMG_NAME,
|
||||||
|
id: null,
|
||||||
|
form: {
|
||||||
|
"evalService": 0,
|
||||||
|
"feedback": ""
|
||||||
|
},
|
||||||
|
fileList: []
|
||||||
|
},
|
||||||
|
|
||||||
},
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let _this = this
|
||||||
|
_this.setData({
|
||||||
|
...options
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
// 选择评价
|
||||||
* 生命周期函数--监听页面加载
|
selectStar(e) {
|
||||||
*/
|
console.log('selectStar', e);
|
||||||
onLoad(options) {
|
let _this = this
|
||||||
|
let form = _this.data.form
|
||||||
|
form.evalService = e.currentTarget.dataset.index + 1
|
||||||
|
_this.setData({
|
||||||
|
form
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
},
|
// input输入内容监听
|
||||||
|
fieldInput(e) {
|
||||||
|
console.log('fieldInput', e);
|
||||||
|
let _this = this;
|
||||||
|
let form = _this.data.form;
|
||||||
|
form[e.currentTarget.dataset.name] = e.detail
|
||||||
|
_this.setData({
|
||||||
|
form
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
// 图片-上传前校验
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
beforeRead(event) {
|
||||||
*/
|
// const {
|
||||||
onReady() {
|
// file,
|
||||||
|
// callback
|
||||||
|
// } = event.detail;
|
||||||
|
// callback(file.type === 'image');
|
||||||
|
},
|
||||||
|
|
||||||
},
|
// 文件-上传后
|
||||||
|
async fileAfterRead(event) {
|
||||||
|
let _this = this;
|
||||||
|
console.log('fileAfterRead', event);
|
||||||
|
// 上传完成需要更新 fileList
|
||||||
|
let fileList = _this.data.fileList;
|
||||||
|
//
|
||||||
|
const {
|
||||||
|
file
|
||||||
|
} = event.detail;
|
||||||
|
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
||||||
|
for (let i = 0; i < file.length; i++) {
|
||||||
|
let url = file[i].url;
|
||||||
|
await repairAttachUpload({
|
||||||
|
url,
|
||||||
|
repairId: _this.data.id,
|
||||||
|
operate: 'eval'
|
||||||
|
}).then(res => {
|
||||||
|
console.log('upload file ', res);
|
||||||
|
fileList.push({
|
||||||
|
id: res.id,
|
||||||
|
relativeUrl: res.url,
|
||||||
|
url: app.IMG_NAME + res.url,
|
||||||
|
deletable: true,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
_this.setData({
|
||||||
|
fileList
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
// 删除图片
|
||||||
* 生命周期函数--监听页面显示
|
deleteImg(event) {
|
||||||
*/
|
console.log('deleteImg', event);
|
||||||
onShow() {
|
let _this = this;
|
||||||
|
let fileList = _this.data.fileList;
|
||||||
|
fileList.splice(event.detail.index, 1);
|
||||||
|
_this.setData({
|
||||||
|
fileList
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
},
|
// 提交数据
|
||||||
|
submitData() {
|
||||||
|
let _this = this;
|
||||||
|
// 数据
|
||||||
|
let form = _this.data.form;
|
||||||
|
//
|
||||||
|
// 校验数据
|
||||||
|
//
|
||||||
|
// 报修名称
|
||||||
|
if (!form.evalService) {
|
||||||
|
app.vantNotifyErr(Notify, '请选择服务评价!')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 评价
|
||||||
|
repairEvalRq({
|
||||||
|
repair: {
|
||||||
|
"id": _this.data.id,
|
||||||
|
..._this.data.form
|
||||||
|
},
|
||||||
|
}).then(res => {
|
||||||
|
console.log('repairEvalRq', res);
|
||||||
|
//
|
||||||
|
if (res.code == 0) {
|
||||||
|
app.vantNotifySuccess(Notify, res.msg)
|
||||||
|
app.selfBackPage(2)
|
||||||
|
} else {
|
||||||
|
app.vantNotifyErr(Notify, res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面隐藏
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
onHide() {
|
onReady() {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面卸载
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onUnload() {
|
onShow() {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 生命周期函数--监听页面隐藏
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh() {
|
onHide() {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面上拉触底事件的处理函数
|
* 生命周期函数--监听页面卸载
|
||||||
*/
|
*/
|
||||||
onReachBottom() {
|
onUnload() {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户点击右上角分享
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onShareAppMessage() {
|
onPullDownRefresh() {
|
||||||
|
|
||||||
}
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
@ -3,6 +3,7 @@
|
|||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"van-icon": "@vant/weapp/icon/index",
|
"van-icon": "@vant/weapp/icon/index",
|
||||||
"van-field": "@vant/weapp/field/index",
|
"van-field": "@vant/weapp/field/index",
|
||||||
"van-uploader": "@vant/weapp/uploader/index"
|
"van-uploader": "@vant/weapp/uploader/index",
|
||||||
|
"van-notify": "@vant/weapp/notify/index"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,21 +2,25 @@
|
|||||||
|
|
||||||
<view class="regionView">
|
<view class="regionView">
|
||||||
<view class="topTitle">服务评价</view>
|
<view class="topTitle">服务评价</view>
|
||||||
<view class="itemView" wx:for="{{3}}">
|
<view class="itemView">
|
||||||
<view class="label">维修速度</view>
|
<view class="label">评价</view>
|
||||||
<van-icon class="star" wx:for="{{5}}" wx:for-item="index" wx:key="*this" name="{{index < 3 ? 'star' : 'star-o'}}" color="{{index < 3 ? '#f9d24e' : '#c9c9c9'}}" size="50rpx" />
|
<van-icon class="star" wx:for="{{5}}" wx:for-item="index" wx:key="*this" name="{{index < form.evalService ? 'star' : 'star-o'}}" color="{{index < form.evalService ? '#f9d24e' : '#c9c9c9'}}" size="50rpx" data-index="{{index}}" bind:tap="selectStar" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="regionView">
|
<view class="regionView">
|
||||||
<view class="topTitle">留言反馈</view>
|
<view class="topTitle">留言反馈</view>
|
||||||
<van-field model:value="{{ value }}" type="textarea" placeholder="请输入用户名" maxlength="{{100}}" show-word-limit border="{{false}}" autosize input-class="selfTextarea" />
|
<van-field model:value="{{ form.feedback }}" bind:input="fieldInput" data-name="feedback" clearable type="textarea" placeholder="请输入" maxlength="{{100}}" show-word-limit border="{{false}}" autosize input-class="selfTextarea" />
|
||||||
<!-- 上传图片 -->
|
<!-- 上传图片 -->
|
||||||
<view class="uploadImgView">
|
<view class="uploadImgView">
|
||||||
<van-uploader file-list="{{ fileList }}" upload-text="点击上传照片" use-before-read bind:before-read="beforeRead" bind:after-read="afterRead" deletable="{{ true }}" bind:delete="deleteImg" max-count="1" />
|
<van-uploader file-list="{{ fileList }}" upload-text="点击上传" bind:after-read="fileAfterRead" deletable="{{ true }}" bind:delete="deleteImg" max-count="6" accept="media" multiple />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="submitBtn">提交</view>
|
<view class="submitBtn" bind:tap="submitData">提交</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 消息通知 -->
|
||||||
|
<van-notify id="van-notify" />
|
@ -53,9 +53,7 @@ Page({
|
|||||||
console.log('flowHandleRq', res);
|
console.log('flowHandleRq', res);
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
app.vantNotifySuccess(Notify, res.msg)
|
app.vantNotifySuccess(Notify, res.msg)
|
||||||
wx.navigateBack({
|
app.selfBackPage(2)
|
||||||
delta: 2
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
app.vantNotifyErr(Notify, res.msg)
|
app.vantNotifyErr(Notify, res.msg)
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,7 @@ Page({
|
|||||||
console.log('flowHandleRq', res);
|
console.log('flowHandleRq', res);
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
app.vantNotifySuccess(Notify, res.msg)
|
app.vantNotifySuccess(Notify, res.msg)
|
||||||
wx.navigateBack({
|
app.selfBackPage(2)
|
||||||
delta: 2
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
app.vantNotifyErr(Notify, res.msg)
|
app.vantNotifyErr(Notify, res.msg)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user