fix: 生成促销码改用script+fetch POST传参,绕过urlwidget/PopupWindow参数传递问题
This commit is contained in:
parent
763e41b7eb
commit
9dbb44fbd9
@ -77,22 +77,8 @@
|
|||||||
{
|
{
|
||||||
"wid": "self",
|
"wid": "self",
|
||||||
"event": "gen_promo",
|
"event": "gen_promo",
|
||||||
"actiontype": "urlwidget",
|
"actiontype": "script",
|
||||||
"target": "PopupWindow",
|
"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));})();"
|
||||||
"popup_options": {
|
|
||||||
"title": "生成促销码",
|
|
||||||
"cwidth": 16,
|
|
||||||
"cheight": 10
|
|
||||||
},
|
|
||||||
"params_mapping": {
|
|
||||||
"mapping": {
|
|
||||||
"id": "marketing_id"
|
|
||||||
},
|
|
||||||
"need_other": false
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"url": "{{entire_url('../api/gen_promo_from_mkt.dspy')}}"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"new_data_url": "{{entire_url('/discount/api/marketing_create.dspy')}}",
|
"new_data_url": "{{entire_url('/discount/api/marketing_create.dspy')}}",
|
||||||
@ -100,4 +86,4 @@
|
|||||||
"delete_data_url": "{{entire_url('/discount/api/marketing_delete.dspy')}}",
|
"delete_data_url": "{{entire_url('/discount/api/marketing_delete.dspy')}}",
|
||||||
"logined_userorgid": "resellerid"
|
"logined_userorgid": "resellerid"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user