From 717075645fe28aea150e291a5ad4531ba3536a09 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Mon, 13 Apr 2026 11:24:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin=E6=94=BF=E7=AD=96=E9=A1=B5):=20?= =?UTF-8?q?=E9=92=88=E5=AF=B9=E5=8D=97=E4=BA=9A=E5=9C=B0=E5=8C=BA=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=90=8C=E7=9A=84=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AdminCenter/policy.vue | 72 +++++++++++++++----------------- 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/src/views/AdminCenter/policy.vue b/src/views/AdminCenter/policy.vue index 72e25ce..1496d8a 100644 --- a/src/views/AdminCenter/policy.vue +++ b/src/views/AdminCenter/policy.vue @@ -6,30 +6,17 @@ color="black" style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999" /> - - - - +
+
+ Policy Image +
+
+ + + + +
+
@@ -39,6 +26,9 @@ import { useI18n } from 'vue-i18n' import { useLangStore } from '@/stores/lang' import { getPngUrl } from '@/config/imagePaths.js' import { preloadImages } from '@/utils/image/imagePreloader.js' +import { getUserId } from '@/utils/userStore.js' + +import { getRegionByUserId } from '@/api/wallet.js' import GeneralHeader from '@/components/GeneralHeader.vue' @@ -57,32 +47,30 @@ const currentLangType = computed(() => { return langStore.selectedLang?.type || 'en' }) -const policyImgUrl = ref('') //政策图 +const userRegion = ref(null) // 区域代码 // 预加载关键图片 const preloadCriticalImages = () => { const criticalImages = [ - imageUrl('policy0'), - imageUrl('policy1'), - imageUrl('policy2'), - imageUrl('policy3'), + imageUrl(getImgName('policy0')), + imageUrl(getImgName('policy1')), + imageUrl(getImgName('policy2')), + imageUrl(getImgName('policy3')), ] - const criticalImages_ar = [ - imageUrl('policy0_ar'), - imageUrl('policy1_ar'), - imageUrl('policy2_ar'), - imageUrl('policy3_ar'), - ] + preloadImages(criticalImages) +} - if (currentLangType.value == 'en') { - preloadImages(criticalImages) - } else if (currentLangType.value == 'ar') { - preloadImages(criticalImages_ar) +// 获取用户所在的区域信息 +const apiGetRegionByUserId = async () => { + const response = await getRegionByUserId(getUserId()) + if (response.status) { + userRegion.value = response.body } } onMounted(() => { + apiGetRegionByUserId() preloadCriticalImages() //预加载关键图片 }) @@ -97,4 +85,10 @@ onMounted(() => { .policy-container::-webkit-scrollbar { display: none; } + +.policy-image { + display: block; + width: 100vw; + object-fit: cover; +}