let app = getApp(); import Notify from '@vant/weapp/notify/notify'; import { flowHandleRq } from "../../../../api/repair/repair.js" Page({ /** * 页面的初始数据 */ data: { IMG_NAME: app.IMG_NAME, id: null, content: '', }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { let _this = this; _this.setData({ ...options, }) }, // input输入内容监听 fieldInput(e) { console.log('fieldInput', e); let _this = this; let detail = _this.data; detail[e.currentTarget.dataset.name] = e.detail _this.setData({ ...detail }) }, // 提交 submit() { let _this = this // 参数校验 if (!_this.data.content) { // 危险通知 app.vantNotifyErrTop(Notify, '请输入描述信息!') return } let data = { "repair": { "id": _this.data.id }, "content": _this.data.content, "operate": "BACK" } flowHandleRq(data).then(res => { console.log('flowHandleRq', res); if (res.code == 0) { app.vantNotifySuccess(Notify, res.msg) app.selfBackPage(2) } else { app.vantNotifyErr(Notify, res.msg) } }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })