uni app中小程序端点进详情页时点了点赞的状态,返回上一页上一页时列表页当前的点赞状态没有跟着改变,用onShow周期,接口又重新刷新,不能是上一次点击的状态,怎么才能实现返回状态变化并且还在当前位置。
<template>
<view>
<swiper class="swiper"
:indicator-dots='true'
indicator-color="#fff"
indicator-active-color='#ccc'
:autoplay='true'
:interval='3000'
:duration='300'
style="padding: 0rpx 24rpx;">
<!-- 不需要循环直接手动放图片 -->
<swiper-item>
<view class="img">
<image src="../../../static/img/png/boy1.png" mode=""></image>
</view>
</swiper-item>
<!-- 循环方便点 -->
<swiper-item v-for="(item,index) in swiper_img" :key="index" style="height: 300rpx;">
<view class="img">
<image :src="item.src" mode=""></image>
</view>
</swiper-item>
</swiper>
</view>
</template>
<script>
export default {
data() {
return {
swiper_img:[
{name:"12f3",src:"../../../static/img/boy2.jpg"},
{name:"12s3",src:"../../../static/img/boy2.jpg"},
{name:"12fd3",src:"../../../static/img/boy3.jpg"},
]
}
},
methods: {
}
}
</script>
<style scoped>
.img{
width: 100%;
height: 100%;
}
image{
width: 100%;
height: 100%;
}
</style>
自动播放和前后衔接是会冲突的,二者只能选一
在首页放个纯图片的轮播图写起来还是很简单滴,不点个赞再走吗