Commit 25012ef1 authored by wangtao's avatar wangtao

多语言图片

parent 770b0c75
{ {
"name": "bmiss-charge-propaganda", "name": "bmiss-fans",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "bmiss-charge-propaganda", "name": "bmiss-fans",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@vant/use": "^1.6.0", "@vant/use": "^1.6.0",
......
{ {
"name": "bmiss-charge-propaganda", "name": "bmiss-fans",
"private": true, "private": true,
"version": "1.0.0", "version": "1.0.0",
"author": "管忠旭", "author": "管忠旭",
......
This diff is collapsed.
This diff is collapsed.
...@@ -72,14 +72,17 @@ const handleBackImg = ({ ele, src, onError }: HandleBackImg) => { ...@@ -72,14 +72,17 @@ const handleBackImg = ({ ele, src, onError }: HandleBackImg) => {
}else{ }else{
if (handleApp.agent === "ios" && handleApp.iosVersion.minorVersion < 14) {
// ios版本小于14,则使用png类型的图片
ele.style.backgroundImage = `url(${baseDir}/${dirPath}/png/${fileName}.png)`; ele.style.backgroundImage = `url(${baseDir}/${dirPath}/png/${fileName}.png)`;
image.src = `${baseDir}/${dirPath}/png/${fileName}.png`; image.src = `${baseDir}/${dirPath}/png/${fileName}.png`;
} else {
ele.style.backgroundImage = `url(${baseDir}/${dirPath}/webp/${fileName}.webp)`; // if (handleApp.agent === "ios" && handleApp.iosVersion.minorVersion < 14) {
image.src = `${baseDir}/${dirPath}/webp/${fileName}.webp`; // // ios版本小于14,则使用png类型的图片
} // ele.style.backgroundImage = `url(${baseDir}/${dirPath}/png/${fileName}.png)`;
// image.src = `${baseDir}/${dirPath}/png/${fileName}.png`;
// } else {
// ele.style.backgroundImage = `url(${baseDir}/${dirPath}/webp/${fileName}.webp)`;
// image.src = `${baseDir}/${dirPath}/webp/${fileName}.webp`;
// }
} }
}; };
......
<template> <template>
<div class="index" @click="closeWebApp"> <Shell>
<main @click.stop> <div class="index" @click.self="HandleApp.closeWebview()">
<Header :title-list="swiperData" :active="activeIndex" @setActive="setActiveIndex" /> <div class="shell">
<div class="container"> <!-- 返回按钮放在最外层,使用固定定位 -->
<div class="swiper removeScrollbar" ref="swiperRef"> <div class="boost">
<div class="swiper-wrapper"> <div class="back">
<div class="swiper-slide" v-for="(item, index) in swiperData" :key="item.title"> <img
<component @click="HandleApp.closeWebview()"
:is="item.component" v-show-image="'index/back'"
:index="index" alt="" />
:currentIndex="activeIndex"
v-show-image="{
isBack: true,
src: item.backgroundImg
}"
/>
</div> </div>
<div class="image-container">
<img v-show-image="'index/bankimg'" alt="" />
</div> </div>
</div> </div>
</div> </div>
</main>
</div> </div>
</Shell>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import handleApp from "@/utils/HandleApp"; import Shell from "components/shell/Shell.vue";
import Header from "views/index/components/header/Header.vue"; import HandleApp from "@/utils/HandleApp";
import usePageSwiper from "views/index/hooks/usePageSwiper";
const { swiperData, setActiveIndex, swiperRef, activeIndex } = usePageSwiper();
const closeWebApp = () => {
handleApp.closeWebview();
};
</script> </script>
<style scoped lang="stylus"> <style scoped lang="stylus">
.index .index
width 100% width 100%
height 100% flex 1
background-color transparent
display flex display flex
flex-direction column align-items flex-end
justify-content flex-end overflow hidden
> main
> .shell
width 100%
height 75%
> .boost
position relative
width 100% width 100%
height 584px height 100%
display flex display flex
flex-direction column flex-direction column
overflow hidden overflow hidden // 保持外层不滚动
>.container
> .back
position fixed // 使用固定定位,固定在左上角
left 16px
width 23px
height 23px
z-index 100 // 确保按钮在最上层
cursor pointer
img
padding-top 20px;
width 23px
height 23px
.image-container
flex 1 flex 1
overflow-y auto // 允许垂直滚动
display flex
flex-direction column
img
width 100% width 100%
> .swiper height auto // 高度自适应
width 100% display block // 消除图片底部间隙
height 100% flex-shrink 0 // 防止图片被压缩
</style> </style>
\ No newline at end of file
<template> <template>
<div>{{ str }}</div> <div>{{ str }}111</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment