WAService.js:3 appServiceSDKScriptError
URI malformed;at api onAppRoute callback function
URIError: URI malformed
at decodeURIComponent (<anonymous>)
at Function.<anonymous> (http://1210065392.appservice.open.weixin.qq.com/WAService.js:4:10003)
at http://1210065392.appservice.open.weixin.qq.com/WAService.js:4:22435
at d (http://1210065392.appservice.open.weixin.qq.com/appservice:16:5545)
at f.registerCallback (http://1210065392.appservice.open.weixin.qq.com/appservice:16:5807)
at k.forEach (http://1210065392.appservice.open.weixin.qq.com/appservice:16:3140)
at Array.forEach (<anonymous>)
at d (http://1210065392.appservice.open.weixin.qq.com/appservice:16:3120)
at WebSocket.h.onmessage (http://1210065392.appservice.open.weixin.qq.com/appservice:16:2996)
可参阅: zhihu.com/question/21861899
用encodeURIComponent则没有报错,但是为啥不能使用escape呢?
如果使用 encodeURIComponent 而非 escape,可以成功吗
<template name="zan-steps">
<view class="zan-steps zan-steps--{{ type == 'vertical' ? 'vsteps' : 'steps' }} zan-steps--{{ steps.length }} {{ className }}">
<view wx:for="{{ steps }}" wx:for-item="step" wx:key="unique" wx:for-index="index"
class="zan-steps__step {{ hasDesc ? 'zan-steps__step--db-title' : '' }} {{ index == 0 ? 'zan-steps__step--first-child' : '' }} {{ index == steps.length - 1 ? 'zan-steps__step--last-child' : '' }} {{ step.done ? 'zan-steps__step--done' : '' }} {{ step.current ? 'zan-steps__step--cur' : '' }}" bindtap="stepTap" data-index="{{index}}"
>
<view class="zan-steps__title {{step.done&&step.isJoin==false?'c':''}}">{{ step.text }}</view>
<view wx:if="{{ hasDesc && step.desc }}" class="zan-steps__title zan-steps__title--desc">{{ step.desc }}</view>
<view class="zan-steps__icons">
<view class="zan-steps__circle"></view>
</view>
<view class="zan-steps__line"></view>
</view>
</view>
</template>
模板事件绑定如下
stepTap(e) {
let stepIndex = e.currentTarget.dataset.index,
self = this;
wx.navigateTo({
url: '/pages/historydetails/index?noticetitle=' + escape(self.data.steps[stepIndex].text)
});
},
你好,请提供一下能复现问题的简单代码示例。