litian
2024-03-12 b7ed8541113f8fa116b19d13e34a70a929310077
pages/personalCenter/feedBack/index.js
@@ -8,12 +8,12 @@
   */
  data: {
    active: 0,
    activeName: "proposition",
    activeName: "bookOpinion",
    tabList: [
      {
        label: '图书建议',
        key: 0,
        value: 'proposition'
        value: 'bookOpinion'
      },
      {
        label: '意见反馈',
@@ -21,11 +21,7 @@
        value: "feedback"
      }
    ],
    list: [
      {
        name: "ceshi",
      }
    ],
    list: [],
    //分页
    page: 1,
    limit: 10,
@@ -36,7 +32,7 @@
    isBackTop: false,
    setScrollValue: 0,
    skeletonLoding: true,
    topicIdOrRefCode: 'bookOpinion'
  },
  /**
@@ -44,11 +40,7 @@
   */
  onLoad(options) {
    console.log(options);
    // if (this.data.activeName == "proposition") {
    //   this.getDataList("bookOpinion", false);
    // } else {
    //   this.getDataList("feedback", false);
    // }
    this.getDataList(false);
  },
  /**
@@ -79,22 +71,19 @@
      skeletonLoding: true,
      active: item.detail.value,
      activeName: info.value,
      topicIdOrRefCode: info.value,
      list: [],
      page: 1,
      bottomLoading: false,
      isMoreData: false,
    })
    if (info.value == "proposition") {
      that.getDataList("bookOpinion", false);
    } else {
      that.getDataList("feedback", false);
    }
    that.getDataList(false);
  },
  getDataList(code, isReachBottom) {
  getDataList(isReachBottom) {
    app.MG.ugc.getTopicMessageList({
      appRefCode: app.config.appRefCode,
      topicIdOrRefCode: code,
      topicIdOrRefCode: this.data.topicIdOrRefCode,
      start: this.data.page * this.data.limit - this.data.limit,
      size: this.data.limit,
      sort: {
@@ -105,12 +94,12 @@
      .then(res => {
        try {
          if (res.datas.length > 0) {
            // res.datas.forEach((item) => {
            //   item.title = JSON.parse(item.content).content;
            //   item.createDate = moment(item.createDate).format("YYYY-MM-DD");
            //   item.updateDate = moment(item.updateDate).format("YYYY-MM-DD");;
            //   item.feedBack = item.feedBack ? item.feedBack : "-";
            // });
            res.datas.forEach((item) => {
              item.content = JSON.parse(item.content);
              item.createDate = moment(item.createDate).format("YYYY-MM-DD");
              item.updateDate = moment(item.updateDate).format("YYYY-MM-DD");
              item.feedBack = item.feedBack ? item.feedBack : "-";
            });
            let dataList = res.datas;
            //触底加载新数据并保留老数据
            if (isReachBottom) {
@@ -123,7 +112,7 @@
              isMoreData: dataList.length > 0 ? false : true,
              skeletonLoding: false,
            })
            console.log(this.data.list, 333)
            console.log(this.data.list, 123)
          } else {
            this.setData({
              skeletonLoding: false,
@@ -151,11 +140,7 @@
    this.setData({
      triggered: false,
    })
    if (this.data.activeName == "proposition") {
      this.getDataList("bookOpinion", false);
    } else {
      this.getDataList("feedback", false);
    }
    this.getDataList(false);
    this._freshing = false
  },
@@ -182,11 +167,7 @@
      }, 100)
      return false;
    }
    if (this.data.activeName == "proposition") {
      this.getDataList("bookOpinion", bool);
    } else {
      this.getDataList("feedback", bool);
    }
    this.getDataList(bool);
  },
  // 监听滚动距离