riku
2022-08-26 9f78f3f014a3423ea3fcab8f9f1056c57cd47fc8
pages/promiseresult/promiseresult.js
@@ -1,66 +1,44 @@
// pages/promiseresult/promiseresult.js
const $f = require("../../service/baserequest")
Page({
  /**
   * 页面的初始数据
   */
  data: {
    promise: {
      picPath: [],
      pdfPath: '',
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    var that = this
    this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
      console.log(data);
      // data.promise.picPath = $f.basePicUrl + data.promise.picPath
      // data.promise.pdfPath = $f.basePicUrl + data.promise.pdfPath
      that.setData({
        promise: data.promise
      })
    })
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    var pages = getCurrentPages()
    var d = pages.length - 1
    wx.navigateBack({
      delta: d,
      success: (res) => {},
      fail: (res) => {},
      complete: (res) => {},
    })
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  }
})