Quellcode durchsuchen

Merge branch 'develop_oycj' of Server_Service/17pdf_front_end into master

ouyangchengjun vor 2 Jahren
Ursprung
Commit
0c82e5d319
5 geänderte Dateien mit 41 neuen und 15 gelöschten Zeilen
  1. 2 1
      components/LoginBar.vue
  2. 3 4
      components/RegisterBar.vue
  3. 19 8
      layouts/components/NavBar.vue
  4. 2 2
      nuxt.config.js
  5. 15 0
      pages/index.vue

+ 2 - 1
components/LoginBar.vue

@@ -38,7 +38,7 @@ export default {
   },
   computed: {
     loginBtnDisabled() {
-      return !(this.form.username && this.form.password)
+      return !(this.form.username && this.form.password && this.form.password.length >= 6)
     },
     forgetDisabled() {
       return !(this.forgetForm.account && this.forgetForm.code)
@@ -81,6 +81,7 @@ export default {
           this.$store.commit('setUser',res.result)
           localStorage.setItem('userInfo',JSON.stringify(res.result))
           this.logging = false
+          this.$emit('loginSucess')
         }
       })
     },

+ 3 - 4
components/RegisterBar.vue

@@ -62,10 +62,8 @@ export default {
           let interval = setInterval(() => {
             this.clock--
             if(this.clock === 0) {
-              this.$once('hook:beforeDestroy',()=> {
-                clearInterval(interval)
-                interval = null
-              })
+              clearInterval(interval)
+              interval = null
               this.clock = 60
               this.sending = false
             }
@@ -87,6 +85,7 @@ export default {
         if(res.code === 200) {
           this.$store.commit('setUser',res.result)
           localStorage.setItem('userInfo',JSON.stringify(res.result))
+          this.$emit('loginSucess')
         }
       })
     },

+ 19 - 8
layouts/components/NavBar.vue

@@ -3,7 +3,7 @@
  * @Author: 欧阳承珺
  * @LastEditors: 欧阳承珺
  * @Date: 2022-10-17 15:19:11
- * @LastEditTime: 2022-11-11 17:47:39
+ * @LastEditTime: 2022-11-14 19:15:50
 -->
 <template>
   <div class="h-80px flex relative z-3 justify-between px-[10%] border-b-1 border-b-[#f0f0f0] border-b-solid">
@@ -22,6 +22,8 @@
       <div v-if="!!token">
         <client-only>
           <el-popover
+            ref="popover"
+            v-model="popover"
             placement="bottom"
             trigger="hover"
             :close-delay="800"
@@ -30,7 +32,7 @@
               <div class="px-24px pt-24px min-w-300px">
                 <div class="flex pb-22px cursor-pointer" style="border-bottom: 1px solid #f0f0f0;">
                   <a href="/members/me/expenses">
-                    <img v-if="userInfo?.memberInfo.subscriberType === 1" class="w-64px rounded-1/2"  src="http://user-file.17pdf.com/avatars/2020/11/16/0577b907be980556bdafa23fb0be0732-jpg.jpg" >
+                    <img v-if="userInfo?.memberInfo?.subscriberType === 1" class="w-64px rounded-1/2"  src="http://user-file.17pdf.com/avatars/2020/11/16/0577b907be980556bdafa23fb0be0732-jpg.jpg" >
                     <img v-else class="w-64px rounded-1/2"  src="http://user-file.17pdf.com/avatars/2018/01/02/f183029426a996325853fa244e7df661-jpg.jpg" >
                   </a>
                   <div class="pl-20px">
@@ -40,13 +42,13 @@
                 </div>
                 <div class="flex py-14px mt-20px justify-between">
                   <div>
-                    <p v-if="userInfo?.memberInfo.subscriberType === 1" class="text-18px text-[#333] leading-24px">17会员</p>
+                    <p v-if="userInfo?.memberInfo?.subscriberType === 1" class="text-18px text-[#333] leading-24px">17会员</p>
                     <p v-else class="text-18px text-[#333] leading-24px">免费用户</p>
-                    <p v-if="userInfo?.memberInfo.subscriberType === 1" class="text-12px text-[#999] leading-17px">剩余<span class="text-bg-$btn-color-primary">{{userInfo?.memberInfo?.day}}</span>天到期</p>
+                    <p v-if="userInfo?.memberInfo?.subscriberType === 1" class="text-12px text-[#999] leading-17px">剩余<span class="text-bg-$btn-color-primary">{{userInfo?.memberInfo?.day}}</span>天到期</p>
                     <p v-else class="text-12px text-[#999] leading-17px">订阅会员免费格式转换</p>
                   </div>
                   <button class="btn-renew" @click="$router.push('/pricing')">
-                    {{userInfo?.memberInfo.subscriberType === 1 ? '续费' : '订阅会员'}}
+                    {{userInfo?.memberInfo?.subscriberType === 1 ? '续费' : '订阅会员'}}
                   </button>
                 </div>
                 <div class="flex py-14px my-8px justify-between" style="border-bottom: 1px solid #f0f0f0;">
@@ -64,7 +66,7 @@
                 </div>
               </div>
             </div>
-            <img v-if="!!token" slot="reference" class="w-36px h-36px rounded-full mt-23px mr-0 md-0 ml-90px cursor-pointer" :src="userInfo?.memberInfo.subscriberType === 1 ? 'https://user-file.17pdf.com/avatars/2020/11/16/0577b907be980556bdafa23fb0be0732-jpg.jpg' : 'http://user-file.17pdf.com/avatars/2018/01/02/f183029426a996325853fa244e7df661-jpg.jpg'" @click="$router.push('/members/me/expenses')" />
+            <img slot="reference" class="w-36px h-36px rounded-full mt-23px mr-0 md-0 ml-90px cursor-pointer" :src="userInfo?.memberInfo?.subscriberType === 1 ? 'https://user-file.17pdf.com/avatars/2020/11/16/0577b907be980556bdafa23fb0be0732-jpg.jpg' : 'http://user-file.17pdf.com/avatars/2018/01/02/f183029426a996325853fa244e7df661-jpg.jpg'" @click="$router.push('/members/me/expenses')" />
           </el-popover>
         </client-only>
       </div>
@@ -84,8 +86,8 @@
         :custom-class="interface === 'manage' ? 'manage-dialog': 'login-dialog'"
         @close="handlerCloseDialog"
       >
-        <login v-show="interface === 'login'" ref="loginRef"  @register="showChange" @close="handlerCloseDialog"></login>
-        <register v-show="interface === 'register'" ref="registerRef" @login="showChange" @close="handlerCloseDialog"></register>
+        <login v-show="interface === 'login'" ref="loginRef"  @register="showChange" @close="handlerCloseDialog" @loginSucess="handleLoginSucess"></login>
+        <register v-show="interface === 'register'" ref="registerRef" @login="showChange" @close="handlerCloseDialog" @loginSucess="handleLoginSucess"></register>
         <UserManage v-show="interface === 'manage'" ref="manageRef" @close="handlerCloseDialog"></UserManage>
         <BuyVip v-if="interface === 'vip'" ref="vipRef" @close="handlerCloseDialog"></BuyVip>
         <BuyTicket v-if="interface === 'ticket'" ref="ticketRef" @close="handlerCloseDialog"></BuyTicket>
@@ -114,6 +116,7 @@ export default {
   data() {
     return {
       dialogVisiable: false,
+      popover: false,
     }
   },
   computed: {
@@ -146,6 +149,14 @@ export default {
     }
   },
   methods: {
+    handleLoginSucess() {
+      this.$nextTick(()=> {
+        this.popover = true
+      })
+      setTimeout(() => {
+        this.popover = false
+      }, 2000);
+    },
     handlerOpenLogin(type) {
       this.dialogVisiable = true
       this.$store.commit('SET_INTERFACE', type)

+ 2 - 2
nuxt.config.js

@@ -3,12 +3,12 @@
  * @Author: 欧阳承珺
  * @LastEditors: 欧阳承珺
  * @Date: 2022-10-17 11:06:52
- * @LastEditTime: 2022-11-14 10:35:27
+ * @LastEditTime: 2022-11-14 13:39:34
  */
 export default {
   // Global page headers: https://go.nuxtjs.dev/config-head
   head: {
-    title: '17PDF Reader 一起阅读 - 移动端PDF阅读器 + 免费在线PDF转档',
+    title: '',
     htmlAttrs: {
       lang: 'en',
     },

+ 15 - 0
pages/index.vue

@@ -6,6 +6,21 @@ export default {
       indexActive: 1
     }
   },
+  head() {
+    return {
+      title: '17PDF Reader 一起阅读 - 移动端PDF阅读器 + 免费在线PDF转档',
+      meta: [
+        {
+          name: 'keywords',
+          content: 'PDFReader,pdfreader,17PDF Reader,pdf软件,PDF阅读器,文件扫描'
+        },
+        {
+          name: 'description',
+          content: '17PDF Reader是行走的PDF阅读器和文件扫描仪,并提供免费的PDF文件格式转换工具,支持pdf转word,pdf转doc,pdf转ppt,pdf转图片等。17PDF Reader被用户誉为“亚洲的Adobe”,拥有自主产权的PDF核心技术,为商务精英、教育族群及企业提供全方位的PDF文件解决方案。'
+        }
+      ]
+    }
+  },
   methods: {
     // elementui走马灯组件bug:item只有两个时变换的方向有问题
     // fix:多增加一份item,自定义轮播点