国际版独立

This commit is contained in:
2026-04-29 11:10:29 +08:00
parent 120eba6c6a
commit 6913d9266b
10 changed files with 742 additions and 106 deletions
+294
View File
@@ -0,0 +1,294 @@
<template>
<view class="h5-home-wrap">
<view class="main-content" :style="mainContentStyle">
<view class="h5-banner-section" v-if="bannerImages && bannerImages.length > 0">
<swiper class="h5-banner-swiper" :indicator-dots="bannerImages.length > 1" :autoplay="true" :interval="4000"
:duration="500" circular>
<swiper-item v-for="(img, idx) in bannerImages" :key="idx">
<view class="h5-banner-item" @click="$emit('bannerClick', idx)">
<image :src="img" mode="aspectFill" class="h5-banner-image"></image>
</view>
</swiper-item>
</swiper>
</view>
<view class="h5-banner-empty" v-else>
<text>{{ loadingText }}</text>
</view>
<view class="h5-cta-card">
<view class="h5-cta-header">
<text class="h5-cta-title">{{ scanText }}</text>
<text class="h5-cta-desc">{{ t('home.h5ScanDesc') }}</text>
</view>
<view class="h5-cta-btn" @click="$emit('scan')">
<image class="h5-cta-icon" src="/static/scan-icon.png" mode="aspectFit" />
<text class="h5-cta-btn-text">{{ scanText }}</text>
</view>
</view>
<view class="h5-section">
<view class="h5-section-title">{{ t('home.h5HowItWorks') }}</view>
<view class="h5-steps">
<view class="h5-step-item">
<text class="h5-step-index">1</text>
<text class="h5-step-text">{{ t('home.h5StepScan') }}</text>
</view>
<view class="h5-step-item">
<text class="h5-step-index">2</text>
<text class="h5-step-text">{{ t('home.h5StepUnlock') }}</text>
</view>
<view class="h5-step-item">
<text class="h5-step-index">3</text>
<text class="h5-step-text">{{ t('home.h5StepReturn') }}</text>
</view>
</view>
</view>
<view class="h5-section">
<view class="h5-section-title">{{ t('home.h5ServiceTitle') }}</view>
<view class="h5-tags">
<text class="h5-tag">{{ t('home.h5ServiceSupport') }}</text>
<text class="h5-tag">{{ t('home.h5ServiceSafePayment') }}</text>
<text class="h5-tag">{{ t('home.h5ServiceEasyReturn') }}</text>
</view>
</view>
</view>
<view class="h5-bottom-actions">
<view class="action-btn secondary" @click="$emit('buy')">
<image class="action-icon" src="/static/shop_icon.png" mode="aspectFit" />
<text class="action-label">{{ buyDeviceText }}</text>
</view>
<view class="action-btn primary" @click="$emit('scan')">
<image class="action-icon" src="/static/scan-icon.png" mode="aspectFit" />
<text class="action-label primary-label">{{ scanText }}</text>
</view>
<view class="action-btn secondary" @click="$emit('my')">
<image class="action-icon" src="/static/user.png" mode="aspectFit" />
<text class="action-label">{{ personalCenterText }}</text>
</view>
</view>
</view>
</template>
<script setup>
import { useI18n } from '../../utils/i18n.js'
const { t } = useI18n()
defineEmits(['bannerClick', 'scan', 'buy', 'my'])
defineProps({
mainContentStyle: { type: Object, default: () => ({}) },
bannerImages: { type: Array, default: () => [] },
loadingText: { type: String, default: '' },
buyDeviceText: { type: String, default: '' },
scanText: { type: String, default: '' },
personalCenterText: { type: String, default: '' }
})
</script>
<style lang="scss" scoped>
.h5-home-wrap {
min-height: 100%;
}
.main-content {
padding-bottom: 220rpx;
}
.h5-banner-section {
padding: 24rpx 20rpx 0;
box-sizing: border-box;
}
.h5-banner-swiper {
width: 100%;
height: 320rpx;
border-radius: 20rpx;
overflow: hidden;
background: #f5f5f5;
}
.h5-banner-item,
.h5-banner-image {
width: 100%;
height: 100%;
}
.h5-banner-empty {
padding: 80rpx 20rpx 0;
text-align: center;
color: #999;
font-size: 26rpx;
}
.h5-cta-card {
margin: 20rpx;
padding: 24rpx;
border-radius: 20rpx;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.05);
}
.h5-cta-header {
flex: 1;
}
.h5-cta-title {
font-size: 32rpx;
font-weight: 600;
color: #1f7d43;
display: block;
}
.h5-cta-desc {
font-size: 24rpx;
color: #4f7b61;
margin-top: 8rpx;
display: block;
}
.h5-cta-btn {
height: 76rpx;
padding: 0 24rpx;
background: #3EAB64;
border-radius: 38rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
}
.h5-cta-icon {
width: 30rpx;
height: 30rpx;
filter: brightness(0) invert(1);
}
.h5-cta-btn-text {
color: #fff;
font-size: 24rpx;
font-weight: 600;
}
.h5-section {
margin: 0 20rpx 20rpx;
background: #fff;
border-radius: 20rpx;
padding: 20rpx;
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.04);
}
.h5-section-title {
font-size: 28rpx;
font-weight: 600;
color: #2d2d2d;
margin-bottom: 16rpx;
}
.h5-steps {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12rpx;
}
.h5-step-item {
background: #f4f8f6;
border-radius: 14rpx;
padding: 16rpx 10rpx;
display: flex;
flex-direction: column;
align-items: center;
gap: 8rpx;
}
.h5-step-index {
width: 34rpx;
height: 34rpx;
background: #3EAB64;
color: #fff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 20rpx;
}
.h5-step-text {
font-size: 22rpx;
color: #315c46;
}
.h5-tags {
display: flex;
flex-wrap: wrap;
gap: 12rpx;
}
.h5-tag {
padding: 10rpx 16rpx;
background: #eef8f1;
color: #2e7d4f;
border-radius: 999rpx;
font-size: 22rpx;
}
.h5-bottom-actions {
position: fixed;
left: 20rpx;
right: 20rpx;
bottom: 30rpx;
z-index: 1200;
padding: 14rpx;
background: rgba(255, 255, 255, 0.96);
border-radius: 56rpx;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
display: flex;
align-items: center;
gap: 12rpx;
}
.action-btn {
height: 86rpx;
border-radius: 43rpx;
padding: 0 20rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
}
.action-btn.primary {
flex: 1;
background: #3EAB64;
max-width: 360rpx;
}
.action-btn.secondary {
width: 150rpx;
background: #f4f6f8;
}
.action-icon {
width: 32rpx;
height: 32rpx;
}
.action-btn.primary .action-icon {
filter: brightness(0) invert(1);
}
.action-label {
font-size: 24rpx;
color: #333;
}
.primary-label {
color: #fff;
font-weight: 600;
}
</style>
+276
View File
@@ -0,0 +1,276 @@
<template>
<view>
<view class="main-content" :style="mainContentStyle">
<!-- 支付宝小程序使用专用组件 -->
<!-- #ifdef MP-ALIPAY -->
<MapComponentAlipay v-if="!isLoading && userLocation && !locationPermissionDenied" ref="innerMapRef"
:userLocation="userLocation" :positionList="positionList" :filteredPositions="filteredPositions"
:searchKeyword="searchKeyword" :enableMarkers="true" :bannerImages="bannerImages"
:hideMapOverlays="hideMapOverlays" @relocate="$emit('relocate')" @scan="$emit('scan')"
@showList="$emit('showList')" @markerTap="$emit('markerTap', $event)"
@mapCenterChange="$emit('mapCenterChange', $event)" @bannerClick="$emit('bannerClick', $event)"
@guide="$emit('guide')" />
<!-- #endif -->
<!-- 非支付宝小程序使用通用组件 -->
<!-- #ifndef MP-ALIPAY -->
<MapComponent v-if="!isLoading && userLocation && !locationPermissionDenied" ref="innerMapRef"
:userLocation="userLocation" :positionList="positionList" :filteredPositions="filteredPositions"
:searchKeyword="searchKeyword" :enableMarkers="true" :bannerImages="bannerImages"
:hideMapOverlays="hideMapOverlays" @relocate="$emit('relocate')" @scan="$emit('scan')"
@showList="$emit('showList')" @markerTap="$emit('markerTap', $event)"
@mapCenterChange="$emit('mapCenterChange', $event)" @bannerClick="$emit('bannerClick', $event)"
@guide="$emit('guide')" />
<!-- #endif -->
<!-- 地图加载状态 -->
<!-- #ifdef MP-ALIPAY -->
<view v-if="!userLocation" class="location-denied-placeholder">
<view class="denied-content">
<text class="denied-text">{{ locationPermissionText }}</text>
<view class="denied-enable-btn" @click="$emit('enableLocation')">
<text class="denied-enable-btn-text">{{ enableLocationText }}</text>
</view>
</view>
</view>
<!-- #endif -->
<!-- #ifndef MP-ALIPAY -->
<view v-if="isLoading || !userLocation" class="map-loading-placeholder">
<view class="loading-content">
<view class="loading-spinner"></view>
<text>{{ loadingLocationText }}</text>
</view>
</view>
<!-- #endif -->
</view>
<view class="bottom-actions">
<view class="action-btn secondary small btn-nearby" @click="$emit('buy')">
<view class="icon-wrap">
<image src="/static/shop_icon.png" class="action-icon" mode="scaleToFill" lazy-load="true"></image>
</view>
<text class="action-label">{{ buyDeviceText }}</text>
</view>
<view class="action-btn primary btn-scan" @click="$emit('scan')">
<view class="icon-wrap">
<image class="action-icon" src="/static/scan-icon.png" mode="aspectFill" lazy-load="true" />
</view>
<text class="primary-label">{{ scanText }}</text>
</view>
<view class="action-btn secondary small btn-my" @click="$emit('my')">
<view class="icon-wrap">
<image class="action-icon" src="/static/user.png" mode="aspectFit" lazy-load="true" />
</view>
<text class="action-label">{{ personalCenterText }}</text>
</view>
</view>
</view>
</template>
<script setup>
import { computed, ref } from 'vue'
import MapComponent from '../MapComponent.vue'
// #ifdef MP-ALIPAY
import MapComponentAlipay from '../MapComponentAlipay.vue'
// #endif
defineEmits(['relocate', 'scan', 'showList', 'markerTap', 'mapCenterChange', 'bannerClick', 'guide', 'enableLocation', 'buy', 'my'])
const props = defineProps({
mainContentStyle: { type: Object, default: () => ({}) },
isLoading: { type: Boolean, default: false },
userLocation: { type: Object, default: null },
locationPermissionDenied: { type: Boolean, default: false },
positionList: { type: Array, default: () => [] },
filteredPositions: { type: Array, default: () => [] },
searchKeyword: { type: String, default: '' },
bannerImages: { type: Array, default: () => [] },
hideMapOverlays: { type: Boolean, default: false },
locationPermissionText: { type: String, default: '' },
enableLocationText: { type: String, default: '' },
loadingLocationText: { type: String, default: '' },
buyDeviceText: { type: String, default: '' },
scanText: { type: String, default: '' },
personalCenterText: { type: String, default: '' }
})
const innerMapRef = ref(null)
defineExpose({
mapCenter: computed(() => innerMapRef.value?.mapCenter || null),
moveToLocation: (location) => innerMapRef.value && innerMapRef.value.moveToLocation && innerMapRef.value.moveToLocation(location)
})
</script>
<style lang="scss" scoped>
.main-content {
flex: 1;
position: relative;
width: 100%;
height: 100%;
padding-bottom: 180rpx;
box-sizing: border-box;
}
.map-loading-placeholder {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 180rpx;
background: #f6f7fb;
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
.loading-content {
background: #ffffff;
border-radius: 16rpx;
padding: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
.loading-spinner {
width: 60rpx;
height: 60rpx;
border: 4rpx solid #f0f0f0;
border-top: 4rpx solid #2196F3;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 24rpx;
}
}
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.location-denied-placeholder {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 180rpx;
background: #f6f7fb;
display: flex;
align-items: center;
justify-content: center;
padding: 0 40rpx;
box-sizing: border-box;
}
.denied-content {
width: 100%;
background: #ffffff;
border-radius: 16rpx;
padding: 40rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
}
.denied-text {
display: block;
font-size: 28rpx;
color: #333;
line-height: 1.6;
}
.denied-enable-btn {
margin-top: 28rpx;
width: 100%;
height: 88rpx;
background: #3EAB64;
border-radius: 44rpx;
display: flex;
align-items: center;
justify-content: center;
}
.denied-enable-btn-text {
font-size: 32rpx;
font-weight: 700;
color: #ffffff;
}
.bottom-actions {
position: fixed;
left: 20rpx;
right: 20rpx;
bottom: 40rpx;
z-index: 1200;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
gap: 16rpx;
}
.action-btn {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.action-btn.primary {
background: #3EAB64;
color: #fff;
border-radius: 56rpx;
height: 112rpx;
flex: 1;
max-width: 400rpx;
padding: 0 24rpx;
flex-direction: row;
gap: 8rpx;
}
.action-btn.secondary {
color: #333;
border-radius: 24rpx;
height: 100rpx;
width: 140rpx;
flex-shrink: 0;
padding: 8rpx 12rpx;
}
.icon-wrap {
width: 36rpx;
height: 36rpx;
display: flex;
align-items: center;
justify-content: center;
}
.btn-scan .icon-wrap {
width: 48rpx;
height: 48rpx;
}
.action-icon {
width: 36rpx;
height: 36rpx;
}
.btn-scan .action-icon {
width: 32rpx;
height: 32rpx;
filter: brightness(0) invert(1);
}
.primary-label {
color: #ffffff;
font-size: 28rpx;
font-weight: 600;
}
.action-label {
line-height: 1.2;
text-align: center;
}
</style>