feat(BD政策): 更改为使用oss图片

This commit is contained in:
hzj 2026-02-04 18:21:10 +08:00
parent 6751dc819a
commit 13a7ba5fa5
4 changed files with 25 additions and 21 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 KiB

View File

@ -609,7 +609,7 @@
<!-- 中奖历史按钮 -->
<img
v-smart-img
:src="imageUrl(getImgName('historyBt'))"
:src="imageUrl('historyBt')"
alt=""
style="width: 8vw; position: absolute; z-index: 2; top: 2vw; right: 4vw"
@click="openPopup('history')"
@ -1661,10 +1661,7 @@
<!-- 中奖历史 -->
<div v-show="historyShow" style="position: relative; width: 95%" @click.stop>
<itemCenter
:imgUrl="imageUrl(getImgName('historyBg'))"
:contentStyle="`padding: 22vw 6vw 11vw;`"
>
<itemCenter :imgUrl="imageUrl('historyBg')" :contentStyle="`padding: 22vw 6vw 11vw;`">
<div
style="
width: 100%;
@ -2029,8 +2026,7 @@ const isTextOverflow = (text) => {
document.body.appendChild(tempDiv) //
const containerWidth = window.innerWidth * 0.3 //
const textWidth = tempDiv.getBoundingClientRect().width
console.log(`"${text}"的宽度为 ${textWidth}px容器宽度为 ${containerWidth}px`)
const textWidth = tempDiv.getBoundingClientRect().width //
document.body.removeChild(tempDiv) //

View File

@ -7,25 +7,42 @@
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
/>
<img
v-smart-img
v-if="from === 'BDLead'"
:src="bdLeaderImgUrl"
alt="bdleader Policy Image"
class="policy-image"
/>
<img :src="bdImgUrl" alt="bd Policy Image" class="policy-image" />
<img v-smart-img :src="bdImgUrl" alt="bd Policy Image" class="policy-image" />
</div>
</template>
<script setup>
import { onMounted, ref } from 'vue'
import { computed, onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { useLangStore } from '@/stores/lang'
import { getPngUrl } from '@/config/imagePaths.js'
import GeneralHeader from '@/components/GeneralHeader.vue'
const route = useRoute()
const { t, locale } = useI18n()
const langStore = useLangStore()
//
const currentLangType = computed(() => {
return langStore.selectedLang?.type || 'en'
})
// OSSURL
const imageUrl = (filename) => getPngUrl('BDCenter/Policy/', filename)
//
const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `${filename}_ar` : filename
}
const from = ref('')
const title = ref('')
@ -37,20 +54,11 @@ const updateImages = () => {
if (from.value === 'BD') {
title.value = t('bd_policy')
bdImgUrl.value = new URL(
'/src/assets/images/BDCenter/Policy/BDPolicy.png',
import.meta.url
).href
bdImgUrl.value = imageUrl('BDPolicy')
} else if (from.value === 'BDLead') {
title.value = t('bd_leader_policy')
bdImgUrl.value = new URL(
'/src/assets/images/BDCenter/Policy/BDPolicy.png',
import.meta.url
).href
bdLeaderImgUrl.value = new URL(
'/src/assets/images/BDCenter/Policy/BDLeaderPolicy.png',
import.meta.url
).href
bdImgUrl.value = imageUrl('BDPolicy')
bdLeaderImgUrl.value = imageUrl('BDLeaderPolicy')
}
}