bayi 1 tahun lalu
induk
melakukan
958adc1873

+ 3 - 2
pages/my/gzh/index.js

@@ -4,7 +4,7 @@ import {
 Component({
     data: {
         show: false,
-        qrCode:''
+        qrCode: ''
     },
     methods: {
         async open() {
@@ -14,7 +14,8 @@ Component({
                 mask: true
             })
             this.setData({
-                show: true
+                show: true,
+                qrCode: res.ticketUrl
             })
         },
         closeModal() {

+ 6 - 1
pages/my/gzh/index.less

@@ -11,7 +11,7 @@
     background: rgba(0, 0, 0, 0.7);
 
     .modal {
-        margin-top: 300rpx;
+        margin-top: 400rpx;
         width: 600rpx;
         height: 680rpx;
         background: url(https://reader-wx.ai160.com/images/reader/v3/bianzu73.png)no-repeat;
@@ -19,6 +19,11 @@
         border-radius: 20rpx;
         text-align: center;
 
+        .qrCode {
+            margin: 220rpx auto;
+            width: 342rpx;
+            height: 342rpx;
+        }
     }
 
     .close {

+ 6 - 1
pages/my/gzh/index.wxss

@@ -11,7 +11,7 @@
   background: rgba(0, 0, 0, 0.7);
 }
 .activationModal .modal {
-  margin-top: 300rpx;
+  margin-top: 400rpx;
   width: 600rpx;
   height: 680rpx;
   background: url(https://reader-wx.ai160.com/images/reader/v3/bianzu73.png) no-repeat;
@@ -19,6 +19,11 @@
   border-radius: 20rpx;
   text-align: center;
 }
+.activationModal .modal .qrCode {
+  margin: 220rpx auto;
+  width: 342rpx;
+  height: 342rpx;
+}
 .activationModal .close {
   padding: 40rpx;
   width: 54rpx;

+ 30 - 19
小咖秀公众号支付/index.html

@@ -110,33 +110,44 @@
       </div>
     </div>
   </body>
-  <script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
+  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.13/vue.js"></script>
   <script src="https://g.tbcdn.cn/mtb/lib-flexible/0.3.2/??flexible_css.js,flexible.js"></script>
   <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.min.js"></script>
   <script>
-    let xhr = new XMLHttpRequest()
-
     let app = new Vue({
       el: '#container',
       data: {
         products: [],
         product: {},
-        active: ''
+        active: '',
+        code: ''
       },
       mounted() {
-        axios({
-          method: 'get',
-          url: 'https://reader-api.efunbox.cn/wx/v3/product/learn',
-          headers: {
-            uid: 'd83d947655f6455a96f4197d31afa6d4',
-            channelCode: '3001'
-          }
-        }).then(res => {
-          this.products = res.data.data.productList
-          console.log(this.products)
-          this.active = res.data.data.productList[0].id
-          this.product = res.data.data.productList[0]
-        })
+        // 原始URL
+        var url = location.search
+        // 创建URLSearchParams对象
+        console.log(url, 'zzzzzzzzzzzzzzzzz')
+        var searchParams = new URLSearchParams(url)
+        // 获取code参数的值
+        var code = searchParams.get('code')
+        console.log(searchParams, '=======', code) // 输出:021gINll25JRUb49AYll2au8ga0gINl-
+        if (code) {
+          this.code = code
+          axios({
+            method: 'get',
+            url: 'https://reader-api.efunbox.cn/wx/v3/product/learn',
+            headers: {
+              uid: 'd83d947655f6455a96f4197d31afa6d4',
+              channelCode: '3001'
+            }
+          }).then(res => {
+            this.products = res.data.data.productList
+            this.active = res.data.data.productList[0].id
+            this.product = res.data.data.productList[0]
+          })
+        } else {
+          this.getWxCode()
+        }
       },
       methods: {
         selected(e) {
@@ -187,8 +198,8 @@
           })
         },
         getWxCode() {
-          const appId = 'wx35303262fa755a18'
-          const redirect_uri = encodeURIComponent('https://zxtx-web.efunbox.cn/login')
+          const appId = 'wxf05800eea975a68b'
+          const redirect_uri = encodeURIComponent('https://h5-pay.ai160.com/reader-ios')
           const url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appId + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_base#wechat_redirect'
           location.href = url
         }