chore: initial import
This commit is contained in:
75
pkgExplore/store_detail/components/FacilityList.vue
Normal file
75
pkgExplore/store_detail/components/FacilityList.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<view class="section-panel" v-if="facilityList && facilityList.length">
|
||||
<view class="section-header">
|
||||
<text class="section-title">{{ t('sectionTitle') }}</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">
|
||||
<text :class="item.icon" class="facility-icon"></text>
|
||||
<text class="facility-name">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
facilityList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
language: {
|
||||
type: String,
|
||||
default: 'zh'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key) {
|
||||
return this.$tm('pkgExplore.store_detail.store_detail', key)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.section-panel {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.15);
|
||||
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||
margin: 24rpx 32rpx 0;
|
||||
padding: 32rpx;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.facility-grid {
|
||||
gap: 32rpx 0;
|
||||
}
|
||||
|
||||
.facility-item {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.facility-icon {
|
||||
font-size: 52rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.facility-name {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
</style>
|
||||
239
pkgExplore/store_detail/components/RoomList.vue
Normal file
239
pkgExplore/store_detail/components/RoomList.vue
Normal file
@@ -0,0 +1,239 @@
|
||||
<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>
|
||||
</view>
|
||||
<view class="room-list-vertical">
|
||||
<view
|
||||
class="room-card-v"
|
||||
v-for="room in roomTypes"
|
||||
:key="room.code"
|
||||
@click="goToRoomDetail(room)"
|
||||
>
|
||||
<view class="room-img-v">
|
||||
<image class="img" :src="room.images && room.images[0] ? room.images[0] : ''" mode="aspectFill"></image>
|
||||
<view class="pay-method-tag" v-if="room.payMethod">{{ getPayMethodText(room.payMethod) }}</view>
|
||||
</view>
|
||||
<view class="room-info-v">
|
||||
<view class="room-header-v tn-flex tn-flex-row-between tn-flex-col-center">
|
||||
<view class="room-name-v tn-text-ellipsis">{{ getRoomName(room) }}</view>
|
||||
</view>
|
||||
|
||||
<view v-if="room.tags && room.tags.length" class="room-tags-v tn-flex tn-flex-wrap">
|
||||
<view class="tag-v" v-for="(tag, index) in room.tags.slice(0, 3)" :key="index">{{ getDisplayTag(tag) }}</view>
|
||||
</view>
|
||||
|
||||
<view v-if="getRoomDescription(room)" class="room-desc-v tn-text-ellipsis">{{ getRoomDescription(room) }}</view>
|
||||
|
||||
<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>
|
||||
</view>
|
||||
<view class="go-btn-v tn-flex tn-flex-col-center tn-flex-row-center">
|
||||
<text>{{ t('viewDetails') }}</text>
|
||||
<text class="tn-icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { localizeHousingTag, localizePayMethodText } from '../../../utils/select-room-normalizers'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
roomTypes: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
language: {
|
||||
type: String,
|
||||
default: 'zh'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key, params = {}) {
|
||||
return this.$tm('pkgExplore.store_detail.store_detail', key, params)
|
||||
},
|
||||
formatPriceValue(priceText) {
|
||||
if (!priceText) {
|
||||
return ''
|
||||
}
|
||||
const matched = String(priceText).match(/(\d+(\.\d+)?)/)
|
||||
return matched ? matched[1] : ''
|
||||
},
|
||||
getPayMethodText(payMethod = '') {
|
||||
return localizePayMethodText(payMethod, this.language)
|
||||
},
|
||||
getDisplayTag(tag = '') {
|
||||
return localizeHousingTag(tag, this.language)
|
||||
},
|
||||
getRoomName(room = {}) {
|
||||
if (this.language === 'en') {
|
||||
return room.nameEnDisplay || room.nameEn || room.name || ''
|
||||
}
|
||||
return room.name || room.nameEn || ''
|
||||
},
|
||||
getRoomDescription(room = {}) {
|
||||
if (this.language === 'en') {
|
||||
return room.descriptionEnDisplay || room.descriptionEn || room.description || ''
|
||||
}
|
||||
return room.description || room.descriptionEn || ''
|
||||
},
|
||||
goToRoomDetail(room) {
|
||||
this.$emit('go-detail', room);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.section-panel {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.15);
|
||||
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||
margin: 24rpx 32rpx 0;
|
||||
padding: 32rpx;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.room-list-vertical {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24rpx;
|
||||
}
|
||||
|
||||
.room-card-v {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.1);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.room-img-v {
|
||||
width: 220rpx;
|
||||
height: 220rpx;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.pay-method-tag {
|
||||
position: absolute;
|
||||
top: 12rpx;
|
||||
left: 12rpx;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
backdrop-filter: blur(8rpx);
|
||||
color: #fff;
|
||||
font-size: 18rpx;
|
||||
padding: 4rpx 10rpx;
|
||||
border-radius: 6rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.room-info-v {
|
||||
flex: 1;
|
||||
padding: 16rpx 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.room-header-v {
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.room-name-v {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.room-tags-v {
|
||||
gap: 12rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.tag-v {
|
||||
font-size: 20rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.room-desc-v {
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
margin-bottom: auto; /* 将底部价格推下去 */
|
||||
}
|
||||
|
||||
.room-bottom-v {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.room-price-v {
|
||||
color: #ffb8b8;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.price-symbol {
|
||||
font-size: 20rpx;
|
||||
font-weight: bold;
|
||||
margin-right: 2rpx;
|
||||
}
|
||||
|
||||
.price-val {
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.price-unit {
|
||||
font-size: 20rpx;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
margin-left: 4rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.go-btn-v {
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
color: #fff;
|
||||
font-size: 22rpx;
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 30rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.go-btn-v .tn-icon-right {
|
||||
font-size: 20rpx;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
</style>
|
||||
199
pkgExplore/store_detail/components/StoreInfo.vue
Normal file
199
pkgExplore/store_detail/components/StoreInfo.vue
Normal file
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<view class="store-info-panel">
|
||||
<!-- 核心信息卡片 -->
|
||||
<view class="info-card tn-flex tn-flex-row-between tn-flex-col-center" @click="openMap">
|
||||
<view class="address-left tn-flex tn-flex-col-center">
|
||||
<view class="icon-wrap tn-flex tn-flex-row-center tn-flex-col-center">
|
||||
<text class="tn-icon-location-fill location-icon"></text>
|
||||
</view>
|
||||
<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="tn-icon-right nav-arrow"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 小区简介 -->
|
||||
<view class="section-panel" v-if="displayDescription">
|
||||
<view class="section-header">
|
||||
<text class="section-title">{{ t('storeIntro') }}</text>
|
||||
</view>
|
||||
<view class="store-desc" :class="{'store-desc--collapsed': isDescCollapsed}">
|
||||
{{ displayDescription }}
|
||||
</view>
|
||||
<view class="expand-btn tn-flex tn-flex-row-center tn-flex-col-center" @click="toggleDesc">
|
||||
<text>{{ isDescCollapsed ? t('expandAll') : t('collapse') }}</text>
|
||||
<text :class="isDescCollapsed ? 'tn-icon-down' : 'tn-icon-up'" class="expand-icon"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
storeData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
language: {
|
||||
type: String,
|
||||
default: 'zh'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDescCollapsed: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
displayDescription() {
|
||||
if (this.language === 'en') {
|
||||
return this.storeData.descriptionEnDisplay || this.storeData.descriptionEn || this.storeData.description || ''
|
||||
}
|
||||
return this.storeData.description || this.storeData.descriptionEn || ''
|
||||
},
|
||||
shortAddress() {
|
||||
const addr = this.language === 'en'
|
||||
? (this.storeData.addressEnDisplay || this.storeData.addressEn || this.storeData.address || '')
|
||||
: (this.storeData.address || this.storeData.addressEn || '')
|
||||
if (!addr) {
|
||||
return this.t('noAddress')
|
||||
}
|
||||
if (this.language === 'en') {
|
||||
return addr
|
||||
}
|
||||
const short = addr.replace(/^(?:.*?省|.*?自治区)?(?:.*?市|.*?自治州)?/, '');
|
||||
return short.trim() ? short : (addr || this.t('noAddress'));
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(key) {
|
||||
return this.$tm('pkgExplore.store_detail.store_detail', key)
|
||||
},
|
||||
toggleDesc() {
|
||||
this.isDescCollapsed = !this.isDescCollapsed;
|
||||
},
|
||||
openMap() {
|
||||
this.$emit('open-map');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.store-info-panel {
|
||||
padding: 0 32rpx;
|
||||
margin-top: 24rpx;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.15);
|
||||
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:active {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
.address-left {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.icon-wrap {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 16rpx;
|
||||
margin-right: 16rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.location-icon {
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.address-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.address-right {
|
||||
flex-shrink: 0;
|
||||
padding-left: 20rpx;
|
||||
border-left: 1rpx solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.nav-text {
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.nav-arrow {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
.section-panel {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.15);
|
||||
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.05);
|
||||
margin-top: 24rpx;
|
||||
padding: 32rpx;
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.store-desc {
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.store-desc--collapsed {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.expand-btn {
|
||||
margin-top: 16rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.expand-icon {
|
||||
margin-left: 8rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user