index.js 950 Bytes
const navStyle = "background-color: transparent;box-shadow:none;";
import commonApi from "~/api/api";
Page({
  data: {
    navStyle,
  },
  navbarReady(e) {
    let navBarHeight = e.detail.height
    this.setData({
      navBarHeight
    })
  },
  onShow() {
    this.selectComponent(`#materails`)?.onLoad && this.selectComponent(`#materails`).onLoad()
    this.closeRemind()
  },

  closeRemind() {
    let userInfo = wx.$util.getUserInfo()

    let params = {
      merchantId: userInfo?.shopMerchantId,
      staffUuid: userInfo?.uuid,
      scene: 1,
      taskId: 6,
    };
    commonApi.shutDownTaskApi(params);
  },
  // 处理滚动事件
  onPageScroll(e) {
    const {
      navBarHeight
    } = this.data
    this.setData({
      navStyle: e.scrollTop >= navBarHeight ? '' : navStyle,
      scrollTop: e.scrollTop
    })
  },
  onHide() {
    this.selectComponent(`#materails`)?.onHide && this.selectComponent(`#materails`).onHide()
  }
})