最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

微信小程序商品到詳情的實(shí)現(xiàn)

 更新時(shí)間:2017年06月27日 09:38:13   投稿:lqh  
這篇文章主要介紹了微信小程序商品到詳情的實(shí)現(xiàn)的相關(guān)資料,需要的朋友可以參考下

微信小程序商品到詳情結(jié)構(gòu)代碼資源分享給大家.

商品頁

post.wxmldata-postid="{{index}}view class="container" 
swiper indicator-dots indicator-color="rgba(255,255,255,0.3)" 
indicator-active-color="rgba(255,255,255,1)" autoplay swiper-item image src= ...

商品頁 post.wxml

data-postid="{{index}}
 
<view class="container">
<swiper indicator-dots indicator-color="rgba(255,255,255,0.3)" indicator-active-color="rgba(255,255,255,1)" autoplay>
<swiper-item>
<image src="/dist/images/wx.png"></image>
</swiper-item>
<swiper-item>
<image src="/dist/images/vr.png"></image>
</swiper-item>
<swiper-item>
<image src="/dist/images/iqiyi.png"></image>
</swiper-item>
</swiper>
<view class="article-list">
<view class="article" wx:for="{{postList}}" wx:for-item="article" wx:key="index" catchtap="goDetail" data-postid="{{index}}">
<view class="article-author-date">
<image src="{{article.avatar}}" class="article-author"></image>
<text class="article-date">{{article.date}}</text>
</view>
<text class="article-title">{{article.title}}</text>
<image src="{{article.imgSrc}}" class="article-image"></image>
<text class="article-content">
{{article.content}}
</text>
<view class="article-link">
<image src="/dist/images/icon/chat1.png"></image>
<text>{{article.collection}}</text>
<image src="/dist/images/icon/view.png"></image>
<text>{{article.reading}}</text>
</view>
</view>
</view>
</view>


post.js

en對象獲取postid

var postData = require ("../../data/posts-data.js");
Page({
onLoad:function(){
this.setData({
postList:postData.postList
})
},
 
goDetail:function(en){
 
var postid = en.currentTarget.dataset.postid;
wx.navigateTo({
url:"post-detail/post-detail?postId="+postid
})
}
})

商品詳情頁 post-detail.js

用option接收postid 

var postData = require("../../../data/posts-data.js");
Page({
onLoad:function(option){
console.log(option);
}
})

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

相關(guān)文章

最新評論

林西县| 夏河县| 浦东新区| 喀什市| 册亨县| 和静县| 木兰县| 法库县| 丰台区| 乌兰县| 资源县| 黑水县| 大余县| 溧阳市| 刚察县| 从化市| 丽水市| 兴海县| 舞阳县| 桦川县| 当雄县| 许昌县| 盱眙县| 澄城县| 泾阳县| 江西省| 固镇县| 弥渡县| 阜南县| 昭通市| 栖霞市| 岳普湖县| 蓝田县| 贵定县| 锡林郭勒盟| 徐水县| 万全县| 新干县| 马龙县| 大名县| 富裕县|