当前页面

// 进入“确认订单”页面
  goOrder: function(e){
    console.log(e);
    var quan = e.currentTarget.dataset;
    var pages = getCurrentPages();
    var prevPage = pages[pages.length - 2]; //上一个页面
    //直接调用上一个页面的setData()方法,把数据存到上一个页面中去
    console.log(this.data.index);
    prevPage.setData({
      coupon_id: quan.quanid,
      coupon_price: quan.quanprice,
      shopIndex: this.data.index
    })
    wx.navigateBack({//返回"确认订单"页面
      delta: 1
    })
  },

需要修改值的页面

onShow: function () {
    console.log(this.data.coupon_id, this.data.coupon_price);//这里打印下在其他页面修改的值,已被修改
  },

 

 

相关文章:

  • 2021-11-08
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
猜你喜欢
  • 2021-10-18
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案