fix: script bind加诊断—若${id}$未替换则alert提示
This commit is contained in:
parent
9dbb44fbd9
commit
e311a42e99
@ -78,7 +78,7 @@
|
|||||||
"wid": "self",
|
"wid": "self",
|
||||||
"event": "gen_promo",
|
"event": "gen_promo",
|
||||||
"actiontype": "script",
|
"actiontype": "script",
|
||||||
"script": "(function(){var id='${id}$';var x=new XMLHttpRequest();x.open('POST','{{entire_url('../api/gen_promo_from_mkt.dspy')}}',true);x.setRequestHeader('Content-Type','application/x-www-form-urlencoded');x.onload=function(){try{var d=JSON.parse(x.responseText);if(d.widgettype==='Message'){var m=new bricks.Message(d.options);m.show();}else{alert(d.options.message||x.responseText);}}catch(e){alert(x.responseText);}};x.send('marketing_id='+encodeURIComponent(id));})();"
|
"script": "(function(){var id='${id}$';if(!id||id==='${id}$'){alert('未获取到方案ID,请先选中一行。');return;}var x=new XMLHttpRequest();x.open('POST','{{entire_url('../api/gen_promo_from_mkt.dspy')}}',true);x.setRequestHeader('Content-Type','application/x-www-form-urlencoded');x.onload=function(){try{var d=JSON.parse(x.responseText);if(d.widgettype==='Message'){var m=new bricks.Message(d.options);m.show();}else{alert(d.options.message||x.responseText);}}catch(e){alert(x.responseText);}};x.send('marketing_id='+encodeURIComponent(id));})();"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"new_data_url": "{{entire_url('/discount/api/marketing_create.dspy')}}",
|
"new_data_url": "{{entire_url('/discount/api/marketing_create.dspy')}}",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user