| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- <template>
- <view class="ct-page">
- <view class="ct-nav" :style="{ paddingTop: statusBar + 'px' }">
- <view class="ct-nav-row">
- <view class="ct-back" @tap="goBack">
- <text class="ct-back-icon">←</text>
- </view>
- <text class="ct-nav-title">{{ copy.title }}</text>
- <view class="ct-nav-placeholder" />
- </view>
- </view>
- <scroll-view
- scroll-y
- class="ct-scroll"
- :style="{ height: scrollHeight + 'px' }"
- >
- <view class="ct-body" :style="{ paddingBottom: safeBottom + 'px' }">
- <view class="ct-hero">
- <view class="ct-hero-icon-wrap">
- <text class="ct-hero-icon">✉</text>
- </view>
- <text class="ct-hero-title">{{ copy.title }}</text>
- <text class="ct-hero-desc">{{ copy.desc }}</text>
- </view>
- <view v-if="loading" class="ct-state-card">
- <text class="ct-state-text">{{ copy.loading }}</text>
- </view>
- <view v-else-if="!email" class="ct-state-card">
- <text class="ct-state-icon">—</text>
- <text class="ct-state-text">{{ copy.empty }}</text>
- </view>
- <view
- v-else
- class="ct-email-card"
- hover-class="ct-email-card--press"
- @tap="copyEmail"
- >
- <view class="ct-email-head">
- <text class="ct-email-label">{{ copy.emailLabel }}</text>
- <view class="ct-copy-pill" @tap.stop="copyEmail">
- <text class="ct-copy-pill-text">{{ copy.copyBtn }}</text>
- </view>
- </view>
- <text class="ct-email-value">{{ email }}</text>
- <text class="ct-email-hint">{{ copy.tapCopy }}</text>
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- import { fetchAppBrand } from '@/features/shell/app-config-gateway'
- import { copyText } from '@/core/storage/clipboard-copy'
- export default {
- data() {
- return {
- statusBar: 0,
- scrollHeight: 600,
- safeBottom: 0,
- loading: false,
- email: ''
- }
- },
- computed: {
- copy() {
- const t = this.$t.bind(this)
- return {
- title: t('about.contactTitle'),
- desc: t('about.contactHeroDesc'),
- emailLabel: t('about.contactEmailLabel'),
- copyBtn: t('about.contactCopy'),
- tapCopy: t('about.contactTapCopy'),
- empty: t('about.contactEmpty'),
- loading: t('about.contactLoading'),
- network: t('user.realnameNetworkError')
- }
- }
- },
- onLoad() {
- const sys = uni.getSystemInfoSync()
- this.statusBar = sys.statusBarHeight || 0
- this.safeBottom = sys.safeAreaInsets ? sys.safeAreaInsets.bottom : 0
- const navH = this.statusBar + uni.upx2px(88)
- this.scrollHeight = (sys.windowHeight || 667) - navH
- this.loadContact()
- },
- methods: {
- goBack() {
- if (getCurrentPages().length > 1) {
- uni.navigateBack({ delta: 1 })
- } else {
- uni.navigateTo({
- url: '/pages/account/about',
- fail: () => uni.reLaunch({ url: '/pages/mine/index' })
- })
- }
- },
- async loadContact() {
- if (this.loading) return
- this.loading = true
- try {
- const brand = await fetchAppBrand()
- this.email = brand.email || ''
- } catch (_) {
- this.email = ''
- this.$appKit && this.$appKit.msg(this.copy.network)
- } finally {
- this.loading = false
- }
- },
- copyEmail() {
- if (!this.email) return
- copyText(this.email, true, this.$i18n)
- }
- }
- }
- </script>
- <style scoped>
- .ct-page {
- min-height: 100vh;
- background-color: #f4f6fb;
- }
- .ct-nav {
- background-color: #ffffff;
- border-bottom: 1rpx solid #eef1f6;
- }
- .ct-nav-row {
- display: flex;
- flex-direction: row;
- align-items: center;
- height: 88rpx;
- padding: 0 24rpx;
- box-sizing: border-box;
- }
- .ct-back {
- width: 64rpx;
- height: 64rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .ct-back-icon {
- font-size: 40rpx;
- color: #1a1d26;
- line-height: 1;
- }
- .ct-nav-title {
- flex: 1;
- text-align: center;
- font-size: 32rpx;
- font-weight: 600;
- color: #1a1d26;
- }
- .ct-nav-placeholder {
- width: 64rpx;
- }
- .ct-body {
- padding: 24rpx 28rpx 40rpx;
- box-sizing: border-box;
- }
- .ct-hero {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 32rpx 24rpx 40rpx;
- }
- .ct-hero-icon-wrap {
- width: 120rpx;
- height: 120rpx;
- border-radius: 32rpx;
- background: linear-gradient(145deg, #eef4ff 0%, #e8f0fe 100%);
- box-shadow: 0 12rpx 36rpx rgba(74, 140, 255, 0.14);
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 24rpx;
- }
- .ct-hero-icon {
- font-size: 52rpx;
- line-height: 1;
- }
- .ct-hero-title {
- font-size: 36rpx;
- font-weight: 700;
- color: #1a1d26;
- margin-bottom: 12rpx;
- }
- .ct-hero-desc {
- font-size: 26rpx;
- color: #8a8d9e;
- line-height: 1.6;
- text-align: center;
- max-width: 560rpx;
- }
- .ct-state-card,
- .ct-email-card {
- background-color: #ffffff;
- border-radius: 24rpx;
- box-shadow: 0 6rpx 24rpx rgba(74, 140, 255, 0.06);
- padding: 32rpx 28rpx;
- box-sizing: border-box;
- }
- .ct-state-card {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- min-height: 200rpx;
- }
- .ct-state-icon {
- font-size: 40rpx;
- color: #c5cad6;
- margin-bottom: 16rpx;
- line-height: 1;
- }
- .ct-state-text {
- font-size: 28rpx;
- color: #8a8d9e;
- text-align: center;
- line-height: 1.5;
- }
- .ct-email-card--press {
- background-color: #f7f9fc;
- }
- .ct-email-head {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 20rpx;
- }
- .ct-email-label {
- font-size: 26rpx;
- color: #8a8d9e;
- }
- .ct-copy-pill {
- padding: 10rpx 24rpx;
- border-radius: 999rpx;
- background-color: rgba(74, 140, 255, 0.1);
- border: 1rpx solid rgba(74, 140, 255, 0.22);
- }
- .ct-copy-pill-text {
- font-size: 24rpx;
- color: #4a8cff;
- font-weight: 600;
- line-height: 1.2;
- }
- .ct-email-value {
- display: block;
- font-size: 32rpx;
- font-weight: 600;
- color: #4a8cff;
- line-height: 1.5;
- word-break: break-all;
- }
- .ct-email-hint {
- display: block;
- margin-top: 16rpx;
- font-size: 24rpx;
- color: #b0b4c0;
- line-height: 1.4;
- }
- </style>
|