uni app中小程序端实现返回上一页更新接口并且是上一次点的状态

uni app中小程序端点进详情页时点了点赞的状态,返回上一页上一页时列表页当前的点赞状态没有跟着改变,用onShow周期,接口又重新刷新,不能是上一次点击的状态,怎么才能实现返回状态变化并且还在当前位置。

  • 这篇博客: 【uni-app 一个能自动播放,有指示点的轮播图怎么写】中的 去官方文档查看详情,我修改的属性依次是是否有指示点,指示点颜色,选中指示点的颜色,是否自动播放,自动播放毫秒数,切换时间 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
  • <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>
    
    

    自动播放和前后衔接是会冲突的,二者只能选一

    在首页放个纯图片的轮播图写起来还是很简单滴,不点个赞再走吗在这里插入图片描述