Commit 6082cf9afae72e407ce481a624a99e5e43b97f0d

Authored by vking
1 parent 8678707b

更换短信逻辑

@@ -63,28 +63,28 @@ Page({ @@ -63,28 +63,28 @@ Page({
63 }, 63 },
64 bookInfo: null, 64 bookInfo: null,
65 async getDetail(id){ 65 async getDetail(id){
66 - let res=await App.Reserve.Detail({rid: id}); 66 + let params={rid: id}
  67 + let res=await App.Reserve.Detail(params);
67 this.bookInfo=res.data 68 this.bookInfo=res.data
68 if(res.data.operator_openid==2){//运营处理订单,强制使用运营短信 69 if(res.data.operator_openid==2){//运营处理订单,强制使用运营短信
69 this.tplsIndex='SMS_173950289' 70 this.tplsIndex='SMS_173950289'
  71 + params.template_code='SMS_173950289'
70 } 72 }
71 - let tplMsg=await ST.getTplMsg(res.data,this.tplsIndex,this.sc)  
72 - console.log('tplMsg',tplMsg) 73 + let msg=await App.SendSMS.GetSmsContent(params);
  74 + //let tplMsg=await ST.getTplMsg(res.data,this.tplsIndex,this.sc)
  75 + console.log('tplMsg',msg.data.content)
73 this.setData({ 76 this.setData({
74 bookInfo: res.data, 77 bookInfo: res.data,
75 - tplMsg: tplMsg 78 + tplMsg: msg.data.content
76 }) 79 })
77 80
  81 +
78 }, 82 },
79 sendsms(){ 83 sendsms(){
80 - App.SendSMS.Message({  
81 - phone: this.bookInfo.phone,  
82 - sign_name: '周到安排',  
83 - template_code: this.tplsIndex,  
84 - template_param: JSON.stringify(ST.smsData), 84 + App.SendSMS.NewMessage({
85 rid: this.bookInfo.id, 85 rid: this.bookInfo.id,
86 - len:this.data.tplMsg.length  
87 - }).then((res) => { 86 + sid: this.bookInfo.seller.id
  87 + }).then(res=>{
88 if (res.ret != 200) { 88 if (res.ret != 200) {
89 return util.toast(res.msg, 'none'); 89 return util.toast(res.msg, 'none');
90 } 90 }
@@ -136,10 +136,16 @@ Page({ @@ -136,10 +136,16 @@ Page({
136 hasUpTime:reserev.type==1 && reserev.hasRunning && reserev.status!=2, 136 hasUpTime:reserev.type==1 && reserev.hasRunning && reserev.status!=2,
137 } 137 }
138 }) 138 })
  139 + /*
139 App.Reserve.SellerInfo({seller_id:reserev.seller.id}).then(async sc=>{ 140 App.Reserve.SellerInfo({seller_id:reserev.seller.id}).then(async sc=>{
140 this.msgTpl=await ST.getTplMsg(reserev,sc.data.setting.template_code,sc.data) 141 this.msgTpl=await ST.getTplMsg(reserev,sc.data.setting.template_code,sc.data)
141 console.log('this.msgTpl',this.msgTpl); 142 console.log('this.msgTpl',this.msgTpl);
142 - }) 143 + })*/
  144 + })
  145 + App.SendSMS.GetSmsContent({
  146 + rid:this.data.options.id,
  147 + }).then(res=>{
  148 + this.msgTpl=res.data.content
143 }) 149 })
144 }, 150 },
145 formatDatail(detail,dateSmart){ 151 formatDatail(detail,dateSmart){
@@ -366,6 +366,11 @@ export default { @@ -366,6 +366,11 @@ export default {
366 openid:'openid', 366 openid:'openid',
367 cachetime: -1, 367 cachetime: -1,
368 }, 368 },
  369 + //查看短信内容
  370 + 'App.SendSMS.GetSmsContent':null,
  371 + //发送短信
  372 + 'App.SendSMS.NewMessage':null,
  373 +
369 //商户修改在线预定 374 //商户修改在线预定
370 'App.Customer.SetReserveInfoById':null, 375 'App.Customer.SetReserveInfoById':null,
371 //生成小程序码 376 //生成小程序码