Commit 25012ef1 authored by wangtao's avatar wangtao

多语言图片

parent 770b0c75
{
"name": "bmiss-charge-propaganda",
"name": "bmiss-fans",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bmiss-charge-propaganda",
"name": "bmiss-fans",
"version": "1.0.0",
"dependencies": {
"@vant/use": "^1.6.0",
......
{
"name": "bmiss-charge-propaganda",
"name": "bmiss-fans",
"private": true,
"version": "1.0.0",
"author": "管忠旭",
......
This diff is collapsed.
This diff is collapsed.
......@@ -72,14 +72,17 @@ const handleBackImg = ({ ele, src, onError }: HandleBackImg) => {
}else{
if (handleApp.agent === "ios" && handleApp.iosVersion.minorVersion < 14) {
// 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`;
}
// if (handleApp.agent === "ios" && handleApp.iosVersion.minorVersion < 14) {
// // 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>
<div class="index" @click="closeWebApp">
<main @click.stop>
<Header :title-list="swiperData" :active="activeIndex" @setActive="setActiveIndex" />
<div class="container">
<div class="swiper removeScrollbar" ref="swiperRef">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item, index) in swiperData" :key="item.title">
<component
:is="item.component"
:index="index"
:currentIndex="activeIndex"
v-show-image="{
isBack: true,
src: item.backgroundImg
}"
/>
<Shell>
<div class="index" @click.self="HandleApp.closeWebview()">
<div class="shell">
<!-- 返回按钮放在最外层,使用固定定位 -->
<div class="boost">
<div class="back">
<img
@click="HandleApp.closeWebview()"
v-show-image="'index/back'"
alt="" />
</div>
<div class="image-container">
<img v-show-image="'index/bankimg'" alt="" />
</div>
</div>
</div>
</main>
</div>
</Shell>
</template>
<script setup lang="ts">
import handleApp from "@/utils/HandleApp";
import Header from "views/index/components/header/Header.vue";
import usePageSwiper from "views/index/hooks/usePageSwiper";
const { swiperData, setActiveIndex, swiperRef, activeIndex } = usePageSwiper();
const closeWebApp = () => {
handleApp.closeWebview();
};
import Shell from "components/shell/Shell.vue";
import HandleApp from "@/utils/HandleApp";
</script>
<style scoped lang="stylus">
.index
width 100%
height 100%
flex 1
background-color transparent
display flex
flex-direction column
justify-content flex-end
> main
align-items flex-end
overflow hidden
> .shell
width 100%
height 75%
> .boost
position relative
width 100%
height 584px
height 100%
display flex
flex-direction column
overflow hidden
>.container
overflow hidden // 保持外层不滚动
> .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
overflow-y auto // 允许垂直滚动
display flex
flex-direction column
img
width 100%
> .swiper
width 100%
height 100%
height auto // 高度自适应
display block // 消除图片底部间隙
flex-shrink 0 // 防止图片被压缩
</style>
\ No newline at end of file
<template>
<div>{{ str }}</div>
<div>{{ str }}111</div>
</template>
<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