jiangping
2024-07-29 d9a89d83c2048a964f16ca179feb2b7f21b9d33a
wechat_staff/pages/promotion/index.js
@@ -1,4 +1,4 @@
import { newsPage } from '../../api/index'
import { newsPage,saveShareRecord } from '../../api/index'
import moment from "moment";
Page({
@@ -23,6 +23,10 @@
      page:this.data.page,
      model:{type:0}})
      .then(res =>{
        wx.stopPullDownRefresh()
        if(this.data.page ==1){
          this.setData({list:[]})
        }
        if(this.data.page == res.data.page){ 
          res.data.records.forEach(element => { 
            element.createDate = moment(element.createDate).format("yyyy/MM/DD")  
@@ -58,6 +62,7 @@
  },
  downfile(e){
    const item =  e.currentTarget.dataset.index;
    saveShareRecord(item.id)
    const files = []
    if(item.fileType ==1 && item.fileList && item.fileList.length && item.fileList[0].fileurlFull  ){
      files.push(item.fileList[0].fileurlFull)
@@ -107,7 +112,7 @@
                          }
                        })
                      }
                  })
                    })
                } 
              }, fail(err) { 
                wx.showToast({
@@ -181,7 +186,9 @@
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
    console.log('下拉刷新')
    this.setData({ page: 1 })
    this.getList()
  },
 
  /**