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

@@ -10,7 +10,7 @@
</view>
<view class="search" @click="$util.redirectTo('/pages_tool/goods/search')">
<text class="iconfont icon-sousuo3"></text>
<text class="tips">搜索商品</text>
<text class="tips">{{ $lang('searchPlaceholder') }}</text>
</view>
<view class="sign"
:style="{ width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }"
@@ -28,17 +28,17 @@
<view class="account-content">
<view class="left">
<image :src="$util.img('public/uniapp/point/point-icon.png')" mode="widthFix"></image>
<view>我的积分</view>
<view>{{ $lang('myPoints') }}</view>
</view>
<view class="right">
<text class="point price-font">{{ point }}</text>
<text class="text">积分</text>
<text class="text">{{ $lang('points') }}</text>
<!-- <text class="iconfont icon-right"></text> -->
</view>
</view>
<view class="remark">
<view class="label">提醒</view>
<view class="text">积分兑好礼,每日上新换不停!</view>
<view class="label">{{ $lang('reminder') }}</view>
<view class="text">{{ $lang('remarkText') }}</view>
</view>
</view>
@@ -81,9 +81,9 @@
<view class="recharge-list-wrap" @click="redirect('/pages_tool/recharge/list')"
v-if="rechargeList.length">
<view class="item-wrap" v-for="(item, index) in rechargeList.slice(0, 4)" :key="index">
<view class="recharge">储值{{ parseFloat(item.buy_price) }}元</view>
<view class="point">可得{{ item.point }}积分</view>
<view class="btn">去储值</view>
<view class="recharge">{{ $lang('rechargeAmount', { price: parseFloat(item.buy_price) }) }}</view>
<view class="point">{{ $lang('earnPoints', { point: item.point }) }}</view>
<view class="btn">{{ $lang('goRecharge') }}</view>
</view>
</view>
@@ -91,7 +91,7 @@
<view class="point-exchange-wrap exchange-coupon" v-if="couponList.length > 0">
<view class="card-category-title">
<text class="before-line"></text>
<text>积分换券</text>
<text>{{ $lang('exchangeCoupon') }}</text>
<text class="after-line"></text>
</view>
@@ -110,30 +110,29 @@
<view class="coupon_left color-line-border">
<view class="price price-font">
<block v-if="couponItem.coupon_type == 'reward'">
<text>¥</text>
<text>{{ $lang('common.currencySymbol') }}</text>
{{ parseFloat(couponItem.money) }}
</block>
<block v-if="couponItem.coupon_type == 'discount'">
<block v-if="couponItem.coupon_type == 'discount'">
{{ parseFloat(couponItem.discount) }}<text>折</text>
{{ parseFloat(couponItem.discount) }}<text>{{ $lang('discountSuffix') }}</text>
</block>
</block>
</view>
<view class="coupon-info">
<view class="coupon_condition font-size-activity-tag">
{{ couponItem.at_least == 0 ? '无门槛优惠券' : '满' +
parseFloat(couponItem.at_least).toFixed(0) + '可用' }}
{{ couponItem.at_least == 0 ? $lang('noThresholdCoupon') : $lang('minSpendAvailable', { amount: parseFloat(couponItem.at_least).toFixed(0) }) }}
</view>
<view class="coupon_type font-size-activity-tag"
v-if="couponItem.goods_type == 1">全场券</view>
v-if="couponItem.goods_type == 1">{{ $lang('allStoreCoupon') }}</view>
<view class="coupon_type font-size-activity-tag"
v-else-if="couponItem.goods_type == 2 || couponItem.goods_type == 3">
指定券</view>
{{ $lang('designatedCoupon') }}</view>
</view>
</view>
<view class="coupon_right">
<view class="coupon_num font-size-tag">{{ couponItem.point }}积分</view>
<view class="coupon_btn">兑换</view>
<view class="coupon_num font-size-tag">{{ couponItem.point }}{{ $lang('points') }}</view>
<view class="coupon_btn">{{ $lang('exchange') }}</view>
</view>
</view>
</view>
@@ -145,7 +144,7 @@
<view class="point-exchange-wrap exchange-hongbao" v-if="hongbaoList.length > 0">
<view class="card-category-title">
<text class="before-line"></text>
<text>积分换红包</text>
<text>{{ $lang('exchangeHongbao') }}</text>
<text class="after-line"></text>
</view>
@@ -160,14 +159,14 @@
<view class="coupon hongbao">
<view class="coupon_left">
<view class="price price-font">
<text>¥</text>
<text>{{ $lang('common.currencySymbol') }}</text>
{{ parseFloat(hongbaoItem.balance).toFixed(0) }}
</view>
<!-- <view class="coupon_condition font-size-activity-tag">{{ hongbaoItem.name }}</view> -->
</view>
<view class="coupon_right">
<view class="coupon_num font-size-tag">{{ hongbaoItem.point }}积分</view>
<view class="coupon_btn">兑换</view>
<view class="coupon_num font-size-tag">{{ hongbaoItem.point }}{{ $lang('points') }}</view>
<view class="coupon_btn">{{ $lang('exchange') }}</view>
</view>
</view>
</view>
@@ -178,7 +177,7 @@
<view class="point-exchange-wrap" v-if="goodsList.length > 0">
<view class="card-category-title">
<text class="before-line"></text>
<text>积分换礼品</text>
<text>{{ $lang('exchangeGift') }}</text>
<text class="after-line"></text>
</view>
@@ -196,7 +195,7 @@
<view class="discount-price">
<view>
<text class="unit price-font point">{{ item.point }}</text>
<text class="unit font-size-tag ">积分</text>
<text class="unit font-size-tag ">{{ $lang('points') }}</text>
</view>
<block v-if="item.price > 0 && item.pay_type > 0">
<text class="unit font-size-tag">+</text>
@@ -204,17 +203,17 @@
<text class="font-size-tag">{{
parseFloat(item.price).toFixed(2).split(".")[0] }}</text>
<text class="unit font-size-tag">.{{
parseFloat(item.price).toFixed(2).split(".")[1] }}元</text>
parseFloat(item.price).toFixed(2).split(".")[1] }}{{ $lang('yuan') }}</text>
</view>
</block>
</view>
<view class="btn" @click="toDetail(item)">兑换</view>
<view class="btn" @click="toDetail(item)">{{ $lang('exchange') }}</view>
</view>
<view class="pro-info" v-if="item.stock_show || item.sale_show">
<view class="font-size-activity-tag color-tip" v-if="item.stock_show">
库存:{{ isNaN(parseInt(item.stock)) ? 0 : parseInt(item.stock) }}</view>
{{ $lang('stock') }}{{ isNaN(parseInt(item.stock)) ? 0 : parseInt(item.stock) }}</view>
<view class="font-size-activity-tag color-tip sale" v-if="item.sale_show">
已兑:{{ isNaN(parseInt(item.sale_num)) ? 0 : parseInt(item.sale_num) }}
{{ $lang('exchanged') }}{{ isNaN(parseInt(item.sale_num)) ? 0 : parseInt(item.sale_num) }}
</view>
</view>
</view>
@@ -231,20 +230,20 @@
<uni-popup ref="pointPopup" type="bottom">
<view class="tips-layer">
<view class="head" @click="closePointPopup()">
<view class="title">{{ isEnEnv ? 'Integral Description' : '积分说明' }}</view>
<view class="title">{{ $lang('pointDescription') }}</view>
<text class="iconfont icon-close"></text>
</view>
<view class="body">
<view class="detail margin-bottom">
<view class="tip">{{ isEnEnv ? 'Integral Acquisition' : '积分的获取' }}</view>
<view class="font-size-base">1、积分可在注册、签到、分享、消费、充值时获得。</view>
<view class="font-size-base">2、在购买部分商品时可获得积分。</view>
<view class="tip">{{ isEnEnv ? 'Integral Use' : '积分的使用' }}</view>
<view class="font-size-base">1、积分可用于兑换积分中心的商品。</view>
<view class="font-size-base">2、积分可在参与某些活动时使用。</view>
<view class="font-size-base">3、积分不得转让,出售,不设有效期。</view>
<view class="tip">{{ isEnEnv ? 'Integral Query' : '积分的查询' }}</view>
<view class="font-size-base">1、积分可在会员中心中查询具体数额以及明细。</view>
<view class="tip">{{ $lang('pointAcquisition') }}</view>
<view class="font-size-base">{{ $lang('acquisitionItem1') }}</view>
<view class="font-size-base">{{ $lang('acquisitionItem2') }}</view>
<view class="tip">{{ $lang('pointUsage') }}</view>
<view class="font-size-base">{{ $lang('usageItem1') }}</view>
<view class="font-size-base">{{ $lang('usageItem2') }}</view>
<view class="font-size-base">{{ $lang('usageItem3') }}</view>
<view class="tip">{{ $lang('pointQuery') }}</view>
<view class="font-size-base">{{ $lang('queryItem1') }}</view>
</view>
</view>
</view>
@@ -302,7 +301,7 @@ export default {
setTimeout(() => {
if (!this.addonIsExist.pointexchange) {
this.$util.showToast({
title: '商家未开启积分商城',
title: this.$lang('merchantNotEnabled'),
mask: true,
duration: 2000
});
@@ -580,7 +579,7 @@ export default {
}
} else {
this.$util.showToast({
title: '暂无相关活动'
title: this.$lang('noActivity')
});
}
}