欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序鏈接傳參并跳轉(zhuǎn)新頁(yè)面

 更新時(shí)間:2016年11月29日 11:02:09   作者:XiaoBaiduQs  
這篇文章主要介紹了微信小程序鏈接傳參并跳轉(zhuǎn)新頁(yè)面的相關(guān)資料,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

 像傳統(tǒng)的傳參一樣,只是在微信里面的標(biāo)簽不一樣而已,navigator標(biāo)簽的文檔說(shuō)明

https://mp.weixin.qq.com/debug/wxadoc/dev/component/navigator.html?t=20161122

下面是傳遞參數(shù)并展示新頁(yè)面的一個(gè)簡(jiǎn)單栗子:

這是index.wxml代碼:

<navigator class="bury-wrapper wx-li" url="../detail/detail?id={{name.id}}"> 
<view>評(píng)19</view> 
</navigator>

url是../detail/detail....... 傳遞參數(shù)是id="{{item.id}}" url="../detail/detail?id=88"

detail.js代碼如下

Page({ 
onLoad: function(options) { 
var duanziId = options.id 
var that = this 
wx.showToast({ 
title: '加載中', 
icon: 'loading', 
duration: 1000 
}) 
wx.request({ 
url: 'https://www.xxx.xxx?m=getDetail&duanziId='+duanziId, //服務(wù)器參數(shù)接收地址, 
data: {token:token}, 
method: 'GET', 
success: function(res){ 
console.log(res.data.result) //打印獲取數(shù)據(jù) 
that.setData({ 
duanziDetail:res.data.result 
}) 
} 
}) 
} 
})

detail.wxml代碼:

<view class="duanzi-content"> 
<text class="dz-content">{{duanziDetail.content}}</text> 
</view>

app.json中pages配置代碼如下

"pages":[ 
"pages/index/index", 
"pages/detail/detail", 
"pages/center/center", 
"pages/tucao/tucao", 
"pages/search/search" 
]

目錄結(jié)構(gòu):

以上所述是小編給大家介紹的微信小程序鏈接傳參并跳轉(zhuǎn)新頁(yè)面,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論