navigateTo与redirectTo跳转出现问题
2019-03-15 16:54:37
微信公开课小程序热门讨论关于「navigateTo与redirectTo跳转出现问题」的小程序开发问题
补充:navigateTo与redirectTo跳转出现问题
展开:pagesaddCustomeraddCustomerjsvarutil=require(utilsutiljs)vardateTimePicker=require(utilsdateTimePickerjs);varapp=getApp();获取录音管理器对象constrecorderManager=wxgetRecorderManager();当前页面的对象varmyPage;结束录音的时候自己触发recorderManageronStop((res)={获取到了录音文件的路径const{tempFilePath}=res;consolelog(tempFilePath);consolelog(开始发送);把录音发送到后台wxuploadFile({url:http:231772m5y6iokla:48568smart_order,filePath:tempFilePath,name:wx_record,success:function(r){consolelog(成功,r);varresult=JSONparse(rdata);判断返回的状态if(resultcode==00000){consolelog(resultdata);consolelog(myPage)myPagesetData({followContent:resultdatatext,})consolelog(myPagedatafollowContent)}else{失败}},fail:function(e){consolelog(失败,e);}});})Page({** *页面的初始数据 *data:{date:||utilformatTime(newDate),time:,dateTimeArray:null,dateTime:null,dateTimeArray1:null,dateTime1:null,startYear:2000,endYear:2050,date:||utilformatTime(newDate),name:,tel:,company:,money:,followContent:123,address:,userId:,content:,way:,project:,locationAddress:,location:},按下录音start_say(){consolelog(1)开始录音recorderManagerstart();},结束录音end_say(){consolelog(2)结束录音varthat=thisrecorderManagerstop();setTimeout(function(){consolelog(thatdatafollowContent)},10000)},获取input的value值name:function(e){thissetData({name:edetailvalue})},followContent:function(e){thissetData({followContent:edetailvalue})consolelog(thisdatafollowContent)},tel:function(e){thissetData({tel:edetailvalue})},company:function(e){thissetData({company:edetailvalue})},money:function(e){thissetData({money:edetailvalue})},go:function(e){wxnavigateTo({url:keHuYiXiangkeHuYiXiang})},go1:function(e){wxnavigateTo({url:dataTypedataType})},go2:function(e){wxnavigateTo({url:SelObjectSelObject})},选择当前的位置chooseLocation(){wxgetSetting({success(res){if(!resauthSetting[scopeuserLocation]){wxauthorize({scope:scopeuserLocation,success(){wxchooseLocation({success(res){consolelog(res)thatsetData({location:reslongitude+&+reslatitude,locationAddress:resaddress})}})}})}else{wxchooseLocation({success(res){consolelog(res)thatsetData({location:reslongitude+&+reslatitude,locationAddress:resaddress})}})}}})constthat=this},finish:function(){wxsetStorage({key:common,data:{name:thisdataname,tel:thisdatatel,company:thisdatacompany,money:thisdatamoney,followContent:thisdatafollowContent,localtion:thisdatalocation,localtionAddress:thisdatalocationAddress},})varthat=thisvarname=vartel=varcompany=varkehu=vartype=varselobject=varmoney=varfollowContent=varlocaltion=varlocaltionAddress=当先输入完条跳转页面时,dingjvaruserId=thisdatauserIdwxgetStorage({key:common,success:function(res){name=resdatanametel=resdatatelcompany=resdatacompanymoney=resdatamoneyfollowContent=resdatafollowContentlocaltion=resdatalocation,localtionAddress=resdatalocationAddressconsolelog(resdata)if(name==||tel==||company==||money==||followContent==||localtion==){wxshowToast({title:内容需要填写完整,icon:none})return;}wxgetStorage({key:xhyx,success:function(res){kehu=resdata[1]wxgetStorage({key:dataType,success:function(res){type=resdata[1],wxgetStorage({key:selobject,success:function(res){vardate=thatdatadate+thatdatatime;consolelog(date)selobject=resdata[1]if(kehu==||type==||selobject==){wxshowToast({title:内容需要填写完整,icon:none})return;}wxshowModal({title:操作提示,content:确定添加该成员吗,success:function(res){if(resconfirm){这里是点击了确定以后 wxrequest({获取openid接口12url:appglobalUrl+customeraddcustomer,data:{customerName:name,customerPhone:tel,customerCompany:company,customerIntentionId:kehu,customerFlowModeId:type,customerProjectId:selobject,projectAmount:money,userId:userId,customerFollowContent:followContent,appointment:date},method:POST,success:function(res){consolelog(resdata)if(resdatastate==0){wxnavigateBack({deIta:1})wxremoveStorage({key:common,})wxremoveStorage({key:xhyx,})wxremoveStorage({key:dataType,})wxremoveStorage({key:selobject,})}else{wxshowToast({title:resdatamessage,icon:none})}}})}else{这里是点击了取消以后consolelog(用户点击取消)}}})},})},})},})},})},** *生命周期函数监听页面显示 *onShow:function(options){varthat=this;客户意向wxgetStorage({key:xhyx,success(res){consolelog(resdata)thatsetData({content:resdata[0],})}})更近方式wxgetStorage({key:dataType,success(res){consolelog(resdata)thatsetData({way:resdata[0],})}})所属项目wxgetStorage({key:selobject,success(res){consolelog(resdata)thatsetData({project:resdata[0],})}})name,tel,company,money的存储wxgetStorage({key:common,success(res){thatsetData({name:resdataname,tel:resdatatel,company:resdatacompany,money:resdatamoney,followContent:resdatafollowContent})consolelog(resdata)}})},** *生命周期函数监听页面初次渲染完成 *** *生命周期函数监听页面加载 *onLoad:function(){myPage=getCurrentPages()[0]varthat=thiswxgetStorage({key:loginSign,success:function(res){thatsetData({userId:resdatauserId})},})varobj=dateTimePickerdateTimePicker(thisdatastartYear,thisdataendYear);varobj1=dateTimePickerdateTimePicker(thisdatastartYear,thisdataendYear);精确到分的处理,将数组的秒去掉varlastArray=obj1dateTimeArraypop();varlastTime=obj1dateTimepop();thissetData({dateTime:objdateTime,dateTimeArray:objdateTimeArray,dateTimeArray1:obj1dateTimeArray,dateTime1:obj1dateTime});},changeDate(e){thissetData({date:edetailvalue});},changeTime(e){thissetData({time:edetailvalue});},changeDateTime(e){thissetData({dateTime:edetailvalue});},changeDateTime1(e){thissetData({dateTime1:edetailvalue});},changeDateTimeColumn(e){vararr=thisdatadateTime,dateArr=thisdatadateTimeArray;arr[edetailcolumn]=edetailvalue;dateArr[2]=dateTimePickergetMonthDay(dateArr[0][arr[0]],dateArr[1][arr[1]]);thissetData({dateTimeArray:dateArr,dateTime:arr});},changeDateTimeColumn1(e){vararr=thisdatadateTime1,dateArr=thisdatadateTimeArray1;arr[edetailcolumn]=edetailvalue;dateArr[2]=dateTimePickergetMonthDay(dateArr[0][arr[0]],dateArr[1][arr[1]]);thissetData({dateTimeArray1:dateArr,dateTime1:arr});},** *生命周期函数监听页面隐藏 *onHide:function(){ varthat=this wxsetStorage({ key:common, data:{ name:thisdataname, tel:thisdatatel, company:thisdatacompany, money:thisdatamoney, followContent:thisdatafollowContent|| }, }) wxgetStorage({ key:common, success(res){ thatsetData({ name:resdataname, tel:resdatatel, company:resdatacompany, money:resdatamoney, followContent:resdatafollowContent }) consolelog(resdata) } })},** *生命周期函数监听页面卸载 *onUnload:function(){wxremoveStorage({key:common,})wxremoveStorage({key:xhyx,})wxremoveStorage({key:dataType,})wxremoveStorage({key:selobject,})},** *页面相关事件处理函数监听用户下拉动作 *onPullDownRefresh:function(){},** *页面上拉触底事件的处理函数 *onReachBottom:function(){},** *用户点击右上角分享 *onShareAppMessage:function(){},})语音识别页面,redirectTo进入语音识别页面,文字也可以渲染,navigateT进入语音识别页面,文字无法渲染,thisfollowContent为空即速小程序:跟页面栈有关系:页面栈超过10了,这代码乱得,:不用想,肯定是‘to’得太多了,不停to来to去,导致页面栈超过10的数量,就to不动了:不如做个代码片段咯:感谢各位大佬,有奖赏的哦~
更多有关「navigateTo与redirectTo跳转出现问题」的讨论可以前往微信公开课小程序参与互动哦!
补充:navigateTo与redirectTo跳转出现问题
展开:pagesaddCustomeraddCustomerjsvarutil=require(utilsutiljs)vardateTimePicker=require(utilsdateTimePickerjs);varapp=getApp();获取录音管理器对象constrecorderManager=wxgetRecorderManager();当前页面的对象varmyPage;结束录音的时候自己触发recorderManageronStop((res)={获取到了录音文件的路径const{tempFilePath}=res;consolelog(tempFilePath);consolelog(开始发送);把录音发送到后台wxuploadFile({url:http:231772m5y6iokla:48568smart_order,filePath:tempFilePath,name:wx_record,success:function(r){consolelog(成功,r);varresult=JSONparse(rdata);判断返回的状态if(resultcode==00000){consolelog(resultdata);consolelog(myPage)myPagesetData({followContent:resultdatatext,})consolelog(myPagedatafollowContent)}else{失败}},fail:function(e){consolelog(失败,e);}});})Page({** *页面的初始数据 *data:{date:||utilformatTime(newDate),time:,dateTimeArray:null,dateTime:null,dateTimeArray1:null,dateTime1:null,startYear:2000,endYear:2050,date:||utilformatTime(newDate),name:,tel:,company:,money:,followContent:123,address:,userId:,content:,way:,project:,locationAddress:,location:},按下录音start_say(){consolelog(1)开始录音recorderManagerstart();},结束录音end_say(){consolelog(2)结束录音varthat=thisrecorderManagerstop();setTimeout(function(){consolelog(thatdatafollowContent)},10000)},获取input的value值name:function(e){thissetData({name:edetailvalue})},followContent:function(e){thissetData({followContent:edetailvalue})consolelog(thisdatafollowContent)},tel:function(e){thissetData({tel:edetailvalue})},company:function(e){thissetData({company:edetailvalue})},money:function(e){thissetData({money:edetailvalue})},go:function(e){wxnavigateTo({url:keHuYiXiangkeHuYiXiang})},go1:function(e){wxnavigateTo({url:dataTypedataType})},go2:function(e){wxnavigateTo({url:SelObjectSelObject})},选择当前的位置chooseLocation(){wxgetSetting({success(res){if(!resauthSetting[scopeuserLocation]){wxauthorize({scope:scopeuserLocation,success(){wxchooseLocation({success(res){consolelog(res)thatsetData({location:reslongitude+&+reslatitude,locationAddress:resaddress})}})}})}else{wxchooseLocation({success(res){consolelog(res)thatsetData({location:reslongitude+&+reslatitude,locationAddress:resaddress})}})}}})constthat=this},finish:function(){wxsetStorage({key:common,data:{name:thisdataname,tel:thisdatatel,company:thisdatacompany,money:thisdatamoney,followContent:thisdatafollowContent,localtion:thisdatalocation,localtionAddress:thisdatalocationAddress},})varthat=thisvarname=vartel=varcompany=varkehu=vartype=varselobject=varmoney=varfollowContent=varlocaltion=varlocaltionAddress=当先输入完条跳转页面时,dingjvaruserId=thisdatauserIdwxgetStorage({key:common,success:function(res){name=resdatanametel=resdatatelcompany=resdatacompanymoney=resdatamoneyfollowContent=resdatafollowContentlocaltion=resdatalocation,localtionAddress=resdatalocationAddressconsolelog(resdata)if(name==||tel==||company==||money==||followContent==||localtion==){wxshowToast({title:内容需要填写完整,icon:none})return;}wxgetStorage({key:xhyx,success:function(res){kehu=resdata[1]wxgetStorage({key:dataType,success:function(res){type=resdata[1],wxgetStorage({key:selobject,success:function(res){vardate=thatdatadate+thatdatatime;consolelog(date)selobject=resdata[1]if(kehu==||type==||selobject==){wxshowToast({title:内容需要填写完整,icon:none})return;}wxshowModal({title:操作提示,content:确定添加该成员吗,success:function(res){if(resconfirm){这里是点击了确定以后 wxrequest({获取openid接口12url:appglobalUrl+customeraddcustomer,data:{customerName:name,customerPhone:tel,customerCompany:company,customerIntentionId:kehu,customerFlowModeId:type,customerProjectId:selobject,projectAmount:money,userId:userId,customerFollowContent:followContent,appointment:date},method:POST,success:function(res){consolelog(resdata)if(resdatastate==0){wxnavigateBack({deIta:1})wxremoveStorage({key:common,})wxremoveStorage({key:xhyx,})wxremoveStorage({key:dataType,})wxremoveStorage({key:selobject,})}else{wxshowToast({title:resdatamessage,icon:none})}}})}else{这里是点击了取消以后consolelog(用户点击取消)}}})},})},})},})},})},** *生命周期函数监听页面显示 *onShow:function(options){varthat=this;客户意向wxgetStorage({key:xhyx,success(res){consolelog(resdata)thatsetData({content:resdata[0],})}})更近方式wxgetStorage({key:dataType,success(res){consolelog(resdata)thatsetData({way:resdata[0],})}})所属项目wxgetStorage({key:selobject,success(res){consolelog(resdata)thatsetData({project:resdata[0],})}})name,tel,company,money的存储wxgetStorage({key:common,success(res){thatsetData({name:resdataname,tel:resdatatel,company:resdatacompany,money:resdatamoney,followContent:resdatafollowContent})consolelog(resdata)}})},** *生命周期函数监听页面初次渲染完成 *** *生命周期函数监听页面加载 *onLoad:function(){myPage=getCurrentPages()[0]varthat=thiswxgetStorage({key:loginSign,success:function(res){thatsetData({userId:resdatauserId})},})varobj=dateTimePickerdateTimePicker(thisdatastartYear,thisdataendYear);varobj1=dateTimePickerdateTimePicker(thisdatastartYear,thisdataendYear);精确到分的处理,将数组的秒去掉varlastArray=obj1dateTimeArraypop();varlastTime=obj1dateTimepop();thissetData({dateTime:objdateTime,dateTimeArray:objdateTimeArray,dateTimeArray1:obj1dateTimeArray,dateTime1:obj1dateTime});},changeDate(e){thissetData({date:edetailvalue});},changeTime(e){thissetData({time:edetailvalue});},changeDateTime(e){thissetData({dateTime:edetailvalue});},changeDateTime1(e){thissetData({dateTime1:edetailvalue});},changeDateTimeColumn(e){vararr=thisdatadateTime,dateArr=thisdatadateTimeArray;arr[edetailcolumn]=edetailvalue;dateArr[2]=dateTimePickergetMonthDay(dateArr[0][arr[0]],dateArr[1][arr[1]]);thissetData({dateTimeArray:dateArr,dateTime:arr});},changeDateTimeColumn1(e){vararr=thisdatadateTime1,dateArr=thisdatadateTimeArray1;arr[edetailcolumn]=edetailvalue;dateArr[2]=dateTimePickergetMonthDay(dateArr[0][arr[0]],dateArr[1][arr[1]]);thissetData({dateTimeArray1:dateArr,dateTime1:arr});},** *生命周期函数监听页面隐藏 *onHide:function(){ varthat=this wxsetStorage({ key:common, data:{ name:thisdataname, tel:thisdatatel, company:thisdatacompany, money:thisdatamoney, followContent:thisdatafollowContent|| }, }) wxgetStorage({ key:common, success(res){ thatsetData({ name:resdataname, tel:resdatatel, company:resdatacompany, money:resdatamoney, followContent:resdatafollowContent }) consolelog(resdata) } })},** *生命周期函数监听页面卸载 *onUnload:function(){wxremoveStorage({key:common,})wxremoveStorage({key:xhyx,})wxremoveStorage({key:dataType,})wxremoveStorage({key:selobject,})},** *页面相关事件处理函数监听用户下拉动作 *onPullDownRefresh:function(){},** *页面上拉触底事件的处理函数 *onReachBottom:function(){},** *用户点击右上角分享 *onShareAppMessage:function(){},})语音识别页面,redirectTo进入语音识别页面,文字也可以渲染,navigateT进入语音识别页面,文字无法渲染,thisfollowContent为空即速小程序:跟页面栈有关系:页面栈超过10了,这代码乱得,:不用想,肯定是‘to’得太多了,不停to来to去,导致页面栈超过10的数量,就to不动了:不如做个代码片段咯:感谢各位大佬,有奖赏的哦~
更多有关「navigateTo与redirectTo跳转出现问题」的讨论可以前往微信公开课小程序参与互动哦!
标签:微信公开课,小程序
「navigateTo与redirectTo跳转出现问题」热门讨论订阅
方法1:微信扫描微信公开课小程序码即可订阅热门讨论「navigateTo与redirectTo跳转出现问题」
方法2:微信搜索微信公开课小程序名称进入,即可订阅热门讨论「navigateTo与redirectTo跳转出现问题」
方法3:微信网页访问即速商店,长按识别微信公开课小程序码即可订阅热门讨论「navigateTo与redirectTo跳转出现问题」
微信公开课小程序热门讨论「navigateTo与redirectTo跳转出现问题」由微信公开课原创摘录于微信小程序商店shop.jisuapp.cn,转载请注明出处。
微信公开课热门讨论「navigateTo与redirectTo跳转出现问题」由微信公开课开发者向微信用户提供,并对本服务内容、数据资料及其运营行为等真实性、合法性及有效性承担全部责任。
微信公开课小程序
更新时间:2019-03-15 16:54:37
>
__methodCallerx27;ofundefined
>-404011cloudfunctionexecutionerror
>,请补充选择商家自营-预付卡销售-发行方类目,并在基础信息处申请该类目,通过
>:host在模拟器中显示无效
>:请在小程序服务页面上架正式(非测试)内容或商品后重新提交审核
>.net 微信小程序 上传图片
>'setTimeout'的问题
>‘三朵里熙SPA主题减压空间’为什么搜索关键词‘三朵里‘搜不到
>‘扫普通链接二维码打开小程序‘中设置为体验版,扫码打开是线上版本
>“cloudfunctions**indexjs”gitignore
>“NO ULINK DEVICE FOUND”是怎么回事
>“万马掌上校园”的类目审核
>“上线了”公司开发的微信小程序怎么样?
>“产品是否一定需要条形码”
>