Explorar el Código

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

lifanagju_citu hace 10 meses
padre
commit
b45a163d0d

+ 0 - 71
src/directives/countDown/countTimer.vue

@@ -1,71 +0,0 @@
-<template>
-  <div class="countdown-timer" v-if="!isCountdownFinished">
-    <div>{{ remainingTime }}</div>
-    <div>浏览得积分 +{{ score }}</div>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'CountdownTimer',
-  props: {
-    duration: {
-      type: Number,
-      require: true
-    },
-    onEnd: {
-      type: Function,
-      require: true
-    },
-    score: {
-      type: Number,
-      default: 100
-    }
-  },
-  data() {
-    return {
-      count: 100,
-      remainingTime: this.duration,
-      isCountdownFinished: false // 倒计时是否结束
-    }
-  },
-  mounted() {
-    this.startTimer()
-  },
-  beforeUnmount() {
-    this.stopTimer()
-  },
-  methods: {
-    startTimer() {
-      this.timer = setInterval(() => {
-        if (this.remainingTime > 0) {
-          this.remainingTime--
-          // this.count = this.count - 6.67
-        } else {
-          this.stopTimer()
-          this.isCountdownFinished = true // 设置倒计时结束状态
-          this.onEnd()
-        }
-      }, 1000)
-    },
-    stopTimer() {
-      clearInterval(this.timer)
-    }
-  }
-}
-</script>
-
-<style scoped>
-.countdown-timer {
-  position: fixed;
-  right: 20px;
-  top: 30%;
-  text-align: center;
-  transform: translateY(-50%);
-  background-color: rgba(0, 0, 0, 0.5);
-  color: white;
-  padding: 10px;
-  border-radius: 5px;
-  font-size: 16px;
-}
-</style>

+ 0 - 25
src/directives/countDown/index.js

@@ -1,25 +0,0 @@
-import { createApp } from 'vue'
-import Snackbar from '@/plugins/snackbar'
-import CountTimer from './countTimer.vue'
-
-export default {
-  mounted(el, binding) {
-    const score = binding.value;
-    const timerDuration = 15
-
-    const tempElement = document.createElement('div')
-    el.parentNode.appendChild(tempElement)
-
-    const app = createApp(CountTimer, {
-      duration: timerDuration,
-      score,
-      onEnd: () => {
-        Snackbar.success('浏览完成, 获得' + score + '积分')
-        el.parentNode.removeChild(tempElement)
-        app.unmount(tempElement)
-      }
-    })
-
-    app.mount(tempElement)
-  }
-}

+ 0 - 16
src/directives/index.js

@@ -1,16 +0,0 @@
-import showScore from './showScore'
-import countDown from './countDown'
-
-// 自定义指令
-const directives = {
-  showScore,
-  countDown
-}
-
-export default {
-  install (Vue) {
-    Object.keys(directives).forEach((key) => {
-      Vue.directive(key, directives[key])
-    })
-  }
-}

+ 0 - 13
src/directives/showScore/index.js

@@ -1,13 +0,0 @@
-import Snackbar from '@/plugins/snackbar'
-
-export default {
-  mounted(el, binding) {
-    el.addEventListener('click', () => {
-      const score = binding.value
-      Snackbar.success('恭喜您获得' + score + '积分')
-    })
-  },
-  unmounted(el) {
-    el.removeEventListener('click', () => {})
-  }
-}

+ 0 - 2
src/main.js

@@ -18,7 +18,6 @@ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' // pinia 持
 // 日期组件
 import VueDatePicker from '@vuepic/vue-datepicker';
 import '@vuepic/vue-datepicker/dist/main.css'
-import Directives from './directives'
 
 import router from './router'
 
@@ -33,7 +32,6 @@ const app = createApp(App)
 
 app.use(pinia)
 app.use(router)
-app.use(Directives)
 
 registerPlugins(app)
 app.component('VueDatePicker', VueDatePicker)

+ 1 - 1
src/router/modules/enterprise.js

@@ -200,7 +200,7 @@ const enterprise = [
         path: '/recruit/enterprise/informationManagement/informationSettings',
         meta: {
           title: '企业信息设置',
-          // isAdmin: true,
+          isAdmin: true,
           enName: 'Enterprise Information Settings'
         },
         component: () => import('@/views/recruit/enterprise/informationManagement/informationSettings.vue')