feat :修改ios的样式

This commit is contained in:
zerosaturation 2026-04-12 21:24:23 +08:00
parent 9a2d597e2b
commit d17589236f
4 changed files with 59 additions and 16 deletions

View File

@ -655,7 +655,6 @@ onMounted(() => {
position: relative; position: relative;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
min-height: 100vh;
overflow: hidden; overflow: hidden;
} }
@ -687,11 +686,18 @@ onMounted(() => {
position: relative; position: relative;
z-index: 1; z-index: 1;
width: 100%; width: 100%;
min-height: 100%; height: 100%;
padding: 100rpx 32rpx 40rpx 32rpx; padding: 100rpx 32rpx 40rpx 32rpx;
box-sizing: border-box; box-sizing: border-box;
} }
/* 隐藏滚动条 */
.content-wrapper::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
}
/* 页面标题 */ /* 页面标题 */
.page-title { .page-title {
width: 100%; width: 100%;
@ -1044,7 +1050,8 @@ onMounted(() => {
display: flex; display: flex;
gap: 20rpx; gap: 20rpx;
margin-top: 40rpx; margin-top: 40rpx;
padding-bottom: 40rpx; padding-bottom: calc(40rpx + constant(safe-area-inset-bottom)); /* iOS 11.0 */
padding-bottom: calc(40rpx + env(safe-area-inset-bottom)); /* iOS 11.2+ */
} }
.btn-secondary, .btn-secondary,

View File

@ -7,7 +7,7 @@
<!-- <view class="background-overlay"></view> --> <!-- <view class="background-overlay"></view> -->
<!-- 左上角返回按钮 --> <!-- 左上角返回按钮 -->
<view class="back-button" @click="handleBack"> <view class="back-button" :style="{ top: backButtonTop }" @click="handleBack">
<image class="back-icon" src="/static/icon/back.png" mode="aspectFit" /> <image class="back-icon" src="/static/icon/back.png" mode="aspectFit" />
</view> </view>
@ -104,7 +104,18 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue'; import { ref, onMounted, computed } from 'vue';
// Android
const isAndroid = ref(false);
// top
const backButtonTop = computed(() => {
if (isAndroid.value) {
return 'calc(env(safe-area-inset-top) + 80rpx)';
}
return 'calc(env(safe-area-inset-top) + 32rpx)';
});
// //
const bannerList = ref([ const bannerList = ref([
@ -176,6 +187,12 @@ const scrollTop = ref(0);
// //
onMounted(() => { onMounted(() => {
//
const systemInfo = uni.getSystemInfoSync();
console.log('[CastloveContent] 系统信息:', systemInfo);
isAndroid.value = systemInfo.platform === 'android';
console.log('[CastloveContent] 是否为Android:', isAndroid.value);
loadBanners(); loadBanners();
loadCreations(); loadCreations();
}); });
@ -387,7 +404,7 @@ const handleBack = () => {
/* 左上角返回按钮 */ /* 左上角返回按钮 */
.back-button { .back-button {
position: fixed; position: fixed;
top: calc(env(safe-area-inset-top) + 80rpx); /* top值通过JS动态设置 */
left: 32rpx; left: 32rpx;
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;

View File

@ -1304,7 +1304,7 @@ onMounted(() => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 16rpx; /* gap: 16rpx; */
z-index: 11; z-index: 11;
} }
@ -1317,6 +1317,9 @@ onMounted(() => {
user-select: none; user-select: none;
-webkit-user-select: none; -webkit-user-select: none;
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
display: flex;
align-items: center;
justify-content: center;
} }
.action-button:active { .action-button:active {
@ -1329,6 +1332,8 @@ onMounted(() => {
color: #FFFFFF; color: #FFFFFF;
font-weight: bold; font-weight: bold;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2); text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2);
white-space: nowrap;
line-height: 1.2;
} }
.hint-text { .hint-text {

View File

@ -1,8 +1,10 @@
<template> <template>
<view class="profile-container"> <view class="profile-container">
<!-- 上半部分用户信息卡片 --> <!-- 背景图片 - 固定在容器上 -->
<!-- 背景图片 -->
<image class="background-image" src="/static/background/starbook.png" mode="aspectFill"></image> <image class="background-image" src="/static/background/starbook.png" mode="aspectFill"></image>
<scroll-view class="profile-scroll" scroll-y :show-scrollbar="false" :enable-back-to-top="true">
<!-- 上半部分用户信息卡片 -->
<view class="top-section"> <view class="top-section">
<!-- 蒙层 --> <!-- 蒙层 -->
@ -243,6 +245,7 @@
<view class="logout-section"> <view class="logout-section">
<button class="logout-button" @tap="handleLogout">退出登录</button> <button class="logout-button" @tap="handleLogout">退出登录</button>
</view> </view>
</scroll-view>
<!-- 新手引导列表弹窗 --> <!-- 新手引导列表弹窗 -->
<GuideListModal :visible="showGuideListModal" @start-guide="handleStartGuide" <GuideListModal :visible="showGuideListModal" @start-guide="handleStartGuide"
@ -1224,9 +1227,21 @@ onMounted(() => {
position: relative; position: relative;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
min-height: 100vh;
overflow: hidden; overflow: hidden;
/* overflow-y: auto; */ }
.profile-scroll {
width: 100%;
height: 100%;
position: relative;
z-index: 1;
}
/* 隐藏滚动条 */
.profile-scroll::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
} }
/* 上半部分:用户信息区域 */ /* 上半部分:用户信息区域 */
@ -1238,7 +1253,7 @@ onMounted(() => {
} }
.background-image { .background-image {
position: absolute; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
@ -1247,10 +1262,7 @@ onMounted(() => {
height: 100%; height: 100%;
z-index: 0; z-index: 0;
object-fit: cover; object-fit: cover;
min-width: 100%;
min-height: 100%;
/* filter: blur(20rpx); */ /* filter: blur(20rpx); */
transform: scale(1.1);
} }
.background-overlay { .background-overlay {
@ -1504,6 +1516,8 @@ onMounted(() => {
.logout-section { .logout-section {
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
padding-bottom: calc(40rpx + constant(safe-area-inset-bottom)); /* iOS 11.0 */
padding-bottom: calc(40rpx + env(safe-area-inset-bottom)); /* iOS 11.2+ */
display: flex; display: flex;
position: relative; position: relative;
} }