const app = getApp() const util = require("../../../utils/jmsUtil.js"); const api = require('../../../api/jms.js'); import moment from 'moment' Page({ data: { id:'', ticket:{}, ations:[], consults:[], consultslist:[], statusDesc: { 0: "创建", 1: "处理中", 2: "已完成", 3: "作废", }, substatusDesc: { 101: "待处理", 102: "升级", 103: "超时驳回", 104: "重新打开", 106: "等待客户上传图片", 107: "客户已上传图片", 108: "加盟商处理中", 109: "加盟商已处理", 201: "完成", 301: "作废", 0: "创建", }, typeTag: ["", "success", "warning", "danger"], levelMap: { 0: "无", 1: "一般", 2: "严重", 3: "非常严重", }, ccResultList:{ Y: "成立", N: "不成立", // O: "无法判定", }, ccResList:{ P: "服务人员", S: "商家运营", C: "客服", O: "其他" }, refundMethodDesc:{ 1: "银行卡", 2: "支付宝", 3: "微信", 4: "盒马二线手工退", 5: "盒马XP工单退" } }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { if(options.id){ this.setData({id:options.id}); // this.getTicketDetail(); } }, getTicketDetail(){ util.request(api.TicketDetail, { id:this.data.id }, 'GET').then(res=>{ if (res.errno == 0) { this.setData({ actions:res.data.acitons, consults:res.data.consults, consultslist:res.data.consultslist, ticket:res.data.ticket }); let actions=res.data.actions; let list=[]; actions.forEach(item=>{ let obj={ inactiveIcon: 'passed', activeIcon: 'passed', text:"["+item.statusDes+'] '+item.content, desc:item.createTime+' '+item.createUserName }; list.push(obj); }); this.setData({ actions:list }); }else{ wx.showToast({ title: res.errmsg, icon:'none' }) } }); }, /** * 生命周期函数--监听页面显示 */ onShow: function () { this.getTicketDetail(); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, preImg(e){ let url=e.currentTarget.dataset.url; wx.previewImage({ current: url, // 当前显示图片的http链接 urls: this.data.ticket.fileUrl // 需要预览的图片http链接列表 }) }, goRemark(){ wx.navigateTo({ url: '/pages/ticket/ticketRemark/ticketRemark?id='+this.data.id }); }, handleTicket(){ wx.navigateTo({ url: '/pages/ticket/ticketHandle/ticketHandle?id='+this.data.id }); }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, })