Commit c407dd89 authored by Damon's avatar Damon

feat: 接口加载动画

parent 6b2e55e9
...@@ -193,7 +193,11 @@ export default { ...@@ -193,7 +193,11 @@ export default {
orders: JSON.stringify(this.lists), orders: JSON.stringify(this.lists),
openId: this.openId, openId: this.openId,
} }
uni.showLoading({
title: '加载中'
})
this.$u.api.payOrder(data).then((res) => { this.$u.api.payOrder(data).then((res) => {
uni.hideLoading()
this.pay(res) this.pay(res)
}) })
}, },
...@@ -223,7 +227,11 @@ export default { ...@@ -223,7 +227,11 @@ export default {
const params = { const params = {
outTradeNo: no, outTradeNo: no,
} }
uni.showLoading({
title: '支付中'
})
this.$u.api.payQuery(params).then((res) => { this.$u.api.payQuery(params).then((res) => {
uni.hideLoading()
if (res.trade_state === 'SUCCESS') { if (res.trade_state === 'SUCCESS') {
this.$u.toast('支付成功') this.$u.toast('支付成功')
} else if (res.trade_state === 'NOTPAY') { } else if (res.trade_state === 'NOTPAY') {
......
...@@ -104,7 +104,11 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) { ...@@ -104,7 +104,11 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
source: vm.source source: vm.source
} }
} }
uni.showLoading({
title: '加载中'
})
vm.$u.api.getQuestion(params).then(res => { vm.$u.api.getQuestion(params).then(res => {
uni.hideLoading()
const list = res.records const list = res.records
let data = {} let data = {}
data.total = res.total data.total = res.total
......
...@@ -37,7 +37,11 @@ export default { ...@@ -37,7 +37,11 @@ export default {
avatar: userInfo.avatarUrl, avatar: userInfo.avatarUrl,
nickname: userInfo.nickName, nickname: userInfo.nickName,
} }
uni.showLoading({
title: '加载中'
})
this.$u.api.loginWechatAuth(data).then((res) => { this.$u.api.loginWechatAuth(data).then((res) => {
uni.hideLoading()
this.$u.vuex('vuex_token', res.token) this.$u.vuex('vuex_token', res.token)
this.$u.vuex('openId', res.openId) this.$u.vuex('openId', res.openId)
this.$u.vuex('userInfo', userInfo) this.$u.vuex('userInfo', userInfo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment