Compare commits
2 Commits
50bc02a178
...
aa4e006b00
Author | SHA1 | Date |
---|---|---|
king | aa4e006b00 | 1 year ago |
king | 358c3ee95c | 1 year ago |
@ -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 |
After Width: | Height: | Size: 478 B |
After Width: | Height: | Size: 690 B |
Loading…
Reference in new issue