feat(unipay): transfer popup displays bank_name and bank_branch from env vars

- init.py: add BANK_NAME/BANK_BRANCH to CONF_ENV['transfer']
- transfer.py: TransferGateway accepts and forwards bank_name/bank_branch
- transfer_info.ui: conditionally display 收款银行/开户行 rows
This commit is contained in:
yumoqing 2026-07-16 12:06:01 +08:00
parent a0bd6fb24f
commit e64bfe81ea
3 changed files with 28 additions and 2 deletions

View File

@ -18,7 +18,9 @@ CONF_ENV = {
"email": "MAIL",
"password": "PASSWORD",
"from_mail": "FROM_MAIL",
"account_no": "ACCOUNT_NO"
"account_no": "ACCOUNT_NO",
"bank_name": "BANK_NAME",
"bank_branch": "BANK_BRANCH"
},
"wechat": {
"mchid": "WXP_MCHID",

View File

@ -65,12 +65,14 @@ class EmailClient:
return content
class TransferGateway(Gateway):
def __init__(self, from_mail="", pop3server="", email="", password="", account_no=""):
def __init__(self, from_mail="", pop3server="", email="", password="", account_no="", bank_name="", bank_branch=""):
self.from_mail = from_mail
self.pop3server = pop3server
self.email = email
self.password = password
self.account_no = account_no
self.bank_name = bank_name
self.bank_branch = bank_branch
self.running = False
async def new_tcode(self, sor):
@ -97,6 +99,8 @@ class TransferGateway(Gateway):
}
ns = DictObject(**ns)
ns.account_no = self.account_no
ns.bank_name = self.bank_name
ns.bank_branch = self.bank_branch
env = payload.request._run_ns
db = DBPools()
dbname = env.get_module_dbname('unipay')

View File

@ -27,6 +27,26 @@
"width": "100%"
},
"subwidgets": [
{% if params_kw.bank_name %}
{
"widgettype": "HBox",
"options": {},
"subwidgets": [
{"widgettype": "Text", "options": {"text": "收款银行", "cwidth": 8}},
{"widgettype": "Text", "options": {"text": {{json.dumps(params_kw.bank_name)}}, "cwidth": 16, "cfontsize": 1.1}}
]
},
{% endif %}
{% if params_kw.bank_branch %}
{
"widgettype": "HBox",
"options": {},
"subwidgets": [
{"widgettype": "Text", "options": {"text": "开户行", "cwidth": 8}},
{"widgettype": "Text", "options": {"text": {{json.dumps(params_kw.bank_branch)}}, "cwidth": 16, "cfontsize": 1.1}}
]
},
{% endif %}
{
"widgettype": "HBox",
"options": {},