caseAudioList.js 1.68 KB
// packageIndex/pages/caseAudioList/caseAudioList.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
import api from '~/api/index/index'
Page({

  /**
   * 页面的初始数据
   */
  data: {
		IMG_URL,
		navBarHeight: 84,
		list: [],
		detailInfo: {}
  },

	navbarReady(e) {
    let navBarHeight = e.detail.height
    this.setData({
      navBarHeight
    })
	},

	back() {
		wx.navigateBack()
	},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
		this.setData({
			optionsId: options?.id
		}, () => {
			this.getData()
		})
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
	},
	
	handlePresent() {
		wx.switchTab({url: '/pages/tab/crew/crew'})
	},

	getData() {
		let {optionsId} = this.data
		api.getSubmitCaseAudioList({id: optionsId}).then(res => {
			let { code, data, message } = res
			if (code == 0) {
				data?.list?.forEach(val => {
					val.carBrand = val.oneCarBrand,
					val.receptionResult = val.receptionStatus == 1 ? '成交' : val.receptionStatus == 0 ? '战败' : ''
				})
				this.setData({
					list: data?.list || []
				})
			} else {
				wx.$util.showToast(message)
			}
		})
	},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})