i18n: 替换所有硬编码文本为多语言配置
将项目中各处的硬编码字符串替换为国际化语言包调用,统一管理页面和组件的文案内容,方便后续多语言适配与维护
This commit is contained in:
@@ -236,7 +236,7 @@ export default {
|
||||
|
||||
handleUnifiedKefuClick() {
|
||||
this.customerService.handleUnifiedKefuClick({
|
||||
sendMessageTitle: '来自悬浮按钮的咨询',
|
||||
sendMessageTitle: this.$lang('kefu.hoverNavConsult'),
|
||||
sendMessagePath: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,8 +36,13 @@ export default {
|
||||
methods: {
|
||||
getText() {
|
||||
let self = this;
|
||||
let timeVal = _time_.getFormatTime(self.textVal, self.maxDate);
|
||||
if (timeVal && (timeVal.endsWith('刚刚') || timeVal.endsWith('分钟前'))) {
|
||||
let timeVal = _time_.getFormatTime(self.textVal, self.maxDate, {
|
||||
justNow: self.$lang('time.justNow'),
|
||||
minutesAgo: self.$lang('time.minutesAgo'),
|
||||
hoursAgo: self.$lang('time.hoursAgo'),
|
||||
daysAgo: self.$lang('time.daysAgo')
|
||||
});
|
||||
if (timeVal && (timeVal.endsWith(self.$lang('time.justNow')) || timeVal.endsWith(self.$lang('time.minutesAgo')))) {
|
||||
setTimeout(() => {
|
||||
let temp = self.textVal;
|
||||
self.textVal = '';
|
||||
|
||||
@@ -89,17 +89,18 @@ timeProto.getLastDate = function(constTime) {
|
||||
return date.getFullYear() + '-' + month + '-' + day;
|
||||
}
|
||||
|
||||
const resDateStr = function(timer, constTime) {
|
||||
const resDateStr = function(timer, constTime, i18n) {
|
||||
const t = i18n || { justNow: "刚刚", minutesAgo: "分钟前", hoursAgo: "小时前", daysAgo: "天前" }
|
||||
let _just = function(timer) {
|
||||
|
||||
if (timer <= 0 || Math.floor(timer / 60) <= 0) {
|
||||
return "刚刚"
|
||||
return t.justNow
|
||||
} else return 'next';
|
||||
}
|
||||
|
||||
let _mm = function(timer) {
|
||||
if (timer < 3600) {
|
||||
return Math.floor(timer / 60) + "分钟前"
|
||||
return Math.floor(timer / 60) + t.minutesAgo
|
||||
} else return 'next';
|
||||
}
|
||||
let _hh = function(timer, constTime) {
|
||||
@@ -107,7 +108,7 @@ const resDateStr = function(timer, constTime) {
|
||||
if (timer >= 3600 && (constTime - today >= 0)) {
|
||||
//可切换显示模式
|
||||
// return "今天 " + new Date(constTime).pattern("HH:mm");
|
||||
return Math.floor(timer / 60 / 60) + "小时前";
|
||||
return Math.floor(timer / 60 / 60) + t.hoursAgo;
|
||||
} else {
|
||||
return 'next'
|
||||
};
|
||||
@@ -116,7 +117,7 @@ const resDateStr = function(timer, constTime) {
|
||||
let today = _time_.getTodayUnix();
|
||||
timer = (today - constTime) / 1000;
|
||||
if (timer / 86400 <= 31) {
|
||||
return Math.ceil(timer / 86400) + "天前"
|
||||
return Math.ceil(timer / 86400) + t.daysAgo
|
||||
} else return 'next';
|
||||
}
|
||||
let _dlast = function(timer, constTime) {
|
||||
|
||||
@@ -41,8 +41,8 @@ export default {
|
||||
},
|
||||
noMoreSize: 2, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
|
||||
empty: {
|
||||
tip: '~ 空空如也 ~', // 提示
|
||||
btnText: '去看看'
|
||||
tip: '~ ' + this.$lang('mescroll.emptyTip') + ' ~', // 提示
|
||||
btnText: this.$lang('mescroll.goBrowse')
|
||||
},
|
||||
onScroll: true
|
||||
},
|
||||
|
||||
@@ -147,7 +147,7 @@ export default {
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
let item = res.data;
|
||||
item.unit = item.unit || '件';
|
||||
item.unit = item.unit || this.$lang('goods.piece');
|
||||
|
||||
if (item.sku_images) item.sku_images = item.sku_images.split(',');
|
||||
else item.sku_images = [];
|
||||
|
||||
@@ -72,12 +72,12 @@ export default {
|
||||
payIndex: 0,
|
||||
// #ifdef H5
|
||||
payTypeList: [{
|
||||
name: '支付宝支付',
|
||||
name: this.$lang('payment.alipayPay'),
|
||||
icon: 'icon-zhifubaozhifu-',
|
||||
type: 'alipay'
|
||||
},
|
||||
{
|
||||
name: '微信支付',
|
||||
name: this.$lang('payment.wechatPay'),
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
}
|
||||
@@ -86,7 +86,7 @@ export default {
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
payTypeList: [{
|
||||
name: '微信支付',
|
||||
name: this.$lang('payment.wechatPay'),
|
||||
provider: 'wxpay',
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
payTypeList: [{
|
||||
name: '支付宝支付',
|
||||
name: this.$lang('payment.alipayPay'),
|
||||
icon: 'icon-zhifubaozhifu-',
|
||||
type: 'alipay',
|
||||
provider: 'alipay'
|
||||
|
||||
@@ -145,7 +145,7 @@ export default {
|
||||
let num = 1; //记录循环执行过的次数
|
||||
let mostDay = this.obj.dataTime.most_day ? this.obj.dataTime.most_day + 1 : 1; // 最多可预约天数
|
||||
let startTime = parseInt(today.getTime() / 1000);
|
||||
let week = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
let week = [this.$lang('date.sunday'), this.$lang('date.monday'), this.$lang('date.tuesday'), this.$lang('date.wednesday'), this.$lang('date.thursday'), this.$lang('date.friday'), this.$lang('date.saturday')];
|
||||
if (obj.time_week && obj.time_week.length == 7) {
|
||||
//判断是否七天全有
|
||||
judge = true;
|
||||
@@ -170,9 +170,9 @@ export default {
|
||||
i = i - 1;
|
||||
} else {
|
||||
objects = {
|
||||
title: this.obj.dataTime.advance_day == 0 ? '今天' : '',
|
||||
title: this.obj.dataTime.advance_day == 0 ? this.$lang('date.today') : '',
|
||||
type: 'special',
|
||||
month: nowMonth + '月' + nowDate + '日',
|
||||
month: nowMonth + this.$lang('date.month') + nowDate + this.$lang('date.day'),
|
||||
Day: '(' + dayStr + ')'
|
||||
};
|
||||
this.dayData.push(objects); //左侧日期数据处理
|
||||
@@ -182,8 +182,8 @@ export default {
|
||||
case 2:
|
||||
if (i == 0 || i == 1) {
|
||||
objects = {
|
||||
title: this.obj.dataTime.advance_day == 0 ? '明天' : '',
|
||||
month: nowMonth + '月' + nowDate + '日',
|
||||
title: this.obj.dataTime.advance_day == 0 ? this.$lang('date.tomorrow') : '',
|
||||
month: nowMonth + this.$lang('date.month') + nowDate + this.$lang('date.day'),
|
||||
Day: '(' + dayStr + ')'
|
||||
};
|
||||
this.dayData.push(objects); //左侧日期数据处理
|
||||
@@ -192,7 +192,7 @@ export default {
|
||||
default:
|
||||
objects = {
|
||||
title: '',
|
||||
month: nowMonth + '月' + nowDate + '日',
|
||||
month: nowMonth + this.$lang('date.month') + nowDate + this.$lang('date.day'),
|
||||
Day: '(' + dayStr + ')'
|
||||
};
|
||||
this.dayData.push(objects); //左侧日期数据处理
|
||||
@@ -267,7 +267,7 @@ export default {
|
||||
if (time <= item.end_time) {
|
||||
let text = '';
|
||||
if (this.obj.delivery.delivery_type == 'local' && i == 0) {
|
||||
text = '立即配送('+ this.$util.getTimeStr(time) + '-' + this.$util.getTimeStr(time + timeInterval) + ')';
|
||||
text = this.$lang('delivery.immediate') + '('+ this.$util.getTimeStr(time) + '-' + this.$util.getTimeStr(time + timeInterval) + ')';
|
||||
} else {
|
||||
text = this.$util.getTimeStr(time) + '-' + this.$util.getTimeStr(time + timeInterval);
|
||||
}
|
||||
|
||||
@@ -63,12 +63,12 @@
|
||||
payIndex: 0,
|
||||
// #ifdef H5
|
||||
payTypeList: [{
|
||||
name: '支付宝支付',
|
||||
name: this.$lang('payment.alipayPay'),
|
||||
icon: 'icon-zhifubaozhifu-',
|
||||
type: 'alipay'
|
||||
},
|
||||
{
|
||||
name: '微信支付',
|
||||
name: this.$lang('payment.wechatPay'),
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
}
|
||||
@@ -77,7 +77,7 @@
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
payTypeList: [{
|
||||
name: '微信支付',
|
||||
name: this.$lang('payment.wechatPay'),
|
||||
provider: 'wxpay',
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
@@ -85,7 +85,7 @@
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
payTypeList: [{
|
||||
name: '支付宝支付',
|
||||
name: this.$lang('payment.alipayPay'),
|
||||
icon: 'icon-zhifubaozhifu-',
|
||||
type: 'alipay',
|
||||
provider: 'alipay'
|
||||
|
||||
@@ -43,12 +43,12 @@ export default {
|
||||
showPop: false,
|
||||
privacyAuthorization: null,
|
||||
privacyResolves: new Set(),
|
||||
privacyContractName: '用户隐私保护指引',
|
||||
appName: '本小程序',
|
||||
privacyContractName: this.$lang('privacy.contractName'),
|
||||
appName: this.$lang('privacy.miniAppName'),
|
||||
// #ifdef WEB || H5
|
||||
appName: '本应用',
|
||||
privacyContractName: '《隐私条款》',
|
||||
privacyServiceName: '《用户服务协议》',
|
||||
appName: this.$lang('privacy.appName'),
|
||||
privacyContractName: this.$lang('privacy.termsTitle'),
|
||||
privacyServiceName: this.$lang('privacy.serviceTerms'),
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
// 方案2:使用SDK打开用户资料
|
||||
this.openUserProfile(contactId);
|
||||
} else {
|
||||
this.showError('未配置企业微信客服信息');
|
||||
this.showError(this.$lang('wxwork.notConfigured'));
|
||||
}
|
||||
// #endif
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
// H5环境直接跳转
|
||||
window.location.href = contactUrl;
|
||||
} else {
|
||||
this.showError('未配置企业微信客服信息');
|
||||
this.showError(this.$lang('wxwork.notConfigured'));
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
@@ -171,7 +171,7 @@
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('跳转企业微信失败:', err);
|
||||
this.showError('跳转失败,请检查企业微信配置');
|
||||
this.showError(this.$lang('wxwork.jumpFailed'));
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -181,7 +181,7 @@
|
||||
*/
|
||||
openUserProfile(contactId) {
|
||||
if (!this.wxWorkSDK) {
|
||||
this.showError('企业微信SDK未初始化');
|
||||
this.showError(this.$lang('wxwork.sdkNotInit'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
}, (res) => {
|
||||
}, (err) => {
|
||||
console.error('打开用户资料失败:', err);
|
||||
this.showError('打开用户资料失败');
|
||||
this.showError(this.$lang('wxwork.openProfileFailed'));
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export function currentTime() {
|
||||
}
|
||||
|
||||
//时间戳转日期
|
||||
export function timeStamp(time) {
|
||||
export function timeStamp(time, dayNames) {
|
||||
const dates = new Date(time)
|
||||
const year = dates.getFullYear()
|
||||
const month = dates.getMonth() + 1
|
||||
@@ -31,32 +31,33 @@ export function timeStamp(time) {
|
||||
const day = dates.getDay()
|
||||
const hour = dates.getHours()
|
||||
const min = dates.getMinutes()
|
||||
const days = ['日', '一', '二', '三', '四', '五', '六']
|
||||
const days = dayNames || ['日', '一', '二', '三', '四', '五', '六']
|
||||
return {
|
||||
allDate: `${year}/${strFormat(month)}/${strFormat(date)}`,
|
||||
date: `${strFormat(month)}-${strFormat(date)}`, //返回的日期 07-01,${strFormat(year)}-${strFormat(month)}-${strFormat(date)}
|
||||
day: `周${days[day]}`, //返回的礼拜天数 星期一
|
||||
day: `${days[day]}`, //返回的礼拜天数 星期一
|
||||
hour: strFormat(hour) + ':' + strFormat(min) // + ':00' //返回的时钟 08:00
|
||||
}
|
||||
}
|
||||
|
||||
//获取最近7天的日期和礼拜天数
|
||||
export function initData(appointedDay = '') {
|
||||
export function initData(appointedDay = '', dayNames) {
|
||||
const time = []
|
||||
const date = appointedDay ? new Date(appointedDay) : new Date()
|
||||
|
||||
const now = date.getTime() //获取当前日期的时间戳
|
||||
let timeStr = 3600 * 24 * 1000 //一天的时间戳
|
||||
const defaults = dayNames || { today: "今天", tomorrow: "明天", dayAfterTomorrow: "后天" }
|
||||
let obj = {
|
||||
0: "今天",
|
||||
1: "明天",
|
||||
2: "后天"
|
||||
0: defaults.today,
|
||||
1: defaults.tomorrow,
|
||||
2: defaults.dayAfterTomorrow
|
||||
}
|
||||
for (let i = 0; i < 7; i++) {
|
||||
const timeObj = {}
|
||||
timeObj.date = timeStamp(now + timeStr * i).date //保存日期
|
||||
timeObj.date = timeStamp(now + timeStr * i, dayNames).date //保存日期
|
||||
timeObj.timeStamp = now + timeStr * i //保存时间戳
|
||||
timeObj.week = appointedDay == '' ? (obj[i] ?? timeStamp(now + timeStr * i).day) : timeStamp(now + timeStr * i)
|
||||
timeObj.week = appointedDay == '' ? (obj[i] ?? timeStamp(now + timeStr * i, dayNames).day) : timeStamp(now + timeStr * i, dayNames)
|
||||
.day
|
||||
time.push(timeObj)
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
return {
|
||||
pickerStartDay: '', // 指定开始日期
|
||||
pickerEndDay: '', // 指定结束日期
|
||||
orderDateTime: '暂无选择', // 选中时间
|
||||
orderDateTime: this.$lang('date.noSelection'), // 选中时间
|
||||
orderTimeArr: {}, //多选的时间
|
||||
dateArr: [], //日期数据
|
||||
timeArr: [], //时间数据
|
||||
@@ -188,14 +188,16 @@
|
||||
};
|
||||
},
|
||||
created(props) {
|
||||
const dayNames = [this.$lang('date.sunday'), this.$lang('date.monday'), this.$lang('date.tuesday'), this.$lang('date.wednesday'), this.$lang('date.thursday'), this.$lang('date.friday'), this.$lang('date.saturday')];
|
||||
const dayLabels = { today: this.$lang('date.today'), tomorrow: this.$lang('date.tomorrow'), dayAfterTomorrow: this.$lang('date.dayAfterTomorrow') };
|
||||
this.selectDate = this.nowDate = currentTime().date;
|
||||
this.pickerStartDay = currentTime().year + '-' + currentTime().date;
|
||||
const now = new Date(this.pickerStartDay).getTime(); //获取当前日期的时间戳
|
||||
let timeStr = 3600 * 24 * 1000; //一天的时间戳
|
||||
let day = 90; // 未来3个月
|
||||
this.pickerEndDay = timeStamp(now + timeStr * day).allDate;
|
||||
this.pickerEndDay = timeStamp(now + timeStr * day, dayNames).allDate;
|
||||
this.initOnload();
|
||||
this.dateArr = initData(); // 日期栏初始化
|
||||
this.dateArr = initData('', dayLabels); // 日期栏初始化
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
@@ -209,18 +211,18 @@
|
||||
let date = e.split("-");
|
||||
date = date[1] + "-" + date[2];
|
||||
if (this.disableWeek.length && date >= weekDate()[0] && date <= weekDate()[1]) {
|
||||
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
let weekBox = [this.$lang('date.sunday'), this.$lang('date.monday'), this.$lang('date.tuesday'), this.$lang('date.wednesday'), this.$lang('date.thursday'), this.$lang('date.friday'), this.$lang('date.saturday')];
|
||||
let index = new Date(e).getDay();
|
||||
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
|
||||
uni.showToast({
|
||||
title: weekBox[index] + '不可以预约',
|
||||
title: weekBox[index] + this.$lang('date.cannotReserve'),
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.initOnload(e);
|
||||
this.dateArr = initData(e); // 日期栏初始化
|
||||
this.dateArr = initData(e, { today: this.$lang('date.today'), tomorrow: this.$lang('date.tomorrow'), dayAfterTomorrow: this.$lang('date.dayAfterTomorrow') }); // 日期栏初始化
|
||||
this.selectDateEvent(0, this.dateArr[0]);
|
||||
},
|
||||
initOnload(appointedDay) {
|
||||
@@ -231,7 +233,7 @@
|
||||
// 判断默认是不能选择的周,则都禁止选中
|
||||
if (this.disableWeek.length && this.selectDate >= weekDate()[0] && this.selectDate <=
|
||||
weekDate()[1]) {
|
||||
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
let weekBox = [this.$lang('date.sunday'), this.$lang('date.monday'), this.$lang('date.tuesday'), this.$lang('date.wednesday'), this.$lang('date.thursday'), this.$lang('date.friday'), this.$lang('date.saturday')];
|
||||
let date = currentTime().year + '-' + this.selectDate;
|
||||
let index = new Date(date).getDay();
|
||||
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
|
||||
@@ -280,7 +282,7 @@
|
||||
this.isSection && (item.isInclude = false);
|
||||
});
|
||||
|
||||
this.orderDateTime = isFullTime ? '暂无选择' : this.selectDate;
|
||||
this.orderDateTime = isFullTime ? this.$lang('date.noSelection') : this.selectDate;
|
||||
this.timeActive = -1;
|
||||
for (let i = 0, len = this.timeArr.length; i < len; i++) {
|
||||
if (!this.timeArr[i].disable) {
|
||||
@@ -297,11 +299,11 @@
|
||||
// 日期选择事件
|
||||
selectDateEvent(index, item) {
|
||||
if (this.disableWeek.length && item.date >= weekDate()[0] && item.date <= weekDate()[1]) {
|
||||
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
let weekBox = [this.$lang('date.sunday'), this.$lang('date.monday'), this.$lang('date.tuesday'), this.$lang('date.wednesday'), this.$lang('date.thursday'), this.$lang('date.friday'), this.$lang('date.saturday')];
|
||||
let index = new Date(item.timeStamp).getDay();
|
||||
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
|
||||
uni.showToast({
|
||||
title: weekBox[index] + '不可以预约',
|
||||
title: weekBox[index] + this.$lang('date.cannotReserve'),
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
|
||||
@@ -118,8 +118,8 @@ export default {
|
||||
} catch (e) {}
|
||||
if (v && v.commitId) {
|
||||
uni.showModal({
|
||||
title: '构建版本信息',
|
||||
content: `提交 ID: ${v.commitId}\n构建时间: ${v.buildTime}`,
|
||||
title: this.$lang('common.buildVersion'),
|
||||
content: this.$lang('common.buildVersionDesc', { commitId: v.commitId, buildTime: v.buildTime }),
|
||||
showCancel: false
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -282,7 +282,7 @@ export default {
|
||||
//生成海报
|
||||
getGoodsPoster() {
|
||||
uni.showLoading({
|
||||
'title': '海报生成中...'
|
||||
'title': this.$lang('goods.posterGenerating')
|
||||
})
|
||||
//活动海报信息
|
||||
if (this.memberInfo && this.memberInfo.member_id) this.posterParams.source_member = this.memberInfo.member_id;
|
||||
@@ -348,12 +348,12 @@ export default {
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({
|
||||
title: "保存成功"
|
||||
title: this.$lang('common.saveSuccess')
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
this.$util.showToast({
|
||||
title: "保存失败,请稍后重试"
|
||||
title: this.$lang('common.saveFailed')
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -361,7 +361,7 @@ export default {
|
||||
},
|
||||
fail: (err) => {
|
||||
this.$util.showToast({
|
||||
title: "保存失败,请稍后重试"
|
||||
title: this.$lang('common.saveFailed')
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -46,16 +46,16 @@ export default {
|
||||
this.mpShareData = res;
|
||||
}).catch(err => {
|
||||
// 如果后台没配置,用默认值
|
||||
this.mpShareData = {
|
||||
appMessage: {
|
||||
title: '发现超多好物,快来看看',
|
||||
path: '/pages_goods/category'
|
||||
},
|
||||
timeLine: {
|
||||
title: '发现超多好物,快来看看',
|
||||
query: '/pages_goods/category'
|
||||
}
|
||||
};
|
||||
this.mpShareData = {
|
||||
appMessage: {
|
||||
title: this.$lang('goods.shareTitle'),
|
||||
path: '/pages_goods/category'
|
||||
},
|
||||
timeLine: {
|
||||
title: this.$lang('goods.shareTitle'),
|
||||
query: '/pages_goods/category'
|
||||
}
|
||||
};
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
@@ -92,19 +92,19 @@ export default {
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData?.appMessage || {
|
||||
title: '发现超多好物,快来看看',
|
||||
title: this.$lang('goods.shareTitle'),
|
||||
path: '/pages_goods/category'
|
||||
};
|
||||
},
|
||||
onShareTimeline() {
|
||||
return this.mpShareData?.timeLine || {
|
||||
title: '发现超多好物,快来看看',
|
||||
title: this.$lang('goods.shareTitle'),
|
||||
query: '/pages_goods/category'
|
||||
};
|
||||
},
|
||||
onAddToFavorites() {
|
||||
return {
|
||||
title: '发现超多好物,快来看看',
|
||||
title: this.$lang('goods.shareTitle'),
|
||||
path: '/pages_goods/category'
|
||||
};
|
||||
}
|
||||
|
||||
@@ -128,10 +128,10 @@
|
||||
<!-- <view class="group-wrap card-info" v-if="goodsSkuDetail.goods_class == 5 && goodsSkuDetail.card_info && goodsSkuDetail.card_info.relation_goods.length">
|
||||
<view class="card-title">- 套餐包含以下的服务及商品 -</view>
|
||||
<view class="card-desc" v-if="goodsSkuDetail.card_info.card_type == 'timecard' || goodsSkuDetail.card_info.card_type == 'commoncard'">
|
||||
{{ goodsSkuDetail.card_info.card_type == 'commoncard' ? '卡项内项目/商品总的可用次数为' + goodsSkuDetail.card_info.common_num + ' ,' : '' }}
|
||||
{{ goodsSkuDetail.card_info.card_type == 'timecard' ? '次数不限 ,' : '' }} 有效期为{{
|
||||
(goodsSkuDetail.card_info.validity_type == 0 && '永久') ||
|
||||
(goodsSkuDetail.card_info.validity_type == 1 && goodsSkuDetail.card_info.validity_day + '天') ||
|
||||
{{ goodsSkuDetail.card_info.card_type == 'commoncard' ? $lang('goods.cardTotalCount', { count: goodsSkuDetail.card_info.common_num }) + ' ,' : '' }}
|
||||
{{ goodsSkuDetail.card_info.card_type == 'timecard' ? $lang('goods.unlimitedCount') + ' ,' : '' }} {{ $lang('goods.validPeriod') }}{{
|
||||
(goodsSkuDetail.card_info.validity_type == 0 && $lang('goods.permanent')) ||
|
||||
(goodsSkuDetail.card_info.validity_type == 1 && goodsSkuDetail.card_info.validity_day + $lang('common.days')) ||
|
||||
(goodsSkuDetail.card_info.validity_type == 2 && $util.timeStampTurnTime(goodsSkuDetail.card_info.validity_time))
|
||||
}}
|
||||
</view>
|
||||
@@ -149,7 +149,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-off" @click="cardOff = !cardOff" v-if="goodsSkuDetail.card_info.relation_goods.length > 1">
|
||||
<text>{{ cardOff ? '收起' : '展开' }}</text>
|
||||
<text>{{ cardOff ? $lang('common.collapse') : $lang('common.expand') }}</text>
|
||||
<text class="icondiy" :class="[cardOff ? 'icon-system-jiantoushang' : 'icon-system-jiantouxia']"></text>
|
||||
</view>
|
||||
</view> -->
|
||||
@@ -173,11 +173,11 @@
|
||||
<view v-if="item.type == 'reward'">
|
||||
{{
|
||||
parseFloat(item.at_least) > 0
|
||||
? '满' + decimalPointFormat(item.at_least) + '减' + decimalPointFormat(item.money)
|
||||
: '无门槛使用' + decimalPointFormat(item.money)
|
||||
? $lang('goods.fullReduce', { atLeast: decimalPointFormat(item.at_least), money: decimalPointFormat(item.money) })
|
||||
: $lang('goods.noThresholdUse', { money: decimalPointFormat(item.money) })
|
||||
}}
|
||||
</view>
|
||||
<view v-else-if="item.type == 'discount'">{{ '满' + decimalPointFormat(item.at_least) + '打' + parseFloat(item.discount)+'折' }}</view>
|
||||
<view v-else-if="item.type == 'discount'">{{ $lang('goods.fullDiscount', { atLeast: decimalPointFormat(item.at_least), discount: parseFloat(item.discount) }) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
@@ -588,7 +588,7 @@ export default {
|
||||
data: '021-51815181',
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '复制成功',
|
||||
title: this.$lang('common.copySuccess'),
|
||||
icon: 'success'
|
||||
});
|
||||
this.closeContactPopup();
|
||||
|
||||
@@ -233,14 +233,14 @@ export default {
|
||||
}
|
||||
if (cart_id.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请选择要删除的商品'
|
||||
title: this.$lang('cart.selectGoodsToDelete')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: cart_id.length > 1 ? '确定要删除这些商品吗?' : '确定要删除该商品吗?',
|
||||
title: this.$lang('common.tip'),
|
||||
content: cart_id.length > 1 ? this.$lang('cart.confirmDeleteSelected') : this.$lang('cart.confirmDeleteOne'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
cart_id = cart_id.toString();
|
||||
@@ -381,8 +381,8 @@ export default {
|
||||
*/
|
||||
clearInvalidGoods() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要清空这些商品吗?',
|
||||
title: this.$lang('common.tip'),
|
||||
content: this.$lang('cart.confirmClearInvalid'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
var cart_ids = [];
|
||||
@@ -432,11 +432,11 @@ export default {
|
||||
if (event.type == 'plus') {
|
||||
if (data.max_buy > 0 && data.max_buy < data.stock) {
|
||||
this.$util.showToast({
|
||||
title: '该商品每人限购' + data.max_buy + '件'
|
||||
title: this.$lang('cart.personLimit', { count: data.max_buy })
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '库存不足'
|
||||
title: this.$lang('sku.insufficientStock')
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -318,9 +318,9 @@ export default {
|
||||
|
||||
let list = this.couponList;
|
||||
if (res.data.is_exist == 1 && res.code < 0) {
|
||||
msg = '您已领取过该优惠券,快去使用吧';
|
||||
msg = this.$lang('goods.couponAlreadyClaimed');
|
||||
} else if (res.code == 0) {
|
||||
msg = '领取成功,快去使用吧';
|
||||
msg = this.$lang('goods.couponClaimSuccess');
|
||||
} else {
|
||||
msg = res.message;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export default {
|
||||
fontWeight: false,
|
||||
padding: 0,
|
||||
cartEvent: "detail",
|
||||
text: "购买",
|
||||
text: this.$lang('goods.buy'),
|
||||
textColor: "#FFFFFF",
|
||||
theme: "default",
|
||||
aroundRadius: 25,
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
if(this.langstatus == 1){
|
||||
// this.$langConfig.refresh();
|
||||
uni.setNavigationBarTitle({
|
||||
title:uni.getStorageSync('lang') == 'en-us'?'Goods List':'商品列表'
|
||||
title: this.$lang('goods.goodsList')
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ export default {
|
||||
* 转发分享
|
||||
*/
|
||||
onShareAppMessage(res) {
|
||||
var title = '搜索到' + this.count + '件“' + this.keyword + this.category_title + this.coupon_name + '”相关的优质商品';
|
||||
var title = this.$lang('goods.searchResultCount', { count: this.count, keyword: this.keyword + this.category_title + this.coupon_name });'”相关的优质商品';
|
||||
let route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var path = route.path;
|
||||
return {
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
},
|
||||
// 分享到微信朋友圈
|
||||
onShareTimeline() {
|
||||
var title = '搜索到' + this.count + '件“' + this.keyword + this.category_title + this.coupon_name + '”相关的优质商品';
|
||||
var title = this.$lang('goods.searchResultCount', { count: this.count, keyword: this.keyword + this.category_title + this.coupon_name });'”相关的优质商品';
|
||||
let route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var query = route.query;
|
||||
return {
|
||||
@@ -362,26 +362,26 @@ export default {
|
||||
// }
|
||||
if (!Number(this.maxPrice) && this.maxPrice) {
|
||||
this.$util.showToast({
|
||||
title: '请输入最高价'
|
||||
title: this.$lang('goods.inputMaxPrice')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (Number(this.minPrice) < 0 || Number(this.maxPrice) < 0) {
|
||||
this.$util.showToast({
|
||||
title: '筛选价格不能小于0'
|
||||
title: this.$lang('goods.priceNotNegative')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.minPrice != '' && Number(this.minPrice) > Number(this.maxPrice) && this.maxPrice) {
|
||||
|
||||
this.$util.showToast({
|
||||
title: '最低价不能大于最高价'
|
||||
title: this.$lang('goods.minNotGreaterMax')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.maxPrice != '' && Number(this.maxPrice) < Number(this.minPrice)) {
|
||||
this.$util.showToast({
|
||||
title: '最高价不能小于最低价'
|
||||
title: this.$lang('goods.maxNotLessMin')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user