<template>
<view class="lesson-list-com">
<view class="lesson-list-all" v-for="(item ,i) in list " :key="i">
<view class="split-bot"></view>
<view class="directory-list">
<view :class="['index',(playAudioId==item.audioId && globalCourseId==courseId)?'colorOrange':'index']"
@click="toDetail(item)" v-if="i+1 < 10">
0{{i+1}}
</view>
<view :class="['index',(playAudioId==item.audioId && globalCourseId==courseId)?'colorOrange':'index']"
@click="toDetail(item)" v-else>
{{i+1}}
</view>
<view class="title-view" @click="toDetail(item)">
<view
:class="['two-line',(playAudioId==item.audioId && globalCourseId==courseId)?'colorOrange':'title']">
{{item.title}}
</view>
</view>
<view class="status-view" v-else>
<image v-if="(playAudioId==item.audioId && globalCourseId==courseId)"
src="../../static/img/play/detailPlaying.png" mode="aspectFit"></image>
<image v-else @click="toPlay(item)" src="../../static/img/play/detailPlay.png" mode="aspectFit">
</image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
list: [],
lessonDetail: {},
playBtn: {
type: String,
default: 'play'
},
courseId: {
type: Number,
default: 0
}
},
data() {
return {
};
},
computed: {
uni-app开发的微信小程序里使用vuex,在IOS系统中,vuex的数据更新了,但是IOS页面上的数据没有更新,安卓手机是正常的
playAudioId() {
return this.$store.state.playAudioId;
},
globalCourseId() {
return this.$store.state.courseId
}
},
methods: {
}
}
</script>
复现步骤:使用iPhone13及13以上扫描上方二维码,点击到课程详情,随便选择播放一个音频,跳转到播放页面,点击左上角返回到课程详情页,换一个音频播放,音频详情没有变。(音频数据是存在vuex里面的)