feat: 新增多语言文案、优化导航及工具函数,修复部分业务逻辑

1. 新增多语言资源文件,覆盖文章、预约日期、会员信息、优惠券、表单、购物车、积分商城、分销、AI聊天等多个模块
2. 优化底部导航组件,使用多语言配置替代硬编码文案
3. 重构工具函数,新增从后端数据提取多语言文案的工具方法
4. 修复邀请好友页面的保存提示文案,替换为多语言版本
5. 修复商品SKU组件的提示文案,使用多语言配置
6. 重构AI聊天页面的帮助文档和回复模板,使用多语言配置
7. 优化空状态组件,支持多语言默认文案
8. 修复跳转逻辑,补全参数传递
9. 新增本地开发环境配置
This commit is contained in:
2026-06-25 18:15:31 +08:00
parent ca4e7fd170
commit 2d8846c64c
82 changed files with 3497 additions and 1062 deletions

View File

@@ -7,7 +7,7 @@
}">
<view class="nav-wrap">
<text class="iconfont icon-back_light" @click="back"></text>
<view class="navbar-title">确认订单</view>
<view class="navbar-title">{{ $lang('payment.title') }}</view>
</view>
</view>
<view class="payment-navbar-block" :style="{ height: menuButtonBounding.bottom + 'px' }"></view>
@@ -36,19 +36,19 @@
:class="{ 'not-delivery-type': orderPaymentData.delivery.express_type.length <= 1 }"
v-if="orderPaymentData.delivery.delivery_type != 'store'">
<block v-if="storeInfo.storeList.length > 1 && orderPaymentData.delivery.delivery_type == 'local'">
<view class="local-delivery-store" v-if="Object.keys(storeInfo.currStore).length"
@click="$refs.deliveryPopup.open()">
<view class="info">
由 <text class="store-name">{{ storeInfo.currStore.store_name }}</text> 提供配送
</view>
<view class="cell-more">
<text>点击切换</text>
<text class="iconfont icon-right"></text>
</view>
<view class="local-delivery-store" v-if="Object.keys(storeInfo.currStore).length"
@click="$refs.deliveryPopup.open()">
<view class="info">
{{ $lang('payment.localDelivery.providedBy') }}<text class="store-name">{{ storeInfo.currStore.store_name }}</text>{{ $lang('payment.localDelivery.deliveredBy') }}
</view>
<view class="cell-more">
<text>{{ $lang('payment.localDelivery.switchStore') }}</text>
<text class="iconfont icon-right"></text>
</view>
</view>
<view v-else class="local-delivery-store">
<view class="info">
<text class="store-name">您的附近没有可配送的门店,请选择其他配送方式</text>
<text class="store-name">{{ $lang('payment.localDelivery.noStoreNearby') }}</text>
</view>
</view>
</block>
@@ -69,7 +69,7 @@
</view>
</view>
<view class="empty-wrap" v-else @click="selectAddress">
<view class="info">请设置收货地址</view>
<view class="info">{{ $lang('payment.address.setAddress') }}</view>
<view class="cell-more">
<view class="iconfont icon-right"></view>
</view>
@@ -80,11 +80,11 @@
<view class="local-box"
v-if="orderPaymentData.config.local.is_use && orderPaymentData.delivery.local.info && orderPaymentData.delivery.local.info.time_is_open == 1">
<view class="pick-block" @click="localtime">
<view class="font-size-base">送达时间</view>
<view class="font-size-base">{{ $lang('payment.address.deliveryTime') }}</view>
<view class="time-picker">
<text :class="{ 'color-tip': !orderCreateData.buyer_ask_delivery_title }">{{
orderCreateData.buyer_ask_delivery_title ?
orderCreateData.buyer_ask_delivery_title : '请选择送达时间' }}</text>
orderCreateData.buyer_ask_delivery_title : $lang('payment.address.selectDeliveryTime') }}</text>
<text class="iconfont icon-right cell-more"></text>
</view>
</view>
@@ -106,8 +106,8 @@
</view>
<view class="store-detail">
<view v-if="storeInfo.currStore.open_date">
营业时间:{{ storeInfo.currStore.open_date }}</view>
<view>地址:{{ storeInfo.currStore.full_address }}
{{ $lang('payment.store.businessHours') }}{{ storeInfo.currStore.open_date }}</view>
<view>{{ $lang('payment.store.address') }}{{ storeInfo.currStore.full_address }}
{{ storeInfo.currStore.address }}
</view>
</view>
@@ -116,28 +116,28 @@
</view>
<view class="mobile-wrap store-mobile">
<view class="form-group">
<text class="text">姓名</text>
<text class="text">{{ $lang('payment.store.name') }}</text>
<input type="text" placeholder-class="color-tip placeholder" class="input"
v-model="member_address.name" disabled />
</view>
</view>
<view class="mobile-wrap store-mobile">
<view class="form-group">
<text class="text">预留手机</text>
<input type="number" maxlength="11" placeholder="请输入您的手机号码"
<text class="text">{{ $lang('payment.store.reservedMobile') }}</text>
<input type="number" maxlength="11" :placeholder="$lang('payment.store.mobilePlaceholder')"
placeholder-class="color-tip placeholder" class="input"
v-model="member_address.mobile" />
</view>
</view>
<view class="store-time">
<view class="left">自提时间</view>
<view class="left">{{ $lang('payment.store.pickupTime') }}</view>
<view class="right" @click="storetime">
{{ orderCreateData.buyer_ask_delivery_title }}
<text class="iconfont icon-right"></text>
</view>
</view>
</block>
<view v-else class="empty">当前无自提门店,请选择其它配送方式</view>
<view v-else class="empty">{{ $lang('payment.store.noPickupStore') }}</view>
<image class="address-line" :src="$util.img('public/uniapp/order/address-line.png')" show-menu-by-longpress></image>
</view>
@@ -147,12 +147,12 @@
<view class="mobile-wrap" v-if="orderPaymentData.is_virtual == 1 && orderCreateData.member_address">
<view class="tips color-base-text">
<text class="iconfont icon-gantanhao"></text>
购买虚拟类商品需填写手机号,方便商家与您联系
{{ $lang('payment.virtual.tips') }}
</view>
<view class="form-group">
<text class="iconfont icon-dianhua2"></text>
<text class="text">手机号码</text>
<input type="number" maxlength="11" placeholder="请输入您的手机号码"
<text class="text">{{ $lang('payment.virtual.mobile') }}</text>
<input type="number" maxlength="11" :placeholder="$lang('payment.virtual.mobilePlaceholder')"
placeholder-class="color-tip placeholder" class="input"
v-model="orderCreateData.member_address.mobile" />
</view>
@@ -185,10 +185,10 @@
</block>
<view class="goods-info">
<view class="goods-name">{{ orderPaymentData.exchange_info.name }}</view>
<view class="goods-sub-section">
<view v-if="orderPaymentData.exchange_info.pay_type == 1" class="color-base-text">
<text class="goods-price">{{ orderPaymentData.exchange_info.point }}</text>
<text class="unit">积分</text>
<view class="goods-sub-section">
<view v-if="orderPaymentData.exchange_info.pay_type == 1" class="color-base-text">
<text class="goods-price">{{ orderPaymentData.exchange_info.point }}</text>
<text class="unit">{{ $lang('payment.orderMoney.pointsSuffix') }}</text>
<template v-if="orderPaymentData.exchange_info.price != '0.00'">
<text class="unit">+{{ $lang('common.currencySymbol') }}</text>
<text class="goods-price">{{ orderPaymentData.exchange_info.price }}</text>
@@ -204,8 +204,8 @@
</view>
<view class="site-footer">
<view class="order-cell">
<text class="tit">买家留言</text>
<view class="box"><input type="text" placeholder="留言前建议先与商家协调一致" placeholder-class="color-tip"
<text class="tit">{{ $lang('payment.orderMoney.buyerMessage') }}</text>
<view class="box"><input type="text" :placeholder="$lang('payment.orderMoney.buyerMessagePlaceholder')" placeholder-class="color-tip"
v-model="orderCreateData.buyer_message" /></view>
</view>
</view>
@@ -214,15 +214,15 @@
<!-- 金额 -->
<view class="order-money">
<view class="order-cell">
<text class="tit">所需积分</text>
<text class="tit">{{ $lang('payment.orderMoney.pointsRequired') }}</text>
<view class="box">
<text class="money">{{ orderPaymentData.point }}</text>
<text class="unit">积分</text>
<text class="unit">{{ $lang('payment.orderMoney.pointsSuffix') }}</text>
</view>
</view>
<view class="order-cell"
v-if="orderPaymentData.exchange_info.type == 1 && orderPaymentData.delivery_money > 0">
<text class="tit">运费</text>
<text class="tit">{{ $lang('payment.orderMoney.shippingFee') }}</text>
<view class="box">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
<text class="money">{{ orderPaymentData.delivery_money | moneyFormat }}</text>
@@ -237,10 +237,10 @@
</view>
<view class="order-submit" :class="{ 'bottom-safe-area': isIphoneX }">
<view class="order-settlement-info">
<text class="font-size-base color-tip margin-right">共{{ orderPaymentData.goods_num }}件</text>
<text class="font-size-base">合计:</text>
<text class="font-size-base color-tip margin-right">{{ $lang('payment.settlement.totalItems', { count: orderPaymentData.goods_num }) }}</text>
<text class="font-size-base">{{ $lang('payment.settlement.total') }}</text>
<text class="color-base-text money">{{ orderPaymentData.point }}</text>
<text class="color-base-text unit">积分</text>
<text class="color-base-text unit">{{ $lang('payment.settlement.pointsSuffix') }}</text>
<template v-if="orderPaymentData.exchange_info.type == 1 && orderPaymentData.order_money > 0">
<text class="color-base-text unit">+{{ $lang('common.currencySymbol') }}</text>
<text class="color-base-text money">{{ orderPaymentData.order_money | moneyFormat }}</text>
@@ -248,13 +248,13 @@
</view>
<view class="submit-btn">
<button v-if="createBtn()" type="primary" class="mini" size="mini"
@click="openChoosePayment()">提交订单</button>
@click="openChoosePayment()">{{ $lang('payment.settlement.submitOrder') }}</button>
<button v-else class="no-submit mini" size="mini">
<block
v-if="orderPaymentData.delivery && orderPaymentData.delivery.delivery_type == 'local' && orderPaymentData.delivery && orderPaymentData.delivery.error && orderPaymentData.delivery.start_money > orderPaymentData.price">
差{{ orderPaymentData.delivery.start_money - orderPaymentData.price | moneyFormat }}起送
{{ $lang('payment.settlement.shortByForMinimum', { amount: orderPaymentData.delivery.start_money - orderPaymentData.price | moneyFormat }) }}
</block>
<block v-else>提交订单</block>
<block v-else>{{ $lang('payment.settlement.submitOrder') }}</block>
</button>
</view>
</view>
@@ -264,7 +264,7 @@
<uni-popup ref="deliveryPopup" type="bottom">
<view class="delivery-popup popup">
<view class="popup-header">
<text class="tit">已为您甄选出附近所有相关门店</text>
<text class="tit">{{ $lang('payment.storePopup.title') }}</text>
<text class="iconfont icon-close" @click="closePopup('deliveryPopup')"></text>
</view>
<view class="popup-body store-popup" :class="{ 'safe-area': isIphoneX }">
@@ -281,19 +281,19 @@
<view
:class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''"
class="font-size-goods-tag">
营业时间:{{ item.open_date }}
{{ $lang('payment.storePopup.businessHours') }}{{ item.open_date }}
</view>
<view
:class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''"
class="font-size-goods-tag">
地址:{{ item.full_address }}{{ item.address }}
{{ $lang('payment.storePopup.address') }}{{ item.full_address }}{{ item.address }}
</view>
</view>
</view>
<view class="icon" v-if="item.store_id == orderPaymentData.delivery.store_id"><text
class="iconfont icon-yuan_checked color-base-text"></text></view>
</view>
<view v-if="!storeInfo.storeList" class="empty">所选择收货地址附近没有可以自提的门店</view>
<view v-if="!storeInfo.storeList" class="empty">{{ $lang('payment.storePopup.noStoreNearby') }}</view>
</view>
</view>
</view>