Commit 887289796fe81e8ec48dfa05bf7b7b85501b27e1

Authored by wangfan
1 parent 1e25e51f

使用新的默认短信模板

Showing 1 changed file with 22 additions and 5 deletions
@@ -5,14 +5,15 @@ import bcm from '../../utils/bookCommon'; @@ -5,14 +5,15 @@ import bcm from '../../utils/bookCommon';
5 const {regeneratorRuntime} = global 5 const {regeneratorRuntime} = global
6 const tpls = { 6 const tpls = {
7 SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!', 7 SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!',
8 - SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!' 8 + SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!',
  9 + SMS_163050401: '尊敬的贵宾,您好!\n ${seller_name}已为您安排${date}的用餐,房间:${region_room_name}; \n地址:${seller_addr}; \n电话:${seller_phone} \n预祝用餐愉快,${cusman}期待您的光临!',
9 }; 10 };
10 Page({ 11 Page({
11 12
12 /** 13 /**
13 * 页面的初始数据 14 * 页面的初始数据
14 */ 15 */
15 - tplsIndex: 'SMS_154587043', 16 + tplsIndex: 'SMS_163050401',
16 data: { 17 data: {
17 bookInfo: {}, 18 bookInfo: {},
18 tplMsg: '' 19 tplMsg: ''
@@ -92,6 +93,13 @@ Page({ @@ -92,6 +93,13 @@ Page({
92 } 93 }
93 return str; 94 return str;
94 }, 95 },
  96 + getTableNameOne(tables){
  97 + let bao = [];
  98 + tables.forEach(t => {
  99 + bao.push(t.name);
  100 + })
  101 + return bao.join('、');
  102 + },
95 getTableNameShort(tables){//短桌位 103 getTableNameShort(tables){//短桌位
96 let str=tables[0].name; 104 let str=tables[0].name;
97 if(tables.length>1){ 105 if(tables.length>1){
@@ -102,12 +110,11 @@ Page({ @@ -102,12 +110,11 @@ Page({
102 smsData: {}, 110 smsData: {},
103 async getTplMsg(){ 111 async getTplMsg(){
104 let smsData = {} 112 let smsData = {}
  113 + let txa=['早上','中午','晚上']
  114 + let tx=await bcm.getTimeSpaceIndexData(this.bookInfo.rdate);
105 switch (this.tplsIndex) { 115 switch (this.tplsIndex) {
106 //尊敬的贵宾,您好!(4月6日)(中午)的用餐,为您安排在(好又多复兴路店)(202)房间,(王丽娜)期待您的光临,预祝就餐愉快! 116 //尊敬的贵宾,您好!(4月6日)(中午)的用餐,为您安排在(好又多复兴路店)(202)房间,(王丽娜)期待您的光临,预祝就餐愉快!
107 case 'SMS_162733710': 117 case 'SMS_162733710':
108 - let txa=['早上','中午','晚上']  
109 - let tx=await bcm.getTimeSpaceIndexData(this.bookInfo.rdate);  
110 - console.log(tx);  
111 smsData = { 118 smsData = {
112 reserve_date: util.unixtoTime(this.bookInfo.rdate,'MM月DD日') 119 reserve_date: util.unixtoTime(this.bookInfo.rdate,'MM月DD日')
113 .replace(/0(\d)/g,function($0,$1){ 120 .replace(/0(\d)/g,function($0,$1){
@@ -117,6 +124,16 @@ Page({ @@ -117,6 +124,16 @@ Page({
117 cusman: (this.bookInfo.cusman || this.bookInfo.seller.sellername).substr(0, 20), 124 cusman: (this.bookInfo.cusman || this.bookInfo.seller.sellername).substr(0, 20),
118 } 125 }
119 break; 126 break;
  127 + case 'SMS_163050401':
  128 + smsData = {
  129 + seller_name: this.bookInfo.seller.sellername.substr(0, 20),
  130 + date: this.bookInfo.rdateStr.replace('日','日'+txa[tx.timeIndex]),
  131 + region_room_name: this.getTableNameOne(this.bookInfo.tables).substr(0, 20),
  132 + seller_addr: (this.bookInfo.seller.real_address || this.bookInfo.seller.map_address).substr(0, 20),
  133 + seller_phone: this.bookInfo.seller.phone.substr(0, 20),
  134 + cusman: (this.bookInfo.cusman||'').substr(0, 20),
  135 + }
  136 + break;
120 default: 137 default:
121 let guest = ''; 138 let guest = '';
122 if (this.bookInfo.sex == 3) { 139 if (this.bookInfo.sex == 3) {