css
litian
2024-09-25 b471803c1a9e4c1452a98a8b3631bde66641b910
pages/home/home.js
@@ -45,8 +45,12 @@
    this.setData({
      searchVal: "",
    });
    console.log(this.data.searchVal)
    this.loadHomePage();
    const token = wx.getStorageSync(app.config.tokenKey)
    if (token) {
      this.getShoppingCartList()
    }
    this.init();
  },
  onLoad() {
@@ -72,11 +76,7 @@
          this.init();
        }
      })
    } else {
      this.init();
      this.registe()
    }
  },
  onReachBottom() {},
  onPullDownRefresh() {
@@ -203,8 +203,8 @@
    }
    app.MG.store.getProductList(obj).then((res) => {
      res.datas.forEach((item) => {
        item.liveTime = item.liveTime ? moment(item.liveTime).format("MM-DD HH:mm:ss") : '';
        item.startTime = item.startTime ? moment(item.startTime).format("MM-DD HH:mm:ss") : '';
        item.liveTime = item.liveTime ? item.liveTime.substring(5) : '';
        item.startTime = item.startTime ? item.startTime.substring(5) : '';
        item.price = item.price ? item.price.toFixed(2) : item.price;
      });
      this.setData({
@@ -453,7 +453,6 @@
    //   duration: 1000
    // })
    const item = e.currentTarget.dataset.book
    console.log(item);
    // 网页类型跳转到网址复制页,因为url传参不能传 带参数的网络地址,所以此处要把网络地址里的传参摘出来,放到url里
    let urlData = ''
    const flags = item.jsek_link.indexOf("?")
@@ -464,11 +463,6 @@
    wx.navigateTo({
      url: urlData ? url + `?path=${item.jsek_link.slice(0,flags)}` + '&' + urlData : url + `?path=${item.jsek_link}`
    })
    // wx.navigateTo({
    //   url: '/pages/specialDiscussion/webView/index?link=' + item.jsek_link
    // });
  },
  goCourseDetail(e) {
@@ -539,7 +533,7 @@
          )
        ) {
          wx.showToast({
            title: "该书已在购物车,请勿重复添加空",
            title: "该商品已在购物车,请勿重复添加",
            icon: 'none',
            duration: 1000
          })