lex %!s(int64=2) %!d(string=hai) anos
pai
achega
2288431e08
Modificáronse 2 ficheiros con 44 adicións e 34 borrados
  1. 3 3
      src/router/index.ts
  2. 41 31
      src/student/music-group/pre-apply/index.tsx

+ 3 - 3
src/router/index.ts

@@ -1,5 +1,5 @@
 import { browser } from '@/helpers/utils'
-import { Dialog } from 'vant'
+import { showDialog } from 'vant'
 import { createRouter, createWebHashHistory, createWebHistory, Router } from 'vue-router'
 import { postMessage } from '@/helpers/native-message'
 import routesTeacher from './routes-teacher'
@@ -52,9 +52,9 @@ router.onError((error) => {
     console.log(error)
     if (isChunkLoadFailed && !isOpen) {
       isOpen = true
-      Dialog.alert({
+      showDialog({
         title: '更新提示',
-        message: 'APP有更新请点击确定刷新页面?',
+        message: 'APP有更新请点击确定刷新页面',
         confirmButtonColor: 'var(--van-primary)'
       }).then(() => {
         // on close

+ 41 - 31
src/student/music-group/pre-apply/index.tsx

@@ -107,18 +107,18 @@ export default defineComponent({
         }
 
         // 判断是否有openId 并且 purchase
-        if (!data.openId && !data.purchase) {
-          if (browser().weixin) {
-            // 微信公众号支付
-            //授权
-            const code = getUrlCode()
-            if (!code) {
-              // goAuth(data.wxAppId)
-            } else {
-              state.code = code
-            }
-          }
-        }
+        // if (!data.openId && !data.purchase) {
+        //   if (browser().weixin) {
+        //     // 微信公众号支付
+        //     //授权
+        //     const code = getUrlCode()
+        //     if (!code) {
+        //       goAuth(data.wxAppId)
+        //     } else {
+        //       state.code = code
+        //     }
+        //   }
+        // }
       } catch {
         //
       }
@@ -159,25 +159,35 @@ export default defineComponent({
       }
     }
 
-    // 先请求接口
-    getRegisterStatus()
-
-    onMounted(() => {
-      // state.code = route.query.code || ''
-      // const { height } = useRect(bannerRef.value)
-      // state.heightV = height
-      // 判断是否是微信,只能微信中打开
-      // if (browser().weixin) {
-      //   // 微信公众号支付
-      //   //授权
-      //   const code = getUrlCode()
-      //   if (!code || !state.code) {
-      //     getAppIdAndCode()
-      //   } else {
-      //     state.code = code
-      //   }
-      // }
-    })
+    // 先请求接口 判断是否有code
+    if (browser().weixin) {
+      // 微信公众号支付
+      //授权
+      const code = getUrlCode()
+      if (!code) {
+        getAppIdAndCode()
+      } else {
+        state.code = code
+        getRegisterStatus()
+      }
+    }
+
+    // onMounted(() => {
+    // state.code = route.query.code || ''
+    // const { height } = useRect(bannerRef.value)
+    // state.heightV = height
+    // 判断是否是微信,只能微信中打开
+    // if (browser().weixin) {
+    //   // 微信公众号支付
+    //   //授权
+    //   const code = getUrlCode()
+    //   if (!code || !state.code) {
+    //     getAppIdAndCode()
+    //   } else {
+    //     state.code = code
+    //   }
+    // }
+    // })
     return () => (
       <div class={styles.preApply}>
         <div class={styles.banner} ref={bannerRef}>