修复我的喜欢跳转视频详情进去走的历史记录问题,公共配置全部放到store/common.js下
This commit is contained in:
@@ -158,6 +158,7 @@
|
||||
useCommonStore
|
||||
} from '@/store/common.js'
|
||||
const $common = useCommonStore()
|
||||
|
||||
// #ifdef APP
|
||||
const domModule = uni.requireNativePlugin('dom')
|
||||
// #endif
|
||||
@@ -191,6 +192,14 @@
|
||||
[]
|
||||
}
|
||||
},
|
||||
options:{
|
||||
tpye: Object,
|
||||
default: () => {
|
||||
return {
|
||||
courseDetailsId:''
|
||||
}
|
||||
}
|
||||
},
|
||||
isCommand: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -510,13 +519,15 @@
|
||||
|
||||
|
||||
function init() {
|
||||
if (JSON.stringify(props.current) !== '{}') {
|
||||
let item=props.list.find(v=>props.options.courseDetailsId==v.courseDetailsId)
|
||||
item=item?item:props.info.current;
|
||||
if (JSON.stringify(item) !== '{}') {
|
||||
// #ifdef H5
|
||||
setVideoList(props.info.current)
|
||||
setVideoList(item)
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
nextTick(() => {
|
||||
const index = props.list.findIndex(v => v.courseDetailsId == props.info.current.courseDetailsId)
|
||||
const index = props.list.findIndex(v => v.courseDetailsId ==item.courseDetailsId)
|
||||
goListPosition(index)
|
||||
})
|
||||
// #endif
|
||||
@@ -558,6 +569,13 @@
|
||||
courseId: item.courseId,
|
||||
courseDetailsId: item.courseDetailsId,
|
||||
type: item.isGood ? 1 : 0
|
||||
}).then(res=>{
|
||||
if(res){
|
||||
uni.showToast({
|
||||
title:'操作成功!',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user