table.js 3.95 KB
// pages/components/table/table.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    unreadClueCount: 0,
    tableWidth: 1088,
    tableFlag: true,
    table: [
      {
        id: null,
        merchantId: 44218100,
        merchantName: '测试门店22',
        dataDate: null,
        getTotal: 0,
        usedTotal: 0,
        upgradeTotal: 0,
        upgradeMoneyTotal: null,
        createdBy: null,
        createdDate: null,
        updatedBy: null,
        updatedDate: null,
        deletedFlag: null,
        startDate: null,
        endDate: null,
        yqMerchantIds: null,
        orderByType: null,
        addTotal: 0,
        orderMoneyTotal: 0,
        merchantIdList: null,
        usedPer: null,
        upgradePer: null,
        totalUsedPer: null,
        totalUpgradePer: null,
        customerUnitMoney: 0,
        upgradeRate: 0,
        experienceTotal: 0,
        filmTimes: 0,
        notUpgradeTotal: null,
        filmTimesGrowth: null,
        usedTotalGrowth: null,
        upgradeTotalGrowth: null,
        notUpgradeTotalGrowth: null,
        orderMoneyTotalGrowth: null,
        customerUnitMoneyGrowth: null,
        experienceTotalGrowth: null,
        upgradeRateGrowth: null,
        goodsOrCouponType: null,
        queryRangeType: null
      },
      {
        id: null,
        merchantId: 44218100,
        merchantName: '测试门店22',
        dataDate: null,
        getTotal: 0,
        usedTotal: 0,
        upgradeTotal: 0,
        upgradeMoneyTotal: null,
        createdBy: null,
        createdDate: null,
        updatedBy: null,
        updatedDate: null,
        deletedFlag: null,
        startDate: null,
        endDate: null,
        yqMerchantIds: null,
        orderByType: null,
        addTotal: 0,
        orderMoneyTotal: 0,
        merchantIdList: null,
        usedPer: null,
        upgradePer: null,
        totalUsedPer: null,
        totalUpgradePer: null,
        customerUnitMoney: 0,
        upgradeRate: 0,
        experienceTotal: 0,
        filmTimes: 0,
        notUpgradeTotal: null,
        filmTimesGrowth: null,
        usedTotalGrowth: null,
        upgradeTotalGrowth: null,
        notUpgradeTotalGrowth: null,
        orderMoneyTotalGrowth: null,
        customerUnitMoneyGrowth: null,
        experienceTotalGrowth: null,
        upgradeRateGrowth: null,
        goodsOrCouponType: null,
        queryRangeType: null
      }
    ],
    tableObj: [
      {
        name: '贴膜',
        unit: '/台',
        key: 'filmTimes',
        width: 'var(--fontSize110)'
      },
      {
        name: '核销',
        unit: '/张',
        key: 'usedTotal',
        width: 'var(--fontSize110)'
      },
      {
        name: '体验',
        unit: '/位',
        key: 'experienceTotal',
        width: 'var(--fontSize110)'
      },
      {
        name: '转化',
        unit: '/单',
        key: 'upgradeTotal',
        width: 'var(--fontSize110)'
      },
      {
        name: '营业额',
        unit: '',
        key: 'orderMoneyTotal',
        sort: false,
        width: '118rpx'
      },
      { name: '客单价', unit: '', key: 'customerUnitMoney', width: '118rpx' },
      {
        name: '转化率',
        unit: '',
        key: 'upgradeRate',
        width: 'var(--fontSize110)'
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    scrollonReachBottom() {
      console.log('scrollonReachBottom')
      let { pages, pageNum } = this.data
      // 判断当前页是否是末页
      if (pages == pageNum) return wx.$util.showToast('列表已到底')

      this.setData({
        pageNum: pageNum + 1
      })
      this.getMerchantCouponList()
    },
    restPageNum() {
      this.setData({
        pageNum: 1
      })
      this.getMerchantCouponList()
    },
  }
})