feat(BD政策): 更改为使用oss图片
This commit is contained in:
parent
6751dc819a
commit
13a7ba5fa5
Binary file not shown.
|
Before Width: | Height: | Size: 384 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 666 KiB |
@ -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) // 删除临时元素
|
||||
|
||||
|
||||
@ -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'
|
||||
})
|
||||
|
||||
// 获取OSS图片URL的函数
|
||||
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')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user