feat: 新增多语言文案、优化导航及工具函数,修复部分业务逻辑
1. 新增多语言资源文件,覆盖文章、预约日期、会员信息、优惠券、表单、购物车、积分商城、分销、AI聊天等多个模块 2. 优化底部导航组件,使用多语言配置替代硬编码文案 3. 重构工具函数,新增从后端数据提取多语言文案的工具方法 4. 修复邀请好友页面的保存提示文案,替换为多语言版本 5. 修复商品SKU组件的提示文案,使用多语言配置 6. 重构AI聊天页面的帮助文档和回复模板,使用多语言配置 7. 优化空状态组件,支持多语言默认文案 8. 修复跳转逻辑,补全参数传递 9. 新增本地开发环境配置
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
</view>
|
||||
<view class="group-wrap padding-top">
|
||||
<view class="goods-module-wrap">
|
||||
<text class="price-symbol ">{{ pointInfo.point }}积分</text>
|
||||
<text class="price-symbol ">{{ pointInfo.point }}{{ $lang('detail.pointsSuffix') }}</text>
|
||||
<template v-if="pointInfo.exchange_price != '0.00' && pointInfo.pay_type > 0">
|
||||
<text class="price-symbol ">+{{ $lang('common.currencySymbol') }}{{ pointInfo.exchange_price
|
||||
}}</text>
|
||||
@@ -48,10 +48,10 @@
|
||||
|
||||
<view class="follow-and-share"
|
||||
v-if="pointInfo.stock_show == 1 || pointInfo.stock_show == undefined">
|
||||
<text class="color-tip" v-if="pointInfo.pointCoupon != 1">库存:{{ pointInfo.stock }}{{
|
||||
<text class="color-tip" v-if="pointInfo.pointCoupon != 1">{{ $lang('detail.stockLabel') }}{{ pointInfo.stock }}{{
|
||||
pointInfo.stock >= 0 ?
|
||||
pointInfo.unit : '' }}</text>
|
||||
<text class="color-tip" v-else>库存:无限{{ pointInfo.stock >= 0 ? pointInfo.unit : '' }}</text>
|
||||
<text class="color-tip" v-else>{{ $lang('detail.stockLabel') }}{{ $lang('detail.unlimitedStock') }}{{ pointInfo.stock >= 0 ? pointInfo.unit : '' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-module-wrap info">
|
||||
@@ -61,21 +61,17 @@
|
||||
<text class="sku-name-wrap" v-else>{{ pointInfo.name }}</text>
|
||||
</view>
|
||||
<view class="coupon-desc">
|
||||
<view v-if="pointInfo.balance && pointInfo.balance > 0" class="color-tip">内含{{ pointInfo.balance
|
||||
}}元</view>
|
||||
<view v-if="pointInfo.coupon_type == 'random'" class="color-tip">无门槛优惠券</view>
|
||||
<view v-if="pointInfo.coupon_type == 'reward'" class="color-tip">{{ '满' + pointInfo.at_least +
|
||||
'减' + pointInfo.money
|
||||
}}</view>
|
||||
<view v-if="pointInfo.balance && pointInfo.balance > 0" class="color-tip">{{ $lang('detail.containsBalance', { balance: pointInfo.balance }) }}</view>
|
||||
<view v-if="pointInfo.coupon_type == 'random'" class="color-tip">{{ $lang('detail.noThresholdCoupon') }}</view>
|
||||
<view v-if="pointInfo.coupon_type == 'reward'" class="color-tip">{{ $lang('detail.fullReduction', { atLeast: pointInfo.at_least, money: pointInfo.money }) }}</view>
|
||||
<view v-if="pointInfo.coupon_type == 'discount'" class="color-tip">
|
||||
满{{ pointInfo.at_least }}元
|
||||
<text>{{ pointInfo.discount }}折</text>
|
||||
{{ $lang('detail.fullAmount', { atLeast: pointInfo.at_least }) }}
|
||||
<text>{{ pointInfo.discount }}{{ $lang('detail.discountSuffix') }}</text>
|
||||
</view>
|
||||
<view v-if="pointInfo.coupon_type == 'discount'" class="color-tip">最多优惠{{
|
||||
pointInfo.discount_limit }}元</view>
|
||||
<view v-if="pointInfo.coupon_type == 'discount'" class="color-tip">{{ $lang('detail.maxDiscount', { limit: pointInfo.discount_limit }) }}</view>
|
||||
<view class="time color-tip" v-if="pointInfo.coupon_type">
|
||||
{{ pointInfo.validity_type == 1 ? '领取之日起' + pointInfo.fixed_term + '天内有效' :
|
||||
$util.timeStampTurnTime(pointInfo.end_time) + '到期' }}
|
||||
{{ pointInfo.validity_type == 1 ? $lang('detail.validFromReceive', { days: pointInfo.fixed_term }) :
|
||||
$lang('detail.validUntil', { time: $util.timeStampTurnTime(pointInfo.end_time) }) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -88,7 +84,7 @@
|
||||
<view class="community-txt">{{ pointInfo.qr_data.community_describe }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="community-btn" @click="onCommunity()">添加</view>
|
||||
<view class="community-btn" @click="onCommunity()">{{ $lang('detail.addCommunity') }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 促销 -->
|
||||
@@ -96,7 +92,7 @@
|
||||
v-show="isCommunity">
|
||||
<view class="community-model-content" @click.stop>
|
||||
<view class="community-model-content-radius">
|
||||
<view>添加社群</view>
|
||||
<view>{{ $lang('detail.addCommunityTitle') }}</view>
|
||||
</view>
|
||||
<view class="community-model-content-draw" v-if="pointInfo.qr_data && pointInfo.qr_data.qr_img">
|
||||
<image :src="pointInfo.qr_data.qr_img != '' && pointInfo.qr_data.qr_state == 1
|
||||
@@ -104,7 +100,7 @@
|
||||
: $util.img('public/uniapp/goods/detail_erweiImage.png')
|
||||
" mode="aspectFill" show-menu-by-longpress />
|
||||
</view>
|
||||
<view class="community-model-content-text">长按识别二维码,添加社群</view>
|
||||
<view class="community-model-content-text">{{ $lang('detail.addCommunityTip') }}</view>
|
||||
</view>
|
||||
<view class="community-model-close" @click.stop="onCloseCommunity()"><text
|
||||
class="iconfont icon-close"></text>
|
||||
@@ -115,7 +111,7 @@
|
||||
<view class="newdetail margin-bottom">
|
||||
<!-- 已选规格 -->
|
||||
<view class="item selected-sku-spec" v-if="pointInfo.sku_spec_format" @click="exchange">
|
||||
<view class="label">选择</view>
|
||||
<view class="label">{{ $lang('detail.selectSpec') }}</view>
|
||||
<view class="box">
|
||||
<text v-for="(item, index) in pointInfo.sku_spec_format" :key="index">{{ item.spec_name
|
||||
}}/{{
|
||||
@@ -126,7 +122,7 @@
|
||||
|
||||
<view class="item goods-attribute" @click="openAttributePopup()"
|
||||
v-if="pointInfo.goods_attr_format && pointInfo.goods_attr_format.length > 0">
|
||||
<view class="label">属性</view>
|
||||
<view class="label">{{ $lang('detail.attribute') }}</view>
|
||||
<view class="box">
|
||||
<text v-for="(item, index) in pointInfo.goods_attr_format" :key="index"
|
||||
v-if="index < 2">{{
|
||||
@@ -141,7 +137,7 @@
|
||||
<uni-popup ref="attributePopup" type="bottom">
|
||||
<view class="goods-attribute-popup-layer popup-layer">
|
||||
<view class="head-wrap" @click="closeAttributePopup()">
|
||||
<text>商品属性</text>
|
||||
<text>{{ $lang('detail.goodsAttribute') }}</text>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view scroll-y class="goods-attribute-body">
|
||||
@@ -152,7 +148,7 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="button-box"><button type="primary"
|
||||
@click="closeAttributePopup()">确定</button></view>
|
||||
@click="closeAttributePopup()">{{ $lang('detail.confirm') }}</button></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
@@ -161,7 +157,7 @@
|
||||
<uni-popup ref="merchantsServicePopup" type="bottom">
|
||||
<view class="goods-merchants-service-popup-layer popup-layer">
|
||||
<view class="head-wrap" @click="closeMerchantsServicePopup()">
|
||||
<text>商品服务</text>
|
||||
<text>{{ $lang('detail.goodsService') }}</text>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view scroll-y>
|
||||
@@ -175,7 +171,7 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="button-box"><button type="primary"
|
||||
@click="closeMerchantsServicePopup()">确定</button></view>
|
||||
@click="closeMerchantsServicePopup()">{{ $lang('detail.confirm') }}</button></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
@@ -184,7 +180,7 @@
|
||||
<!-- 详情 -->
|
||||
<view class="goods-detail-tab">
|
||||
<view class="detail-tab">
|
||||
<view class="tab-item">兑换详情</view>
|
||||
<view class="tab-item">{{ $lang('detail.exchangeDetail') }}</view>
|
||||
</view>
|
||||
|
||||
<view class="detail-content">
|
||||
@@ -192,7 +188,7 @@
|
||||
<view class="goods-details" v-if="pointInfo.content"><rich-text
|
||||
:nodes="pointInfo.content"></rich-text>
|
||||
</view>
|
||||
<view class="goods-details active" v-else>暂无兑换详情!</view>
|
||||
<view class="goods-details active" v-else>{{ $lang('detail.noExchangeDetail') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -205,14 +201,14 @@
|
||||
</view>
|
||||
|
||||
<view class="detail-swap" @click="exchange()" :class="{ 'position-bottom': isIphoneX }" v-if="!isLogin"><button
|
||||
type="primary">登录之后方可兑换</button></view>
|
||||
type="primary">{{ $lang('detail.loginToExchange') }}</button></view>
|
||||
<block v-else>
|
||||
<view class="detail-swap" :class="{ 'position-bottom': isIphoneX }" v-if="pointInfo.stock == 0"><button
|
||||
disabled>库存不足</button></view>
|
||||
disabled>{{ $lang('detail.insufficientStock') }}</button></view>
|
||||
<view class="detail-swap" :class="{ 'position-bottom': isIphoneX }" v-else-if="enough"><button
|
||||
disabled>积分不足</button></view>
|
||||
disabled>{{ $lang('detail.insufficientPoints') }}</button></view>
|
||||
<view class="detail-swap" @click="exchange()" :class="{ 'position-bottom': isIphoneX }" v-else><button
|
||||
type="primary" hover-class="none">兑换</button></view>
|
||||
type="primary" hover-class="none">{{ $lang('detail.exchange') }}</button></view>
|
||||
</block>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
@@ -293,7 +289,7 @@ export default {
|
||||
imageUrl = this.pointInfo.image;
|
||||
break;
|
||||
}
|
||||
title = '仅需' + this.pointInfo.point + '积分即可兑换' + title;
|
||||
title = this.$lang('detail.shareTitle', { point: this.pointInfo.point, title: title });
|
||||
imageUrl = this.$util.img(imageUrl);
|
||||
var route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var path = route.path;
|
||||
@@ -322,7 +318,7 @@ export default {
|
||||
imageUrl = this.pointInfo.image;
|
||||
break;
|
||||
}
|
||||
title = '仅需' + this.pointInfo.point + '积分即可兑换' + title;
|
||||
title = this.$lang('detail.shareTitle', { point: this.pointInfo.point, title: title });
|
||||
imageUrl = this.$util.img(imageUrl);
|
||||
var route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var query = route.query;
|
||||
@@ -424,7 +420,7 @@ export default {
|
||||
if (this.pointInfo.goods_spec_format) this.pointInfo.goods_spec_format = JSON.parse(this.pointInfo.goods_spec_format);
|
||||
}
|
||||
|
||||
this.pointInfo.unit = this.pointInfo.unit || '件';
|
||||
this.pointInfo.unit = this.pointInfo.unit || this.$lang('detail.unitPiece');
|
||||
|
||||
// 商品详情
|
||||
if (this.pointInfo.content) this.pointInfo.content = htmlParser(this.pointInfo.content);
|
||||
@@ -458,7 +454,7 @@ export default {
|
||||
*/
|
||||
refreshGoodsSkuDetail(pointInfo) {
|
||||
Object.assign(this.pointInfo, pointInfo);
|
||||
this.pointInfo.unit = this.pointInfo.unit || '件';
|
||||
this.pointInfo.unit = this.pointInfo.unit || this.$lang('detail.unitPiece');
|
||||
},
|
||||
//服务
|
||||
openMerchantsServicePopup() {
|
||||
|
||||
Reference in New Issue
Block a user