Small micro-channel program when the jump page parameters cause parameter is missing for too long

Problem Description:

Small micro-channel program: mass participation Jump page parameter is too long resulting in the loss of parameters

Jump to the article details page, use the link to the article e.currentTarget.dataset.idis too long lead parameter is missing

  handleClickArticle: function (e) {
    wx.navigateTo({
      url: '/pages/index/articleinfo/articleinfo?urllink=' + e.currentTarget.dataset.id
    })
  },

solution:

The API call micro-channel, the coding parameters transmitted, decodes the received can.

Complete the following wording:

// 传参
  handleClickArticle: function (e) {
    wx.navigateTo({
      url: '/pages/index/articleinfo/articleinfo?urllink=' + encodeURIComponent(e.currentTarget.dataset.id)
    })
  },
// 接收
Page({
  onLoad: function (options) {
    var _this = this;
    _this.setData({
      urllink: decodeURIComponent(options.urllink)
    })
  }
})

This would solve the problem.

Guess you like

Origin www.cnblogs.com/mmzs/p/11635040.html