微信小程序商品到详情的实现
网络编程 2021-07-04 18:32www.168986.cn编程入门
这篇文章主要介绍了微信小程序商品到详情的实现的相关资料,需要的朋友可以参考下
微信小程序商品到详情结构代码资源分享给大家.
商品页
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)" aulay 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)" aulay> <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); } })
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
上一篇:微信小程序 开发MAP(地图)实例详解
下一篇:微信小程序的分类页面制作
编程语言
- 宿迁百度关键词排名指南:实现精准营销的关键
- 四川SEO优化怎么做网络推广
- 立昂技术备案老域名收购:如何为您的业务赋能
- 安徽百度关键词seo贵不贵,一般需要多少钱
- 吉林百度快照排名怎么做电话营销
- 多伦新手做SEO怎么做
- 甘肃优化关键词排名推广怎么做论坛营销
- 沙雅SEO网站推广:提升您的在线可见性
- 四川SEO优化如何提升销售额和销售量
- 聂荣网站排名优化:提升网站可见性的全方位指
- 涞水SEO:提升地方企业在线可见性的策略
- 辽宁百度seo排名怎样做网站排名
- 临湘哪有关键词排名优化:提升网站可见度的关
- 黑龙江百度网站优化有没有优惠
- 凉城优化关键词排名推广:提升您的网络可见性
- 萝北整站优化:提升您网站流量和排名的全面指