Procházet zdrojové kódy

支付宝购买券、会员开发完成

Darkhorsedamon před 2 roky
rodič
revize
070561b404
3 změnil soubory, kde provedl 19 přidání a 7 odebrání
  1. 2 2
      components/BuyTicket.vue
  2. 12 2
      components/BuyVip.vue
  3. 5 3
      nuxt.config.js

+ 2 - 2
components/BuyTicket.vue

@@ -3,7 +3,7 @@
  * @Author: 欧阳承珺
  * @LastEditors: 欧阳承珺
  * @Date: 2022-11-01 14:10:22
- * @LastEditTime: 2022-11-07 16:07:10
+ * @LastEditTime: 2022-11-08 16:57:28
 -->
 <template>
   <div>
@@ -153,7 +153,7 @@ export default {
       }
       this.$axios.post('subscription/create',params).then((res) => {
         if(res.code === 200) {
-          window.open(res.result.order.pagePayUrl)
+          location.href = res.result.order.pagePayUrl
         }
       }) 
     },

+ 12 - 2
components/BuyVip.vue

@@ -3,7 +3,7 @@
  * @Author: 欧阳承珺
  * @LastEditors: 欧阳承珺
  * @Date: 2022-10-31 20:41:42
- * @LastEditTime: 2022-11-07 10:53:47
+ * @LastEditTime: 2022-11-08 17:01:57
 -->
 <template>
   <div>
@@ -152,7 +152,17 @@ export default {
       })
     },
     handlePlayNow() {
-
+      const params = {
+        client: 'web',
+        payment: 0,
+        targetType: 'SetPricing',
+        targetId: this.choosedVip.id
+      }
+      this.$axios.post('subscription/create',params).then((res) => {
+        if(res.code === 200) {
+          location.href = res.result.order.pagePayUrl
+        }
+      }) 
     }
   }
 }

+ 5 - 3
nuxt.config.js

@@ -3,9 +3,11 @@
  * @Author: 欧阳承珺
  * @LastEditors: 欧阳承珺
  * @Date: 2022-10-17 11:06:52
- * @LastEditTime: 2022-11-01 16:50:24
+ * @LastEditTime: 2022-11-09 13:33:17
  */
 export default {
+  dev: process.env.NODE_ENV !== 'production',
+
   // Global page headers: https://go.nuxtjs.dev/config-head
   head: {
     title: '17PDF',
@@ -20,7 +22,7 @@ export default {
     ],
     link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
   },
-
+  
   // Global CSS: https://go.nuxtjs.dev/config-css
   css: [
     '@/assets/main.scss',
@@ -55,7 +57,7 @@ export default {
   axios: {
     timeout: 3000,
     prefix: '/17pdf-backend-core/',
-    proxy: true
+    proxy: !!dev
   },
   proxy: {
     '/17pdf-backend-core': { target: 'http://81.68.234.235:8999',}