|
@@ -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) { // 页面下拉刷新
|