feat: release news and store experience updates

This commit is contained in:
Codex
2026-07-26 11:09:11 +08:00
parent 2b37713791
commit c63bef311c
100 changed files with 2519 additions and 105 deletions
+58 -7
View File
@@ -13,9 +13,15 @@ if ( ! defined( 'ABSPATH' ) ) {
get_header();
$store_name = fragrance_trade_get_mod( 'b2b_hero_title' );
$store_address = fragrance_trade_get_mod( 'store_address', '' );
$store_brand = fragrance_trade_get_mod( 'store_brand' );
$authorization = fragrance_trade_get_mod( 'store_authorization' );
$store_city = fragrance_trade_get_mod( 'store_city' );
$contact_name = fragrance_trade_get_mod( 'store_contact_person' );
$store_address = fragrance_trade_get_mod( 'store_address' );
$store_phone = fragrance_trade_get_mod( 'store_phone' );
$store_hours = fragrance_trade_get_mod( 'store_hours', '' );
$store_hours = fragrance_trade_get_mod( 'store_hours' );
$store_map_lat = fragrance_trade_get_mod( 'store_map_lat' );
$store_map_lng = fragrance_trade_get_mod( 'store_map_lng' );
$store_image = fragrance_trade_image_uri( 'b2b_factory_image_1', 'store/storefront.jpg' );
$phone_href = preg_replace( '/[^0-9+]/', '', $store_phone );
$has_phone = strlen( preg_replace( '/[^0-9]/', '', $phone_href ) ) >= 5;
@@ -26,10 +32,31 @@ if ( ! $store_address ) {
$map_nav_url = fragrance_trade_get_mod( 'store_map_url', '' );
$baidu_map_url = '';
if ( $store_address ) {
$baidu_map_url = 'https://api.map.baidu.com/geocoder?address='
. rawurlencode( $store_address )
$map_search_term = $store_name ? $store_name : $store_address;
$has_map_coordinates = is_numeric( $store_map_lat )
&& is_numeric( $store_map_lng )
&& (float) $store_map_lat >= -90
&& (float) $store_map_lat <= 90
&& (float) $store_map_lng >= -180
&& (float) $store_map_lng <= 180;
if ( $has_map_coordinates ) {
$baidu_map_url = 'https://api.map.baidu.com/marker?location='
. rawurlencode( $store_map_lat . ',' . $store_map_lng )
. '&title=' . rawurlencode( $store_name )
. '&content=' . rawurlencode( $store_address )
. '&output=html&src=webapp';
} elseif ( $map_search_term ) {
if ( $store_city ) {
$baidu_map_url = 'https://api.map.baidu.com/place/search?query='
. rawurlencode( $map_search_term )
. '&region=' . rawurlencode( $store_city )
. '&city_limit=true&output=html&src=webapp';
} else {
$baidu_map_url = 'https://api.map.baidu.com/geocoder?address='
. rawurlencode( $map_search_term )
. '&output=html&src=webapp';
}
}
if ( ! $map_nav_url ) {
$map_nav_url = $baidu_map_url;
@@ -97,6 +124,24 @@ $map_title = sprintf( __( '%s门店地图', 'fragrance-trade' ), $store_name );
<p class="contact-detail-label"><?php esc_html_e( '门店名称', 'fragrance-trade' ); ?></p>
<h3><?php echo esc_html( $store_name ); ?></h3>
</article>
<?php if ( $store_brand ) : ?>
<article class="contact-detail-card">
<p class="contact-detail-label"><?php esc_html_e( '主营品牌', 'fragrance-trade' ); ?></p>
<h3><?php echo esc_html( $store_brand ); ?></h3>
</article>
<?php endif; ?>
<?php if ( $authorization ) : ?>
<article class="contact-detail-card">
<p class="contact-detail-label"><?php esc_html_e( '授权级别', 'fragrance-trade' ); ?></p>
<h3><?php echo esc_html( $authorization ); ?></h3>
</article>
<?php endif; ?>
<?php if ( $contact_name ) : ?>
<article class="contact-detail-card">
<p class="contact-detail-label"><?php esc_html_e( '门店联系人', 'fragrance-trade' ); ?></p>
<h3><?php echo esc_html( $contact_name ); ?></h3>
</article>
<?php endif; ?>
<article class="contact-detail-card">
<p class="contact-detail-label"><?php esc_html_e( '联系电话', 'fragrance-trade' ); ?></p>
<?php if ( $store_phone ) : ?>
@@ -111,6 +156,12 @@ $map_title = sprintf( __( '%s门店地图', 'fragrance-trade' ), $store_name );
<p class="contact-detail-empty"><?php esc_html_e( '请在后台填写联系电话', 'fragrance-trade' ); ?></p>
<?php endif; ?>
</article>
<?php if ( $store_city ) : ?>
<article class="contact-detail-card">
<p class="contact-detail-label"><?php esc_html_e( '所在城市', 'fragrance-trade' ); ?></p>
<h3><?php echo esc_html( $store_city ); ?></h3>
</article>
<?php endif; ?>
<article class="contact-detail-card">
<p class="contact-detail-label"><?php esc_html_e( '门店地址', 'fragrance-trade' ); ?></p>
<?php if ( $store_address ) : ?>
@@ -135,8 +186,8 @@ $map_title = sprintf( __( '%s门店地图', 'fragrance-trade' ), $store_name );
<div>
<p class="section-eyebrow"><?php esc_html_e( '地图与导航', 'fragrance-trade' ); ?></p>
<h2 id="contact-map-title"><?php esc_html_e( '找到门店', 'fragrance-trade' ); ?></h2>
<?php if ( $store_address ) : ?>
<p><?php echo esc_html( $store_address ); ?></p>
<?php if ( $store_city ) : ?>
<p><?php echo esc_html( $store_city ); ?></p>
<?php endif; ?>
</div>
<?php if ( $map_nav_url ) : ?>