关注公众号:青山有路

小程序页面跳转传参数

全部 admin 7年前 (2017-11-15) 1410次浏览 已收录 0个评论 扫描二维码
根据绑定的data-id的值:
<view class=”items” data-id=”{{item.id}}” bindtap=”index”>
    <viewclass=”detail”>
        <viewclass=”detail-express”>
            <textclass=”{{title != ” ? ” : ‘type-text’}}”>{{item.name}}</text>
        </view>
        <viewclass=”detail-express”>
        <text>{{item.in_business == ‘1’ ? ‘营业中’ : ‘休息中’}}</text>
        </view>
        <viewclass=”detail-express”>
        <text>{{item.address}}</text>
        <textclass=”number”></text>
    </view>
</view>
         <viewclass=”des”>详情</view>
</view>
跳转函数:
index: function (event) {
    console.log(event);
    wx.navigateTo({
        url: “../store/store?storeid=” + event.currentTarget.dataset.id,//获取data-id中的参数
        //接口调用成功的回调方法
        success: function () { },
        fail: function () { },
        complete: function () { }
    })
}


版权所有丨如未注明 , 均为原创 , 转载请注明小程序页面跳转传参数
喜欢 (1)

Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in /www/wwwroot/gaowenjie.cc/wp-content/themes/Git-alpha/comments.php on line 17
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到