litian
2024-09-02 c3086cda662e2b908cf96b6b3ff599713eb924d6
pages/personalCenter/index.js
@@ -1,4 +1,5 @@
const app = getApp();
import moment from 'moment'
import {
  loginInfo
} from '../../assets/js/login';
@@ -17,7 +18,7 @@
  {
    title: '我的证书',
    icon: '/static/images/personal/certificate.png',
    url: '',
    url: '/pages/personalCenter/certificate/index',
    type: 'certificate',
  },
  {
@@ -41,13 +42,13 @@
  {
    title: '我的上传',
    icon: '/static/images/personal/upload.png',
    url: '',
    url: '/pages/personalCenter/myUpload/index',
    type: 'upload',
  },
  {
    title: '出书申请',
    icon: '/static/images/personal/chushu.png',
    url: '',
    url: '/packagePersonal/pages/publishBooks/index',
    type: 'publishBooks',
  }
];
@@ -102,6 +103,7 @@
  data: {
    barHeight: '',
    navBarHeight: '',
    scoll: false,
    isWhite: false,
    userInfo: {},
    currAuthStep: 1,
@@ -120,7 +122,7 @@
      value: false
    },
    loadingProps: {
      size: '50rpx',
      size: '10rpx',
    },
    scrollTop: 0,
  },
@@ -152,6 +154,7 @@
            currAuthStep: 2,
          });
          this.getUserInfo()
          this.getIntegral()
        }
      })
    } else {
@@ -159,6 +162,7 @@
        currAuthStep: 3,
      });
      this.getUserInfo()
      this.getIntegral()
    }
  },
  /**
@@ -169,6 +173,8 @@
      'baseRefresh.value': true,
    })
    this.getUserInfo()
    this.getIntegral()
    wx.stopPullDownRefresh()
  },
  /**
   * 页面上拉触底事件的处理函数
@@ -329,6 +335,25 @@
    });
  },
  getIntegral() {
    app.MG.store
      .getUserWallet({
        type: 'integral'
      })
      .then((res) => {
        this.setData({
          integral: res.balance,
        });
      })
  },
  getIntegralList() {
    wx.navigateTo({
      url: `/pages/personalCenter/pointsRecord/index`,
    });
  },
  //点击目录
  toPages(item) {
    let info = item.currentTarget.dataset.info
@@ -346,15 +371,23 @@
  },
  onScroll(e) {
    if (this.data.scoll) {
      if (e.detail.scrollTop < 20) {
        this.data.scoll = false
        this.isChange(false);
      }
    } else {
      if (e.detail.scrollTop > 20) {
        this.data.scoll = true
        this.isChange(true);
      }
    }
  },
  isChange(data) {
    this.setData({
      isWhite: e.detail.scrollTop > 10 ? true : false
      isWhite: data
    })
    const {
      scrollTop
    } = e.detail;
    this.setData({
      scrollTop
    });
  },