2023年6月29日发(作者:)
微信⼩程序⽂章详情页跳转案例详解前⾯写了⼀篇⾥⾯所有的⽂章列表⾥⾯都是跳转了同⼀篇⽂章链接,那么,如果所有的列表跳转详情页的时候,跳转对应id所在的⽂章⼜该怎么写?
padding-top: 25rpx; flex-direction: column; justify-content: space-between;}.item .ok { width: 60px; height: 100%; padding-right: 20rpx; display: flex; justify-content: center; align-items: center; background-color: #98f5ff;}.item .img { width: 150rpx; height: 150rpx; padding: 20rpx;}.number-wrapper .name { margin: 10rpx 10rpx 10rpx 10rpx; font-size: 39rpx; overflow: hidden;}.number-wrapper .count-wrapper { display: flex; align-items: center; margin-left: 10rpx; font-size: 25rpx;}.number-wrapper .count-wrapper .decrease-btn { font-size: 30rpx;}.number-wrapper .count-wrapper .increase-btn { font-size: 30rpx;}.number-wrapper .count-wrapper .count { margin: 0 1rpx 0 1rpx; font-size: 30rpx;}.number-wrapper .price-wrapper .people { margin-left: 250rpx; font-size: 30rpx;}/* 搜索框样式 */.view-search { display: flex; flex-direction: row; height: 70rpx; margin: 20rpx; padding: 5rpx; border: 1px #e4e2e2 solid; border-width: thin; align-items: center;}.input { flex: 1; height: 60rpx;}.input-placeholder { color: #999;}.button { width: 60rpx; height: 60rpx;}.details{font-size: 36rpx;color:red;}////获取应⽤实例var app = getApp();var cardTeams;Page({ data: { cardTeams: [{ "viewid": "1", "imgsrc": "/image/", "price": "¥1245", "count": "为什么说 C 语⾔⽐ Java 难? ", "name": "为什么说 C 语⾔⽐ Java 难? ", }, { "viewid": "2", "imgsrc": "/image/", "price": "¥2345", "count": "⼩程序云开发⼊门实战总结 ", "name": "⼩程序云开发⼊门实战总结 ", }, { "viewid": "3", "imgsrc": "/image/", "price": "¥2345", "count": "写⼀个⼩爬⾍ ", "name": "写⼀个⼩爬⾍ ", }, { "viewid": "4", "imgsrc": "/image/", "price": "¥2345", "count": "推荐⼀个前端开源项⽬ ", "name": "推荐⼀个前端开源项⽬ ", } ] }, onLoad: function () { // ('onLoad:' + ) }})详情页⾯
{showDesc: '/s?__biz=MzI2ODUxMzg4Nw==&mid=2247485900&idx=1&sn=5aa1e6028f6499a611fff1ec2a641bf6&chksm=eaef2efcdd98a7eaeb618e687ed3f36cf5f9085779e0a130a8515ce46d8a444b08595dc15994&token=1964115409& { showDesc: '/s?__biz=MzI2ODUxMzg4Nw==&mid=2247485848&idx=1&sn=af73f05a22febcb4dfae60b197a6ca8e&chksm=eaef2ea8dd98a7bee88721a853d7dfce17387d11a371ba27295bec502b2f7ea76b2fd6faf34c&token=1964115409& ] }, /** * ⽣命周期函数--监听页⾯加载 */ onLoad: function (options) {
var goodsId = d; (goodsId) a({ url: tsList[goodsId].showDesc }); }})样式可以⾃⼰进⾏优化,然后其中的道理就不⼀⼀细说了,根据index点击的列表的id判断所对应的url即可。以上就是本⽂的全部内容,希望对⼤家的学习有所帮助,也希望⼤家多多⽀持。
发布者:admin,转转请注明出处:http://www.yc00.com/web/1687985430a63900.html
评论列表(0条)