修改收藏bug
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<view class="item" :class="getStatusClass(item.isFinish)" @click="click_item(item)">
|
||||
<view class="img_div">
|
||||
<image-preview class="img" :src="item.ossAddr" mode="scaleToFill"></image-preview>
|
||||
<view class="subscript" v-if="item.isFinish === '00'">未完成</view>
|
||||
<view class="subscript" v-if="item.isFinish === '01'">已完成</view>
|
||||
<view class="subscript" v-if="item.isFinish === '02'">已完成</view>
|
||||
<view class="subscript" v-else>未完成</view>
|
||||
</view>
|
||||
<view class="right_div">
|
||||
<view class="title ellipsis-text">
|
||||
|
||||
@@ -211,7 +211,8 @@
|
||||
getData();
|
||||
// 监听里面学习完成后更新任务历程
|
||||
uni.$on('refresh_course_list', () => {
|
||||
console.log('监听里面学习完成后更新任务历程');
|
||||
console.log('详情监听里面学习完成后更新任务历程');
|
||||
getData();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<script setup>
|
||||
import { LineBg } from '@/enum.js';
|
||||
import content from './components/content.vue';
|
||||
import { onLoad, onUnload } from '@dcloudio/uni-app';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import common from '@/common/common.js';
|
||||
const listItemRefs = ref([]);
|
||||
@@ -69,7 +70,7 @@
|
||||
const search = (value) => {
|
||||
listItemRefs.value[tabAct.value]?.search(value);
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
watch(
|
||||
tabAct,
|
||||
@@ -82,6 +83,21 @@
|
||||
}
|
||||
); // 这里的immediate会在onMounted之后执行
|
||||
});
|
||||
|
||||
onLoad(() => {
|
||||
uni.$on('refresh_course_list', (crsId) => {
|
||||
console.log('列表监听里面学习完成后更新任务历程', crsId);
|
||||
queryAllTraTaskIUserId({crsId}).then(res => {
|
||||
const index = listItemRefs
|
||||
typeof listItemRefs.value[newValue]?.getData === 'function' &&
|
||||
listItemRefs.value[newValue]?.getData('first');
|
||||
})
|
||||
|
||||
});
|
||||
});
|
||||
onUnload(() => {
|
||||
uni.$off('refresh_course_list');
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user