使用uni.loading进行加载提示
This commit is contained in:
parent
b5ef305654
commit
b68be4a41b
|
|
@ -2,7 +2,7 @@
|
||||||
export const DEV_CONFIG = {
|
export const DEV_CONFIG = {
|
||||||
// 临时token,用于开发测试
|
// 临时token,用于开发测试
|
||||||
TEMP_TOKEN:
|
TEMP_TOKEN:
|
||||||
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjIwZGUwMWIxLTYyZTMtNDZiNi04ZDY2LWM5MGNkMzk0MzBkZSJ9.3XuGxoM7Q4sQBt7UJXYgHG_FWI88unIsvq7ni-Jg5_UDpgjLa7SaM-ZDIgWQw73r-Jrs37g5ubahxTa8aiZTkA',
|
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjViMTMzOTU5LWRkOGYtNDUwZS1hNDNmLTQyNTZmNzljNjU4YyJ9.vEal-nq4biYni9F3YhBr6pt6mEepOYFQzlSeERQ-Ft_YejklpzmjhvIF9nO3PkjS7F5ns4unIUt8Ov0JEWnY2Q',
|
||||||
|
|
||||||
// 是否使用临时token
|
// 是否使用临时token
|
||||||
USE_TEMP_TOKEN: true,
|
USE_TEMP_TOKEN: true,
|
||||||
|
|
|
||||||
|
|
@ -341,9 +341,12 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('续费数据:', renewData)
|
console.log('续费数据:', renewData)
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在生成续费订单',
|
||||||
|
mask: 'true',
|
||||||
|
})
|
||||||
const response = await renewDevice(renewData)
|
const response = await renewDevice(renewData)
|
||||||
|
uni.hideLoading()
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
const wxpPayParams = data.payParams
|
const wxpPayParams = data.payParams
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,6 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uv-popup>
|
</uv-popup>
|
||||||
<uv-toast ref="toast"></uv-toast>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -481,15 +480,20 @@ export default {
|
||||||
content: `确认支付 ¥${this.payAmount} 吗?\n\n${this.formData.quantity}台${this.formData.equipment}\n周期:${this.formData.period}`,
|
content: `确认支付 ¥${this.payAmount} 吗?\n\n${this.formData.quantity}台${this.formData.equipment}\n周期:${this.formData.period}`,
|
||||||
success: async res => {
|
success: async res => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
this.$refs.toast.show({
|
// this.$refs.toast.show({
|
||||||
type: 'loading',
|
// type: 'loading',
|
||||||
message: '正在提交订单中...',
|
// message: '正在提交订单中...',
|
||||||
overlay: true, // 启用遮罩
|
// overlay: true, // 启用遮罩
|
||||||
duration: 10000,
|
// duration: 10000,
|
||||||
|
// })
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在生成订单',
|
||||||
|
mask: 'true',
|
||||||
})
|
})
|
||||||
// 这里可以调用支付API
|
// 这里可以调用支付API
|
||||||
const response = await createLeaseOrder(this.formData)
|
const response = await createLeaseOrder(this.formData)
|
||||||
this.$refs.toast.hide()
|
// this.$refs.toast.hide()
|
||||||
|
uni.hideLoading()
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
console.log(data)
|
console.log(data)
|
||||||
|
|
@ -520,7 +524,7 @@ export default {
|
||||||
fail: function (res) {
|
fail: function (res) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付失败',
|
title: '支付失败',
|
||||||
icon: 'fail',
|
icon: 'error',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
complete: function (res) {
|
complete: function (res) {
|
||||||
|
|
|
||||||
|
|
@ -79,10 +79,11 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { wxLogin } from '@/api/auth/auth.js'
|
import { wxLogin } from '@/api/auth/auth.js'
|
||||||
import { forceHideLoading } from '@/utils/request.js'
|
// import { forceHideLoading } from '@/utils/request.js'
|
||||||
import { getServiceTerms, getPrivacyPolicy } from '@/api/article/article.js'
|
import { getServiceTerms, getPrivacyPolicy } from '@/api/article/article.js'
|
||||||
import { commonEnum } from '../../enum/commonEnum'
|
import { commonEnum } from '../../enum/commonEnum'
|
||||||
import { getNavBarHeight, getTitleBarHeight } from '../../utils/system'
|
import { getNavBarHeight, getTitleBarHeight } from '../../utils/system'
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -121,7 +122,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
onUnload() {
|
onUnload() {
|
||||||
forceHideLoading()
|
// forceHideLoading()
|
||||||
if (this.pageLoading) {
|
if (this.pageLoading) {
|
||||||
this.pageLoading.destroy()
|
this.pageLoading.destroy()
|
||||||
}
|
}
|
||||||
|
|
@ -227,7 +228,7 @@ export default {
|
||||||
|
|
||||||
async Login() {
|
async Login() {
|
||||||
console.log('开始登录流程')
|
console.log('开始登录流程')
|
||||||
this.showLoading()
|
// this.showLoading()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 1. 未同意显示协议确认弹窗
|
// 1. 未同意显示协议确认弹窗
|
||||||
|
|
@ -235,6 +236,10 @@ export default {
|
||||||
const confirmed = await this.showLoginConfirmation()
|
const confirmed = await this.showLoginConfirmation()
|
||||||
if (!confirmed) return
|
if (!confirmed) return
|
||||||
}
|
}
|
||||||
|
uni.showLoading({
|
||||||
|
title: '登录中',
|
||||||
|
mask: 'true',
|
||||||
|
})
|
||||||
|
|
||||||
// 2. 获取微信登录code
|
// 2. 获取微信登录code
|
||||||
const wxCode = await this.getWxLoginCode()
|
const wxCode = await this.getWxLoginCode()
|
||||||
|
|
@ -242,25 +247,27 @@ export default {
|
||||||
// 3. 执行登录请求
|
// 3. 执行登录请求
|
||||||
const loginResult = await this.executeLogin(wxCode)
|
const loginResult = await this.executeLogin(wxCode)
|
||||||
|
|
||||||
|
uni.hideLoading()
|
||||||
|
|
||||||
// 4. 处理登录成功
|
// 4. 处理登录成功
|
||||||
this.handleLoginSuccess(loginResult)
|
this.handleLoginSuccess(loginResult)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.handleLoginError(error)
|
this.handleLoginError(error)
|
||||||
} finally {
|
} finally {
|
||||||
this.hideLoading()
|
// this.hideLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 显示加载状态
|
// 显示加载状态
|
||||||
showLoading() {
|
// showLoading() {
|
||||||
this.pageLoading?.show('登录中...')
|
// this.pageLoading?.show('登录中...')
|
||||||
},
|
// },
|
||||||
|
|
||||||
// 隐藏加载状态
|
// 隐藏加载状态
|
||||||
hideLoading() {
|
// hideLoading() {
|
||||||
this.pageLoading?.hide()
|
// this.pageLoading?.hide()
|
||||||
forceHideLoading()
|
// forceHideLoading()
|
||||||
},
|
// },
|
||||||
|
|
||||||
// 显示登录确认弹窗
|
// 显示登录确认弹窗
|
||||||
showLoginConfirmation() {
|
showLoginConfirmation() {
|
||||||
|
|
|
||||||
|
|
@ -81,15 +81,12 @@ export default {
|
||||||
async getshuaxin() {
|
async getshuaxin() {
|
||||||
try {
|
try {
|
||||||
// 显示加载Toast(30秒超时自动隐藏)
|
// 显示加载Toast(30秒超时自动隐藏)
|
||||||
this.$refs.toast.show({
|
uni.showLoading({
|
||||||
type: 'loading',
|
title: '正在刷新实名信息',
|
||||||
message: '正在刷新实名信息...',
|
mask: 'true',
|
||||||
overlay: true,
|
|
||||||
duration: 30000,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const res = await refreshRealName()
|
const res = await refreshRealName()
|
||||||
this.$refs.toast.hide()
|
uni.hideLoading()
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.handleRefreshSuccess(res.data)
|
this.handleRefreshSuccess(res.data)
|
||||||
|
|
@ -97,7 +94,7 @@ export default {
|
||||||
this.handleRefreshFail(res.msg || '人脸认证失败')
|
this.handleRefreshFail(res.msg || '人脸认证失败')
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$refs.toast.hide()
|
uni.hideLoading()
|
||||||
this.handleRefreshFail(error.message || '网络异常')
|
this.handleRefreshFail(error.message || '网络异常')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,29 @@
|
||||||
|
<template>
|
||||||
|
<view @click="open()">123</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: 'https://api.ccttiot.com/安装协议(准备好)-1757570264575.pdf',
|
||||||
|
success: function (res) {
|
||||||
|
var filePath = res.tempFilePath
|
||||||
|
uni.openDocument({
|
||||||
|
filePath: filePath,
|
||||||
|
showMenu: true,
|
||||||
|
success: function (res) {},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss"></style>
|
||||||
<!--<template>-->
|
<!--<template>-->
|
||||||
<!-- <view style="width: 750rpx; height: 750rpx">-->
|
<!-- <view style="width: 750rpx; height: 750rpx">-->
|
||||||
<!-- <l-signature-->
|
<!-- <l-signature-->
|
||||||
|
|
@ -64,29 +90,3 @@
|
||||||
<!--}-->
|
<!--}-->
|
||||||
<!--</script>-->
|
<!--</script>-->
|
||||||
<!--<style lang="scss"></style>-->
|
<!--<style lang="scss"></style>-->
|
||||||
<template>
|
|
||||||
<view @click="open()">123</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
open() {
|
|
||||||
uni.downloadFile({
|
|
||||||
url: 'https://api.ccttiot.com/安装协议(准备好)-1757570264575.pdf',
|
|
||||||
success: function (res) {
|
|
||||||
var filePath = res.tempFilePath
|
|
||||||
uni.openDocument({
|
|
||||||
filePath: filePath,
|
|
||||||
showMenu: true,
|
|
||||||
success: function (res) {},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss"></style>
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ const ENV_CONFIG = {
|
||||||
release: {
|
release: {
|
||||||
// 正式版
|
// 正式版
|
||||||
// baseUrl: 'https://chu.chuangtewl.com/prod-api',
|
// baseUrl: 'https://chu.chuangtewl.com/prod-api',
|
||||||
// baseUrl: 'http://192.168.2.88:4601',
|
// baseUrl: 'http://192.168.2.21:4601',
|
||||||
baseUrl: 'http://192.168.2.21:4601',
|
baseUrl: 'http://192.168.2.21:4601',
|
||||||
appId: 1,
|
appId: 1,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user