feat: 新增多语言文案、优化导航及工具函数,修复部分业务逻辑
1. 新增多语言资源文件,覆盖文章、预约日期、会员信息、优惠券、表单、购物车、积分商城、分销、AI聊天等多个模块 2. 优化底部导航组件,使用多语言配置替代硬编码文案 3. 重构工具函数,新增从后端数据提取多语言文案的工具方法 4. 修复邀请好友页面的保存提示文案,替换为多语言版本 5. 修复商品SKU组件的提示文案,使用多语言配置 6. 重构AI聊天页面的帮助文档和回复模板,使用多语言配置 7. 优化空状态组件,支持多语言默认文案 8. 修复跳转逻辑,补全参数传递 9. 新增本地开发环境配置
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<view class="member-desc">
|
||||
<view class="font-size-toolbar">{{ memberInfo.nickname }}</view>
|
||||
<view class="font-size-tag expire-time" v-if="memberInfo.level_expire_time > 0">
|
||||
有效期至:{{ $util.timeStampTurnTime(memberInfo.level_expire_time, true) }}
|
||||
{{ $lang('validUntil') }}{{ $util.timeStampTurnTime(memberInfo.level_expire_time, true) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -60,9 +60,9 @@
|
||||
<view class="level-detail" :style="{ color: levelList[curIndex]['level_text_color'] }">
|
||||
{{ levelList[curIndex].level_name }}</view>
|
||||
<view class="growr-name" :style="{ color: levelList[curIndex]['level_text_color'] }">{{
|
||||
levelList[curIndex].level_name }}可享受消费折扣和</view>
|
||||
levelList[curIndex].level_name }}{{ $lang('enjoyDiscountAnd') }}</view>
|
||||
<view class="growr-value" :style="{ color: levelList[curIndex]['level_text_color'] }">
|
||||
会员大礼包等权益</view>
|
||||
{{ $lang('memberGiftBenefits') }}</view>
|
||||
<view class="growth-rules font-size-tag" @click="openExplainPopup"
|
||||
v-if="levelList[curIndex].remark != ''">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
@@ -78,7 +78,7 @@
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">卡种选择</view>
|
||||
<view class="card-content-title">{{ $lang('cardTypeSelection') }}</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
@@ -107,7 +107,7 @@
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">会员权益</view>
|
||||
<view class="card-content-title">{{ $lang('memberBenefits') }}</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
@@ -118,18 +118,18 @@
|
||||
<view class="card-privilege-icon">
|
||||
<text class="iconfont icon-tedianquanchangbaoyou"></text>
|
||||
</view>
|
||||
<view class="card-privilege-name">全场包邮</view>
|
||||
<view class="card-privilege-text">享受商品包邮服务</view>
|
||||
<view class="card-privilege-name">{{ $lang('freeShipping') }}</view>
|
||||
<view class="card-privilege-text">{{ $lang('enjoyFreeShipping') }}</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.consume_discount < 100">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-zhekou"></text></view>
|
||||
<view class="card-privilege-name">消费折扣</view>
|
||||
<view class="card-privilege-text">部分商品下单可享{{ currCard.consume_discount / 10 }}折优惠</view>
|
||||
<view class="card-privilege-name">{{ $lang('consumptionDiscount') }}</view>
|
||||
<view class="card-privilege-text">{{ $lang('enjoyDiscountOnSomeProducts', { discount: currCard.consume_discount / 10 }) }}</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.point_feedback > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen2 f32"></text></view>
|
||||
<view class="card-privilege-name">积分回馈</view>
|
||||
<view class="card-privilege-text">下单享{{ parseFloat(currCard.point_feedback) }}倍积分回馈</view>
|
||||
<view class="card-privilege-name">{{ $lang('pointsReward') }}</view>
|
||||
<view class="card-privilege-text">{{ $lang('earnPointsMultiplier', { multiplier: parseFloat(currCard.point_feedback) }) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">开卡礼包</view>
|
||||
<view class="card-content-title">{{ $lang('welcomeGift') }}</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
@@ -147,18 +147,18 @@
|
||||
<view class="card-privilege-list">
|
||||
<view class="card-privilege-item" v-if="currCard.send_point > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen3"></text></view>
|
||||
<view class="card-privilege-name">积分礼包</view>
|
||||
<view class="card-privilege-text">赠送{{ currCard.send_point }}积分</view>
|
||||
<view class="card-privilege-name">{{ $lang('pointsGift') }}</view>
|
||||
<view class="card-privilege-text">{{ $lang('giftPoints', { points: currCard.send_point }) }}</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.send_balance > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-hongbao"></text></view>
|
||||
<view class="card-privilege-name">红包礼包</view>
|
||||
<view class="card-privilege-text">赠送{{ parseFloat(currCard.send_balance) }}元红包</view>
|
||||
<view class="card-privilege-name">{{ $lang('redPacketGift') }}</view>
|
||||
<view class="card-privilege-text">{{ $lang('giftRedPacket', { amount: parseFloat(currCard.send_balance) }) }}</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.send_coupon != ''">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-youhuiquan1"></text></view>
|
||||
<view class="card-privilege-name">优惠券礼包</view>
|
||||
<view class="card-privilege-text">赠送{{ currCard.send_coupon.split(',').length }}张优惠券
|
||||
<view class="card-privilege-name">{{ $lang('couponGift') }}</view>
|
||||
<view class="card-privilege-text">{{ $lang('giftCoupons', { count: currCard.send_coupon.split(',').length }) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -170,17 +170,17 @@
|
||||
</view>
|
||||
<view class="action" :class="{ 'bottom-safe-area': isIphoneX, 'have-agreement': agreement }">
|
||||
<view class="action-btn" @click="create">
|
||||
<block v-if="currCard.level_id == levelId"><text class="bold title">立即续费</text></block>
|
||||
<block v-if="currCard.level_id == levelId"><text class="bold title">{{ $lang('renewNow') }}</text></block>
|
||||
<block v-else>
|
||||
<text class="bold title" v-if="currCard.charge_type == 1">充值开通</text>
|
||||
<text class="bold title" v-else>立即开通</text>
|
||||
<text class="bold title" v-if="currCard.charge_type == 1">{{ $lang('rechargeToActivate') }}</text>
|
||||
<text class="bold title" v-else>{{ $lang('activateNow') }}</text>
|
||||
</block>
|
||||
<text class="font-size-tag">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="bold">{{ currCard.charge_rule_arr[choiceIndex].value }}</text>
|
||||
<text>/{{ cardType[currCard.charge_rule_arr[choiceIndex].key].unit }}</text>
|
||||
</view>
|
||||
<view class="agreement" v-if="agreement">
|
||||
购买既视为同意
|
||||
{{ $lang('purchaseAgreement') }}
|
||||
<text @click="$util.redirectTo('/pages_tool/member/card_agreement')">《{{ agreement.title
|
||||
}}》</text>
|
||||
</view>
|
||||
@@ -193,13 +193,13 @@
|
||||
<uni-popup ref="explainPopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closeExplainPopup()">
|
||||
<view class="title">会员卡说明</view>
|
||||
<view class="title">{{ $lang('cardDescription') }}</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">
|
||||
<block v-if="currCard.remark != ''">
|
||||
<view class="tip">会员卡说明</view>
|
||||
<view class="tip">{{ $lang('cardDescription') }}</view>
|
||||
<view class="font-size-base">{{ currCard.remark }}</view>
|
||||
</block>
|
||||
</view>
|
||||
@@ -211,7 +211,7 @@
|
||||
<ns-payment ref="choosePaymentPopup" :payMoney="currCard.charge_rule_arr[choiceIndex].value"
|
||||
@confirm="toPay" v-if="currCard.charge_rule_arr.length"></ns-payment>
|
||||
</block>
|
||||
<block v-else><ns-empty text="暂无可开会员卡" :isIndex="false"></ns-empty></block>
|
||||
<block v-else><ns-empty :text="$lang('noCardsAvailable')" :isIndex="false"></ns-empty></block>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
@@ -246,24 +246,6 @@ export default {
|
||||
},
|
||||
levelList: [],
|
||||
levelId: 0,
|
||||
cardType: {
|
||||
week: {
|
||||
name: '周卡',
|
||||
unit: '周'
|
||||
},
|
||||
month: {
|
||||
name: '月卡',
|
||||
unit: '月'
|
||||
},
|
||||
quarter: {
|
||||
name: '季卡',
|
||||
unit: '季'
|
||||
},
|
||||
year: {
|
||||
name: '年卡',
|
||||
unit: '年'
|
||||
}
|
||||
},
|
||||
choiceIndex: 0,
|
||||
outTradeNo: '',
|
||||
agreement: null
|
||||
@@ -273,6 +255,26 @@ export default {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
cardType() {
|
||||
return {
|
||||
week: {
|
||||
name: this.$lang('weekCardName'),
|
||||
unit: this.$lang('weekCardUnit')
|
||||
},
|
||||
month: {
|
||||
name: this.$lang('monthCardName'),
|
||||
unit: this.$lang('monthCardUnit')
|
||||
},
|
||||
quarter: {
|
||||
name: this.$lang('quarterCardName'),
|
||||
unit: this.$lang('quarterCardUnit')
|
||||
},
|
||||
year: {
|
||||
name: this.$lang('yearCardName'),
|
||||
unit: this.$lang('yearCardUnit')
|
||||
}
|
||||
};
|
||||
},
|
||||
currCard() {
|
||||
if (this.levelList[this.curIndex]) {
|
||||
let card = this.levelList[this.curIndex];
|
||||
@@ -349,8 +351,8 @@ export default {
|
||||
create() {
|
||||
if (this.memberInfo.member_level_type && this.memberInfo.member_level != this.currCard.level_id) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您有尚未过期的会员卡,再次购卡会覆盖掉之前的卡,是否继续?',
|
||||
title: this.$lang('common.tip'),
|
||||
content: this.$lang('cardOverrideConfirm'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$refs.choosePaymentPopup.open();
|
||||
|
||||
Reference in New Issue
Block a user