import { queryGZCJJCOrderDetail } from "../../../../services/api/trade/index" import { getEnumdicValue, userid } from "../../../../services/utils" import { hideLoading, showLoading } from "../../../../utils/message/index" import { isnullstr } from "../../../../utils/util" Page({ /** * 页面的初始数据 */ data: { /// 底部安全区域 safeBottom: getApp().globalData.safeBottom, /// 列头 titles: [['货物编号', '形状 | 重量(ct)| 参考货值(USD)'], ['刻印服务 | 是否披露 | 服务类别 | 原证书号'], ['彩钻信息 | 其他']], /// 单据信息 order: {}, /// 数据信息 orders: [], /// 显示的值 values: <{}[]>[], }, /** * 返回上层视图 */ backToParent() { /// 返回上层视图 wx.navigateBack() }, /** * 查询出境检测单据明细 */ queryGZCJJCOrderDetail() { /// loding..... showLoading(()=>{ /// 发送查询 queryGZCJJCOrderDetail({ data: { /// 模糊搜索 userid: userid(), orderid: this.data.order.orderidstr }, /// 加载成功 success: (res) => { if (res.code != 200) { /// 加载失败 hideLoading(()=>{}, '请求失败,原因:'+res.msg) return } hideLoading(()=>{ /// 数据赋值 this.setData({ orders: res.data, isEmpty: res.data.length === 0, /// 显示的值 values: res.data.map(obj => { return { up: [obj.gzno, getEnumdicValue('GZCJShapeType', obj.gzcjshapetype)+' | '+obj.weight.toString()+' | '+obj.amount.toFixed(2)], mid: [getEnumdicValue('GZCJMarkType', obj.gzcjmarktype)+' | '+getEnumdicValue('GZCJPublishType', obj.gzcjpublishtype)+' | '+getEnumdicValue('GZCJServiceType', obj.gzcjservicetype)+' | '+isnullstr(obj.origincertno)], dwn: [isnullstr(obj.colorinfo)+' | '+ isnullstr(obj.remark)]} }) }) }) }, fail: (emsg) => { /// 加载失败 hideLoading(()=>{}, emsg) }, complete: () => { /// 停止下拉刷新 wx.stopPullDownRefresh() } }) }) }, /** * 生命周期函数--监听页面加载 */ onLoad(options: any) { /// 传参信息 const item: GuangZuan.GZCJJCOrder = JSON.parse(options.item ?? '') /// 单据信息 if (item) { this.setData({ order: item }) } /// 获取明细数据信息 this.queryGZCJJCOrderDetail() }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { /// 获取明细数据信息 this.queryGZCJJCOrderDetail() }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })