refactor: 国际化文本迁移至全局 locales/messages.js
将组件级 i18n 对象重构为统一由全局 locales/messages.js 管理,确保中英文语言切换时正确显示对应文本。 - 新增 utils/i18n.js 国际化工具函数 - 更新 store/$t.mixin.js 翻译混入逻辑 - 迁移 pkgService、pkgBooking、pkgAccount、pkgExplore、pages 等共 58 个组件的中英文文本至全局消息表
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<text class='icon tn-icon-left'></text>
|
||||
</view>
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-center ">
|
||||
<text class="tn-text-bold tn-text-lg tn-color-black">{{ t('navTitle') }}</text>
|
||||
<text class="tn-text-bold tn-text-lg tn-color-black">{{ $tr('资料图库') }}</text>
|
||||
</view>
|
||||
</tn-nav-bar>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<view class="justify-content-item align-content-item" style="width: 100vw;">
|
||||
<view class="tn-flex tn-flex-col-center" style="border: 1rpx solid #D2D2D2;border-radius: 100rpx;padding: 10rpx 20rpx 10rpx 20rpx;width: 90%;">
|
||||
<text class="tn-icon-search justify-content-item tn-padding-right-xs tn-color-gray tn-text-lg"></text>
|
||||
<input class="justify-content-item" :placeholder="t('searchPlaceholder')" name="input" placeholder-style="color:#AAAAAA" style="width: 90%;"></input>
|
||||
<input class="justify-content-item" :placeholder="$tr('请输入搜索关键词')" name="input" placeholder-style="color:#AAAAAA" style="width: 90%;"></input>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<view class="justify-content-item tn-text-center">
|
||||
<!-- 没输入前-->
|
||||
<tn-button backgroundColor="#3C97FF80" shape="round" padding="20rpx 20rpx" width="150rpx" @tap="">
|
||||
<text class="tn-color-white">{{ t('searchButton') }}</text>
|
||||
<text class="tn-color-white">{{ $tr('搜 索') }}</text>
|
||||
</tn-button>
|
||||
<!-- 输入后 -->
|
||||
<!-- <tn-button backgroundColor="#3C97FF" shape="round" padding="20rpx 20rpx" width="150rpx" @tap="">
|
||||
@@ -70,22 +70,6 @@
|
||||
export default {
|
||||
name: 'List',
|
||||
mixins: [template_page_mixin],
|
||||
i18n: {
|
||||
zh: {
|
||||
navTitle: '资料图库',
|
||||
searchPlaceholder: '请输入搜索关键词',
|
||||
searchButton: '搜 索',
|
||||
galleryImage: '游戏攻略图',
|
||||
galleryImageLong: '游戏攻略图游戏攻略图游戏攻略图'
|
||||
},
|
||||
en: {
|
||||
navTitle: 'Gallery',
|
||||
searchPlaceholder: 'Enter search keywords',
|
||||
searchButton: 'Search',
|
||||
galleryImage: 'Guide Image',
|
||||
galleryImageLong: 'Guide Image Guide Image Guide Image'
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
list: [
|
||||
@@ -158,13 +142,10 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key, params) {
|
||||
return this.$tm('pkgExplore.download.download', key, params)
|
||||
},
|
||||
syncList() {
|
||||
this.list = this.list.map((item, index) => ({
|
||||
...item,
|
||||
desc: index === 1 ? this.t('galleryImageLong') : this.t('galleryImage')
|
||||
desc: index === 1 ? this.$tr('游戏攻略图游戏攻略图游戏攻略图') : this.$tr('游戏攻略图')
|
||||
}))
|
||||
},
|
||||
// 跳转
|
||||
|
||||
@@ -7,31 +7,31 @@
|
||||
<text class='icon tn-icon-left'></text>
|
||||
</view>
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-center ">
|
||||
<text class="tn-text-bold tn-text-xl tn-color-black">{{ t('navTitle') }}</text>
|
||||
<text class="tn-text-bold tn-text-xl tn-color-black">{{ $tr('应用专区') }}</text>
|
||||
</view>
|
||||
</tn-nav-bar>
|
||||
|
||||
<view class="top-fixed" :style="{paddingTop: vuex_custom_bar_height + 10 + 'px'}">
|
||||
<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding-left-sm tn-padding-right-sm">
|
||||
<view class="tn-flex tn-flex-col-center tn-padding-sm">
|
||||
<view class="tn-padding-right-xs">{{ t('sortDefault') }}</view>
|
||||
<view class="tn-padding-right-xs">{{ $tr('默认') }}</view>
|
||||
<!-- <view class="ri-bookmark-line tn-color-gray--dark"></view> -->
|
||||
</view>
|
||||
<view class="tn-flex tn-flex-col-center tn-padding-sm" @tap="openTypeModal">
|
||||
<view class="tn-padding-right-xs">{{ t('typeLabel') }}</view>
|
||||
<view class="tn-padding-right-xs">{{ $tr('类型') }}</view>
|
||||
<view class="tn-icon-down-fill icon-active" v-if="showTypeModal"></view>
|
||||
<view class="tn-icon-down-fill tn-color-gray--dark" v-else></view>
|
||||
</view>
|
||||
<view class="tn-flex tn-flex-col-center tn-padding-sm">
|
||||
<view class="tn-padding-right-xs">{{ t('salesLabel') }}</view>
|
||||
<view class="tn-padding-right-xs">{{ $tr('销量') }}</view>
|
||||
<view class="tn-icon-sort tn-color-gray--dark"></view>
|
||||
</view>
|
||||
<view class="tn-flex tn-flex-col-center tn-padding-sm">
|
||||
<view class="tn-padding-right-xs">{{ t('priceLabel') }}</view>
|
||||
<view class="tn-padding-right-xs">{{ $tr('价格') }}</view>
|
||||
<view class="tn-icon-sort tn-color-gray--dark"></view>
|
||||
</view>
|
||||
<view class="tn-flex tn-flex-col-center tn-padding-sm" @tap="openSelectModal">
|
||||
<view class="tn-padding-right-xs">{{ t('comprehensiveLabel') }}</view>
|
||||
<view class="tn-padding-right-xs">{{ $tr('综合') }}</view>
|
||||
<view class="tn-icon-filter tn-color-gray--dark tn-text-sm"></view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -58,7 +58,7 @@
|
||||
<view class="justify-content-item tn-flex tn-flex-col-center tn-padding-left-sm tn-padding-right-sm" style="margin-left: -6rpx;color: #333333;">
|
||||
<text class="tn-text-sm">¥</text>
|
||||
<text class="tn-padding-right-sm tn-text-lg tn-text-bold">{{ item.price }}</text>
|
||||
<text class="tn-color-gray tn-text-sm" style="color: #C1CACF;"> {{ item.number }} {{ t('purchasedSuffix') }}</text>
|
||||
<text class="tn-color-gray tn-text-sm" style="color: #C1CACF;"> {{ item.number }} {{ $tr('人已购') }}</text>
|
||||
</view>
|
||||
<!-- <view class="justify-content-item tn-flex tn-flex-col-center">
|
||||
<tn-button size="sm" shape="icon" backgroundColor="#3e486400" fontColor="#333333" padding="10rpx 0 0 0">
|
||||
@@ -95,40 +95,6 @@
|
||||
components: { TypeModal , SelectModal },
|
||||
name: 'TemplateFilter',
|
||||
mixins: [template_page_mixin],
|
||||
i18n: {
|
||||
zh: {
|
||||
navTitle: '应用专区',
|
||||
sortDefault: '默认',
|
||||
typeLabel: '类型',
|
||||
salesLabel: '销量',
|
||||
priceLabel: '价格',
|
||||
comprehensiveLabel: '综合',
|
||||
purchasedSuffix: '人已购',
|
||||
product1: '蛋仔派对',
|
||||
product2: '保卫萝卜',
|
||||
product3: '旅行青蛙',
|
||||
product4: '辐射避难所',
|
||||
product5: '王国保卫战',
|
||||
product6: '崩坏 · 星穹铁道',
|
||||
product7: '纪念碑谷'
|
||||
},
|
||||
en: {
|
||||
navTitle: 'App Zone',
|
||||
sortDefault: 'Default',
|
||||
typeLabel: 'Type',
|
||||
salesLabel: 'Sales',
|
||||
priceLabel: 'Price',
|
||||
comprehensiveLabel: 'All',
|
||||
purchasedSuffix: 'purchased',
|
||||
product1: 'Eggy Party',
|
||||
product2: 'Carrot Defense',
|
||||
product3: 'Travel Frog',
|
||||
product4: 'Fallout Shelter',
|
||||
product5: 'Kingdom Rush',
|
||||
product6: 'Honkai: Star Rail',
|
||||
product7: 'Monument Valley'
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
/* 选择弹窗*/
|
||||
@@ -197,14 +163,11 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key, params) {
|
||||
return this.$tm('pkgExplore.filter.filter', key, params)
|
||||
},
|
||||
syncProducts() {
|
||||
const keys = ['product1', 'product2', 'product3', 'product4', 'product5', 'product6', 'product7']
|
||||
const names = ['蛋仔派对', '保卫萝卜', '旅行青蛙', '辐射避难所', '王国保卫战', '崩坏 · 星穹铁道', '纪念碑谷']
|
||||
this.product = this.product.map((item, index) => ({
|
||||
...item,
|
||||
desc: this.t(keys[index] || 'product1')
|
||||
desc: this.$tr(names[index] || '蛋仔派对')
|
||||
}))
|
||||
},
|
||||
// 打开选择弹框
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<view class="section-header tn-flex tn-flex-row-between tn-flex-col-center">
|
||||
<view class="title-wrap tn-flex tn-flex-col-center">
|
||||
<view class="title-accent"></view>
|
||||
<text class="section-title">{{ t('sectionTitle') }}</text>
|
||||
<text class="section-title">{{ $tr('房间配置') }}</text>
|
||||
</view>
|
||||
<text class="section-subtitle">{{ t('sectionSubtitle', { count: assetList.length }) }}</text>
|
||||
<text class="section-subtitle">{{ $tr('{count} 项配置', { count: assetList.length }) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="asset-grid">
|
||||
@@ -53,11 +53,7 @@ export default {
|
||||
default: 'zh'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key, params = {}) {
|
||||
return this.$tm('pkgExplore.room_detail.room_detail', key, params)
|
||||
}
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="room-hero">
|
||||
<view v-if="showVrPanel" class="hero-vr-panel" @click="openVR">
|
||||
<image v-if="vrPoster" :src="vrPoster" mode="aspectFill" class="hero-image"></image>
|
||||
<view v-else class="hero-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ t('noImage') }}</view>
|
||||
<view v-else class="hero-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ $tr('暂无图片') }}</view>
|
||||
<view class="hero-vr-glow"></view>
|
||||
<view class="vr-center-entry">
|
||||
<view class="vr-center-ring vr-center-ring--outer"></view>
|
||||
@@ -11,8 +11,8 @@
|
||||
<text class="tn-icon-vr vr-center-core-icon"></text>
|
||||
</view>
|
||||
<view class="vr-center-text">
|
||||
<view class="vr-center-title">{{ t('vrPreview') }}</view>
|
||||
<view class="vr-center-desc">{{ t('vrPreviewDesc') }}</view>
|
||||
<view class="vr-center-title">{{ $tr('VR预览') }}</view>
|
||||
<view class="vr-center-desc">{{ $tr('切换到沉浸式看房模式。') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -30,7 +30,7 @@
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view v-else class="hero-empty tn-flex tn-flex-col-center tn-flex-row-center">
|
||||
{{ t('noImage') }}
|
||||
{{ $tr('暂无图片') }}
|
||||
</view>
|
||||
|
||||
<view class="hero-mask"></view>
|
||||
@@ -46,7 +46,7 @@
|
||||
@click="switchMedia('image')"
|
||||
>
|
||||
<text class="tn-icon-image media-tab-icon"></text>
|
||||
<text>{{ t('imageTab') }}</text>
|
||||
<text>{{ $tr('图片') }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="media-tab"
|
||||
@@ -54,7 +54,7 @@
|
||||
@click="switchMedia('vr')"
|
||||
>
|
||||
<text class="tn-icon-vr media-tab-icon"></text>
|
||||
<text>{{ t('vrPreview') }}</text>
|
||||
<text>{{ $tr('VR预览') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
<!-- 引导下滑箭头 -->
|
||||
<view class="scroll-down-hint tn-flex tn-flex-direction-column tn-flex-col-center">
|
||||
<text class="hint-text">{{ t('swipeUpHint') }}</text>
|
||||
<text class="hint-text">{{ $tr('上滑查看详情') }}</text>
|
||||
<text class="tn-icon-up arrow-icon"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -113,9 +113,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key) {
|
||||
return this.$tm('pkgExplore.room_detail.room_detail', key)
|
||||
},
|
||||
onSwiperChange(e) {
|
||||
this.currentImageIndex = e.detail.current;
|
||||
this.$emit('swiper-change', e);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="room-info-wrapper">
|
||||
<view class="section-panel" v-if="basicInfoRows.length">
|
||||
<view class="section-header">
|
||||
<text class="section-title">{{ t('basicInfo') }}</text>
|
||||
<text class="section-title">{{ $tr('基础信息') }}</text>
|
||||
</view>
|
||||
<view class="info-list">
|
||||
<view v-for="item in basicInfoRows" :key="item.label" class="info-row tn-flex tn-flex-row-between tn-flex-col-center">
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<view class="section-panel" v-if="displayDescriptions.length">
|
||||
<view class="section-header">
|
||||
<text class="section-title">{{ isRoomType ? t('roomTypeDesc') : t('roomDesc') }}</text>
|
||||
<text class="section-title">{{ isRoomType ? $tr('房型介绍') : $tr('房间介绍') }}</text>
|
||||
</view>
|
||||
<view class="desc-wrap" :class="{ 'desc-wrap--collapsed': isDescCollapsed }">
|
||||
<view
|
||||
@@ -32,7 +32,7 @@
|
||||
class="expand-btn tn-flex tn-flex-row-center tn-flex-col-center"
|
||||
@click="toggleDesc"
|
||||
>
|
||||
<text>{{ isDescCollapsed ? t('expandAll') : t('collapse') }}</text>
|
||||
<text>{{ isDescCollapsed ? $tr('展开全部') : $tr('收起') }}</text>
|
||||
<text :class="isDescCollapsed ? 'tn-icon-down' : 'tn-icon-up'" class="expand-icon"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -69,9 +69,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key) {
|
||||
return this.$tm('pkgExplore.room_detail.room_detail', key)
|
||||
},
|
||||
toggleDesc() {
|
||||
this.isDescCollapsed = !this.isDescCollapsed;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="section-panel" v-if="bookingRuleRows.length">
|
||||
<view class="section-header">
|
||||
<text class="section-title">{{ isRoomType ? t('bookingRules') : t('bookingInfo') }}</text>
|
||||
<text class="section-title">{{ isRoomType ? $tr('预订规则') : $tr('预订信息') }}</text>
|
||||
</view>
|
||||
<view class="rule-list">
|
||||
<view v-for="item in bookingRuleRows" :key="item.label" class="rule-item tn-flex tn-flex-row-between tn-flex-col-center">
|
||||
@@ -31,11 +31,7 @@ export default {
|
||||
default: 'zh'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key) {
|
||||
return this.$tm('pkgExplore.room_detail.room_detail', key)
|
||||
}
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
<template v-if="hasPrice">
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-value">{{ detailData.priceValue }}</text>
|
||||
<text class="price-unit">{{ t('priceUnit') }}</text>
|
||||
<text class="price-unit">{{ $tr('/月') }}</text>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text class="price-empty">{{ t('pricePending') }}</text>
|
||||
<text class="price-empty">{{ $tr('待定') }}</text>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<view class="address-info">
|
||||
<view class="address-text tn-text-ellipsis">{{ shortAddress }}</view>
|
||||
<view class="address-sub tn-flex tn-flex-col-center">
|
||||
<text class="address-sub-text">{{ t('addressHint') }}</text>
|
||||
<text class="address-sub-text">{{ $tr('查看地图位置') }}</text>
|
||||
<text class="tn-icon-right address-sub-icon"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -48,7 +48,7 @@
|
||||
<view class="address-right">
|
||||
<view class="nav-btn tn-flex tn-flex-row-center tn-flex-col-center">
|
||||
<text class="tn-icon-navigation-fill"></text>
|
||||
<text class="nav-text">{{ t('navigate') }}</text>
|
||||
<text class="nav-text">{{ $tr('导航') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -91,19 +91,16 @@ export default {
|
||||
shortAddress() {
|
||||
const addr = this.displayAddress;
|
||||
if (!addr) {
|
||||
return this.t('noAddress')
|
||||
return this.$tr('暂无地址')
|
||||
}
|
||||
if (this.language === 'en') {
|
||||
return addr
|
||||
}
|
||||
const short = addr.replace(/^(?:.*?省|.*?自治区)?(?:.*?市|.*?自治州)?/, '');
|
||||
return short.trim() ? short : (addr || this.t('noAddress'));
|
||||
return short.trim() ? short : (addr || this.$tr('暂无地址'));
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key) {
|
||||
return this.$tm('pkgExplore.room_detail.room_detail', key)
|
||||
},
|
||||
handleAddressClick() {
|
||||
this.$emit('open-map', this.detailData)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
:fixed="true"
|
||||
class="glass-nav-bar"
|
||||
>
|
||||
<view class="nav-title" :style="{ opacity: navTitleOpacity, color: navTitleColor }">{{ displayName || t('navDetail') }}</view>
|
||||
<view class="nav-title" :style="{ opacity: navTitleOpacity, color: navTitleColor }">{{ displayName || $tr('房型详情') }}</view>
|
||||
</tn-nav-bar>
|
||||
|
||||
<swiper
|
||||
@@ -50,7 +50,7 @@
|
||||
<view class="compact-hero-panel">
|
||||
<view v-if="showVrPanel" class="compact-vr-panel" @click="openVR">
|
||||
<image v-if="vrPoster" :src="vrPoster" mode="aspectFill" class="compact-hero-image"></image>
|
||||
<view v-else class="compact-hero-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ t('noImage') }}</view>
|
||||
<view v-else class="compact-hero-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ $tr('暂无图片') }}</view>
|
||||
<view class="compact-vr-glow"></view>
|
||||
</view>
|
||||
<swiper
|
||||
@@ -65,7 +65,7 @@
|
||||
<image class="compact-hero-image" :src="image" mode="aspectFill"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view v-else class="compact-hero-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ t('noImage') }}</view>
|
||||
<view v-else class="compact-hero-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ $tr('暂无图片') }}</view>
|
||||
<view class="compact-hero-mask"></view>
|
||||
<view class="compact-hero-topbar tn-flex tn-flex-row-between tn-flex-col-center">
|
||||
<view v-if="hasVR" class="compact-media-tabs">
|
||||
@@ -74,17 +74,17 @@
|
||||
:class="{ 'compact-media-tab--active': currentMediaType === 'image' }"
|
||||
@click="switchMedia('image')"
|
||||
>
|
||||
{{ t('imageTab') }}
|
||||
{{ $tr('图片') }}
|
||||
</view>
|
||||
<view
|
||||
class="compact-media-tab"
|
||||
:class="{ 'compact-media-tab--active': currentMediaType === 'vr' }"
|
||||
@click="switchMedia('vr')"
|
||||
>
|
||||
{{ t('vrTab') }}
|
||||
{{ $tr('VR') }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="galleryList.length" class="compact-hero-counter">{{ t('imageCount', { count: galleryList.length }) }}</view>
|
||||
<view v-if="galleryList.length" class="compact-hero-counter">{{ $tr('{count} 张图片', { count: galleryList.length }) }}</view>
|
||||
</view>
|
||||
<view class="compact-hero-action-layer">
|
||||
<view v-if="showVrPanel" class="compact-hero-center-action" @click="openVR">
|
||||
@@ -94,8 +94,8 @@
|
||||
<text class="tn-icon-vr compact-hero-core-icon"></text>
|
||||
</view>
|
||||
<view class="compact-hero-action-text">
|
||||
<view class="compact-hero-action-title">{{ t('vrPreview') }}</view>
|
||||
<view class="compact-hero-action-desc">{{ t('vrPreviewDesc') }}</view>
|
||||
<view class="compact-hero-action-title">{{ $tr('VR预览') }}</view>
|
||||
<view class="compact-hero-action-desc">{{ $tr('切换到沉浸式看房模式。') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="compact-hero-center-action" @click="previewImage">
|
||||
@@ -105,8 +105,8 @@
|
||||
<text class="tn-icon-image compact-hero-core-icon"></text>
|
||||
</view>
|
||||
<view class="compact-hero-action-text">
|
||||
<view class="compact-hero-action-title">{{ t('viewLargeImage') }}</view>
|
||||
<view class="compact-hero-action-desc">{{ t('viewLargeImageDesc') }}</view>
|
||||
<view class="compact-hero-action-title">{{ $tr('查看大图') }}</view>
|
||||
<view class="compact-hero-action-desc">{{ $tr('点击查看当前图片的大图预览。') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -147,7 +147,7 @@
|
||||
<view class="action-left tn-flex tn-flex-col-center">
|
||||
<button class="action-icon-btn" open-type="share">
|
||||
<text class="tn-icon-share-circle action-icon-font"></text>
|
||||
<text class="action-icon-text">{{ t('share') }}</text>
|
||||
<text class="action-icon-text">{{ $tr('分享') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="action-right tn-flex tn-flex-col-center">
|
||||
@@ -159,7 +159,7 @@
|
||||
class="action-btn action-btn--primary"
|
||||
@click="handleApplyStay"
|
||||
>
|
||||
<text>{{ t('applyStay') }}</text>
|
||||
<text>{{ $tr('申请入住') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -680,7 +680,7 @@ export default {
|
||||
return this.detailData.priceValue !== '' && this.detailData.priceValue !== null
|
||||
},
|
||||
primaryActionText() {
|
||||
return this.isRoomType ? this.t('applyViewing') : this.t('bookRoom')
|
||||
return this.isRoomType ? this.$tr('预约看房') : this.$tr('立即预订')
|
||||
},
|
||||
summaryBadges() {
|
||||
const badges = []
|
||||
@@ -693,30 +693,30 @@ export default {
|
||||
badges.push(localizePayMethodText(this.detailData.payMethod, this.language))
|
||||
}
|
||||
if (this.isRoomType && this.detailData.needApproval === true) {
|
||||
badges.push(this.t('needApproval'))
|
||||
badges.push(this.$tr('需审核'))
|
||||
}
|
||||
if (this.isRoomType && this.detailData.needApproval === false) {
|
||||
badges.push(this.t('noApprovalNeeded'))
|
||||
badges.push(this.$tr('无需审核'))
|
||||
}
|
||||
return badges
|
||||
},
|
||||
basicInfoRows() {
|
||||
const rows = this.isRoomType
|
||||
? [
|
||||
{ label: this.t('roomTypeNameLabel'), value: this.displayName },
|
||||
{ label: this.t('englishNameLabel'), value: this.showEnglishName ? (this.detailData.nameEnDisplay || this.detailData.nameEn) : '' },
|
||||
{ label: this.t('areaLabel'), value: this.language === 'en' ? (this.detailData.areaNameEnDisplay || this.detailData.areaNameEn || this.detailData.areaName) : (this.detailData.areaName || '') },
|
||||
{ label: this.t('payMethodLabel'), value: localizePayMethodText(this.detailData.pricePlan.matchedStrategies || this.detailData.payMethod, this.language) },
|
||||
{ label: this.t('priceLabel'), value: this.hasPrice ? `¥${this.detailData.priceValue}` : '' }
|
||||
{ label: this.$tr('房型名称'), value: this.displayName },
|
||||
{ label: this.$tr('英文名称'), value: this.showEnglishName ? (this.detailData.nameEnDisplay || this.detailData.nameEn) : '' },
|
||||
{ label: this.$tr('所属区域'), value: this.language === 'en' ? (this.detailData.areaNameEnDisplay || this.detailData.areaNameEn || this.detailData.areaName) : (this.detailData.areaName || '') },
|
||||
{ label: this.$tr('支付方式'), value: localizePayMethodText(this.detailData.pricePlan.matchedStrategies || this.detailData.payMethod, this.language) },
|
||||
{ label: this.$tr('价格'), value: this.hasPrice ? `¥${this.detailData.priceValue}` : '' }
|
||||
]
|
||||
: [
|
||||
{ label: this.t('roomCodeLabel'), value: this.detailData.roomCode },
|
||||
{ label: this.t('roomTypeLabel'), value: this.language === 'en' ? (this.detailData.roomTypeNameEnDisplay || this.detailData.roomTypeNameEn || this.detailData.roomTypeName) : (this.detailData.roomTypeName || '') },
|
||||
{ label: this.t('buildingLabel'), value: this.language === 'en' ? (this.detailData.buildingNameEnDisplay || this.detailData.buildingNameEn || this.detailData.buildingName) : (this.detailData.buildingName || '') },
|
||||
{ label: this.t('unitLabel'), value: this.language === 'en' ? (this.detailData.buildingSectionNameEnDisplay || this.detailData.buildingSectionNameEn || this.detailData.buildingSectionName) : (this.detailData.buildingSectionName || '') },
|
||||
{ label: this.t('floorLabel'), value: this.language === 'en' ? (this.detailData.floorNameEnDisplay || this.detailData.floorNameEn || this.detailData.floorName) : (this.detailData.floorName || '') },
|
||||
{ label: this.t('orientationLabel'), value: this.language === 'en' ? (this.detailData.orientationEn || this.detailData.orientation) : (this.detailData.orientation || '') },
|
||||
{ label: this.t('statusLabel'), value: localizeKnownStatusText(this.detailData.statusText, this.language) }
|
||||
{ label: this.$tr('房号'), value: this.detailData.roomCode },
|
||||
{ label: this.$tr('房型'), value: this.language === 'en' ? (this.detailData.roomTypeNameEnDisplay || this.detailData.roomTypeNameEn || this.detailData.roomTypeName) : (this.detailData.roomTypeName || '') },
|
||||
{ label: this.$tr('楼栋'), value: this.language === 'en' ? (this.detailData.buildingNameEnDisplay || this.detailData.buildingNameEn || this.detailData.buildingName) : (this.detailData.buildingName || '') },
|
||||
{ label: this.$tr('单元'), value: this.language === 'en' ? (this.detailData.buildingSectionNameEnDisplay || this.detailData.buildingSectionNameEn || this.detailData.buildingSectionName) : (this.detailData.buildingSectionName || '') },
|
||||
{ label: this.$tr('楼层'), value: this.language === 'en' ? (this.detailData.floorNameEnDisplay || this.detailData.floorNameEn || this.detailData.floorName) : (this.detailData.floorName || '') },
|
||||
{ label: this.$tr('朝向'), value: this.language === 'en' ? (this.detailData.orientationEn || this.detailData.orientation) : (this.detailData.orientation || '') },
|
||||
{ label: this.$tr('状态'), value: localizeKnownStatusText(this.detailData.statusText, this.language) }
|
||||
]
|
||||
|
||||
return rows.filter((item) => item.value)
|
||||
@@ -798,22 +798,19 @@ export default {
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: this.displayName || this.t('shareTitle'),
|
||||
title: this.displayName || this.$tr('房型详情'),
|
||||
path: this.buildSharePath(),
|
||||
imageUrl: this.detailData.image || ''
|
||||
}
|
||||
},
|
||||
onShareTimeline() {
|
||||
return {
|
||||
title: this.displayName || this.t('shareTitle'),
|
||||
title: this.displayName || this.$tr('房型详情'),
|
||||
query: this.buildShareQuery(),
|
||||
imageUrl: this.detailData.image || ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key, params = {}) {
|
||||
return this.$tm('pkgExplore.room_detail.room_detail', key, params)
|
||||
},
|
||||
scheduleAutoSwitch() {
|
||||
if (this.hasAutoSwitched || this.currentSwiperIndex !== 0) {
|
||||
return
|
||||
@@ -870,7 +867,7 @@ export default {
|
||||
},
|
||||
previewImage() {
|
||||
if (!this.galleryList.length) {
|
||||
uni.showToast({ title: this.t('noPreviewImage'), icon: 'none' })
|
||||
uni.showToast({ title: this.$tr('暂无预览图片'), icon: 'none' })
|
||||
return
|
||||
}
|
||||
uni.previewImage({
|
||||
@@ -892,15 +889,15 @@ export default {
|
||||
this.sourceAreaData && this.sourceAreaData.lng
|
||||
)
|
||||
if (latitude === null || longitude === null) {
|
||||
uni.showToast({ title: this.t('noLocation'), icon: 'none' });
|
||||
uni.showToast({ title: this.$tr('暂无位置信息'), icon: 'none' });
|
||||
return;
|
||||
}
|
||||
uni.openLocation({
|
||||
latitude,
|
||||
longitude,
|
||||
name: this.language === 'en'
|
||||
? (detail.buildingNameEnDisplay || detail.buildingNameEn || detail.areaNameEnDisplay || detail.areaNameEn || detail.buildingName || detail.areaName || this.displayName || this.t('apartmentName'))
|
||||
: (detail.buildingName || detail.areaName || this.displayName || this.t('apartmentName')),
|
||||
? (detail.buildingNameEnDisplay || detail.buildingNameEn || detail.areaNameEnDisplay || detail.areaNameEn || detail.buildingName || detail.areaName || this.displayName || this.$tr('公寓'))
|
||||
: (detail.buildingName || detail.areaName || this.displayName || this.$tr('公寓')),
|
||||
address: this.language === 'en'
|
||||
? (detail.addressEnDisplay || detail.addressEn || detail.address || (this.sourceAreaData && (this.sourceAreaData.addressEnDisplay || this.sourceAreaData.addressEn || this.sourceAreaData.address)) || '')
|
||||
: (detail.address || (this.sourceAreaData && this.sourceAreaData.address) || ''),
|
||||
@@ -908,14 +905,14 @@ export default {
|
||||
});
|
||||
},
|
||||
openVR() {
|
||||
const titleZh = `${this.displayName || this.t('roomTypeFallback')} ${this.t('vrViewingTitle')}`
|
||||
const titleZh = `${this.displayName || this.$tr('房型')} ${this.$tr('VR看房')}`
|
||||
const englishName = this.detailData.roomTypeNameEnDisplay
|
||||
|| this.detailData.roomTypeNameEn
|
||||
|| this.detailData.nameEnDisplay
|
||||
|| this.detailData.nameEn
|
||||
|| this.displayName
|
||||
|| this.t('roomTypeFallback')
|
||||
const titleEn = `${englishName} ${this.t('vrViewingTitle')}`
|
||||
|| this.$tr('房型')
|
||||
const titleEn = `${englishName} ${this.$tr('VR看房')}`
|
||||
uni.navigateTo({
|
||||
url: `/pkgExplore/vr_preview/vr_preview?title=${encodeURIComponent(this.language === 'en' ? titleEn : titleZh)}&titleZh=${encodeURIComponent(titleZh)}&titleEn=${encodeURIComponent(titleEn)}&poster=${encodeURIComponent(this.vrPoster || '')}`
|
||||
})
|
||||
@@ -1045,10 +1042,10 @@ export default {
|
||||
|
||||
if (!ensureBookingAccess({
|
||||
language: this.$getLanguage(),
|
||||
loginTitle: this.t('loginTitle'),
|
||||
loginTitle: this.$tr('请先登录'),
|
||||
loginContent: this.isRoomType
|
||||
? this.t('roomTypeApplyLoginContent')
|
||||
: this.t('allRoomsLoginContent'),
|
||||
? this.$tr('请先登录后再提交该房型的看房申请。')
|
||||
: this.$tr('请先登录后再预订该房间。'),
|
||||
loginRedirectUrl: targetUrl
|
||||
})) {
|
||||
return
|
||||
@@ -1068,8 +1065,8 @@ export default {
|
||||
handleApplyStay() {
|
||||
const serviceEntryUrl = this.buildServiceEntryUrl({
|
||||
path: '/pkgService/submit_request/submit_request',
|
||||
title: `${this.displayName || this.t('roomTypeFallback')} ${this.t('stayApplicationSuffix')}`,
|
||||
desc: `${this.t('roomTypeCodePrefix')}${this.detailData.roomTypeCode || ''}.${this.hasPrice ? ` ${this.t('pricePrefix')}¥${this.detailData.priceValue}.` : ''}${this.detailData.pricePlan.matchedStrategies || this.detailData.payMethod ? ` ${this.t('payMethodPrefix')}${localizePayMethodText(this.detailData.pricePlan.matchedStrategies || this.detailData.payMethod, this.language)}.` : ''}`,
|
||||
title: `${this.displayName || this.$tr('房型')} ${this.$tr('入住申请')}`,
|
||||
desc: `${this.$tr('房型编码:')}${this.detailData.roomTypeCode || ''}.${this.hasPrice ? ` ${this.$tr('价格:')}¥${this.detailData.priceValue}.` : ''}${this.detailData.pricePlan.matchedStrategies || this.detailData.payMethod ? ` ${this.$tr('支付方式:')}${localizePayMethodText(this.detailData.pricePlan.matchedStrategies || this.detailData.payMethod, this.language)}.` : ''}`,
|
||||
key: 'roomTypeSubmitList',
|
||||
payload: {
|
||||
sourceType: 'area-room-type',
|
||||
@@ -1091,8 +1088,8 @@ export default {
|
||||
|
||||
if (!ensureBookingAccess({
|
||||
language: this.$getLanguage(),
|
||||
loginTitle: this.t('loginTitle'),
|
||||
loginContent: this.t('stayLoginContent'),
|
||||
loginTitle: this.$tr('请先登录'),
|
||||
loginContent: this.$tr('请先登录后再提交入住申请。'),
|
||||
loginRedirectUrl: serviceEntryUrl
|
||||
})) {
|
||||
return
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
</view>
|
||||
<view class="tn-margin tn-padding-top-sm" style="color: #001E50;font-size: 50rpx;">
|
||||
<text class="tn-text-bold">62,888</text>
|
||||
<text class="tn-padding-left-xs tn-text-xs tn-color-gray">{{ t('pointsUnit') }}</text>
|
||||
<text class="tn-padding-left-xs tn-text-xs tn-color-gray">{{ $tr('积分') }}</text>
|
||||
</view>
|
||||
<view class="tn-margin tn-text-sm" style="color: #001E50;">
|
||||
{{ t('pointsRecord') }} <text class="tn-icon-right tn-padding-left-xs tn-color-gray"></text>
|
||||
{{ $tr('积分记录') }} <text class="tn-icon-right tn-padding-left-xs tn-color-gray"></text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -84,7 +84,7 @@
|
||||
<!-- 未签到-->
|
||||
<view class="tn-flex-1 justify-content-item tn-margin-xs tn-text-center">
|
||||
<tn-button shape="round" backgroundColor="$brand-primary" fontColor="#FFFFFF" padding="40rpx 0" width="100%" :fontSize="30" @tap="showLandscape">
|
||||
<text class="">{{ t('checkInNow') }}</text>
|
||||
<text class="">{{ $tr('立即签到') }}</text>
|
||||
</tn-button>
|
||||
</view>
|
||||
|
||||
@@ -96,12 +96,12 @@
|
||||
</view> -->
|
||||
|
||||
<view class="tn-strip-bottom-min tn-padding" style="color: #95A3A8;">
|
||||
{{ t('checkInRewardHint') }}
|
||||
{{ $tr('坚持每天连续签到可以获得多重奖励哦') }}
|
||||
</view>
|
||||
|
||||
<view class="tn-padding-left tn-pright tn-padding-top tn-padding-bottom tn-text-sm" style="color: #95A3A8;">
|
||||
{{ t('warmTip') }}<br>
|
||||
{{ t('warmTipDesc') }}
|
||||
{{ $tr('温馨提示:') }}<br>
|
||||
{{ $tr('每日签到可获得10积分奖励,连续完成7天签到可能获得额外奖励,连续签到满7天后将会重置签到记录。') }}
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -110,10 +110,10 @@
|
||||
<view class="tn-padding-top-sm">
|
||||
<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin" @click="tn('')">
|
||||
<view class="justify-content-item tn-text-bold tn-text-lg tn-padding-left-xs">
|
||||
{{ t('taskSectionTitle') }}
|
||||
{{ $tr('做任务领金币') }}
|
||||
</view>
|
||||
<view class="justify-content-item tn-text-df" style="color: #C1CACF;">
|
||||
<text class="tn-padding-xs">{{ t('more') }}</text>
|
||||
<text class="tn-padding-xs">{{ $tr('更多') }}</text>
|
||||
<text class="tn-icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -130,7 +130,7 @@
|
||||
</view>
|
||||
<view class="justify-content-item">
|
||||
<tn-button shape="round" size="sm" backgroundColor="$brand-primary" fontColor="#FFFFFF" padding="30rpx 0" width="160rpx">
|
||||
<text class="tn-text-bold tn-text-sm">{{ t('goComplete') }}</text>
|
||||
<text class="tn-text-bold tn-text-sm">{{ $tr('去完成') }}</text>
|
||||
<text class="tn-icon-right-fill tn-padding-left-xs tn-text-lg"></text>
|
||||
</tn-button>
|
||||
</view>
|
||||
@@ -156,19 +156,19 @@
|
||||
<image src="https://cdn.nlark.com/yuque/0/2024/png/280373/1719936460577-assets/web-upload/697ed6f1-6126-4734-bd80-bed28296e16d.png" mode="aspectFit" style="width: 320rpx;height: 330rpx;"></image>
|
||||
</view>
|
||||
<view class="tn-text-xl tn-text-bold" style="padding-top: 120rpx;">
|
||||
{{ t('checkInSuccess') }}
|
||||
{{ $tr('签到成功') }}
|
||||
</view>
|
||||
<view class="tn-padding tn-color-gray--dark">
|
||||
<text>{{ t('checkedInFor') }}</text>
|
||||
<text>{{ $tr('已连续签到') }}</text>
|
||||
<text class="tn-color-orangered" style="padding-left: 6rpx;padding-right: 6rpx">3</text>
|
||||
<text>{{ t('daysAndEarned') }}</text>
|
||||
<text>{{ $tr('天,获得') }}</text>
|
||||
<text class="tn-color-orangered" style="padding-left: 6rpx;padding-right: 6rpx">20</text>
|
||||
<text>{{ t('pointsUnit') }}</text>
|
||||
<text>{{ $tr('积分') }}</text>
|
||||
</view>
|
||||
<view class=" tn-padding tn-color-gray">
|
||||
<text>{{ t('continuousCheckIn') }}</text>
|
||||
<text>{{ $tr('连续签到') }}</text>
|
||||
<text class="tn-color-orangered" style="padding-left: 6rpx;padding-right: 6rpx;">7</text>
|
||||
<text>{{ t('daysRewardHint') }}</text>
|
||||
<text>{{ $tr('天可获得额外奖励哦!') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -186,50 +186,6 @@
|
||||
export default {
|
||||
name: 'Sign',
|
||||
mixins: [template_page_mixin],
|
||||
i18n: {
|
||||
zh: {
|
||||
pointsUnit: '积分',
|
||||
pointsRecord: '积分记录',
|
||||
checkInNow: '立即签到',
|
||||
checkInRewardHint: '坚持每天连续签到可以获得多重奖励哦',
|
||||
warmTip: '温馨提示:',
|
||||
warmTipDesc: '每日签到可获得10积分奖励,连续完成7天签到可能获得额外奖励,连续签到满7天后将会重置签到记录。',
|
||||
taskSectionTitle: '做任务领金币',
|
||||
more: '更多',
|
||||
goComplete: '去完成',
|
||||
checkInSuccess: '签到成功',
|
||||
checkedInFor: '已连续签到',
|
||||
daysAndEarned: '天,获得',
|
||||
continuousCheckIn: '连续签到',
|
||||
daysRewardHint: '天可获得额外奖励哦!',
|
||||
notice1: '恭喜 付*其 连续7天签到,获得 300积分 奖励',
|
||||
notice2: '恭喜 徐*圆 连续7天签到,获得 300积分 奖励',
|
||||
notice3: '恭喜 蔡*东 连续7天签到,获得 300积分 奖励',
|
||||
taskName: '任务名称',
|
||||
taskDesc: '抓住那只猪吖'
|
||||
},
|
||||
en: {
|
||||
pointsUnit: 'Points',
|
||||
pointsRecord: 'Points History',
|
||||
checkInNow: 'Check In Now',
|
||||
checkInRewardHint: 'Daily continuous check-ins unlock multiple rewards',
|
||||
warmTip: 'Tips:',
|
||||
warmTipDesc: 'Daily check-in grants 10 points. Completing 7 consecutive days may unlock extra rewards, and the record resets after day 7.',
|
||||
taskSectionTitle: 'Complete Tasks for Coins',
|
||||
more: 'More',
|
||||
goComplete: 'Go',
|
||||
checkInSuccess: 'Check-in Successful',
|
||||
checkedInFor: 'Checked in for',
|
||||
daysAndEarned: 'days and earned',
|
||||
continuousCheckIn: 'Continuous check-in',
|
||||
daysRewardHint: 'days unlocks extra rewards!',
|
||||
notice1: 'Congrats to Fu*qi for 7 consecutive check-ins and earning 300 points',
|
||||
notice2: 'Congrats to Xu*yuan for 7 consecutive check-ins and earning 300 points',
|
||||
notice3: 'Congrats to Cai*dong for 7 consecutive check-ins and earning 300 points',
|
||||
taskName: 'Task Name',
|
||||
taskDesc: 'Catch That Pig'
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
show: true,
|
||||
@@ -238,19 +194,16 @@
|
||||
},
|
||||
computed: {
|
||||
noticeList() {
|
||||
return [this.t('notice1'), this.t('notice2'), this.t('notice3')]
|
||||
return [this.$tr('恭喜 付*其 连续7天签到,获得 300积分 奖励'), this.$tr('恭喜 徐*圆 连续7天签到,获得 300积分 奖励'), this.$tr('恭喜 蔡*东 连续7天签到,获得 300积分 奖励')]
|
||||
},
|
||||
taskList() {
|
||||
return Array.from({ length: 6 }).map(() => ({
|
||||
title: this.t('taskName'),
|
||||
desc: this.t('taskDesc')
|
||||
title: this.$tr('任务名称'),
|
||||
desc: this.$tr('抓住那只猪吖')
|
||||
}))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key, params) {
|
||||
return this.$tm('pkgExplore.sign.sign', key, params)
|
||||
},
|
||||
// 跳转
|
||||
tn(e) {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="section-panel" v-if="facilityList && facilityList.length">
|
||||
<view class="section-header">
|
||||
<text class="section-title">{{ t('sectionTitle') }}</text>
|
||||
<text class="section-title">{{ $tr('配套设施') }}</text>
|
||||
</view>
|
||||
<view class="facility-grid tn-flex tn-flex-wrap">
|
||||
<view class="facility-item tn-flex tn-flex-direction-column tn-flex-col-center" v-for="(item, index) in facilityList" :key="index">
|
||||
@@ -24,11 +24,7 @@ export default {
|
||||
default: 'zh'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key) {
|
||||
return this.$tm('pkgExplore.store_detail.store_detail', key)
|
||||
}
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="section-panel room-section">
|
||||
<view class="section-header tn-flex tn-flex-row-between tn-flex-col-center">
|
||||
<text class="section-title">{{ t('roomSectionTitle', { count: roomTypes.length }) }}</text>
|
||||
<text class="section-title">{{ $tr('在租房型({count})', { count: roomTypes.length }) }}</text>
|
||||
</view>
|
||||
<view class="room-list-vertical">
|
||||
<view
|
||||
@@ -28,11 +28,11 @@
|
||||
<view class="room-bottom-v tn-flex tn-flex-row-between tn-flex-col-bottom">
|
||||
<view class="room-price-v">
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-val">{{ formatPriceValue(room.price) || t('pricePending') }}</text>
|
||||
<text class="price-unit">{{ t('priceUnit') }}</text>
|
||||
<text class="price-val">{{ formatPriceValue(room.price) || $tr('待定') }}</text>
|
||||
<text class="price-unit">{{ $tr('/月') }}</text>
|
||||
</view>
|
||||
<view class="go-btn-v tn-flex tn-flex-col-center tn-flex-row-center">
|
||||
<text>{{ t('viewDetails') }}</text>
|
||||
<text>{{ $tr('查看详情') }}</text>
|
||||
<text class="tn-icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -65,9 +65,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key, params = {}) {
|
||||
return this.$tm('pkgExplore.store_detail.store_detail', key, params)
|
||||
},
|
||||
formatPriceValue(priceText) {
|
||||
if (!priceText) {
|
||||
return ''
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<text class="address-title tn-text-ellipsis">{{ shortAddress }}</text>
|
||||
</view>
|
||||
<view class="address-right tn-flex tn-flex-col-center">
|
||||
<text class="nav-text">{{ t('navigate') }}</text>
|
||||
<text class="nav-text">{{ $tr('导航') }}</text>
|
||||
<text class="tn-icon-right nav-arrow"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -17,7 +17,7 @@
|
||||
<!-- 小区简介 -->
|
||||
<view class="section-panel" v-if="displayDescription">
|
||||
<view class="section-header">
|
||||
<text class="section-title">{{ t('storeIntro') }}</text>
|
||||
<text class="section-title">{{ $tr('小区简介') }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="store-desc"
|
||||
@@ -29,7 +29,7 @@
|
||||
<text v-else>{{ displayDescription }}</text>
|
||||
</view>
|
||||
<view v-if="shouldShowToggle" class="expand-btn tn-flex tn-flex-row-center tn-flex-col-center" @click="toggleDesc">
|
||||
<text>{{ isDescCollapsed ? t('expandAll') : t('collapse') }}</text>
|
||||
<text>{{ isDescCollapsed ? $tr('展开全部') : $tr('收起') }}</text>
|
||||
<text :class="isDescCollapsed ? 'tn-icon-down' : 'tn-icon-up'" class="expand-icon"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -104,19 +104,16 @@ export default {
|
||||
? (this.storeData.addressEnDisplay || this.storeData.addressEn || this.storeData.address || '')
|
||||
: (this.storeData.address || this.storeData.addressEn || '')
|
||||
if (!addr) {
|
||||
return this.t('noAddress')
|
||||
return this.$tr('暂无地址')
|
||||
}
|
||||
if (this.language === 'en') {
|
||||
return addr
|
||||
}
|
||||
const short = addr.replace(/^(?:.*?省|.*?自治区)?(?:.*?市|.*?自治州)?/, '');
|
||||
return short.trim() ? short : (addr || this.t('noAddress'));
|
||||
return short.trim() ? short : (addr || this.$tr('暂无地址'));
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key) {
|
||||
return this.$tm('pkgExplore.store_detail.store_detail', key)
|
||||
},
|
||||
toggleDesc() {
|
||||
this.isDescCollapsed = !this.isDescCollapsed;
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<image class="bg-image" :src="image" mode="aspectFill"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view v-else class="bg-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ t('noImage') }}</view>
|
||||
<view v-else class="bg-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ $tr('暂无图片') }}</view>
|
||||
<!-- 渐变暗化遮罩,确保上层文字卡片清晰 -->
|
||||
<view class="bg-mask"></view>
|
||||
</view>
|
||||
@@ -88,7 +88,7 @@
|
||||
<view class="action-bar">
|
||||
<button class="action-btn action-btn--glass" open-type="share">
|
||||
<text class="tn-icon-share action-btn__icon"></text>
|
||||
<text>{{ t('share') }}</text>
|
||||
<text>{{ $tr('分享') }}</text>
|
||||
</button>
|
||||
<button class="action-btn action-btn--primary-glass" @click="handleCall">
|
||||
<text class="tn-icon-phone action-btn__icon"></text>
|
||||
@@ -165,9 +165,9 @@ export default {
|
||||
},
|
||||
displayStoreName() {
|
||||
if (this.language === 'en') {
|
||||
return this.storeData.nameEnDisplay || this.storeData.nameEn || this.storeData.name || this.t('apartmentName')
|
||||
return this.storeData.nameEnDisplay || this.storeData.nameEn || this.storeData.name || this.$tr('公寓详情')
|
||||
}
|
||||
return this.storeData.name || this.storeData.nameEn || this.t('apartmentName')
|
||||
return this.storeData.name || this.storeData.nameEn || this.$tr('公寓详情')
|
||||
},
|
||||
displayStoreAddress() {
|
||||
if (this.language === 'en') {
|
||||
@@ -214,15 +214,15 @@ export default {
|
||||
},
|
||||
contactButtonText() {
|
||||
if (this.isAreaManagerLoading) {
|
||||
return this.t('loading')
|
||||
return this.$tr('加载中...')
|
||||
}
|
||||
if (this.areaManagerOptions.length > 1) {
|
||||
return this.t('selectContact')
|
||||
return this.$tr('选择联系人')
|
||||
}
|
||||
if (this.areaManagerName) {
|
||||
return this.t('contactManager')
|
||||
return this.$tr('联系管家')
|
||||
}
|
||||
return this.t('phoneConsult')
|
||||
return this.$tr('电话咨询')
|
||||
},
|
||||
navBarBackStyle() {
|
||||
const isDarkBg = this.scrollTop < 100;
|
||||
@@ -253,29 +253,26 @@ export default {
|
||||
this.applyStoreData(data)
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(this.t('parseStoreDataFailed'), e);
|
||||
console.error(this.$tr('解析小区数据失败'), e);
|
||||
})
|
||||
return
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: this.displayStoreName || this.t('shareTitle'),
|
||||
title: this.displayStoreName || this.$tr('小区详情'),
|
||||
path: `/pkgExplore/store_detail/store_detail?storeData=${encodeURIComponent(JSON.stringify(this.storeData || {}))}`,
|
||||
imageUrl: this.heroImage || ''
|
||||
}
|
||||
},
|
||||
onShareTimeline() {
|
||||
return {
|
||||
title: this.displayStoreName || this.t('shareTitle'),
|
||||
title: this.displayStoreName || this.$tr('小区详情'),
|
||||
query: `storeData=${encodeURIComponent(JSON.stringify(this.storeData || {}))}`,
|
||||
imageUrl: this.heroImage || ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key) {
|
||||
return this.$tm('pkgExplore.store_detail.store_detail', key)
|
||||
},
|
||||
applyStoreData(data) {
|
||||
this.storeData = data && typeof data === 'object' ? data : {}
|
||||
this.roomTypes = this.storeData.roomTypes || []
|
||||
@@ -333,16 +330,16 @@ export default {
|
||||
},
|
||||
getManagerActionText(manager) {
|
||||
if (!manager) {
|
||||
return this.t('phoneConsult')
|
||||
return this.$tr('电话咨询')
|
||||
}
|
||||
if (manager.displayName && manager.phone) {
|
||||
return `${manager.displayName}(${manager.phone})`
|
||||
}
|
||||
return manager.displayName || manager.phone || this.t('phoneConsult')
|
||||
return manager.displayName || manager.phone || this.$tr('电话咨询')
|
||||
},
|
||||
makePhoneCall(phoneNumber) {
|
||||
if (!phoneNumber) {
|
||||
uni.showToast({ title: this.t('noServicePhone'), icon: 'none' })
|
||||
uni.showToast({ title: this.$tr('暂无联系电话'), icon: 'none' })
|
||||
return
|
||||
}
|
||||
uni.makePhoneCall({
|
||||
@@ -360,7 +357,7 @@ export default {
|
||||
const longitude = parseCoordinate(this.storeData.longitude, this.storeData.lng)
|
||||
if (latitude === null || longitude === null) {
|
||||
uni.showToast({
|
||||
title: this.t('noLocation'),
|
||||
title: this.$tr('暂无位置信息'),
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -368,7 +365,7 @@ export default {
|
||||
uni.openLocation({
|
||||
latitude,
|
||||
longitude,
|
||||
name: this.displayStoreName || this.t('apartmentName'),
|
||||
name: this.displayStoreName || this.$tr('公寓详情'),
|
||||
address: this.displayStoreAddress || '',
|
||||
scale: 18
|
||||
});
|
||||
@@ -390,7 +387,7 @@ export default {
|
||||
},
|
||||
handleCall() {
|
||||
if (this.isAreaManagerLoading && !this.contactPhoneNumber) {
|
||||
uni.showToast({ title: this.t('loadingManagerInfo'), icon: 'none' })
|
||||
uni.showToast({ title: this.$tr('正在加载管家信息'), icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -12,23 +12,23 @@
|
||||
|
||||
<view class="vr-stage">
|
||||
<image v-if="poster" :src="poster" mode="aspectFill" class="vr-poster"></image>
|
||||
<view v-else class="vr-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ t('emptyPreview') }}</view>
|
||||
<view v-else class="vr-empty tn-flex tn-flex-col-center tn-flex-row-center">{{ $tr('暂无VR预览画面') }}</view>
|
||||
<view class="vr-mask"></view>
|
||||
|
||||
<view class="vr-mode-chip">{{ t('modeChip') }}</view>
|
||||
<view class="vr-mode-chip">{{ $tr('VR预览模式') }}</view>
|
||||
|
||||
<view class="vr-center-indicator" @click="openPosterPreview">
|
||||
<view class="indicator-ring"></view>
|
||||
<view class="indicator-core">
|
||||
<text class="tn-icon-vr indicator-icon"></text>
|
||||
</view>
|
||||
<text class="indicator-text">{{ poster ? t('viewFullscreen') : t('waitingAsset') }}</text>
|
||||
<text class="indicator-text">{{ poster ? $tr('查看全屏预览') : $tr('等待素材接入') }}</text>
|
||||
</view>
|
||||
|
||||
<view class="vr-bottom-bar tn-safe-area-inset-bottom">
|
||||
<view class="vr-title-area">
|
||||
<view class="vr-title">{{ resolvedPageTitle }}</view>
|
||||
<view class="vr-subtitle">{{ poster ? t('posterSubtitle') : t('placeholderSubtitle') }}</view>
|
||||
<view class="vr-subtitle">{{ poster ? $tr('当前展示 VR 预览海报,可点击查看大图。') : $tr('当前房型已保留 VR 入口,后续可继续接入更完整的沉浸式资源。') }}</view>
|
||||
</view>
|
||||
|
||||
<view class="vr-action-circle" @click="openPosterPreview">
|
||||
@@ -41,28 +41,6 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
i18n: {
|
||||
zh: {
|
||||
defaultTitle: 'VR看房',
|
||||
emptyPreview: '暂无VR预览画面',
|
||||
modeChip: 'VR预览模式',
|
||||
viewFullscreen: '查看全屏预览',
|
||||
waitingAsset: '等待素材接入',
|
||||
posterSubtitle: '当前展示 VR 预览海报,可点击查看大图。',
|
||||
placeholderSubtitle: '当前房型已保留 VR 入口,后续可继续接入更完整的沉浸式资源。',
|
||||
noAsset: '暂无VR预览素材'
|
||||
},
|
||||
en: {
|
||||
defaultTitle: 'VR Viewing',
|
||||
emptyPreview: 'No VR preview available',
|
||||
modeChip: 'VR Preview',
|
||||
viewFullscreen: 'View Fullscreen',
|
||||
waitingAsset: 'Waiting for assets',
|
||||
posterSubtitle: 'The current VR preview poster is displayed. Tap to view the full image.',
|
||||
placeholderSubtitle: 'This room type keeps its VR entry reserved for richer immersive assets later.',
|
||||
noAsset: 'No VR preview asset available'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageTitleZh: '',
|
||||
@@ -74,9 +52,9 @@ export default {
|
||||
computed: {
|
||||
resolvedPageTitle() {
|
||||
if (this.$getLanguage() === 'en') {
|
||||
return this.pageTitleEn || this.pageTitleZh || this.rawPageTitle || this.t('defaultTitle')
|
||||
return this.pageTitleEn || this.pageTitleZh || this.rawPageTitle || this.$tr('VR看房')
|
||||
}
|
||||
return this.pageTitleZh || this.pageTitleEn || this.rawPageTitle || this.t('defaultTitle')
|
||||
return this.pageTitleZh || this.pageTitleEn || this.rawPageTitle || this.$tr('VR看房')
|
||||
},
|
||||
navBarBackStyle() {
|
||||
return {
|
||||
@@ -112,13 +90,10 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key, params) {
|
||||
return this.$tm('pkgExplore.vr_preview.vr_preview', key, params)
|
||||
},
|
||||
openPosterPreview() {
|
||||
if (!this.poster) {
|
||||
uni.showToast({
|
||||
title: this.t('noAsset'),
|
||||
title: this.$tr('暂无VR预览素材'),
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user