Browse Source

🎈 perf: 优化若干内容

Pchen. 10 months ago
parent
commit
deeccf4521
3 changed files with 31 additions and 11 deletions
  1. BIN
      public/background.webm
  2. 1 1
      src/pages/Main/Main.vue
  3. 30 10
      src/pages/lepao/accountList/index.vue

BIN
public/background.webm


+ 1 - 1
src/pages/Main/Main.vue

@@ -2,7 +2,7 @@
     <div id="section1" class="section root">
     <div id="section1" class="section root">
         <div class="videocontainer">
         <div class="videocontainer">
             <video class="fullscreenvideo" playsinline="" autoplay="" muted="" loop=""
             <video class="fullscreenvideo" playsinline="" autoplay="" muted="" loop=""
-                src="https://lepao-cloud.xxoo365.top/down.php/4f73ff78996ee4520b24e8044eeeeec5.webm" type="video/mp4" />
+                src="/background.webm" type="video/mp4" />
             <div class="overlay" />
             <div class="overlay" />
         </div>
         </div>
         <Header color="white" />
         <Header color="white" />

+ 30 - 10
src/pages/lepao/accountList/index.vue

@@ -190,7 +190,7 @@
         <a-input v-model="form.student_num" placeholder="账号所有者学号,填写错误将无法登录" />
         <a-input v-model="form.student_num" placeholder="账号所有者学号,填写错误将无法登录" />
       </a-form-item>
       </a-form-item>
       <a-form-item field="email" label="通知邮箱">
       <a-form-item field="email" label="通知邮箱">
-        <a-input v-model="form.email" placeholder="用于接收乐跑失败、登录失效的通知" />
+        <a-auto-complete :data="email" @search="handleSearch" v-model="form.email" placeholder="用于接收乐跑失败、登录失效的通知" />
       </a-form-item>
       </a-form-item>
       <a-form-item field="area" label="乐跑跑区">
       <a-form-item field="area" label="乐跑跑区">
         <a-select v-model="form.area" placeholder="请选择乐跑跑区" default-value="">
         <a-select v-model="form.area" placeholder="请选择乐跑跑区" default-value="">
@@ -227,13 +227,41 @@
 
 
 <script setup>
 <script setup>
 import { ref, reactive, h } from 'vue'
 import { ref, reactive, h } from 'vue'
-import { useUserStore } from '@/store/modules/user'
 import { accountList, deleteAccount, addAccount, changeAutoRun, singleRun } from '@/api/lepao'
 import { accountList, deleteAccount, addAccount, changeAutoRun, singleRun } from '@/api/lepao'
 import { Modal, Notification, Message } from '@arco-design/web-vue'
 import { Modal, Notification, Message } from '@arco-design/web-vue'
 import { IconSearch } from '@arco-design/web-vue/es/icon'
 import { IconSearch } from '@arco-design/web-vue/es/icon'
 import userCard from '@/components/userCard/userCard.vue'
 import userCard from '@/components/userCard/userCard.vue'
 import { isElectron } from '@/utils/electron'
 import { isElectron } from '@/utils/electron'
 
 
+const email = ref([])
+const handleSearch = (value) => {
+  const emailSuffix = ["qq.com", "ctbu.edu.cn"]
+  const input = (value || "").trim()
+
+  if (!input) {
+    email.value = []
+    return
+  }
+
+  // 没有输入 @,直接拼接所有后缀
+  if (!input.includes("@")) {
+    email.value = emailSuffix.map(suffix => `${input}@${suffix}`)
+    return
+  }
+
+  // 输入了 @ 但结尾是 @,拼接所有后缀
+  if (input.endsWith("@")) {
+    email.value = emailSuffix.map(suffix => `${input}${suffix}`)
+    return
+  }
+
+  // 输入了 @ 且有部分后缀,智能匹配
+  const [prefix, suffixPart] = input.split("@")
+  email.value = emailSuffix
+    .filter(suffix => suffix.startsWith(suffixPart))
+    .map(suffix => `${prefix}@${suffix}`)
+}
+
 const area = ["兰花湖校区跑区", "主校区北跑区", "主校区南跑区"]
 const area = ["兰花湖校区跑区", "主校区北跑区", "主校区南跑区"]
 const distance = [
 const distance = [
   { label: '女生(1.6~2Km)', value: [1.60, 2.00] },
   { label: '女生(1.6~2Km)', value: [1.60, 2.00] },
@@ -254,13 +282,6 @@ const autoTimeLabel = (val) => {
 const data = ref([])
 const data = ref([])
 const loading = ref(false)
 const loading = ref(false)
 
 
-const email = ref('')
-const getuser = async () => {
-  const userStore = useUserStore()
-  let userInfo = await userStore.getInfo()
-  email.value = userInfo.email
-}
-
 const visible = ref(false)
 const visible = ref(false)
 const ok_loading = ref(false)
 const ok_loading = ref(false)
 const form = reactive({
 const form = reactive({
@@ -439,7 +460,6 @@ const stramptoTime = (time) => {
 }
 }
 
 
 getAccounts()
 getAccounts()
-getuser()
 </script>
 </script>
 
 
 <style scoped lang="less">
 <style scoped lang="less">