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
|
<img
|
||||||
v-smart-img
|
v-smart-img
|
||||||
:src="imageUrl(getImgName('historyBt'))"
|
:src="imageUrl('historyBt')"
|
||||||
alt=""
|
alt=""
|
||||||
style="width: 8vw; position: absolute; z-index: 2; top: 2vw; right: 4vw"
|
style="width: 8vw; position: absolute; z-index: 2; top: 2vw; right: 4vw"
|
||||||
@click="openPopup('history')"
|
@click="openPopup('history')"
|
||||||
@ -1661,10 +1661,7 @@
|
|||||||
|
|
||||||
<!-- 中奖历史 -->
|
<!-- 中奖历史 -->
|
||||||
<div v-show="historyShow" style="position: relative; width: 95%" @click.stop>
|
<div v-show="historyShow" style="position: relative; width: 95%" @click.stop>
|
||||||
<itemCenter
|
<itemCenter :imgUrl="imageUrl('historyBg')" :contentStyle="`padding: 22vw 6vw 11vw;`">
|
||||||
:imgUrl="imageUrl(getImgName('historyBg'))"
|
|
||||||
:contentStyle="`padding: 22vw 6vw 11vw;`"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -2029,8 +2026,7 @@ const isTextOverflow = (text) => {
|
|||||||
document.body.appendChild(tempDiv) // 将临时元素添加到文档中
|
document.body.appendChild(tempDiv) // 将临时元素添加到文档中
|
||||||
|
|
||||||
const containerWidth = window.innerWidth * 0.3 // 所在容器宽度
|
const containerWidth = window.innerWidth * 0.3 // 所在容器宽度
|
||||||
const textWidth = tempDiv.getBoundingClientRect().width
|
const textWidth = tempDiv.getBoundingClientRect().width // 文本宽度
|
||||||
console.log(`"${text}"的宽度为 ${textWidth}px,容器宽度为 ${containerWidth}px`)
|
|
||||||
|
|
||||||
document.body.removeChild(tempDiv) // 删除临时元素
|
document.body.removeChild(tempDiv) // 删除临时元素
|
||||||
|
|
||||||
|
|||||||
@ -7,25 +7,42 @@
|
|||||||
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
|
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
|
||||||
/>
|
/>
|
||||||
<img
|
<img
|
||||||
|
v-smart-img
|
||||||
v-if="from === 'BDLead'"
|
v-if="from === 'BDLead'"
|
||||||
:src="bdLeaderImgUrl"
|
:src="bdLeaderImgUrl"
|
||||||
alt="bdleader Policy Image"
|
alt="bdleader Policy Image"
|
||||||
class="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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
import { useLangStore } from '@/stores/lang'
|
||||||
|
import { getPngUrl } from '@/config/imagePaths.js'
|
||||||
|
|
||||||
import GeneralHeader from '@/components/GeneralHeader.vue'
|
import GeneralHeader from '@/components/GeneralHeader.vue'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { t, locale } = useI18n()
|
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 from = ref('')
|
||||||
|
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
@ -37,20 +54,11 @@ const updateImages = () => {
|
|||||||
|
|
||||||
if (from.value === 'BD') {
|
if (from.value === 'BD') {
|
||||||
title.value = t('bd_policy')
|
title.value = t('bd_policy')
|
||||||
bdImgUrl.value = new URL(
|
bdImgUrl.value = imageUrl('BDPolicy')
|
||||||
'/src/assets/images/BDCenter/Policy/BDPolicy.png',
|
|
||||||
import.meta.url
|
|
||||||
).href
|
|
||||||
} else if (from.value === 'BDLead') {
|
} else if (from.value === 'BDLead') {
|
||||||
title.value = t('bd_leader_policy')
|
title.value = t('bd_leader_policy')
|
||||||
bdImgUrl.value = new URL(
|
bdImgUrl.value = imageUrl('BDPolicy')
|
||||||
'/src/assets/images/BDCenter/Policy/BDPolicy.png',
|
bdLeaderImgUrl.value = imageUrl('BDLeaderPolicy')
|
||||||
import.meta.url
|
|
||||||
).href
|
|
||||||
bdLeaderImgUrl.value = new URL(
|
|
||||||
'/src/assets/images/BDCenter/Policy/BDLeaderPolicy.png',
|
|
||||||
import.meta.url
|
|
||||||
).href
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user