feat(storefront): 产线产品展示型卡片——进产线入口/规划中占位,不走购买扣款

This commit is contained in:
yumoqing 2026-08-31 08:38:32 +08:00
parent ff501c13b5
commit f2e828c7b6

View File

@ -52,6 +52,20 @@
{% if p.get('is_active', true) %}
{% set disp = get_product_display_info(p.get('id')) %}
{% set pricing_text = (disp or {}).get('pricing_text', '定价暂不可用') if (disp or {}).get('success') else '定价暂不可用' %}
{% set is_pipeline = (p.get('product_type') == 'pipeline') %}
{% set extra = {} %}
{% if is_pipeline %}
{% set extra = {'tab_name': 'pipeline_card_' + str(p.get('product_code','')), 'tab_label': p.get('product_name') or '', 'url': '', 'planned': False, 'message': ''} %}
{% if (p.get('product_code') or '') == 'PIPE-OPP' %}
{% set _ = extra.update({'url': '/pipeline-opportunity/agent'}) %}
{% elif (p.get('product_code') or '') == 'PIPE-BID' %}
{% set _ = extra.update({'url': '/pipeline-bidding/agent'}) %}
{% elif (p.get('product_code') or '') == 'PIPE-DEV' %}
{% set _ = extra.update({'url': '/pipeline_core/agent'}) %}
{% else %}
{% set _ = extra.update({'planned': True, 'message': (p.get('product_name') or '') + '规划中,尚未开发'}) %}
{% endif %}
{% endif %}
{% if not ns.first %},{% endif %}
{% set ns.first = false %}
{
@ -65,6 +79,27 @@
"cursor": "pointer",
"gap": "8px"
},
{% if is_pipeline %}
"binds": [
{% if extra.planned %}
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": {{json.dumps("bricks.show_message({title:" + json.dumps(extra.tab_label, ensure_ascii=False) + ",message:" + json.dumps(extra.message, ensure_ascii=False) + "});", ensure_ascii=False)}}
}
{% else %}
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": {{json.dumps("var _tp=bricks.getWidgetById('main_content',bricks.app);if(_tp&&_tp.open_tab){_tp.open_tab({name:" + json.dumps(extra.tab_name, ensure_ascii=False) + ",label:" + json.dumps(extra.tab_label, ensure_ascii=False) + ",url:" + json.dumps(extra.url, ensure_ascii=False) + ",removable:true});}", ensure_ascii=False)}}
}
{% endif %}
],
{% else %}
"binds": [
{
"wid": "self",
@ -85,6 +120,7 @@
}
}
],
{% endif %}
"subwidgets": [
{
"widgettype": "Title4",
@ -111,6 +147,23 @@
}
]
},
{% if is_pipeline %}
{
"widgettype": "Text",
"options": {
{% if extra.planned %}
"text": "规划中",
"fontSize": "14px",
"color": "#94a3b8",
"fontWeight": "600"
{% else %}
"text": "订阅制",
"fontSize": "14px",
"color": "#e74c3c"
{% endif %}
}
},
{% else %}
{
"widgettype": "Text",
"options": {
@ -119,6 +172,7 @@
"color": "#e74c3c"
}
},
{% endif %}
{
"widgettype": "HBox",
"options": {
@ -126,7 +180,38 @@
"justifyContent": "flex-end"
},
"subwidgets": [
{% if userid %}
{% if is_pipeline %}
{% if extra.planned %}
{
"widgettype": "Text",
"options": {
"text": "敬请期待",
"fontSize": "13px",
"color": "#94a3b8"
}
}
{% else %}
{
"widgettype": "Button",
"options": {
"label": "进入产线",
"bgcolor": "#2563eb",
"color": "#fff",
"padding": "8px 24px",
"borderRadius": "6px"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": {{json.dumps("var _tp=bricks.getWidgetById('main_content',bricks.app);if(_tp&&_tp.open_tab){_tp.open_tab({name:" + json.dumps(extra.tab_name, ensure_ascii=False) + ",label:" + json.dumps(extra.tab_label, ensure_ascii=False) + ",url:" + json.dumps(extra.url, ensure_ascii=False) + ",removable:true});}", ensure_ascii=False)}}
}
]
}
{% endif %}
{% elif userid %}
{
"widgettype": "Button",
"options": {