|
...
|
...
|
@@ -451,6 +451,29 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TTS:逐字加空格,避免数字被读成数值(如 801 → 八百零一)
|
|
|
|
toTtsSpacedText(str) {
|
|
|
|
if (!str && str !== 0) return '';
|
|
|
|
return String(str).split('').join(' ');
|
|
|
|
},
|
|
|
|
|
|
|
|
// TTS:区域名保持原读法,仅将包间名逐字拆开
|
|
|
|
buildTtsTablesText(tablesText, deskStr) {
|
|
|
|
if (!tablesText) return '';
|
|
|
|
let result = String(tablesText);
|
|
|
|
const names = String(deskStr || '')
|
|
|
|
.split('、')
|
|
|
|
.filter(Boolean)
|
|
|
|
.sort((a, b) => b.length - a.length);
|
|
|
|
if (!names.length) {
|
|
|
|
return result.replace(/\d/g, d => d + ' ').replace(/ +/g, ' ').trim();
|
|
|
|
}
|
|
|
|
names.forEach(name => {
|
|
|
|
result = result.split(name).join(this.toTtsSpacedText(name));
|
|
|
|
});
|
|
|
|
return result;
|
|
|
|
},
|
|
|
|
|
|
|
|
// 文字转语音的方法(2-13页面)
|
|
|
|
textToSpeechFun(sid, reserve) {
|
|
|
|
console.log('reservereserve-----', reserve);
|
|
...
|
...
|
@@ -509,9 +532,8 @@ export default { |
|
|
|
})
|
|
|
|
data.detail.rname = data.detail.rname.trim()
|
|
|
|
let str = data.detail.sex == 1 ? '先生' : data.detail.sex == 2 ? '女士' : data.detail.sex == 4 ? '贵宾' : '';
|
|
|
|
let charArray = data.seller.deskStr.split('');
|
|
|
|
let modifiedArray = charArray.map(char => char + ' ');
|
|
|
|
let resultString = modifiedArray.join('').slice(0, -1);
|
|
|
|
let resultString = this.toTtsSpacedText(data.seller.deskStr || '');
|
|
|
|
let tablesTextForTts = this.buildTtsTablesText(data.seller.tablesText, data.seller.deskStr);
|
|
|
|
const replacements = {
|
|
|
|
"{店铺名}": data.seller.name,
|
|
|
|
"{年月日}": data.seller.yearMonthDay,
|
|
...
|
...
|
@@ -519,7 +541,7 @@ export default { |
|
|
|
"{餐段}": data.seller.soltName,
|
|
|
|
"{就餐时间}": data.seller.dateStr + data.seller.dateStrDivide,
|
|
|
|
"{包间名}": resultString,
|
|
|
|
"{区域名+包间名}": data.seller.tablesText,
|
|
|
|
"{区域名+包间名}": tablesTextForTts,
|
|
|
|
"{经理名字}": data.staffinfo.name,
|
|
|
|
"{客人姓名+称呼}": data.detail.rname ? (data.detail.rname + str) : str == '贵宾' ? '贵宾' : '',
|
|
|
|
"{预订日期}": data.seller.yearMonthDay,
|
|
...
|
...
|
@@ -698,7 +720,7 @@ export default { |
|
|
|
userinfo
|
|
|
|
}).then(res => {
|
|
|
|
if (res.ret == 200) {
|
|
|
|
util.toast('赴约成功', 'none')
|
|
|
|
util.toast('赴约成功', 'none', 2500)
|
|
|
|
this.setData({
|
|
|
|
isShowBtn: false,
|
|
|
|
})
|
...
|
...
|
|