diff --git a/.github/workflows/docker-image-ci.yml b/.github/workflows/docker-image-ci.yml index eddef18..127523a 100644 --- a/.github/workflows/docker-image-ci.yml +++ b/.github/workflows/docker-image-ci.yml @@ -2,7 +2,6 @@ name: Docker Image CI on: push: - branches: [ 'dev' ] tags: - v* @@ -38,4 +37,5 @@ jobs: push: true platforms: linux/amd64,linux/arm64 tags: | - ghcr.io/${{ github.repository_owner }}/douyin:latest \ No newline at end of file + ghcr.io/${{ github.repository_owner }}/douyin-vue:${{ steps.vars.outputs.version }} + ghcr.io/${{ github.repository_owner }}/douyin-vue:latest \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index b4f7095..99e0e98 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,4 +1,183 @@ - 123 + + + + + + + + + + + + + 切换至手机模式获取最佳体验 + 1. 按 F12 调出控制台 + 2. 按 Ctrl+Shift+M,或点击下面图标 + + + + - + + + diff --git a/src/main.ts b/src/main.ts index 43d27f6..30fba91 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,60 @@ import { createApp } from 'vue' import App from './App.vue' +import './assets/less/index.less' +import { startMock } from '@/mock' +import router from './router' +import mixin from './utils/mixin' +import VueLazyload from '@jambonn/vue-lazyload' +import { createPinia } from 'pinia' +import { useClick } from '@/utils/hooks/useClick' +import bus, { EVENT_KEY } from '@/utils/bus' +window.isMoved = false +window.isMuted = true +window.showMutedNotice = true +HTMLElement.prototype.addEventListener = new Proxy(HTMLElement.prototype.addEventListener, { + apply(target, ctx, args) { + const eventName = args[0] + const listener = args[1] + if (listener instanceof Function && eventName === 'click') { + args[1] = new Proxy(listener, { + apply(target1, ctx1, args1) { + // console.log('e', args1) + // console.log('click点击', window.isMoved) + if (window.isMoved) return + try { + return target1.apply(ctx1, args1) + } catch (e) { + console.error(`[proxyPlayerEvent][${eventName}]`, listener, e) + } + } + }) + } + return target.apply(ctx, args) + } +}) + +const vClick = useClick() +const pinia = createPinia() const app = createApp(App) +app.mixin(mixin) +const loadImage = new URL('./assets/img/icon/img-loading.png', import.meta.url).href +app.use(VueLazyload, { + preLoad: 1.3, + loading: loadImage, + attempt: 1 +}) +app.use(pinia) +app.use(router) app.mount('#app') +app.directive('click', vClick) + +//放到最后才可以使用pinia +startMock() +setTimeout(() => { + bus.emit(EVENT_KEY.HIDE_MUTED_NOTICE) + window.showMutedNotice = false +}, 2000) +bus.on(EVENT_KEY.REMOVE_MUTED, () => { + window.isMuted = false +})