feat: add and optimize multilingual text resources
- add new language packs for multiple pages and components including category, cart, order, member center, distribution, etc. - add Chinese and English translations for new features and UI text - fix navigation service error message to use multilingual text - update component templates to use dynamic language translation instead of hardcoded text - adjust code indentation and formatting for consistency
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
<image :src="$util.img(orderdetails.order_goods ? orderdetails.order_goods[0].sku_image : '')" mode="aspectFill" show-menu-by-longpress></image>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ orderdetails.order_goods ? orderdetails.order_goods[0].sku_name : '' }}</view>
|
||||
<view class="font-size-goods-tag">订单状态:{{ orderdetails.order_status_name }}</view>
|
||||
<view class="font-size-goods-tag">配送方式:{{ orderdetails.delivery_type_name }}</view>
|
||||
<view class="font-size-goods-tag">{{ $lang('components.nsChatOrder.orderStatus', { status: orderdetails.order_status_name }) }}</view>
|
||||
<view class="font-size-goods-tag">{{ $lang('components.nsChatOrder.deliveryMethod', { method: orderdetails.delivery_type_name }) }}</view>
|
||||
<view class="goods-bottom">
|
||||
<view class="goods-price color-base-text">
|
||||
<text class="goods-price-sign">¥</text>
|
||||
<text>{{ orderdetails.order_goods ? orderdetails.order_goods[0].price : '' }}</text>
|
||||
</view>
|
||||
<view class="goods-option font-size-goods-tag color-base-bg" @click="sendMsg('order')">发送</view>
|
||||
<view class="goods-option font-size-goods-tag color-base-bg" @click="sendMsg('order')">{{ $lang('components.nsChatOrder.send') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -19,14 +19,14 @@
|
||||
<image :src="$util.img(orderInfo.order_goods ? orderInfo.order_goods[0].sku_image : '')" mode="aspectFill" show-menu-by-longpress></image>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ orderInfo.order_goods ? orderInfo.order_goods[0].sku_name : '' }}</view>
|
||||
<view class="font-size-goods-tag">订单状态:{{ orderInfo.order_status_name }}</view>
|
||||
<view class="font-size-goods-tag">配送方式:{{ orderInfo.delivery_type_name }}</view>
|
||||
<view class="font-size-goods-tag">{{ $lang('components.nsChatOrder.orderStatus', { status: orderInfo.order_status_name }) }}</view>
|
||||
<view class="font-size-goods-tag">{{ $lang('components.nsChatOrder.deliveryMethod', { method: orderInfo.delivery_type_name }) }}</view>
|
||||
<view class="goods-bottom">
|
||||
<view class="goods-price color-base-text">
|
||||
<text class="goods-price-sign">¥</text>
|
||||
<text>{{ orderInfo.order_goods ? orderInfo.order_goods[0].price : '' }}</text>
|
||||
</view>
|
||||
<view class="goods-option font-size-goods-tag disabled">已发送</view>
|
||||
<view class="goods-option font-size-goods-tag disabled">{{ $lang('components.nsChatOrder.sent') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
<uni-popup ref="servicePopup" type="center">
|
||||
<view class="service-popup-wrap">
|
||||
<view class="head-wrap" @click="$refs.servicePopup.close()">
|
||||
<text>联系客服</text>
|
||||
<text>{{ $lang('components.nsContact.contactService') }}</text>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body-wrap">{{ siteInfo.site_tel ? '请联系客服,客服电话是' + siteInfo.site_tel : '抱歉,商家暂无客服,请线下联系' }}
|
||||
<view class="body-wrap">{{ siteInfo.site_tel ? $lang('components.nsContact.callServiceTip', { phone: siteInfo.site_tel }) : $lang('components.nsContact.noServiceOffline') }}
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
@@ -93,9 +93,8 @@ export default {
|
||||
var startHours = format[0].split(':');
|
||||
var endHours = format[1].split(':');
|
||||
|
||||
let timeData = obj.month.split('月');
|
||||
let month = timeData[0];
|
||||
let date = timeData[1].split('日')[0];
|
||||
let month = obj.monthNum;
|
||||
let date = obj.dateNum;
|
||||
|
||||
// 开始时间戳
|
||||
dateTime.setHours(startHours[0],startHours[1],0,0);
|
||||
@@ -180,7 +179,9 @@ export default {
|
||||
objects = {
|
||||
title: this.obj.dataTime.advance_day == 0 ? this.$lang('components.nsSelectTime.today') : '',
|
||||
type: 'special',
|
||||
month: nowMonth + '月' + nowDate + '日',
|
||||
month: this.$lang('components.nsSelectTime.monthDayFormat', { month: nowMonth, date: nowDate }),
|
||||
monthNum: nowMonth,
|
||||
dateNum: nowDate,
|
||||
Day: '(' + dayStr + ')'
|
||||
};
|
||||
this.dayData.push(objects); //左侧日期数据处理
|
||||
@@ -191,7 +192,9 @@ export default {
|
||||
if (i == 0 || i == 1) {
|
||||
objects = {
|
||||
title: this.obj.dataTime.advance_day == 0 ? this.$lang('components.nsSelectTime.tomorrow') : '',
|
||||
month: nowMonth + '月' + nowDate + '日',
|
||||
month: this.$lang('components.nsSelectTime.monthDayFormat', { month: nowMonth, date: nowDate }),
|
||||
monthNum: nowMonth,
|
||||
dateNum: nowDate,
|
||||
Day: '(' + dayStr + ')'
|
||||
};
|
||||
this.dayData.push(objects); //左侧日期数据处理
|
||||
@@ -200,7 +203,9 @@ export default {
|
||||
default:
|
||||
objects = {
|
||||
title: '',
|
||||
month: nowMonth + '月' + nowDate + '日',
|
||||
month: this.$lang('components.nsSelectTime.monthDayFormat', { month: nowMonth, date: nowDate }),
|
||||
monthNum: nowMonth,
|
||||
dateNum: nowDate,
|
||||
Day: '(' + dayStr + ')'
|
||||
};
|
||||
this.dayData.push(objects); //左侧日期数据处理
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
import Lang from '@/common/js/lang.js';
|
||||
|
||||
// 内部翻译函数封装(组件级工具函数直接调用语言包)
|
||||
function $lang(key, ...args) {
|
||||
return Lang.lang(key, ...args);
|
||||
}
|
||||
|
||||
//字符串拼接
|
||||
export function strFormat(str) {
|
||||
return str < 10 ? `0${str}` : str
|
||||
@@ -31,11 +38,19 @@ export function timeStamp(time) {
|
||||
const day = dates.getDay()
|
||||
const hour = dates.getHours()
|
||||
const min = dates.getMinutes()
|
||||
const days = ['日', '一', '二', '三', '四', '五', '六']
|
||||
const weekDays = [
|
||||
$lang('components.yuyueDate.weekSunday'),
|
||||
$lang('components.yuyueDate.weekMonday'),
|
||||
$lang('components.yuyueDate.weekTuesday'),
|
||||
$lang('components.yuyueDate.weekWednesday'),
|
||||
$lang('components.yuyueDate.weekThursday'),
|
||||
$lang('components.yuyueDate.weekFriday'),
|
||||
$lang('components.yuyueDate.weekSaturday'),
|
||||
]
|
||||
return {
|
||||
allDate: `${year}/${strFormat(month)}/${strFormat(date)}`,
|
||||
date: `${strFormat(month)}-${strFormat(date)}`, //返回的日期 07-01,${strFormat(year)}-${strFormat(month)}-${strFormat(date)}
|
||||
day: `周${days[day]}`, //返回的礼拜天数 星期一
|
||||
day: weekDays[day], //返回的礼拜天数 星期一
|
||||
hour: strFormat(hour) + ':' + strFormat(min) // + ':00' //返回的时钟 08:00
|
||||
}
|
||||
}
|
||||
@@ -48,9 +63,9 @@ export function initData(appointedDay = '') {
|
||||
const now = date.getTime() //获取当前日期的时间戳
|
||||
let timeStr = 3600 * 24 * 1000 //一天的时间戳
|
||||
let obj = {
|
||||
0: "今天",
|
||||
1: "明天",
|
||||
2: "后天"
|
||||
0: $lang('components.yuyueDate.today'),
|
||||
1: $lang('components.yuyueDate.tomorrow'),
|
||||
2: $lang('components.yuyueDate.dayAfterTomorrow')
|
||||
}
|
||||
for (let i = 0; i < 7; i++) {
|
||||
const timeObj = {}
|
||||
|
||||
Reference in New Issue
Block a user