Browse Source

对接H5支付

master
梁欣 1 year ago
parent
commit
32a8bde331
  1. 27
      pages/user/settled/index.vue

27
pages/user/settled/index.vue

@ -713,7 +713,25 @@ import * as YinhangApi from '@/api/shop/yinhang'
import * as InfoApi from '@/api/shop/info' import * as InfoApi from '@/api/shop/info'
import * as Api from '@/api/page' import * as Api from '@/api/page'
import store from '@/store' import store from '@/store'
import storage from '@/utils/storage'
import {
ACCESS_TOKEN,
USER_ID
} from '@/store/mutation-types'
const loginSuccess = (commit, {
token,
userId
}) => {
// 30
const expiryTime = 30 * 86400
// tokneuserId
storage.set(USER_ID, userId, expiryTime)
storage.set(ACCESS_TOKEN, token, expiryTime)
// store
commit('SET_TOKEN', token)
commit('SET_USER_ID', userId)
}
export default { export default {
data() { data() {
return { return {
@ -798,8 +816,10 @@ export default {
var systemInfo = graceJS.system(); var systemInfo = graceJS.system();
this.contentHeight = systemInfo.windowHeight * 0.65; this.contentHeight = systemInfo.windowHeight * 0.65;
}, },
async onLoad() {
await this.getUserInfo()
async onLoad(options) {
if (options.token) {
await this.getUserInfo(options.id, options.token)
}
this.getDetail() this.getDetail()
this.getCategory() this.getCategory()
@ -813,6 +833,7 @@ export default {
store.dispatch('Login', { store.dispatch('Login', {
mobile: result.data.mobile mobile: result.data.mobile
}) })
loginSuccess(token, id)
resolve() resolve()
}) })
}) })

Loading…
Cancel
Save