没有合适的资源?快使用搜索试试~ 我知道了~
首页微信小程序文章详情页跳转案例详解
资源详情
资源评论
资源推荐

微信小程序文章详情页跳转案例详解微信小程序文章详情页跳转案例详解
主要介绍了微信小程序文章详情页跳转案例详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
前面写了一篇小程序访问公众号文章
里面所有的文章列表里面都是跳转了同一篇文章链接,那么,如果所有的列表跳转详情页的时候,跳转对应id所在的文章又该怎么写?
index.html
<view class="container">
<view wx:for="{{cardTeams}}" wx:key="{{index}}" wx:for-item="cardTeam" class="item">
<image class="img" src="{{cardTeam.imgsrc}}" mode="scaleToFill"></image>
<view class="number-wrapper">
<text class="name">{{cardTeam.name}}</text>
<view class="count-wrapper">
<text class="count">{{cardTeam.count}}</text>
</view>
<view class="details">
<navigator url="../details/details?goodsId={{index}}">查看详情</navigator>
</view>
</view>
</view>
</view>
index.wxss
.container {
padding-top: 0;
}
.item {
width: 100%;
height: 220rpx;
position: relative;
display: flex;
margin: 10rpx 10rpx;
border-bottom: 1px solid rgb(197, 199, 199);
}
.item:first-child {
margin-top: 0;
}
.item .remove {
width: 60px;
height: 100%;
background-color: red;
position: absolute;
top: 0;
right: -60px;
display: flex;
justify-content: center;
align-items: center;
}
.item .number-wrapper {
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;













安全验证
文档复制为VIP权益,开通VIP直接复制

评论0