生产企业做网站的费用怎么做账/百度指数什么意思
微信小程序带参数跳转页面,参数文章内容太长或包含特殊字符,解决方案
报错的内容:
因为参数内容太长或者参数中有特殊字符,所以就被截断了,这时就要用到encodeURIComponent
转换数据类型encodeURIComponent:
//每日一文点击事件跳转
getdaquan:function(e){
wx.showLoading({
title: '数据加载中...',
mask:"true"
})
var daquanid=e.currentTarget.dataset.daquanid;
console.log(JSON.stringify(daquanid))
//meiriyiwen
wx.navigateTo({
url: '../meiriyiwen/meiriyiwen?daquanid='+encodeURIComponent(JSON.stringify(daquanid)),
})
wx.hideLoading()
},
然后在接收页面用decodeURIComponent转换回来:
onLoad: function (options) {
this.setData({
id: JSON.parse(decodeURIComponent(options.daquanid))
})
},