hsiehhanyu commited on
Commit
b1fcbc4
·
verified ·
1 Parent(s): 2f95330

feat: 比價卡片新增「❤️ 加入收藏」按鈕

Browse files
Files changed (1) hide show
  1. app.py +17 -3
app.py CHANGED
@@ -155,9 +155,12 @@ def _do_photo_query(user_id, reply_token, product_name):
155
  {"type": "text", "text": safe_name, "weight": "bold", "size": "xl", "wrap": True},
156
  {"type": "box", "layout": "vertical", "spacing": "sm", "margin": "lg", "contents": specs_contents}
157
  ]},
158
- "footer": {"type": "box", "layout": "vertical", "contents": [
159
  {"type": "button", "style": "primary", "color": "#000000", "height": "md",
160
- "action": {"type": "uri", "label": "前往商家購買", "uri": safe_link}}
 
 
 
161
  ]}
162
  }
163
  bubbles.append(card)
@@ -525,6 +528,7 @@ def handle_image(event):
525
  "footer": {
526
  "type": "box",
527
  "layout": "vertical",
 
528
  "contents": [
529
  {
530
  "type": "button",
@@ -533,9 +537,19 @@ def handle_image(event):
533
  "height": "md",
534
  "action": {
535
  "type": "uri",
536
- "label": "前往商家購買",
537
  "uri": safe_link
538
  }
 
 
 
 
 
 
 
 
 
 
539
  }
540
  ]
541
  }
 
155
  {"type": "text", "text": safe_name, "weight": "bold", "size": "xl", "wrap": True},
156
  {"type": "box", "layout": "vertical", "spacing": "sm", "margin": "lg", "contents": specs_contents}
157
  ]},
158
+ "footer": {"type": "box", "layout": "vertical", "spacing": "sm", "contents": [
159
  {"type": "button", "style": "primary", "color": "#000000", "height": "md",
160
+ "action": {"type": "uri", "label": "🛍️ 前往商家購買", "uri": safe_link}},
161
+ {"type": "button", "style": "secondary", "height": "md",
162
+ "action": {"type": "message", "label": "❤️ 加入收藏",
163
+ "text": f"快速收藏:{safe_name}:${safe_price}"}}
164
  ]}
165
  }
166
  bubbles.append(card)
 
528
  "footer": {
529
  "type": "box",
530
  "layout": "vertical",
531
+ "spacing": "sm",
532
  "contents": [
533
  {
534
  "type": "button",
 
537
  "height": "md",
538
  "action": {
539
  "type": "uri",
540
+ "label": "🛍️ 前往商家購買",
541
  "uri": safe_link
542
  }
543
+ },
544
+ {
545
+ "type": "button",
546
+ "style": "secondary",
547
+ "height": "md",
548
+ "action": {
549
+ "type": "message",
550
+ "label": "❤️ 加入收藏",
551
+ "text": f"快速收藏:{safe_name}:${safe_price}"
552
+ }
553
  }
554
  ]
555
  }