intention.js 4.1 KB
// packageStoreAssistant/packageActivity/pages/intention/intention.js
// import intentionApi from '~/api/intentionApi/index'
Page({

  // /**
  //  * 页面的初始数据
  //  */
  // data: {
  //   tab: ['浏览次数', '访问时间'],
  //   tabIndex: 0,
  //   isBrowse: false,
  //   isBrowseTime: false,
  //   orderByType: '',
  //   scrollTop: 0,
  //   totalNum: 0,
  //   activityId: '',
  //   list: [],
  //   pageParam: {
  //     pageNum: 1,
  //     pageSize: 10,
  //   },
  // },

  // tabClick(e) {
  //   let {
  //     index
  //   } = e.currentTarget.dataset
  //   this.setData({
  //     tabIndex: index,
  //     scrollTop: 0,
  //     pageParam: {
  //       pageNum: 1,
  //       pageSize: 10
  //     }
  //   })
  //   this.orderBySource()

  // },
  // orderBySource() {
  //   let {
  //     tabIndex,
  //     orderByType,
  //     isBrowse,
  //     isBrowseTime
  //   } = this.data

  //   if (tabIndex == 0) {
  //     isBrowse = true
  //     isBrowseTime = false
  //     orderByType = this.whatorderByType(orderByType) && orderByType != 3 && orderByType != 4 ? this.whatorderByType(orderByType) : 1
  //   } else {
  //     isBrowse = false
  //     isBrowseTime = true
  //     orderByType = this.whatorderByType(orderByType) && orderByType != 1 && orderByType != 2 ? this.whatorderByType(orderByType) : 3
  //   }
  //   this.setData({
  //     orderByType,
  //     isBrowse,
  //     isBrowseTime
  //   })
  //   this.getList(tabIndex)
  // },
  // whatorderByType(value) {
  //   const order = {
  //     1: 2,
  //     2: 1,
  //     3: 4,
  //     4: 3
  //   }
  //   return order[value] ? order[value] : '';
  // },
  // getList(index, status) {
  //   return new Promise(resolve => {
  //     const {
  //       pageParam,
  //       orderByType,
  //       list,
  //       activityId
  //     } = this.data

  //     intentionApi.getNotPayUser({
  //       activityId,
  //       orderByType,
  //       ...pageParam
  //     }).then(res => {
  //       let intentionList = [];
  //       if (status == 2) {
  //         intentionList = list
  //       } else {
  //         intentionList = pageParam.pageNum > 1 ? [...list, ...res.list] : res.list
  //       }
  //       this.setData({
  //         list: intentionList,
  //         activeTrigger: false,
  //         totalNum: res.total
  //       })
  //       resolve(1)
  //     })
  //   })

  // },

  // // 保存用户跟进线索
  // saveMerchantUserFollowInfo(data) {
  //   intentionApi.saveMerchantUserFollowInfo({
  //     businessScene: 2,
  //     missionType: 6,
  //     activityId: this.data.activityId,
  //     openId: data.customerOpenId,
  //     unionId: data.customerIdentify,
  //     phone: data.mobile
  //   }).then(res => {})
  // },
  // toCopyName(e) {
  //   const {
  //     item
  //   } = e.currentTarget.dataset
  //   console.log(e)
  //   if (item.accountName) {
  //     wx.setClipboardData({
  //       data: item.accountName
  //     })
  //   }
  //     this.saveMerchantUserFollowInfo(item)
   
 

  // },

  // // 打电话
  // callPhone(e) {
  //   let {
  //     item
  //   } = e.currentTarget.dataset
  //   wx.makePhoneCall({
  //     phoneNumber: item.mobile.toString()
  //   })
  //   this.saveMerchantUserFollowInfo(item)
  // },
  // async onRoute(options) {
  //   this.data.activityId = options.activityId
  //   await this.getList(0, 1)

  // },

  // /**
  //  * 页面相关事件处理函数--监听用户下拉动作
  //  */
  // activityRefresh(e) {
  //   let {
  //     pageParam,
  //     tabIndex
  //   } = this.data
  //   pageParam.pageNum = 1
  //   this.setData({
  //       pageParam
  //     },
  //     () => {
  //       this.getList()
  //     }
  //   )
  // },

  // /**
  //  * 页面上拉触底事件的处理函数
  //  */
  // scrollonReachBottom: function () {
  //   let {
  //     pageParam,
  //     tabIndex,
  //     totalNum,
  //     list
  //   } = this.data
  //   console.log(list.length, totalNum)
  //   if (list.length == totalNum) return
  //   pageParam.pageNum++
  //   this.setData({
  //       pageParam
  //     },
  //     () => {
  //       this.getList()
  //     }
  //   )
  // }
})