小程序
小游戏
企业微信
微信支付
扫描小程序码分享
云开发的微信小程序订阅消息,page不带参数的时候,详情页可以正常跳转,带参数之后page:"/pages/network/neiwang/neiwangapply?applyer="+event.applyer,能正常跳转到neiwangapply这个页面,但是获取不到apply这个参数的值,获取的方法是在neiwangapply这个页面的onload采用options.applyer,一直获取不到,求帮助
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
这个问题解决了吗
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
// miniprogram/pages/network/ipapply/ipapply.js var time = require('../../../common'); Page({ /** * 页面的初始数据 */ data: { index:0, index1:0, array:['请选择楼层','1-6楼','7楼','8楼','9楼','10楼','11-14楼','15-19楼','裙楼'], array1:['请选择类型','内网','外网'], objectArray: [ { id: -1, name: '请选择楼层' }, { id: 0, name: '1-6楼' }, { id: 1, name: '7楼' }, { id: 2, name: '8楼' }, { id: 3, name: '9楼' } , { id: 4, name: '10楼' } , { id: 5, name: '11-14楼' } , { id: 6, name: '15-19楼' } , { id: 7, name: '裙楼' } ], objectArray1: [ { id:-1, name:'请选择类型' } , { id:0, name:'内网' } , { id:1, name:'外网' } ], applydate:new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate(), applyer:'', dept:'', level:'', memo:'是否为路由器地址或其他', page:'' }, indexchange:function(e){ this.setData({ index:e.detail.value, level:this.data.array[this.data.index] }) }, indexchange1:function(e){ this.setData({ index1:e.detail.value, level:this.data.array1[this.data.index1] }) }, applyerinput:function(e){ this.setData({ applyer:e.detail.value }) }, memoinput:function(e){ this.setData({ memo:e.detail.value }) }, datechange:function(e){ this.setData({ applydate:e.detail.value }) }, submit:function(e){ if(this.data.index==0||this.data.index1==0||this.data.applyer==''){ wx.showModal({ title:'提示', content:'请输入完整申请信息' }) } else{ var that=this console.log(new Date(that.data.applydate)) console.log(that.data.array[that.data.index]) if(that.data.index1==1){ that.setData({ // page:'/pages/network/neiwang/neiwangapply?index='+that.data.index1+'&dept='+that.data.dept+'&applyer='+that.data.applyer+'&memo='+that.data.memo page:'/pages/network/neiwang/neiwangapply?applyer='+that.data.applyer }) } else{ that.setData({ page:'/pages/network/waiwang/waiwangapply?applyer='+that.data.applyer }) } wx.cloud.callFunction({ name:'ipapplyeradd', data:{ apply_type:that.data.array1[that.data.index1], apply_level:that.data.array[that.data.index], applyer:that.data.applyer, apply_reason:that.data.memo, apply_date:that.data.applydate, }, success:function(res){ wx.showModal({ title:'提示', content:'申请成功,待审批', success:function(suc){ if(suc.confirm){ wx.requestSubscribeMessage({ tmplIds: ['5J3WjQR4u5p9ngOmwcaIQBujnTidOode1C_JhGL3OAY','rwCuVp2NAyncSnevjnTuDLaevjM0Cioq8sz_PSUhiFg'], success:function(eee){ wx.cloud.callFunction({ name:'ipapplynote',//下发函数 data:{ thing4:that.data.array1[that.data.index1]+'申请', thing7:that.data.array[that.data.index], thing8:that.data.applyer, thing9:that.data.memo, time10:time.formatTime(new Date()), page:that.data.page, applyer:that.data.applyer }, success:function(rrr){ console.log(rrr) }, fail:function(error){ console.log(error) } }) }, fail:function(err){ console.log(err) } }) } } }) } }) } },
event.applye 你这个有值吗
// miniprogram/pages/network/ipapply/ipapply.js
var time = require('../../../common');
Page({
/**
* 页面的初始数据
*/
data: {
index:0,
index1:0,
array:['请选择楼层','1-6楼','7楼','8楼','9楼','10楼','11-14楼','15-19楼','裙楼'],
array1:['请选择类型','内网','外网'],
objectArray: [
{
id: -1,
name: '请选择楼层'
},
id: 0,
name: '1-6楼'
id: 1,
name: '7楼'
id: 2,
name: '8楼'
id: 3,
name: '9楼'
submit:function(e){
if(this.data.index==0||this.data.index1==0||this.data.applyer==''){
wx.showModal({
title:'提示',
content:'请输入完整申请信息'
})
}
else{
var that=this
console.log(new Date(that.data.applydate))
console.log(that.data.array[that.data.index])
if(that.data.index1==1){
that.setData({
// page:'/pages/network/neiwang/neiwangapply?index='+that.data.index1+'&dept='+that.data.dept+'&applyer='+that.data.applyer+'&memo='+that.data.memo
page:'/pages/network/neiwang/neiwangapply?applyer='+that.data.applyer
page:'/pages/network/waiwang/waiwangapply?applyer='+that.data.applyer
wx.cloud.callFunction({
name:'ipapplyeradd',
data:{
apply_type:that.data.array1[that.data.index1],
apply_level:that.data.array[that.data.index],
applyer:that.data.applyer,
apply_reason:that.data.memo,
apply_date:that.data.applydate,
success:function(res){
content:'申请成功,待审批',
success:function(suc){
if(suc.confirm){
wx.requestSubscribeMessage({
tmplIds: ['5J3WjQR4u5p9ngOmwcaIQBujnTidOode1C_JhGL3OAY','rwCuVp2NAyncSnevjnTuDLaevjM0Cioq8sz_PSUhiFg'],
success:function(eee){
name:'ipapplynote',//下发函数
thing4:that.data.array1[that.data.index1]+'申请',
thing7:that.data.array[that.data.index],
thing8:that.data.applyer,
thing9:that.data.memo,
time10:time.formatTime(new Date()),
page:that.data.page,
applyer:that.data.applyer
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
这个问题解决了吗
// miniprogram/pages/network/ipapply/ipapply.js var time = require('../../../common'); Page({ /** * 页面的初始数据 */ data: { index:0, index1:0, array:['请选择楼层','1-6楼','7楼','8楼','9楼','10楼','11-14楼','15-19楼','裙楼'], array1:['请选择类型','内网','外网'], objectArray: [ { id: -1, name: '请选择楼层' }, { id: 0, name: '1-6楼' }, { id: 1, name: '7楼' }, { id: 2, name: '8楼' }, { id: 3, name: '9楼' } , { id: 4, name: '10楼' } , { id: 5, name: '11-14楼' } , { id: 6, name: '15-19楼' } , { id: 7, name: '裙楼' } ], objectArray1: [ { id:-1, name:'请选择类型' } , { id:0, name:'内网' } , { id:1, name:'外网' } ], applydate:new Date().getFullYear()+'-'+(new Date().getMonth()+1)+'-'+new Date().getDate(), applyer:'', dept:'', level:'', memo:'是否为路由器地址或其他', page:'' }, indexchange:function(e){ this.setData({ index:e.detail.value, level:this.data.array[this.data.index] }) }, indexchange1:function(e){ this.setData({ index1:e.detail.value, level:this.data.array1[this.data.index1] }) }, applyerinput:function(e){ this.setData({ applyer:e.detail.value }) }, memoinput:function(e){ this.setData({ memo:e.detail.value }) }, datechange:function(e){ this.setData({ applydate:e.detail.value }) }, submit:function(e){ if(this.data.index==0||this.data.index1==0||this.data.applyer==''){ wx.showModal({ title:'提示', content:'请输入完整申请信息' }) } else{ var that=this console.log(new Date(that.data.applydate)) console.log(that.data.array[that.data.index]) if(that.data.index1==1){ that.setData({ // page:'/pages/network/neiwang/neiwangapply?index='+that.data.index1+'&dept='+that.data.dept+'&applyer='+that.data.applyer+'&memo='+that.data.memo page:'/pages/network/neiwang/neiwangapply?applyer='+that.data.applyer }) } else{ that.setData({ page:'/pages/network/waiwang/waiwangapply?applyer='+that.data.applyer }) } wx.cloud.callFunction({ name:'ipapplyeradd', data:{ apply_type:that.data.array1[that.data.index1], apply_level:that.data.array[that.data.index], applyer:that.data.applyer, apply_reason:that.data.memo, apply_date:that.data.applydate, }, success:function(res){ wx.showModal({ title:'提示', content:'申请成功,待审批', success:function(suc){ if(suc.confirm){ wx.requestSubscribeMessage({ tmplIds: ['5J3WjQR4u5p9ngOmwcaIQBujnTidOode1C_JhGL3OAY','rwCuVp2NAyncSnevjnTuDLaevjM0Cioq8sz_PSUhiFg'], success:function(eee){ wx.cloud.callFunction({ name:'ipapplynote',//下发函数 data:{ thing4:that.data.array1[that.data.index1]+'申请', thing7:that.data.array[that.data.index], thing8:that.data.applyer, thing9:that.data.memo, time10:time.formatTime(new Date()), page:that.data.page, applyer:that.data.applyer }, success:function(rrr){ console.log(rrr) }, fail:function(error){ console.log(error) } }) }, fail:function(err){ console.log(err) } }) } } }) } }) } },
event.applye 你这个有值吗
// miniprogram/pages/network/ipapply/ipapply.js
var time = require('../../../common');
Page({
/**
* 页面的初始数据
*/
data: {
index:0,
index1:0,
array:['请选择楼层','1-6楼','7楼','8楼','9楼','10楼','11-14楼','15-19楼','裙楼'],
array1:['请选择类型','内网','外网'],
objectArray: [
{
id: -1,
name: '请选择楼层'
},
{
id: 0,
name: '1-6楼'
},
{
id: 1,
name: '7楼'
},
{
id: 2,
name: '8楼'
},
{
id: 3,
name: '9楼'
submit:function(e){
if(this.data.index==0||this.data.index1==0||this.data.applyer==''){
wx.showModal({
title:'提示',
content:'请输入完整申请信息'
})
}
else{
var that=this
console.log(new Date(that.data.applydate))
console.log(that.data.array[that.data.index])
if(that.data.index1==1){
that.setData({
// page:'/pages/network/neiwang/neiwangapply?index='+that.data.index1+'&dept='+that.data.dept+'&applyer='+that.data.applyer+'&memo='+that.data.memo
page:'/pages/network/neiwang/neiwangapply?applyer='+that.data.applyer
})
}
else{
that.setData({
page:'/pages/network/waiwang/waiwangapply?applyer='+that.data.applyer
})
}
wx.cloud.callFunction({
name:'ipapplyeradd',
data:{
apply_type:that.data.array1[that.data.index1],
apply_level:that.data.array[that.data.index],
applyer:that.data.applyer,
apply_reason:that.data.memo,
apply_date:that.data.applydate,
},
success:function(res){
wx.showModal({
title:'提示',
content:'申请成功,待审批',
success:function(suc){
if(suc.confirm){
wx.requestSubscribeMessage({
tmplIds: ['5J3WjQR4u5p9ngOmwcaIQBujnTidOode1C_JhGL3OAY','rwCuVp2NAyncSnevjnTuDLaevjM0Cioq8sz_PSUhiFg'],
success:function(eee){
wx.cloud.callFunction({
name:'ipapplynote',//下发函数
data:{
thing4:that.data.array1[that.data.index1]+'申请',
thing7:that.data.array[that.data.index],
thing8:that.data.applyer,
thing9:that.data.memo,
time10:time.formatTime(new Date()),
page:that.data.page,
applyer:that.data.applyer