fix: promote.dspy替代promote.ui绕过模板引擎500
This commit is contained in:
parent
bea89dadd5
commit
4b7e501ee0
44
wwwroot/promote.dspy
Normal file
44
wwwroot/promote.dspy
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# Customer promote page - scan QR code to claim discount
|
||||||
|
from ahserver.serverenv import ServerEnv
|
||||||
|
|
||||||
|
env = ServerEnv()
|
||||||
|
code = params_kw.get('code', '')
|
||||||
|
|
||||||
|
result = {
|
||||||
|
"widgettype": "Form",
|
||||||
|
"options": {
|
||||||
|
"width": "100%",
|
||||||
|
"height": "100%",
|
||||||
|
"url": "/discount/generate_qr.dspy?code=" + code,
|
||||||
|
"method": "POST",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "valid_term",
|
||||||
|
"label": "有效期",
|
||||||
|
"uitype": "str",
|
||||||
|
"tip": "格式:xY, xM, xD, x是1到多位数字,Y(年),M(月),D(日)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "expired_date",
|
||||||
|
"label": "促销失效日期",
|
||||||
|
"uitype": "date",
|
||||||
|
"tip": "促销二维码需在此日期前使用"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "discount",
|
||||||
|
"label": "折扣",
|
||||||
|
"uitype": "float",
|
||||||
|
"tip": "折扣>0, <1, 最终价格=产品价格*折扣"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"binds": [
|
||||||
|
{
|
||||||
|
"wid": "self",
|
||||||
|
"event": "submited",
|
||||||
|
"actiontype": "script",
|
||||||
|
"target": "self",
|
||||||
|
"script": "await bricks.show_resp_message_or_error(event.params)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1,37 +0,0 @@
|
|||||||
{# promote page for customer scan #}
|
|
||||||
{
|
|
||||||
"widgettype": "Form",
|
|
||||||
"options": {
|
|
||||||
"width": "100%",
|
|
||||||
"height": "100%",
|
|
||||||
"url": "/discount/generate_qr.dspy",
|
|
||||||
"method": "POST",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "valid_term",
|
|
||||||
"label": "有效期",
|
|
||||||
"uitype": "str",
|
|
||||||
"tip":"格式:xY, xM, xD,x是1到多位数字,Y(年),M(月),D(日)"
|
|
||||||
},{
|
|
||||||
"name": "expired_date",
|
|
||||||
"label": "促销失效日期",
|
|
||||||
"uitype": "date",
|
|
||||||
"tip": "促销二维码需在此日期前使用"
|
|
||||||
},{
|
|
||||||
"name": "discount",
|
|
||||||
"label": "折扣",
|
|
||||||
"uitype": "float",
|
|
||||||
"tip": "折扣>0, < 1, 最终价格=产品价格*折扣, 折扣越小,折扣力度越大"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"binds":[
|
|
||||||
{
|
|
||||||
"wid": "self",
|
|
||||||
"event": "submited",
|
|
||||||
"actiontype": "script",
|
|
||||||
"target": "self",
|
|
||||||
"script": "await bricks.show_resp_message_or_error(event.params)"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user