收藏
回答

模板列表绑定事件,调用的时候报错,旧版本开发工具则没有报错,具体报错如下:

问题模块
开发者工具


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)

最后一次编辑于  2017-09-11  (未经腾讯允许,不得转载)
回答关注问题邀请回答
收藏

5 个回答

  • HS
    HS
    2017-09-11

    可参阅: zhihu.com/question/21861899

    2017-09-11
    赞同
    回复
  • HS
    HS
    2017-09-11

    如果使用 encodeURIComponent 而非 escape,可以成功吗

    2017-09-11
    赞同
    回复
  • HS
    HS
    2017-09-11

    你好,请提供一下能复现问题的简单代码示例。

    2017-09-11
    赞同
    回复
  • 守望者
    守望者
    2017-09-11

    encodeURIComponent则没有报错,但是为啥不能使用escape呢?

    2017-09-11
    赞同
    回复
  • 守望者
    守望者
    2017-09-11

    <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)

        });

    },


    2017-09-11
    赞同
    回复