parent
50bc02a178
commit
358c3ee95c
@ -1,5 +1,5 @@ |
||||
TARO_APP_API=https://yjx.dev.yaojiankang.top |
||||
#TARO_APP_API=https://mooc.yaojiankang.top |
||||
#TARO_APP_API=https://yjx.dev.yaojiankang.top |
||||
TARO_APP_API=https://mooc.yaojiankang.top |
||||
#TARO_APP_API=https://shopfix.yaojiankang.top |
||||
#TARO_APP_API=https://playedu.yaojiankang.top |
||||
TARO_APP_LGOIN=true |
||||
|
@ -0,0 +1,28 @@ |
||||
import Taro from "@tarojs/taro"; |
||||
|
||||
const KEY = 'VIDEO_EVENTS' |
||||
|
||||
interface Data { |
||||
id: number |
||||
view: number |
||||
} |
||||
|
||||
function videoAdd(data: Data) { |
||||
Taro.eventCenter.trigger(KEY + data.id, data) |
||||
} |
||||
|
||||
function videoOn(id: number, fn: (data: Data) => void) { |
||||
Taro.eventCenter.on(KEY + id, fn) |
||||
} |
||||
|
||||
function off(id: number) { |
||||
Taro.eventCenter.off(KEY + id) |
||||
} |
||||
|
||||
const VideoEvent = { |
||||
videoAdd, |
||||
videoOn, |
||||
off |
||||
} |
||||
|
||||
export default VideoEvent |
Loading…
Reference in new issue