| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <template>
- <view class="agreement-page">
- <!-- 自定义头部 -->
- <view class="custom-header" :style="{ paddingTop: statusBarHeight + 'px' }">
- <view class="header-content">
- <view class="back-btn" @click="handleBack">
- <text class="back-icon">‹</text>
- </view>
- <text class="header-title">{{ t('pagesContent.my.agreement.title') }}</text>
- <view class="placeholder"></view>
- </view>
- </view>
-
- <!-- 页面内容 -->
- <view class="page-body" :style="{ paddingTop: headerHeight + 'px' }">
- <!-- 协议列表 -->
- <view class="agreement-list">
- <!-- 用户协议 -->
- <view class="list-item" @click="handleUserAgreement">
- <view class="item-content">
- <view class="item-icon-wrapper">
- <image class="item-icon" src="/static/pages-content/my/agreement/user.png" mode="aspectFit" />
- </view>
- <view class="item-info">
- <text class="item-title">{{ t('pagesContent.my.agreement.userAgreement') }}</text>
- <text class="item-desc">{{ t('pagesContent.my.agreement.userAgreementDesc') }}</text>
- </view>
- </view>
- <text class="item-arrow">›</text>
- </view>
-
- <!-- 隐私协议 -->
- <view class="list-item" @click="handlePrivacyPolicy">
- <view class="item-content">
- <view class="item-icon-wrapper">
- <image class="item-icon" src="/static/pages-content/my/agreement/privacy.png" mode="aspectFit" />
- </view>
- <view class="item-info">
- <text class="item-title">{{ t('pagesContent.my.agreement.privacyPolicy') }}</text>
- <text class="item-desc">{{ t('pagesContent.my.agreement.privacyPolicyDesc') }}</text>
- </view>
- </view>
- <text class="item-arrow">›</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import { ref, computed, onMounted } from 'vue'
- import { useI18n } from 'vue-i18n'
- const { t } = useI18n()
- // 状态栏高度
- const statusBarHeight = ref(0)
- // 头部总高度(状态栏 + 导航栏 + 额外间距)
- const headerHeight = computed(() => {
- return statusBarHeight.value + 44 + 10 // 44px是导航栏高度,100px是额外间距
- })
- onMounted(() => {
- // 获取系统信息
- const systemInfo = uni.getSystemInfoSync()
- statusBarHeight.value = systemInfo.statusBarHeight || 0
-
- console.log('协议说明页面已加载')
- })
- // 返回上一页
- const handleBack = () => {
- const pages = getCurrentPages()
- if (pages.length > 1) {
- uni.navigateBack()
- } else {
- uni.reLaunch({
- url: '/pages/index'
- })
- }
- }
- // 用户协议
- const handleUserAgreement = () => {
- // TODO: 跳转到用户协议详情页
- uni.navigateTo({
- url: '/pages-content/my/aggreement/detail?type=user'
- })
- }
- // 隐私协议
- const handlePrivacyPolicy = () => {
- // TODO: 跳转到隐私协议详情页
- uni.navigateTo({
- url: '/pages-content/my/aggreement/detail?type=privacy'
- })
- }
- </script>
- <style lang="scss" scoped>
- .agreement-page {
- width: 100%;
- min-height: 100vh;
- display: flex;
- flex-direction: column;
- background: linear-gradient(180deg, #f0f4ff 0%, #f8f9fa 100%);
-
- // 自定义头部
- .custom-header {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- background-color: #ffffff;
- border-bottom: 1rpx solid #e5e5e5;
- z-index: 100;
-
- .header-content {
- height: 88rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 32rpx;
-
- .back-btn {
- width: 60rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .back-icon {
- font-size: 56rpx;
- color: #333333;
- font-weight: 300;
- }
- }
-
- .header-title {
- flex: 1;
- text-align: center;
- font-size: 32rpx;
- font-weight: 500;
- color: #000000;
- }
-
- .placeholder {
- width: 60rpx;
- }
- }
- }
-
- // 页面内容
- .page-body {
- flex: 1;
- padding: 40rpx;
-
- // 协议列表
- .agreement-list {
- .list-item {
- background-color: #ffffff;
- border-radius: 20rpx;
- padding: 40rpx;
- margin-bottom: 24rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
- transition: all 0.3s ease;
- position: relative;
- overflow: hidden;
-
- &:active {
- transform: translateY(-4rpx);
- box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.12);
- }
-
- .item-content {
- flex: 1;
- display: flex;
- align-items: center;
-
- .item-icon-wrapper {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 32rpx;
-
- .item-icon {
- width: 48rpx;
- height: 48rpx;
- }
- }
-
- .item-info {
- flex: 1;
- display: flex;
- flex-direction: column;
-
- .item-title {
- font-size: 32rpx;
- color: #333333;
- font-weight: 600;
- margin-bottom: 8rpx;
- }
-
- .item-desc {
- font-size: 24rpx;
- color: #999999;
- line-height: 1.5;
- }
- }
- }
-
- .item-arrow {
- font-size: 48rpx;
- color: #d0d0d0;
- font-weight: 300;
- margin-left: 20rpx;
- }
- }
- }
- }
- }
- </style>
|