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

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

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

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

商品頁(yè)

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= ...

商品頁(yè) 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對(duì)象獲取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
})
}
})

商品詳情頁(yè) post-detail.js

用option接收postid 

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

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

相關(guān)文章

最新評(píng)論

淮北市| 普宁市| 建水县| 河曲县| 内丘县| 南投县| 湛江市| 宜川县| 湖口县| 炎陵县| 乐清市| 隆安县| 平武县| 礼泉县| 丘北县| 杂多县| 二连浩特市| 唐海县| 白河县| 辛集市| 清徐县| 门源| 古交市| 新竹市| 汉中市| 夏邑县| 都昌县| 靖边县| 原阳县| 花莲县| 新巴尔虎左旗| 太保市| 桂林市| 龙江县| 丁青县| 桦川县| 阳谷县| 林甸县| 石景山区| 济宁市| 赣榆县|