首页模态窗跳实名

This commit is contained in:
WindowBird 2025-09-12 15:17:47 +08:00
parent a4e863a872
commit a6e5f9e2da
2 changed files with 29 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import request from '@/utils/request' import request from '@/utils/request'
import { uploadFile } from '@/utils/request.js' import { uploadFile } from '@/utils/request.js'
import { exp } from 'qrcode/lib/core/galois-field'
/** /**
* 获取用户信息 * 获取用户信息
@ -233,3 +234,9 @@ export function clearLocalUserId() {
uni.removeStorageSync('userId') uni.removeStorageSync('userId')
console.log('本地用户ID已清除') console.log('本地用户ID已清除')
} }
export function getIsRealName() {
return request({
url: '/app/user/isReal',
})
}

View File

@ -59,6 +59,7 @@ import { getNewAnnouncement } from '../../api/article/article.js'
import { getBannerList } from '../../api/banner/banner.js' import { getBannerList } from '../../api/banner/banner.js'
import { getDeviceList } from '../../api/device/device.js' import { getDeviceList } from '../../api/device/device.js'
import { renewDevice, getPeriodPackages, getPeriodPackagesByTypeId } from '../../api/lease/lease.js' import { renewDevice, getPeriodPackages, getPeriodPackagesByTypeId } from '../../api/lease/lease.js'
import { getIsRealName } from '../../api'
export default { export default {
components: { components: {
@ -70,6 +71,7 @@ export default {
data() { data() {
return { return {
// //
isRealName: false,
indicatorDots: true, indicatorDots: true,
autoplay: true, autoplay: true,
interval: 2000, interval: 2000,
@ -105,6 +107,7 @@ export default {
this.fetchAnnouncement() this.fetchAnnouncement()
this.fetchBannerList() this.fetchBannerList()
this.fetchDeviceList() this.fetchDeviceList()
this.goToRealName()
}, },
onShow() { onShow() {
@ -114,6 +117,25 @@ export default {
}, },
methods: { methods: {
async goToRealName() {
const res = await getIsRealName()
if (!res.data) {
uni.showModal({
title: '提示',
content: '需要租赁,请先实名',
showCancel: true,
confirmText: '去实名',
cancelText: '暂不',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/realNameAuthentication/realNameAuthentication',
})
}
},
})
}
},
// //
async fetchAnnouncement() { async fetchAnnouncement() {
try { try {