87 lines
5.4 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"widgettype": "VBox",
"options": {"height": "100%", "width": "100%", "padding": "24px", "gap": "16px"},
"subwidgets": [
{
"widgettype": "Title2",
"options": {"otext": "微信通道配置", "text": "微信通道配置", "i18n": true}
},
{
"widgettype": "Text",
"options": {"otext": "系统级公众号配置(业主机构公众号,仅系统管理员)+ 用户微信绑定", "text": "系统级公众号配置(业主机构公众号,仅系统管理员)+ 用户微信绑定", "i18n": true, "cfontsize": 0.85, "color": "#94a3b8"}
},
{
"widgettype": "VBox",
"id": "admin_section",
"options": {"css": "card", "padding": "16px", "gap": "12px"},
"subwidgets": [
{
"widgettype": "Title3",
"options": {"otext": "公众号配置(系统管理员)", "text": "公众号配置(系统管理员)", "i18n": true}
},
{
"widgettype": "Form",
"id": "wechat_form",
"options": {
"name": "wechat_form",
"cols": 2,
"fields": [
{"name": "name", "uitype": "str", "label": "公众号名称", "cwidth": 12},
{"name": "appid", "uitype": "str", "label": "AppID", "cwidth": 12},
{"name": "appsecret", "uitype": "password", "label": "AppSecret", "cwidth": 12, "placeholder": "留空则不修改"},
{"name": "token", "uitype": "str", "label": "校验Token", "cwidth": 12},
{"name": "encoding_aes_key", "uitype": "str", "label": "加密Key(可选)", "cwidth": 12},
{"name": "enabled", "uitype": "code", "label": "启用", "cwidth": 12, "dataurl": "/pipeline-sdlc/api/wechat_config.dspy?action=opts_enabled", "valueField": "k", "textField": "v"}
]
}
},
{
"widgettype": "Button",
"options": {"name": "save_config", "label": "保存配置", "css": "primary"},
"binds": [
{
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
"script": "var f=bricks.getWidgetById('wechat_form',bricks.app);if(!f||!f.form_element){bricks.alert('表单未加载');return;}var d={};var els=f.form_element.querySelectorAll('[name]');els.forEach(function(e){d[e.getAttribute('name')]=e.value||'';});d.action='save';var body=Object.keys(d).map(function(k){return encodeURIComponent(k)+'='+encodeURIComponent(d[k]);}).join('&');fetch('/pipeline-sdlc/api/wechat_config.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:body}).then(function(r){return r.json()}).then(function(j){bricks.alert(j.success?'保存成功':'保存失败: '+(j.error||''));}).catch(function(e){bricks.alert('保存失败: '+e);});"
}
]
}
]
},
{
"widgettype": "VBox",
"id": "bind_section",
"options": {"css": "card", "padding": "16px", "gap": "12px"},
"subwidgets": [
{
"widgettype": "Title3",
"options": {"otext": "绑定我的微信", "text": "绑定我的微信", "i18n": true}
},
{
"widgettype": "Text",
"id": "bind_status",
"options": {"otext": "加载中...", "text": "加载中...", "i18n": true, "cfontsize": 0.9, "color": "#64748b"}
},
{
"widgettype": "Button",
"options": {"name": "gen_code_btn", "label": "生成绑定验证码", "css": "primary"},
"binds": [
{
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
"script": "fetch('/pipeline-sdlc/api/wechat_binding.dspy',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'action=gen_code'}).then(function(r){return r.json()}).then(function(j){if(!j.success){bricks.alert('生成失败: '+(j.error||''));return;}var code=j.code;var tip=bricks.getWidgetById('bind_tip',bricks.app);if(tip){tip.options.text='验证码:'+code+'10分钟有效。请关注公众号后发送绑定 '+code;}}).catch(function(e){bricks.alert('生成失败: '+e);});"
}
]
},
{
"widgettype": "Text",
"id": "bind_tip",
"options": {"text": "", "cfontsize": 0.9, "color": "#2563eb"}
},
{
"widgettype": "Text",
"options": {"otext": "绑定步骤1. 点「生成绑定验证码」拿到 6 位码 → 2. 关注公众号「能做事的AI」→ 3. 给公众号发「绑定 验证码」完成绑定", "text": "绑定步骤1. 点「生成绑定验证码」拿到 6 位码 → 2. 关注公众号「能做事的AI」→ 3. 给公众号发「绑定 验证码」完成绑定", "i18n": true, "cfontsize": 0.8, "color": "#94a3b8"}
}
]
}
]
}