瀏覽代碼

静态页面

xcx 4 年之前
父節點
當前提交
87bdd10006
共有 2 個檔案被更改,包括 16 行新增21 行删除
  1. 1
    0
      index.html
  2. 15
    21
      src/pages/WoDe/ZhiFuBaoRenZheng/index.vue

+ 1
- 0
index.html 查看文件

@@ -7,6 +7,7 @@
7 7
   <meta name="referrer" content="no-referrer">
8 8
   <link rel="stylesheet" href="//at.alicdn.com/t/font_2039339_np6ovj5y28g.css">
9 9
   <script src="//api.map.baidu.com/api?v=2.0&ak=NH4DjAzwLcPkHgwBLWcfeZfr3uUnTlwk"></script>
10
+  <script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.min.js"></script>
10 11
   <title>牛彩</title>
11 12
   <script>
12 13
     let Width = document.documentElement.clientWidth / 375 * 100

+ 15
- 21
src/pages/WoDe/ZhiFuBaoRenZheng/index.vue 查看文件

@@ -113,7 +113,7 @@
113 113
 
114 114
         </div>
115 115
         <div class="Content" v-if="UserInfo !== null && !UserInfo.isValidAli">
116
-          <a class="AliShouQuan centerLabel">支付宝授权</a>
116
+          <a class="AliShouQuan centerLabel" @click="ShouQuan">支付宝授权</a>
117 117
         </div>
118 118
       </div>
119 119
     </MainPageContainer>
@@ -128,6 +128,7 @@ export default {
128 128
   name: 'index',
129 129
   data () {
130 130
     return {
131
+      DataLock: false,
131 132
       Timer: null
132 133
     }
133 134
   },
@@ -153,28 +154,21 @@ export default {
153 154
     ...mapUserActions([
154 155
       'GetAliAppId'
155 156
     ]),
157
+    ShouQuan () {
158
+      this.GetAliAppId().then((res) => {
159
+        console.log(111)
160
+        window.ap.getAuthCode({
161
+          appId: res.data.data,
162
+          scopes: ['auth_base'],
163
+          showErrorTip: true
164
+        }, (subRes) => {
165
+          console.log(subRes, 222)
166
+        })
167
+      })
168
+    },
156 169
     UserInfoChange () {
157 170
       if (this.UserInfo !== null && !this.UserInfo.isValidAli) {
158
-        let HtmlHead = document.getElementsByTagName('head')[0]
159
-        let Script = document.createElement('script')
160
-        Script.src = 'https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.min.js'
161
-        HtmlHead.appendChild(Script)
162
-        window.clearInterval(this.Timer)
163
-        this.Timer = window.setInterval(() => {
164
-          if (window.ap) {
165
-            window.clearInterval(this.Timer)
166
-            this.GetAliAppId().then((res) => {
167
-              document.getElementsByClassName('AliShouQuan')[0].addEventListener('click', () => {
168
-                window.ap.getAuthCode({
169
-                  appId: res.data.data,
170
-                  scopes: ['auth_base']
171
-                }, (subRes) => {
172
-                  console.log(subRes)
173
-                })
174
-              })
175
-            })
176
-          }
177
-        }, 100)
171
+
178 172
       }
179 173
     },
180 174
     Refresh (done) { // 页面下拉刷新