网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網

微信小程序商品到詳情(傳參)

發布時間:2017-12-19 10:38 所屬欄目:小程序開發教程

商品頁 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}}

 

		
  1. <view class="container">
  2. <swiper indicator-dots indicator-color="rgba(255,255,255,0.3)" indicator-active-color="rgba(255,255,255,1)" autoplay>
  3. <swiper-item>
  4. <image src="/dist/images/wx.png"></image>
  5. </swiper-item>
  6. <swiper-item>
  7. <image src="/dist/images/vr.png"></image>
  8. </swiper-item>
  9. <swiper-item>
  10. <image src="/dist/images/iqiyi.png"></image>
  11. </swiper-item>
  12. </swiper>
  13. <view class="article-list">
  14. <view class="article" wx:for="{{postList}}" wx:for-item="article" wx:key="index" catchtap="goDetail" data-postid="{{index}}">
  15. <view class="article-author-date">
  16. <image src="{{article.avatar}}" class="article-author"></image>
  17. <text class="article-date">{{article.date}}</text>
  18. </view>
  19. <text class="article-title">{{article.title}}</text>
  20. <image src="{{article.imgSrc}}" class="article-image"></image>
  21. <text class="article-content">
  22. {{article.content}}
  23. </text>
  24. <view class="article-link">
  25. <image src="/dist/images/icon/chat1.png"></image>
  26. <text>{{article.collection}}</text>
  27. <image src="/dist/images/icon/view.png"></image>
  28. <text>{{article.reading}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
 

post.js

en對象獲取postid

 

		
  1. var postData = require ("../../data/posts-data.js");
  2. Page({
  3. onLoad:function(){
  4. this.setData({
  5. postList:postData.postList
  6. })
  7. },
  8.  
  9. goDetail:function(en){
  10.  
  11. var postid = en.currentTarget.dataset.postid;
  12. wx.navigateTo({
  13. url:"post-detail/post-detail?postId="+postid
  14. })
  15. }
  16. })
 

商品詳情頁 post-detail.js

用option接收postid

 

		
  1. var postData = require("../../../data/posts-data.js");
  2. Page({
  3. onLoad:function(option){
  4. console.log(option);
  5. }
  6. })


易優小程序(企業版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/18209.html 復制鏈接 如需定制請聯系易優客服咨詢:800182392 點擊咨詢
QQ在線咨詢
AI智能客服 ×