yukyo0821 2 years ago
parent
commit
6fa3a7d329

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+__pycache__

+ 27 - 0
SA_Logistics/diagrams/0.通路代碼.puml

@@ -0,0 +1,27 @@
+@startuml
+
+start
+:選擇通路;
+switch ()
+case()
+    :宅配;
+    :宅配通
+    黑猫宅急便
+    全速配
+    新竹貨運
+    便利帶
+    順豐速運;
+case()
+    :店配;
+    :全家
+    統一數網;
+case()
+    :自送;
+case()
+    :店到店;
+endswitch
+
+:通路代碼;
+stop
+
+@enduml

+ 18 - 0
SA_Logistics/diagrams/1.資料匯入.puml

@@ -0,0 +1,18 @@
+@startuml
+
+start
+:匯入資料;
+:選擇通路代碼
+選擇 Excel 檔;
+
+if (匯入訂單 upload_orders() 成功) then (yes)
+    :匯入訂單;
+else (no)
+    :匯入失敗;
+    stop
+endif
+:出貨明細查詢
+query_shipping_details();
+stop
+
+@enduml

+ 56 - 0
SA_Logistics/diagrams/2.點貨作業.puml

@@ -0,0 +1,56 @@
+@startuml
+
+start
+switch (點貨作業)
+case()
+    :列印出貨面單;
+    :選擇通路代碼;
+    :列印
+    shipment_out();
+case()
+    :袋進倉
+    bag_in();
+case()
+    :進站;
+    :選擇通路代碼;
+    :wh_in();
+case()
+    :出站;
+    :選擇通路代碼;
+    :指定下一站;
+    :wh_out();
+case()
+    :配送;
+    :deliver_out();
+case()
+    :簽收;
+    :選擇通路代碼;
+    :簽收類別(成功/異常)
+    簽收人(本人/代收/警衛);
+    :sign();
+case()
+    :二次出貨;
+    :選擇通路代碼;
+    :whout_again();
+case()
+    :退貨;
+    :選擇通路代碼;
+    :選擇倉別/儲區;
+    :s_return();
+case()
+    :重印面單
+    reprint();
+case()
+    :面單批次列印;
+    :查詢條件;
+    :batch_print();
+case()
+    :刷退條碼;
+    :選擇通路代碼;
+    :print_return();
+
+endswitch
+stop
+
+
+@enduml

+ 38 - 0
SA_Logistics/diagrams/3.倉管.puml

@@ -0,0 +1,38 @@
+@startuml
+
+start
+switch (倉管)
+case()
+    :入庫;
+    :選擇通路代碼;
+    :選擇倉別/儲區;
+    :stock_in();
+case()
+    :上架;
+    :選擇通路代碼;
+    :選擇倉別/儲區;
+    :shelf();
+case()
+    :出庫;
+    :選擇倉庫;
+    :stock_out();
+case()
+    :移動儲位;
+    :選擇倉庫;
+    :選擇來源儲區;
+    :選擇目的儲區;
+    :stock_move();
+case()
+    :下架;
+    :選擇下架方式(標示/掃描/批次);
+    :選擇倉庫;
+    :outstock();
+case()
+    :出庫檢核;
+    :匯入/匯出/清空;
+    :stock_check();
+endswitch
+stop
+
+
+@enduml

+ 245 - 0
SA_Logistics/diagrams/datamodel.puml

@@ -0,0 +1,245 @@
+@startuml
+
+class 營業所 {
+  {field} 主營業站所代碼
+  {field} 營業所代碼
+  {field} 營業所名稱
+  {field} 角色
+  {field} 公司統編 
+  {field} 公司名稱
+  {field} 公司英文名稱
+  {method} 下架(營業站)
+}
+note left of 營業所: 例:長慶,安達物流,森鴻物流
+
+
+class 門市 {
+  {field} 通路代碼
+  {field} 門市店號
+  {field} 門市名稱
+  {field} 門市地址
+  {field} 門市電話
+  {field} 路線
+  {field} 路順
+  {field} 二配路線
+  {field} 二配路順
+  {field} 配送頻率
+  {field} 配送週期
+}
+門市 -- 通路商
+
+class 配送區 {
+  {field} 縣市
+  {field} 鄉鎮市區
+  {field} 營業所
+  {field} 營業所名稱
+}
+營業所 -- 配送區
+
+class 貨態 {
+  {field} 貨態代碼
+  {field} 貨態說明
+  {field} 是否啟用
+}
+
+
+class 通路商 {
+  {field} 運單號碼
+}
+note top of 通路商: 例:全家,統一數碼,黑貓宅急便
+
+
+
+class 運單 {
+  {field} 運單號碼
+}
+
+class 配送單 {
+  {field} 配送單號
+}
+配送單 -- 運單
+配送單 -- 營業所
+
+
+class 倉儲基本資料 {
+  {field} 倉別
+  {field} 儲區
+  {field} 儲區內容物
+}
+
+
+class 儲區 {
+  {field} 倉庫代碼
+  {field} 儲區代碼
+  {field} 儲區名稱
+  {method} 移儲位(來源儲區,目的儲區)
+}
+倉儲基本資料 -- 儲區
+
+class 儲區內容物 {
+  {field} 儲區
+  {field} 通路代碼
+  {field} 原單營業所
+  {field} 運單號
+}
+儲區 -- 儲區內容物
+
+
+class 庫存 {
+  {field} 儲位
+  {field} 營業站
+  {field} 通路商
+  {field} 原提單號
+  {field} 配送單號
+  {field} 退件單號
+  {field} 貨物內容
+  {field} 入庫時間
+  {method} 入庫(test)
+  {method} 出庫(test)
+}
+庫存 -- 通路商
+庫存 -- 儲區
+
+class 揀貨單 {
+  {field} 儲位
+  {field} 通路商
+  {field} 原提單號
+  {field} 配送單號
+  {field} 收貨人
+  {field} 貨物內容
+  {field} 金額
+}
+揀貨單 -- 儲區
+揀貨單 -- 通路商
+
+class 進出倉紀錄 {
+  {field} 倉別
+  {field} 儲位
+  {field} 進出倉
+  {field} 通路商
+  {field} 營業站
+  {field} 運單號碼
+  {field} 配送單號
+  {field} 退件單號
+  {field} 進出倉時間
+}
+進出倉紀錄 -- 運單
+進出倉紀錄 -- 通路商
+進出倉紀錄 -- 營業所
+進出倉紀錄 -- 貨態
+進出倉紀錄 -- 使用者代碼
+
+
+class 袋{
+  {field} 外袋條碼
+}
+袋 -- 通路商
+袋 -- 配送單
+
+class 出貨面單{
+  {field} 配送類別
+  {field} 通路代碼
+  {field} 運單號碼
+  {field} 收貨人
+  {field} 收貨人電話
+  {field} 收貨人地址
+  {field} 發貨人
+  {field} 發貨人電話
+  {field} 發貨人地址
+  {field} 品名
+  {field} 貨件重量
+}
+出貨面單 -- 通路商
+出貨面單 -- 配送單
+出貨面單 -- 運單
+
+
+class 代碼表 {
+  {field} 代碼表類別
+  {field} 代碼
+  {field} 參考號
+  {field} 啟用
+}
+
+class 語系代碼表 {
+  {field} 語系
+  {field} 代碼表類別
+  {field} 代碼
+  {field} 代碼說明
+}
+
+class FTP設定 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+
+
+
+class 黑貓宅急便 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+FTP設定 -- 黑貓宅急便
+
+class 新竹貨運 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+FTP設定 -- 新竹貨運
+
+class 統一數網 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+FTP設定 -- 統一數網
+
+class 全家 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+FTP設定 -- 全家
+
+class 便利帶 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+FTP設定 -- 便利帶
+
+class 自配 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+FTP設定 -- 自配
+
+class 宅配通 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+FTP設定 -- 宅配通
+
+
+class 順豐速運 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+FTP設定 -- 順豐速運
+
+class 全速配 {
+  {field} FTP_IP
+  {field} PASSIVE
+}
+FTP設定 -- 全速配
+
+class 二段標ECST設定 {
+}
+
+class 退貨退款設定 {
+}
+
+class 使用者代碼 {
+}
+
+class 異常說明 {
+}
+
+@enduml

+ 57 - 0
SA_Logistics/diagrams/functions.puml

@@ -0,0 +1,57 @@
+@startmindmap
++ 流程
+++ 袋進倉
++++ 手動輸入
+++++_ 條碼掃描
+++++_ 已掃描件數統計
++++ 已到袋數查詢
+++++_ 日期查詢
++++[#orange] 訂單袋號更新
+++++_ 通路商
+++++_ 營業站
+++ 進站
++++ 配送類別
+++++_ 宅配
+++++_ 店配
+++++_ 自送
+++++_ 店到店
++++ 配通路代碼
+++++_ 宅配通
+++++_ 黑貓宅急便
+++++_ 全速配
+++++_ 新竹貨運
+++++_ 便利帶
+++++_ 順豐速運
++++ 已掃描件數
+++++_ 運單號碼
+++++_ 配送營業站
++++ 手動輸入
++++ 其他說明
+++ 出站
++++ 配送類別
+++++_ 宅配
+++++_ 店配
+++++_ 自送
+++++_ 店到店
++++ 通路代碼
+++++_ 全家
+++++_ 統一數網
++++ 下一站
+++++_ 長慶
+++++_ 安達物流
+++++_ 安達一展
++++ 手動輸入
++++ 已掃描件數
+++ 配送
++++ 配送類別
+++++_ 宅配
+++++_ 店配
+++++_ 自送
+++++_ 店到店
++++ 通路代碼
+++++_ 全家
+++++_ 統一數網
++++ 已掃描件數
+++ 配送
+
+@endmindmap

+ 2 - 0
SA_Logistics/docs/SA.md

@@ -0,0 +1,2 @@
+# 系統設計
+

File diff suppressed because it is too large
+ 1 - 0
SA_Logistics/src/imgs/datamodel.svg


+ 425 - 0
SA_Logistics/src/main.py

@@ -0,0 +1,425 @@
+import time
+from fastapi import FastAPI
+import sys
+import os
+import datetime
+import ast
+from fastapi.responses import JSONResponse, FileResponse
+from fastapi.middleware.cors import CORSMiddleware
+from pydantic import BaseModel
+import uvicorn
+from fastapi.staticfiles import StaticFiles
+
+app = FastAPI(description="長慶運通系統設計")
+app.mount("/imgs", StaticFiles(directory="imgs"), name="imgs")
+origins = [
+    "http://www.googo.org",
+    "http://www.googo.org:8080",
+    "http://0.0.0.0:8080",
+    "http://googo.org:8080",
+    "http://googo.org",
+    "http://139.162.121.30"
+]
+#uvicorn main:app --host 0.0.0.0 --port 8001
+app.add_middleware(
+    CORSMiddleware,
+    allow_origins=origins,
+    allow_credentials=True,
+    allow_methods=["*"],
+    allow_headers=["*"],
+)
+
+class q_req(BaseModel):
+    domain_name: str
+
+class kw_req(BaseModel):
+    fullurl: str
+    shorturl: str
+
+class upload_orders_item(BaseModel):
+    objtype: str
+    channel_id: str
+    customer_contract_id: str
+    shipment_type:str
+    ship_date:str
+
+
+class shipping_details(BaseModel):
+    filed_date: str
+    channel_id: str
+    customer_contract_id: str
+    shipment_type:str
+    ship_date:str
+    
+@app.post("/op_doc/upload_orders",
+summary="訂單明細上傳",
+description=
+    """
+        訂單明細上傳:
+
+        - objtype: 配送類別
+        - channel_id: 通路代碼
+        - customer_contract_id: 客契代碼
+        - shipment_type: 運單種類
+        - ship_date: 出貨日期
+    """
+)
+async def upload_orders(req:upload_orders_item):
+    return "OK"
+
+
+
+@app.post("/op_doc/query_shipping_details",
+response_model=shipping_details,
+summary="出貨明細查詢",
+description=
+    """
+        回傳:
+
+        - objtype: 建檔日期
+        - channel_id: 入單營業所
+        - customer_contract_id: 收單營業所
+        - shipment_type: 配送類別
+        - ship_date: 通路商
+        - ship_date: 運單種類
+        - ship_date: 二配
+        - ship_date: 建檔人
+        - ship_date: 檔案名稱
+        - ship_date: 上傳時間
+        - ship_date: 傳送帳號
+    """
+)
+async def query_shipping_details():
+    return None
+
+
+
+@app.post("/stock_taking/shipment_out",
+response_model=shipping_details,
+summary="出貨面單",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - channel_id: 通路代碼
+        - customer_contract_id: 運單號碼
+        - shipment_type: 收貨人
+        - ship_date: 收貨人電話
+        - ship_date: 收貨人地址
+        - ship_date: 發貨人
+        - ship_date: 發貨人電話
+        - ship_date: 發貨人地址
+        - ship_date: 品名
+        - ship_date: 貨件重量
+    """
+)
+async def shipment_out():
+    return None
+
+
+
+@app.post("/stock_taking/bag_in",
+response_model=shipping_details,
+summary="袋進倉",
+description=
+    """
+        回傳:
+
+        - objtype: 外袋條碼
+    """
+)
+async def bag_in():
+    return None
+
+
+@app.post("/stock_taking/wh_in",
+response_model=shipping_details,
+summary="進站",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - objtype: 通路代碼
+        - objtype: 配送單號
+        - objtype: 運單號碼
+        - objtype: 配送營業站
+    """
+)
+async def wh_in():
+    return None
+
+
+
+@app.post("/stock_taking/wh_out",
+response_model=shipping_details,
+summary="出站",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - objtype: 通路代碼
+        - nextstop: 下一站
+        - objtype: 配送單號
+        - objtype: 運單號碼
+        - objtype: 配送營業站
+    """
+)
+async def wh_out():
+    return None
+
+@app.post("/stock_taking/deliver_out",
+response_model=shipping_details,
+summary="配送",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - objtype: 通路代碼
+        - objtype: 配送單號
+        - objtype: 運單號碼
+        - objtype: 配送營業站
+    """
+)
+async def deliver_out():
+    return None
+
+
+@app.post("/stock_taking/sign",
+response_model=shipping_details,
+summary="簽收",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - objtype: 簽收類別
+        - objtype: 簽收人
+        - objtype: 運單號碼
+    """
+)
+async def sign():
+    return None
+
+
+@app.post("/stock_taking/whout_again",
+response_model=shipping_details,
+summary="二次出貨",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - channel_id: 通路代碼
+        - customer_contract_id: 運單號碼
+        - shipment_type: 收貨人
+        - ship_date: 收貨人電話
+        - ship_date: 收貨人地址
+        - ship_date: 發貨人
+        - ship_date: 發貨人電話
+        - ship_date: 發貨人地址
+        - ship_date: 品名
+        - ship_date: 貨件重量
+    """
+)
+async def whout_again():
+    return None
+
+
+@app.post("/stock_taking/s_return",
+response_model=shipping_details,
+summary="退貨",
+description=
+    """
+        回傳:
+
+        - objtype: 營業所
+        - objtype: 配送類別
+        - channel_id: 通路代碼
+        - customer_contract_id: 倉別
+        - shipment_type: 儲區
+        - ship_date: 運單號碼
+        - ship_date: 其他說明
+    """
+)
+async def s_return():
+    return None
+
+
+@app.post("/stock_taking/reprint",
+response_model=shipping_details,
+summary="重印面單",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - channel_id: 通路代碼
+        - customer_contract_id: 運單號碼
+        - shipment_type: 收貨人
+        - ship_date: 收貨人電話
+        - ship_date: 收貨人地址
+        - ship_date: 發貨人
+        - ship_date: 發貨人電話
+        - ship_date: 發貨人地址
+        - ship_date: 品名
+        - ship_date: 貨件重量
+    """
+)
+async def reprint():
+    return None
+
+
+
+@app.post("/stock_taking/batch_print",
+response_model=shipping_details,
+summary="面單批次列印",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - channel_id: 通路代碼
+        - customer_contract_id: 運單號碼
+        - shipment_type: 收貨人
+        - ship_date: 收貨人電話
+        - ship_date: 收貨人地址
+        - ship_date: 發貨人
+        - ship_date: 發貨人電話
+        - ship_date: 發貨人地址
+        - ship_date: 已列印次數
+    """
+)
+async def batch_print():
+    return None
+
+
+@app.post("/stock_taking/print_return",
+response_model=shipping_details,
+summary="刷退條碼",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - channel_id: 通路代碼
+        - customer_contract_id: 運單號碼
+        - shipment_type: 收貨人
+        - ship_date: 收貨人電話
+        - ship_date: 收貨人地址
+        - ship_date: 發貨人
+        - ship_date: 發貨人電話
+        - ship_date: 發貨人地址
+        - ship_date: 已列印次數
+    """
+)
+async def print_return():
+    return None
+
+
+@app.post("/ELPC/stock_in",
+response_model=shipping_details,
+summary="入庫",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - channel_id: 通路代碼
+        - customer_contract_id: 倉庫
+        - shipment_type: 儲區
+        - ship_date: 配送號碼
+    """
+)
+async def stock_in():
+    return None
+
+
+@app.post("/ELPC/shelf",
+response_model=shipping_details,
+summary="上架",
+description=
+    """
+        回傳:
+
+        - objtype: 配送類別
+        - channel_id: 通路代碼
+        - customer_contract_id: 倉庫
+        - shipment_type: 儲區
+        - ship_date: 配送號碼
+    """
+)
+async def shelf():
+    return None
+
+
+@app.post("/ELPC/stock_out",
+response_model=shipping_details,
+summary="出庫",
+description=
+    """
+        回傳:
+
+        - customer_contract_id: 倉庫
+        - ship_date: 配送號碼
+    """
+)
+async def stock_out():
+    return None
+
+
+
+@app.post("/ELPC/stock_move",
+response_model=shipping_details,
+summary="移動儲位",
+description=
+    """
+        回傳:
+
+        - customer_contract_id: 倉庫
+        - ship_date: 來源儲區
+        - ship_date: 目的儲區
+
+    """
+)
+async def stock_move():
+    return None
+
+@app.post("/ELPC/outstock",
+response_model=shipping_details,
+summary="下架",
+description=
+    """
+        回傳:
+
+        - customer_contract_id: 下架營業站
+        - ship_date: 通路商
+        - ship_date: 倉別
+
+    """
+)
+async def outstock():
+    return None
+
+
+@app.post("/ELPC/stock_check",
+response_model=shipping_details,
+summary="出庫檢核",
+description=
+    """
+        回傳:
+
+        - customer_contract_id: 出庫檢核
+
+    """
+)
+async def outstock():
+    return None
+
+
+if __name__ == "__main__":
+    uvicorn.run("main:app", host="0.0.0.0", port=9898)
+

+ 3 - 0
aws_ses/requirements.txt

@@ -0,0 +1,3 @@
+boto3==1.21.22
+botocore==1.24.22
+dataset==1.5.2

+ 144 - 0
aws_ses/sesmail.py

@@ -0,0 +1,144 @@
+
+import boto3
+from botocore.exceptions import ClientError
+import dataset
+
+db = dataset.connect(
+    'mysql://hhh7796hhh:lYmWsu^ujcA1@hhh-v57.cmab1ctkglka.ap-northeast-2.rds.amazonaws.com:3306/xoops?charset=utf8mb4')
+
+def GetList():
+    
+    #本週/粉絲/編輯推薦
+    records = db.query("""SELECT hs.start_time,hs.end_time, ifnull(ca.hdesigner_id,co.hdesigner_ids) hid, ca.hdesigner_id,co.hdesigner_ids, oss.title sec
+,dd.title, dd.name, dd.mail, ifnull(ca.cover,co.clogo) img
+FROM homepage_set hs
+LEFT JOIN outer_site_set oss ON oss.oss_id = hs.outer_set
+left join _hcase ca ON ca.hcase_id = hs.mapping_id AND hs.theme_type='case'
+LEFT JOIN _hcolumn co ON hs.mapping_id = co.hcolumn_id AND hs.theme_type='column'
+LEFT JOIN _hdesigner dd ON dd.hdesigner_id = ifnull(ca.hdesigner_id,co.hdesigner_ids)
+WHERE hs.theme_type IN ('case','column')
+and start_time BETWEEN DATE_ADD(CURDATE(), INTERVAL-1 DAY) AND DATE_ADD(NOW(), INTERVAL-1 DAY)
+ORDER BY hs.ps_id
+""")
+    mList = []
+    for row in records:
+        if str(row['hid']) != "":
+            sMail = row['mail']
+            sName = row['name']
+            sCom = row['title']
+            sSec = row['sec']
+            sImg = row['img']
+            sDuration = row['start_time'].strftime("%Y/%m/%d") + '-' + row['end_time'].strftime("%Y/%m/%d")
+            mList.append([sMail,sCom,sName,sDuration,sSec,sImg])
+            
+    #首八大
+    records = db.query("""SELECT hh.start_time,hh.end_time, hh.hdesigner_id hid, '首頁大' sec
+,dd.title, dd.name, dd.mail, adlogo img 
+FROM _had hh
+LEFT JOIN _hdesigner dd ON dd.hdesigner_id = hh.hdesigner_id
+WHERE adtype LIKE '首八大%'
+AND hh.onoff='1' AND dd.onoff = '1'
+and start_time BETWEEN DATE_ADD(CURDATE(), INTERVAL-1 DAY) AND DATE_ADD(NOW(), INTERVAL-1 DAY)
+-- AND(NOW() BETWEEN start_time AND end_time OR(start_time='0000-00-00 00:00:00' and end_time='0000-00-00 00:00:00') or (start_time is null and end_time is NULL))
+ORDER BY cast(SUBSTR(adtype,4) AS DECIMAL)
+""")
+
+    for row in records:
+        if str(row['hid']) != "":
+            sMail = row['mail']
+            sName = row['name']
+            sCom = row['title']
+            sSec = row['sec']
+            sImg = row['img']
+            sDuration = row['start_time'].strftime("%Y/%m/%d") + '-' + row['end_time'].strftime("%Y/%m/%d")
+            mList.append([sMail,sCom,sName,sDuration,sSec,sImg])
+
+    return mList
+    #print(sMail,sCom,sName,sDuration,sSec)
+
+def SendMail(iRecipient:str, iCompany:str, iName:str, iDuration:str, iSection:str, iImg:str):
+    # Replace sender@example.com with your "From" address.
+    # This address must be verified with Amazon SES.
+    SENDER = "Gorgeous Space - Mailer <noreply@hhh.com.tw>"
+
+    # Replace recipient@example.com with a "To" address. If your account 
+    # is still in the sandbox, this address must be verified.
+    #RECIPIENT = iRecipient
+    RECIPIENTS = iRecipient.split(',')
+    CCS = ["yukyo@choozmo.com","mollie@hhh.com.tw","hhh_backup@hhh.com.tw"]
+    BCCS = []
+
+    # Specify a configuration set. If you do not want to use a configuration
+    # set, comment the following variable, and the 
+    # ConfigurationSetName=CONFIGURATION_SET argument below.
+    #CONFIGURATION_SET = "ConfigSet"
+
+    # If necessary, replace us-west-2 with the AWS Region you're using for Amazon SES.
+    AWS_REGION = "us-east-1"
+
+    # The subject line for the email.
+    SUBJECT = "【幸福空間】BANNER露出:" + iCompany
+
+    # The email body for recipients with non-HTML email clients.
+    BODY_TEXT = ("\r\n" + iName + " 設計師 , 您好:\r\n\r\n您的幸福空間BANNER已露出!\r\n露出期間:"+ iDuration + "\r\n露出位置:"+ iSection+"Banner\r\n\r\n"+ iImg+"\r\n\r\n幸福空間 www.hhh.com.tw")
+                
+    # The HTML body of the email.
+    BODY_HTML = """<html>
+    <head></head>
+    <body>
+    <p>""" + iName + " 設計師 , 您好:<br /><br />您的幸福空間BANNER已露出!<br />露出期間:"+ iDuration + "<br />露出位置:"+ iSection+" Banner<br /><br /><img style='width:40%' src='" + iImg + """' /><br /><br />幸福空間 <a href='http://www.hhh.com.tw'>www.hhh.com.tw</a></p>
+    </body>
+    </html>"""            
+
+    # The character encoding for the email.
+    CHARSET = "UTF-8"
+
+    # Create a new SES resource and specify a region.
+    client = boto3.client('ses'
+            ,aws_access_key_id='AKIAQG3PJZCHXPCSTAJG'
+            ,aws_secret_access_key='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'
+            ,region_name=AWS_REGION)
+
+    # Try to send the email.
+    try:
+        #Provide the contents of the email.
+        response = client.send_email(
+            Destination={
+                'ToAddresses': RECIPIENTS,
+                'CcAddresses': CCS,
+                'BccAddresses': BCCS
+            },
+            Message={
+                'Body': {
+                    'Html': {
+                        'Charset': CHARSET,
+                        'Data': BODY_HTML,
+                    },
+                    'Text': {
+                        'Charset': CHARSET,
+                        'Data': BODY_TEXT,
+                    },
+                },
+                'Subject': {
+                    'Charset': CHARSET,
+                    'Data': SUBJECT,
+                },
+            },
+            Source=SENDER,
+            # If you are not using a configuration set, comment or delete the
+            # following line
+            #ConfigurationSetName=CONFIGURATION_SET,
+        )
+    # Display an error if something goes wrong.	
+    except ClientError as e:
+        print(e.response['Error']['Message'])
+    else:
+        print("Email sent! Message ID:"),
+        print(response['MessageId'])
+
+
+for item in GetList():
+    #print(item)
+    SendMail(item[0],item[1],item[2],item[3],item[4],item[5])
+
+

BIN
genjson/__pycache__/genjson.cpython-39.pyc


+ 813 - 0
genjson/gen_json_alone.py

@@ -0,0 +1,813 @@
+import itertools
+import os
+from typing import Optional
+from dataset.util import ResultIter
+from datetime import tzinfo
+import datetime
+# import mysql.connector
+# from mysql.connector import Error
+import dataset
+import json
+from pytube import extract
+
+
+hhhMBPath = '../hhh-home-mb'
+hhhPCPath = '../hhh-home-pc'
+
+connstr = 'mysql://hhh7796hhh:lYmWsu^ujcA1@hhh-v57.cmab1ctkglka.ap-northeast-2.rds.amazonaws.com:3306/xoops?charset=utf8mb4'
+
+#        charset='utf8',
+#        collation='utf8_unicode_ci'
+
+# @app.get("/genjson")
+
+
+def genjson(filename: str = "realtime.json"):
+
+    with dataset.connect(connstr) as db:
+        jData = json.load(open(hhhMBPath+'/json/data.json', encoding='utf8'))
+
+        records = db.query("SELECT * FROM _had where (now() between start_time and end_time or ( start_time is null and end_time is null) or ( start_time = '0000-00-00 00:00:00' and end_time = '0000-00-00 00:00:00')) and onoff='1' and adtype like '首八大%' ")
+
+        for x in jData:
+
+            # 頂部輪播區-新刊頭
+            if x['id'] == 0:
+                records = db.query("""SELECT adlogo lo,adlogo_mobile mlo, adhref lk, adlogo_mobile_webp lomwebp, adlogo_webp dwebp FROM _had
+                            WHERE adtype LIKE '新刊頭%'
+                            AND onoff='1'
+                            AND(NOW() BETWEEN start_time AND end_time OR(start_time='0000-00-00 00:00:00' and end_time='0000-00-00 00:00:00') or (start_time is null and end_time is NULL))
+                            ORDER BY cast(SUBSTR(adtype,4) AS DECIMAL)""")
+
+                x["data"] = []
+                for c in records:
+                    a = {'imgUrl': c['mlo'], 'link': str(
+                        c['lk']), 'DimgUrl': c['lo'], 'webp': str(c['lomwebp']), 'Dwebp': str(c['dwebp'])}
+                    x["data"].append(a)
+                # print(x["data"])
+
+            # 主要輪播區-首八大
+            if x['id'] == 1:
+                records = db.query("""SELECT adlogo lo,adlogo_mobile mlo, adhref lk, adlogo_mobile_webp lomwebp, adlogo_webp dwebp FROM _had
+                            WHERE adtype LIKE '首八大%'
+                            AND onoff='1'
+                            AND(NOW() BETWEEN start_time AND end_time OR(start_time='0000-00-00 00:00:00' and end_time='0000-00-00 00:00:00') or (start_time is null and end_time is NULL))
+                            ORDER BY cast(SUBSTR(adtype,4) AS DECIMAL)""")
+
+                x["data"] = []
+                for c in records:
+                    a = {'imgUrl': c['mlo'], 'link': str(
+                        c['lk']), 'DimgUrl': c['lo'], 'webp': str(c['lomwebp']), 'Dwebp': str(c['dwebp'])}
+                    x["data"].append(a)
+                # print(x["data"])
+
+            # tab區塊-最夯設計, 影音實錄, 專欄文章
+            if x['id'] == 2:
+                x["data"] = []
+                records = db.query("""SELECT caption TT ,cover IMG, CONCAT('https://hhh.com.tw/cases/detail/',hcase_id,'/') LK, short_desc txt
+                                from _hcase
+                                left join _hdesigner ON _hcase.hdesigner_id=_hdesigner.hdesigner_id
+                                WHERE
+                                _hcase.onoff='1' AND _hdesigner.onoff='1'
+                                AND(NOW() > sdate)
+                                ORDER BY hcase_id DESC
+                                LIMIT 3""")
+                a = {'tab': '最夯設計', 'data': []}
+                for c in records:
+                    ad = {'imgUrl': c['IMG'], 'link': c['LK'],
+                        'title': c['TT'], 'description': c['txt']}
+                    a['data'].append(ad)
+                x["data"].append(a)
+
+                records = db.query("""SELECT title TT,iframe IMG , CONCAT('https://hhh.com.tw/video-post.php?id=',hvideo_id) LK , name
+                                from _hvideo
+                                where display_datetime < now()
+                                ORDER BY hvideo_id DESC
+                                LIMIT 4""")
+                a = {'tab': '影音實錄', 'data': []}
+                cnt = 0
+                for c in records:
+                    if cnt == 0:
+                        cnt += 1
+                        continue
+                    tid = extract.video_id(c['IMG'])
+                    timg = "https://img.youtube.com/vi/" + tid+"/hqdefault.jpg"
+                    ad = {'imgUrl': timg, 'link': c['LK'],
+                        'title': c['name'], 'description': c['TT']}
+                    a['data'].append(ad)
+                x["data"].append(a)
+
+                records = db.query("""SELECT ctitle TT,clogo IMG, CONCAT('https://hhh.com.tw/columns/detail/',hcolumn_id,'/') LK, cdesc
+                                from _hcolumn
+                                WHERE onoff='1'
+                                AND NOW() > sdate
+                                ORDER BY hcolumn_id DESC
+                                LIMIT 3""")
+                a = {'tab': '專欄文章', 'data': []}
+                for c in records:
+                    ad = {'imgUrl': c['IMG'], 'link': c['LK'],
+                        'title': c['TT'], 'description': c['cdesc']}
+                    a['data'].append(ad)
+                x["data"].append(a)
+                # print(x["data"])
+
+            # 主題企劃區
+            if x['id'] == 3:
+                records = db.query("""SELECT logo lo, CONCAT('https://hhh.com.tw/topic/detail/',htopic_id,'/') lk, `desc`, title FROM _htopic
+    WHERE onoff = '1'
+    ORDER BY htopic_id DESC limit 3""")
+
+                x["data"] = []
+                for c in records:
+                    a = {'imgUrl': c['lo'], 'link': str(
+                        c['lk']), 'video': 'false', 'description': c['desc'], 'title': c['title']}
+                    x["data"].append(a)
+                # print(x["data"])
+
+            # 編輯精選
+            if x['id'] == 4:
+                records = db.query("""SELECT hcolumn_id, ctitle, clogo,cdesc
+                                    FROM homepage_set
+                                    LEFT JOIN _hcolumn ON mapping_id = hcolumn_id
+                                    WHERE outer_set=8
+                                    AND homepage_set.onoff='Y'
+                                    AND(NOW() BETWEEN homepage_set.start_time AND homepage_set.end_time OR(homepage_set.start_time='0000-00-00 00:00:00' and homepage_set.end_time='0000-00-00 00:00:00') or (homepage_set.start_time is null and homepage_set.end_time is NULL))
+                                    ORDER BY inner_sort""")
+
+                x["data"] = []
+                for c in records:
+                    a = {'imgUrl': c['clogo'], 'link': "https://hhh.com.tw/columns/detail/" + str(
+                        c['hcolumn_id']) + "/", 'title': c['ctitle'], 'video': 'false', 'description': c['cdesc']}
+                    x["data"].append(a)
+                # print(x["data"])
+
+            # 首列表廣告
+            if x['id'] == 5:
+                records = db.query("""SELECT adlogo lo,adlogo_mobile mlo, adhref lk, adlogo_mobile_webp lomwebp, adlogo_webp dwebp FROM _had
+                            WHERE adtype LIKE '首列表廣告%'
+                            AND onoff='1'
+                            AND(NOW() BETWEEN start_time AND end_time OR(start_time='0000-00-00 00:00:00' and end_time='0000-00-00 00:00:00') or (start_time is null and end_time is NULL))
+                            ORDER BY adtype""")
+
+                x["data"] = []
+                for c in records:
+                    a = {'imgUrl': c['mlo'], 'link': str(
+                        c['lk']), 'DimgUrl': c['lo'], 'webp': str(c['lomwebp']), 'Dwebp': str(c['dwebp'])}
+                    x["data"].append(a)
+                # print(x["data"])
+
+            # 來選好物區
+            if x['id'] == 6:
+
+                records = db.query(
+                    "SELECT max_row from outer_site_set WHERE title='來選好貨'")
+
+                maxrow = 1
+                for c in records:
+                    maxrow = c['max_row']
+
+                records = db.query("""(SELECT theme_type, mapping_id, IFNULL(ifnull(ifnull(_hcase.caption,_hcolumn.ctitle),_hproduct.name),_hvideo.title) COLLATE utf8_general_ci caption  , IFNULL(ifnull(_hcase.cover,_hcolumn.clogo),_hproduct.cover) COLLATE utf8_general_ci J, iframe , IFNULL(ifnull(ifnull(_hcase.short_desc,_hcolumn.cdesc),_hproduct.descr),_hvideo.`desc`) COLLATE utf8_general_ci short_desc
+    , (case when theme_type='case' then CONCAT('https://hhh.com.tw/cases/detail/d/',mapping_id) when theme_type='column' then CONCAT('https://hhh.com.tw/columns/detail/',mapping_id) when theme_type='product' then CONCAT('https://hhh.com.tw/product-post.php?id=',mapping_id) when theme_type='video' then CONCAT('https://hhh.com.tw/video-post.php?id=',mapping_id) ELSE '' END) url
+    -- SELECT *
+    FROM homepage_set
+    left join _hcase ON _hcase.hcase_id=homepage_set.mapping_id AND theme_type='case'-- AND _hcase.onoff = '1'
+    LEFT JOIN _hproduct ON mapping_id = _hproduct.id AND theme_type='product'-- AND _hproduct.onoff = '1'
+    LEFT JOIN _hcolumn ON mapping_id = _hcolumn.hcolumn_id AND theme_type='column'-- AND _hcolumn.onoff = '1'
+    LEFT JOIN _hvideo ON mapping_id = _hvideo.hvideo_id AND theme_type='video'
+    WHERE homepage_set.onoff='Y'
+    AND outer_set = (SELECT oss_id from outer_site_set WHERE title='來選好貨')
+    AND(NOW() BETWEEN homepage_set.start_time AND homepage_set.end_time OR(homepage_set.start_time='0000-00-00 00:00:00' and homepage_set.end_time='0000-00-00 00:00:00') or (homepage_set.start_time is null and homepage_set.end_time is NULL))
+    ORDER BY outer_set, inner_sort)
+    UNION
+    (SELECT 'product', id, `name`, cover, NULL ,descr ,CONCAT('https://hhh.com.tw/product-post.php?id=',id) FROM _hproduct WHERE onoff='1' ORDER BY id DESC LIMIT """ + str(maxrow) + """)
+                                    LIMIT """ + str(maxrow))
+
+                x["data"] = []
+                for c in records:
+                    #print(c)
+                    if c['iframe'] is None:
+                        if isinstance(c['J'], bytearray) or isinstance(c['J'], bytes):
+                            c['J'] = c['J'].decode('utf8')
+                        if isinstance(c['caption'], bytearray) or isinstance(c['caption'], bytes):
+                            c['caption'] = c['caption'].decode('utf8')
+                        if isinstance(c['short_desc'], bytearray) or isinstance(c['short_desc'], bytes):
+                            c['short_desc'] = c['short_desc'].decode('utf8')
+                        a = {'imgUrl': c['J'], 'link': c['url'], 'title': c['caption'],
+                            'description': c['short_desc'], 'video': 'false'}
+                    else:
+                        tid = extract.video_id(str(c['iframe']))
+                        timg = "https://img.youtube.com/vi/" + tid+"/hqdefault.jpg"
+                        ccaption = ""
+                        cdescription = ""
+                        if isinstance(c['caption'], bytearray):
+                            ccaption = str(c['caption'].decode('utf8'))
+                        else:
+                            ccaption = str(c['caption'])
+                        if c['short_desc'] is not None:
+                            if isinstance(c['short_desc'], bytes):
+                                cdescription = str(c['short_desc'].decode('utf8'))
+                            else:
+                                cdescription = str(c['short_desc'])
+                        a = {'imgUrl': timg, 'link': c['url'], 'title': ccaption,
+                            'description': cdescription, 'video': tid}
+                    x["data"].append(a)
+                # print(x["data"])
+
+            # 本週推薦
+            if x['id'] == 7:
+                records = db.query(
+                    "SELECT max_row from outer_site_set WHERE title='本週推薦'")
+
+                maxrow = 1
+                for c in records:
+                    maxrow = c['max_row']
+
+                records = db.query("""SELECT theme_type, mapping_id, IFNULL(ifnull(ifnull(_hcase.caption,_hcolumn.ctitle),_hproduct.name),_hvideo.title) caption , IFNULL(ifnull(_hcase.cover,_hcolumn.clogo),_hproduct.cover) J, iframe , IFNULL(ifnull(ifnull(_hcase.short_desc,_hcolumn.cdesc),_hproduct.descr),_hvideo.`desc`) short_desc
+    , (case when theme_type='case' then CONCAT('https://hhh.com.tw/cases/detail/d/',mapping_id) when theme_type='column' then CONCAT('https://hhh.com.tw/columns/detail/',mapping_id) when theme_type='product' then CONCAT('https://hhh.com.tw/product-post.php?id=',mapping_id) when theme_type='video' then CONCAT('https://hhh.com.tw/video-post.php?id=',mapping_id) ELSE '' END) url
+    -- SELECT *
+    FROM homepage_set
+    left join _hcase ON _hcase.hcase_id=homepage_set.mapping_id AND theme_type='case'-- AND _hcase.onoff = '1'
+    LEFT JOIN _hproduct ON mapping_id = _hproduct.id AND theme_type='product'-- AND _hproduct.onoff = '1'
+    LEFT JOIN _hcolumn ON mapping_id = _hcolumn.hcolumn_id AND theme_type='column'-- AND _hcolumn.onoff = '1'
+    LEFT JOIN _hvideo ON mapping_id = _hvideo.hvideo_id AND theme_type='video'
+    WHERE homepage_set.onoff='Y'
+    AND outer_set = (SELECT oss_id from outer_site_set WHERE title='本週推薦')
+    AND(NOW() BETWEEN homepage_set.start_time AND homepage_set.end_time OR(homepage_set.start_time='0000-00-00 00:00:00' and homepage_set.end_time='0000-00-00 00:00:00') or (homepage_set.start_time is null and homepage_set.end_time is NULL))
+    ORDER BY outer_set, inner_sort
+                                LIMIT """ + str(maxrow))
+
+                x["data"] = []
+                for c in records:
+                    if c['iframe'] is None:
+                        if isinstance(c['J'], bytearray) or isinstance(c['J'], bytes):
+                            c['J'] = c['J'].decode('utf8')
+                        if isinstance(c['caption'], bytearray) or isinstance(c['caption'], bytes):
+                            c['caption'] = c['caption'].decode('utf8')
+                        if isinstance(c['short_desc'], bytearray) or isinstance(c['short_desc'], bytes):
+                            c['short_desc'] = c['short_desc'].decode('utf8')
+                        a = {'imgUrl': c['J'], 'link': c['url'], 'title': c['caption'],
+                            'description': c['short_desc'], 'video': 'false'}
+                    else:
+                        tid = extract.video_id(str(c['iframe']))
+                        timg = "https://img.youtube.com/vi/" + tid+"/hqdefault.jpg"
+                        ccaption = ""
+                        cdescription = ""
+                        if isinstance(c['caption'], bytearray):
+                            ccaption = str(c['caption'].decode('utf8'))
+                        else:
+                            ccaption = str(c['caption'])
+                        if c['short_desc'] is not None:
+                            if isinstance(c['short_desc'], bytes):
+                                cdescription = str(c['short_desc'].decode('utf8'))
+                            else:
+                                cdescription = str(c['short_desc'])
+                        a = {'imgUrl': timg, 'link': c['url'], 'title': ccaption,
+                            'description': cdescription, 'video': tid}
+                    x["data"].append(a)
+                # print(x["data"])
+
+            # 粉絲推薦
+            if x['id'] == 8:
+
+                records = db.query(
+                    "SELECT max_row from outer_site_set WHERE title='粉絲推薦'")
+
+                maxrow = 1
+                for c in records:
+                    maxrow = c['max_row']
+
+                records = db.query("""SELECT theme_type, mapping_id, IFNULL(ifnull(ifnull(_hcase.caption,_hcolumn.ctitle),_hproduct.name),_hvideo.title) caption , IFNULL(ifnull(_hcase.cover,_hcolumn.clogo),_hproduct.cover) J, iframe , IFNULL(ifnull(ifnull(_hcase.short_desc,_hcolumn.cdesc),_hproduct.descr),_hvideo.`desc`) short_desc
+    , (case when theme_type='case' then CONCAT('https://hhh.com.tw/cases/detail/d/',mapping_id) when theme_type='column' then CONCAT('https://hhh.com.tw/columns/detail/',mapping_id) when theme_type='product' then CONCAT('https://hhh.com.tw/product-post.php?id=',mapping_id) when theme_type='video' then CONCAT('https://hhh.com.tw/video-post.php?id=',mapping_id) ELSE '' END) url
+    -- SELECT *
+    FROM homepage_set
+    left join _hcase ON _hcase.hcase_id=homepage_set.mapping_id AND theme_type='case'-- AND _hcase.onoff = '1'
+    LEFT JOIN _hproduct ON mapping_id = _hproduct.id AND theme_type='product'-- AND _hproduct.onoff = '1'
+    LEFT JOIN _hcolumn ON mapping_id = _hcolumn.hcolumn_id AND theme_type='column'-- AND _hcolumn.onoff = '1'
+    LEFT JOIN _hvideo ON mapping_id = _hvideo.hvideo_id AND theme_type='video'
+    WHERE homepage_set.onoff='Y'
+    AND outer_set = (SELECT oss_id from outer_site_set WHERE title='粉絲推薦')
+    AND(NOW() BETWEEN homepage_set.start_time AND homepage_set.end_time OR(homepage_set.start_time='0000-00-00 00:00:00' and homepage_set.end_time='0000-00-00 00:00:00') or (homepage_set.start_time is null and homepage_set.end_time is NULL))
+    ORDER BY outer_set, inner_sort
+                                LIMIT """ + str(maxrow))
+
+                x["data"] = []
+                for c in records:
+                    if c['iframe'] is None:
+                        if isinstance(c['J'], bytearray) or isinstance(c['J'], bytes):
+                            c['J'] = c['J'].decode('utf8')
+                        if isinstance(c['caption'], bytearray) or isinstance(c['caption'], bytes):
+                            c['caption'] = c['caption'].decode('utf8')
+                        if isinstance(c['short_desc'], bytearray) or isinstance(c['short_desc'], bytes):
+                            c['short_desc'] = c['short_desc'].decode('utf8')
+                        a = {'imgUrl': c['J'], 'link': c['url'], 'title': c['caption'],
+                            'description': c['short_desc'], 'video': 'false'}
+                    else:
+                        tid = extract.video_id(str(c['iframe']))
+                        timg = "https://img.youtube.com/vi/" + tid+"/hqdefault.jpg"
+                        ccaption = ""
+                        cdescription = ""
+                        if isinstance(c['caption'], bytearray):
+                            ccaption = str(c['caption'].decode('utf8'))
+                        else:
+                            ccaption = str(c['caption'])
+                        if c['short_desc'] is not None:
+                            if isinstance(c['short_desc'], bytes):
+                                cdescription = str(c['short_desc'].decode('utf8'))
+                            else:
+                                cdescription = str(c['short_desc'])
+                        a = {'imgUrl': timg, 'link': c['url'], 'title': ccaption,
+                            'description': cdescription, 'video': tid}
+                    x["data"].append(a)
+                # print(x["data"])
+
+            if x['id'] == 9:
+                records = db.query(
+                    "SELECT id, (case when youtube_title = '' OR youtube_title IS NULL then (SELECT title FROM _hvideo where display_datetime < now() ORDER BY hvideo_id DESC LIMIT 1) ELSE youtube_title END) T, (case when youtube_id = '' OR youtube_id IS NULL then (SELECT iframe FROM _hvideo where display_datetime < now() ORDER BY hvideo_id DESC LIMIT 1) ELSE youtube_id end) Y FROM site_setup")
+
+                for c in records:
+                    x['title'] = ""
+                    if isinstance(c['T'], bytearray):
+                        x['title'] = str(c['T'].decode('utf8'))
+                    else:
+                        x['title'] = str(c['T'])
+                    x['yt'] = extract.video_id(str(c['Y']))
+                    # print(id)
+
+            if x['id'] == 10:
+                records = db.query(
+                    "SELECT all_search_tag ast FROM site_setup")
+
+                x["data"] = []
+                for c in records:
+                    x["data"] = c['ast'].split(',')
+                    # print(id)
+
+        # print(jData)
+        if not os.path.exists(hhhMBPath):
+            os.mkdir(hhhMBPath)
+        with open(hhhMBPath+'/json/' + filename, 'w', encoding='utf-8') as f:
+            json.dump(jData, f, ensure_ascii=False, indent=4)
+
+        if not os.path.exists(hhhPCPath):
+            os.mkdir(hhhPCPath)
+        with open(hhhPCPath+'/json/' + filename, 'w', encoding='utf-8') as f:
+            json.dump(jData, f, ensure_ascii=False, indent=4)
+
+        return jData
+
+# @app.get("/gencase")
+
+
+def gencase(id: str = "12257", sort: str = "new", page: str = "1"):
+
+    with dataset.connect(connstr) as db:
+        jData = json.load(open(hhhMBPath+'/json/cases.json', encoding='utf8'))
+
+        records = db.query("""SELECT *, c.style cstyle, c.style2 cstyle2 FROM _hcase c
+    LEFT JOIN _hdesigner d ON c.hdesigner_id = d.hdesigner_id
+    WHERE c.hcase_id = '""" + id + """'  AND c.onoff='1' AND d.onoff='1' and c.sdate < now() """)
+
+        # print(jData)
+        for x in jData:
+            tmpCaseDetail = []
+            icount = 0
+            for c in records:
+                icount += 1
+                #tmpCaseDetail.append({"CaseDetailImg": c["cimg"]})
+                #x["CaseDetail"] = tmpCaseDetail
+
+                if c != None:
+                    x["designerid"] = str(c["hdesigner_id"])
+                    x["CaseId"] = str(c["hcase_id"])
+                    x["Casetitle"] = c["caption"]
+                    x["CaseTeamName"] = c["name"]
+                    x["CaseCompany"] = c["title"]
+                    x["CaseCompanyAddress"] = c["address"]
+                    x["CaseCompanyTel"] = c["phone"]
+                    x["CaseCompanyEmail"] = c["mail"]
+                    x["CaseCompanyWeb"] = c["website"]
+                    x["CaseDate"] = str(c["sdate"])
+                    x["CaseViews"] = c["viewed"]
+                    x["CaseCoverImg"] = c["cover"]
+                    x["CaseImgAmount"] = icount
+                    x["CaseStyle"] = c["cstyle"]
+                    x["CaseHouse"] = c["layout"]
+                    x["CaseSize"] = c["area"]
+                    x["CaseProject"] = ""
+                    x["CaseDataMember"] = c["member"]
+                    x["CaseDataSize"] = c["area"]
+                    x["CaseDataStyle"] = c["cstyle"] + c["cstyle2"]
+                    x["CaseDataType"] = c["type"]
+                    x["CaseDataSituation"] = c["condition"]
+                    x["CaseDataImgProvide"] = c["provider"]
+                    x["CaseDataSpace"] = c["layout"]
+                    x["CaseDataMaterial"] = c["materials"]
+                    x["ContactFreeTel"] = c["service_phone"]
+                    x["ContactDesignerImg"] = c["img_path"]
+                    x["CasePageLink"] = ""
+                    x["CasePageprev"] = ""
+                    #x["CaseTag"]= []
+
+                    # 相同設計師的個案
+                    sql = """SELECT * FROM _hcase c
+            WHERE hdesigner_id = '""" + x["designerid"] + """' and hcase_id <> '""" + x["CaseId"] + """' and sdate < now()  AND c.onoff='1'
+            ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+            LIMIT """ + str((int(page) - 1)*12) + """,12
+            """
+                    cases = db.query(sql)
+
+                    tmpOtherCases = []
+                    for other in cases:
+                        tmpOtherCase = {}
+                        tmpOtherCase["designerid"] = str(other["hdesigner_id"])
+                        tmpOtherCase["casesid"] = str(other["hcase_id"])
+                        tmpOtherCase["Views"] = other["viewed"]
+                        tmpOtherCase["ProfileImg"] = other["cover"]
+                        tmpTags = []
+                        for tag in other["tag"].split(','):
+                            tmpTags.append({"Tag": tag, "TagLink": ""})
+                        tmpOtherCase["ProfileTag"] = tmpTags
+                        tmpOtherCases.append(tmpOtherCase)
+
+                    x["DesignerProfile"] = tmpOtherCases
+
+                    # 相同風格的個案
+                    sql = """SELECT * FROM _hcase c
+            WHERE style = '""" + x["CaseStyle"] + """' and hcase_id <> '""" + x["CaseId"] + """' and sdate < now()  AND c.onoff='1'
+            ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+            LIMIT """ + str((int(page) - 1)*12) + """,12
+            """
+                    cases = db.query(sql)
+
+                    tmpOtherCases = []
+                    for other in cases:
+                        tmpOtherCase = {}
+                        tmpOtherCase["designerid"] = str(other["hdesigner_id"])
+                        tmpOtherCase["casesid"] = str(other["hcase_id"])
+                        tmpOtherCase["Views"] = other["viewed"]
+                        tmpOtherCase["ProfileImg"] = other["cover"]
+                        tmpTags = []
+                        for tag in other["tag"].split(','):
+                            tmpTags.append({"Tag": tag, "TagLink": ""})
+                        tmpOtherCase["ProfileTag"] = tmpTags
+                        tmpOtherCases.append(tmpOtherCase)
+
+                    x["StyleProfile"] = tmpOtherCases
+
+                    # 相同風格的RANDOM 10筆
+                    # cases = db.query("""SELECT * FROM _hcase c
+            # WHERE style = '""" + x["CaseStyle"] + """' and hcase_id <> '""" + x["CaseId"] + """' and sdate < now()  AND c.onoff='1'
+            # ORDER BY RAND()
+            # LIMIT 10
+            # """)
+                    """ tmpOtherCases = []
+                    for other in cases:
+                        tmpOtherCase = {}
+                        tmpOtherCase["designerid"] = str(other["hdesigner_id"])
+                        tmpOtherCase["casesid"] = str(other["hcase_id"])
+                        tmpOtherCase["PortfoliolImg"] = other["cover"]
+                        tmpOtherCase["PortfoliolLink"] = ""
+                        tmpOtherCase["PortfoliolImgAlt"] = other["caption"]
+                        tmpOtherCases.append(tmpOtherCase)
+                    x["OtherStylePortfolio"]= tmpOtherCases """
+
+        # print(x)
+
+        # print(jData)
+        if not os.path.exists(hhhMBPath):
+            os.mkdir(hhhMBPath)
+        with open(hhhMBPath+'/json/cases-' + id + '.json', 'w', encoding='utf-8') as f:
+            json.dump(jData, f, ensure_ascii=False, indent=4)
+
+        return jData
+
+
+def gendesigner(id: str = "14151", sort: str = "new", page: str = "1"):
+    with dataset.connect(connstr) as db:
+        jData = json.load(open(hhhMBPath+'/json/designers.json', encoding='utf8'))
+
+        records = db.query("""SELECT * FROM _hdesigner d
+    WHERE d.hdesigner_id = '""" + id + """' AND d.onoff='1' """)
+
+        # print(jData)
+        for x in jData:
+            tmpCaseDetail = []
+            icount = 0
+            for c in records:
+                icount += 1
+                # tmpCaseDetail.append({"CaseDetailImg":c["cimg"]})
+
+            if page == "1":
+                x["id"] = c["hdesigner_id"]
+                x["BannerImg"] = c["background"]
+                x["CompanyName"] = c["title"]
+                x["DesignerName"] = c["name"]
+                x["Designerimg"] = c["img_path"]
+                x["Description"] = c["seo"]
+                x["Approve"] = c["position"]
+                x["FB_link"] = c["fbpageurl"]
+                x["Basics"] = [
+                    {"title": "免費專線:",
+                        "link": c["service_phone"], "data": c["service_phone"]},
+                    {"title": "諮詢專線:", "link": c["phone"], "data": c["phone"]},
+                    {"title": "諮詢專線:", "link": c["phone"], "data": c["phone"]},
+                    {"title": "公司傳真:", "link": c["fax"], "data": c["fax"]},
+                    {"title": "公司地址:", "link": c["address"], "data": c["address"]},
+                    {"title": "電子信箱:", "link": c["mail"], "data": c["mail"]},
+                    {"title": "公司網址:", "link": c["website"], "data": c["website"]}
+                ]
+                x["FreeCall"] = c["service_phone"]
+                x["ConsoleCall_1"] = c["phone"]
+                x["ConsoleCall_2"] = c["phone"]
+                x["Fax"] = c["fax"]
+                x["Address"] = c["address"]
+                x["Email"] = c["mail"]
+                x["Web"] = c["website"]
+                
+                x["Branches"] = []
+                branches = db.query("""SELECT * FROM designer_branch br 
+    WHERE br.designer_id = '""" + id + """' """)
+                
+                for branch in branches:
+                    tmpobj = {
+                        "title": branch["title"],
+                        "address": branch["address"],
+                        "tel": branch["tel"],
+                        "fax": branch["fax"]
+                    }
+                    x["Branches"].append(tmpobj)
+
+                x["Budget"] = c["budget"]
+                x["Square"] = c["area"]
+                x["SpecialCase"] = c["special"]
+                x["Charge"] = c["charge"]
+                x["Pay"] = c["payment"]
+                x["WorkLoc"] = c["region"]
+                x["WorkType"] = c["type"]
+                x["WorkStyle"] = c["style"]
+                x["WorkBudget"] = c["budget"]
+                x["Terms"] = [
+                    {"title": "接案預算:", "data": c["budget"]},
+                    {"title": "接案坪數:", "data": c["area"]},
+                    {"title": "特殊接案:", "data": c["special"]},
+                    {"title": "收費方式:", "data": c["charge"]},
+                    {"title": "付費方式:", "data": c["payment"]},
+                    {"title": "接案區域:", "data": c["region"]},
+                    {"title": "接案類型:", "data": c["type"]},
+                    {"title": "接案風格:", "data": c["style"]}
+                ]
+                x["scMedia"] = [
+                    {"name": "Facebook", "img": "https://hhh.com.tw/assets/images/rv_web/fb.svg",
+                        "link": c["fbpageurl"]},
+                    {"name": "Line", "img": "https://hhh.com.tw/assets/images/rv_web/line.svg",
+                        "link": c["line_link"]},
+                    {"name": "Wechat", "img": "https://hhh.com.tw/assets/images/rv_web/wechat.svg",
+                        "link": c["fbpageurl"]},
+                    {"name": "email", "img": "https://hhh.com.tw/assets/images/rv_web/share.svg",
+                        "link": c["mail"]},
+                    {"name": "Like", "img": "https://hhh.com.tw/assets/images/rv_web/like-o.svg", "link": ""}
+                ]
+                x["Content"] = [
+                    {
+                        "Title": "設計師作品",
+                        "mb_title": "作品",
+                        "Tabtag": "intro",
+                        "Display_mb": "true",
+                        "isActive": "true",
+                        "Carddata": []
+                    },
+                    {
+                        "Title": "設計師影音",
+                        "mb_title": "影音",
+                        "Tabtag": "video",
+                        "Display_mb": "true",
+                        "isActive": "true",
+                        "Carddata": []
+                    },
+                    {
+                        "Title": "設計師專欄",
+                        "mb_title": "專欄",
+                        "Tabtag": "columns",
+                        "Display_mb": "true",
+                        "isActive": "true",
+                        "Carddata": []
+                    },
+                    {
+                        "Title": "VR360",
+                        "mb_title": "",
+                        "Tabtag": "vr360",
+                        "Display_mb": "false",
+                        "isActive": "true",
+                        "Carddata": []
+                    },
+                    {
+                        "Title": "設計師公司簡介",
+                        "mb_title": "公司簡介",
+                        "Tabtag": "company",
+                        "Display_mb": "true",
+                        "isActive": "true",
+                        "Carddata": [],
+                        "info": [
+                            {"title": "設計理念", "data": c["idea"]},
+                            {"title": "公司統編", "data": c["taxid"]},
+                            {"title": "相關經歷", "data": c["career"]},
+                            {"title": "專業證照", "data": c["license"]},
+                            {"title": "獲獎紀錄", "data": c["awards"]}
+                        ]
+                    }
+                ]
+
+            # 設計師作品
+            x["Content"][0]["Carddata"] = []
+            cases = db.query("""SELECT tag,cover,caption,hcase_id,viewed,sdate FROM _hcase c
+    WHERE c.hdesigner_id = '""" + id + """' AND c.onoff='1' 
+    ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+    LIMIT """ + str((int(page) - 1)*12) + """,12
+    """)
+
+            for case in cases:
+                tmpobj = {
+                    "url": "https://hhh.com.tw/cases/detail/d/"+str(case["hcase_id"]),
+                    "imgURL": case["cover"],
+                    "title": case["caption"],
+                    "tag": [{"name": tag, "link": ""} for tag in case["tag"].split(',')],
+                    "views": case["viewed"],
+                    "dateSort": str(case["sdate"])
+                }
+                x["Content"][0]["Carddata"].append(tmpobj)
+
+            # 設計師影音
+            # https://i.ytimg.com/vi/y6VmaLC7O9Y/hqdefault.jpg
+            x["Content"][1]["Carddata"] = []
+            videos = db.query("""SELECT tag_vpattern,iframe,title,hvideo_id,viewed,display_datetime FROM _hvideo v
+    WHERE v.hdesigner_id = '""" + id + """' AND display_datetime < NOW() 
+    ORDER BY """ + ("display_datetime" if sort == 'new' else 'viewed') + """ DESC
+    LIMIT """ + str((int(page) - 1)*12) + """,12
+    """)
+
+            for video in videos:
+                tmpobj = {
+                    "url": "https://hhh.com.tw/video-post.php?id="+str(video['hvideo_id']),
+                    "imgURL": "https://i.ytimg.com/vi/" + extract.video_id(str(video['iframe']))+"/hqdefault.jpg",
+                    "title": video["title"],
+                    "tag": [{"name": tag, "link": ""} for tag in video["tag_vpattern"].split(',')],
+                    "views": video["viewed"],
+                    "dateSort": str(video["display_datetime"])
+                }
+                x["Content"][1]["Carddata"].append(tmpobj)
+
+            # 設計師專欄
+            x["Content"][2]["Carddata"] = []
+            columns = db.query("""SELECT tag,clogo,ctitle,hcolumn_id,viewed,sdate FROM _hcolumn c
+    WHERE onoff=1 AND (hdesigner_ids LIKE '""" + id + """,%' OR hdesigner_ids LIKE '%,""" + id + """,%' OR hdesigner_ids LIKE '%,""" + id + """' OR hdesigner_ids = '""" + id + """') 
+    ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+    LIMIT """ + str((int(page) - 1)*12) + """,12
+    """)
+
+            for column in columns:
+                tmpobj = {
+                    "url": "https://hhh.com.tw/video-post.php?id="+str(video['hvideo_id']),
+                    "imgURL": column['clogo'],
+                    "title": column["ctitle"],
+                    "tag": [] if not column["tag"] else [{"name": tag, "link": ""} for tag in column["tag"].split(',')],
+                    "views": column["viewed"],
+                    "dateSort": str(column["sdate"])
+                }
+                x["Content"][2]["Carddata"].append(tmpobj)
+
+            # VR360
+            x["Content"][3]["Carddata"] = []
+            cases = db.query("""SELECT tag,cover,caption,hcase_id,viewed,sdate FROM _hcase c
+    WHERE c.hdesigner_id = '""" + id + """' and istaging != '' AND c.onoff='1' 
+    ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+    LIMIT """ + str((int(page) - 1)*12) + """,12
+    """)
+
+            for case in cases:
+                tmpobj = {
+                    "url": "https://hhh.com.tw/cases/detail/d/"+str(case["hcase_id"]),
+                    "imgURL": case["cover"],
+                    "title": case["caption"],
+                    "tag": [{"name": tag, "link": ""} for tag in case["tag"].split(',')],
+                    "views": case["viewed"],
+                    "dateSort": str(case["sdate"])
+                }
+                x["Content"][3]["Carddata"].append(tmpobj)
+
+            # 設計公司簡介
+            #x["Content"][4]["Carddata"] = []
+            #cases = db.query("")
+
+            """ for case in cases:
+                tmpobj = {
+                    "imgURL":case["cover"],
+                    "title":case["caption"],
+                    "tag":[{"name": tag, "link": ""} for tag in case["tag"].split(',')],
+                    "views":case["viewed"],
+                    "dateSort":str(case["sdate"])
+                    }
+                x["Content"][4]["Carddata"].append(tmpobj) """
+
+        # print(x)
+
+        # print(jData)
+        if not os.path.exists(hhhMBPath):
+            os.mkdir(hhhMBPath)
+        with open(hhhMBPath+'/json/designers-' + id + '.json', 'w', encoding='utf-8') as f:
+            json.dump(jData, f, ensure_ascii=False, indent=4)
+
+        return jData
+
+
+def gencolumn(id: str = "6392", sort: str = "new", page: str = "1"):
+    with dataset.connect(connstr) as db:
+        jData = json.load(open(hhhMBPath+'/json/Columns.json', encoding='utf8'))
+
+        records = db.query("""SELECT * FROM _hcolumn c
+    WHERE c.hcolumn_id = '""" + id + """'  AND c.onoff='1' """)
+
+        # print(id)
+        for x in jData:
+            icount = 0
+            c = None
+            for c in records:
+                icount += 1
+                if c != None:
+                    x["Columnsid"] = str(c["hcolumn_id"])
+                    x["Columnstitle"] = c["ctitle"]
+                    x["ColumnsCoverImg"] = c["clogo"]
+                    x["ColumnsDate"] = str(c["sdate"])
+                    x["ColumnsViews"] = str(c["viewed"])
+                    # 只有第一頁時有內容,以免資料過大
+                    if page == "1":
+                        x["ColumnsContent"] = c["page_content"]
+                    tmpTags = []
+                    for tag in c["ctag"].split(','):
+                        tmpTags.append({"Tag": tag})
+                    x["ColumnsTag"] = tmpTags
+
+                    # 相同類別的最新12筆
+                    sql = """SELECT * FROM _hcolumn c
+            WHERE (c.ctype like '%""" + str(c["ctype"]) + """%' and c.ctype_sub like '%""" + str(c["ctype_sub"]) + """%') and hcolumn_id <> '""" + str(c["hcolumn_id"]) + """' and sdate < now()  AND c.onoff='1'
+            ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+            LIMIT """ + str((int(page) - 1)*12) + """,12
+            """
+                    ctypes = db.query(sql)
+                    tmpOtherCols = []
+                    for other in ctypes:
+                        tmpOtherCol = {}
+                        tmpOtherCol["Columnsid"] = str(other["hcolumn_id"])
+                        tmpOtherCol["ColumnsCoverImg"] = other["clogo"]
+                        tmpOtherCol["Views"] = other["viewed"]
+                        tmpOtherCol["Columnstitle"] = other["ctitle"]
+                        tmpTags = []
+                        for tag in other["ctag"].split(','):
+                            tmpTags.append({"Tag": tag})
+                        tmpOtherCol["ColumnsTag"] = tmpTags
+                        tmpOtherCols.append(tmpOtherCol)
+                    x["OtherColumns"] = tmpOtherCols
+
+        # print(x)
+
+        # print(jData)
+        if not os.path.exists(hhhMBPath):
+            os.mkdir(hhhMBPath)
+        with open(hhhMBPath+'/json/Columns-' + id + '.json', 'w', encoding='utf-8') as f:
+            json.dump(jData, f, ensure_ascii=False, indent=4)
+
+        return jData
+
+# genjson("realtime.json")
+#cmd="""curl -X POST "https://api.cloudflare.com/client/v4/zones/8cb58022ad5743cfd9f088d5e3a261eb/purge_cache" -H "X-Auth-Email: web.dept.hhh@gmail.com"  -H "X-Auth-Key:63e51d9a1638d66afcbfc3320aabec52304de" -H "Content-Type: application/json" --data '{"files":["https://m.hhh.com.tw/hhh-home-mb/json/realtime.json"]}'"""
+# os.system(cmd)
+
+with dataset.connect(connstr) as db:
+
+    genjson()
+    """ gencase("14151")
+    gendesigner("788")
+    gencolumn("6392") """
+    """ gencolumn("6349")
+    gencolumn("6476")
+    gencolumn("6392") """
+
+    """ gencase("421")
+    gencase("12257")
+    gencase("14305") """
+
+    """ gendesigner("312") """
+
+    cases = db.query("""SELECT DISTINCT hcase_id FROM _hcase c
+    WHERE c.onoff='1' """)
+
+    """ for sc in cases:
+        gencase(str(sc['hcase_id'])) """
+
+    columns = db.query("""SELECT DISTINCT hcolumn_id FROM _hcolumn c
+    WHERE c.onoff='1' and sdate < now() """)
+
+    """ for sc in columns:
+        gencolumn(str(sc['hcolumn_id'])) """
+
+    # """ if __name__ == "__main__":
+    #    uvicorn.run(app, host="0.0.0.0", port=8000) """

+ 544 - 61
genjson/genjson.py

@@ -1,6 +1,7 @@
 
 import os
 from typing import Optional
+import mysql.connector
 from dataset.util import ResultIter
 from fastapi import FastAPI
 from fastapi.middleware.cors import CORSMiddleware
@@ -8,8 +9,11 @@ from fastapi.middleware.cors import CORSMiddleware
 from pytrends.request import TrendReq
 from datetime import tzinfo
 import datetime
-import mysql.connector
-from mysql.connector import Error
+from io import BytesIO
+from fastapi.responses import StreamingResponse
+import xlsxwriter
+import pandas as pd
+import dataset
 
 import json
 from pytube import extract
@@ -29,10 +33,10 @@ app.add_middleware(
 
 hhhMBPath = '../hhh-home-mb'
 hhhPCPath = '../hhh-home-pc'
-
+connstr = 'mysql://hhh7796hhh:lYmWsu^ujcA1@hhh-v57.cmab1ctkglka.ap-northeast-2.rds.amazonaws.com:3306/xoops?charset=utf8mb4'
 
 def ExecuteQuery(isql):
-    connection = mysql.connector.connect(
+    with mysql.connector.connect(
         host='hhh-v57.cmab1ctkglka.ap-northeast-2.rds.amazonaws.com',
         database='xoops',
         user='hhh7796hhh',
@@ -40,29 +44,61 @@ def ExecuteQuery(isql):
         use_unicode=True,
         charset='utf8',
         collation='utf8_unicode_ci'
-    )
+    ) as connection :
+        with connection.cursor(dictionary=True) as cursor:
     # connection.set_charset_collation('utf8','utf8_general_ci')
-    cursor = connection.cursor(dictionary=True)
-    cursor.execute(isql)
-    if cursor.rowcount == -1:
-        return cursor.fetchall()
-    else:
-        connection.commit()
-        return cursor.rowcount
-
+            #cursor = connection.cursor(dictionary=True)
+            cursor.execute(isql)
+            return cursor.fetchall()
 
 def ExecuteCmd(isql):
-    connection = mysql.connector.connect(
+    with mysql.connector.connect(
         host='hhh-v57.cmab1ctkglka.ap-northeast-2.rds.amazonaws.com',
         database='xoops',
         user='hhh7796hhh',
-        password='lYmWsu^ujcA1'
-    )
-    cursor = connection.cursor(dictionary=True)
-    cursor.execute(isql)
-    print(cursor.rowcount)
-    connection.commit()
-    return None
+        password='lYmWsu^ujcA1',
+        use_unicode=True,
+        charset='utf8',
+        collation='utf8_unicode_ci'
+    ) as connection:
+        cursor = connection.cursor(dictionary=True)
+        cursor.execute(isql)
+        print(cursor.rowcount)
+        connection.commit()
+        return None
+
+@app.get("/ExportExecuteDetail")
+async def ExportExecuteDetail():
+
+    with dataset.connect(connstr) as db:
+        output = BytesIO()
+        records = db.query(""" select f.exf_id, num 合約, company 合約公司,lv1 大項目,lv2 執行項, contract_time 合約到期日,price 金額,sales_man 業務,quota 額度,creator 建立者,is_close 狀態,sdate 上架日期,edate 下架日期,f.note 備註,designer 設計師,mobile 手機,telete 電話,contract_person 聯絡人,detail_status 合約名稱,d.create_time 建立時間,d.update_time 更新時間,last_update 最後更新 from execute_form f
+    left join execute_detail d on f.exf_id=d.exf_id
+    where f.is_delete='N' order BY f.exf_id DESC, exd_id
+    """)
+
+        df = pd.DataFrame(list(records))
+        writer = pd.ExcelWriter(output)
+        df.to_excel(writer, sheet_name='bar')
+        writer.save()
+
+
+        """ workbook = xlsxwriter.Workbook(output)
+        worksheet = workbook.add_worksheet()
+
+        for cols in records:
+            worksheet.write(0, 0, 'ISBN')
+            worksheet.write(0, 1, 'Name')
+            worksheet.write(0, 2, 'Takedown date')
+            worksheet.write(0, 3, 'Last updated')
+            
+        workbook.close() """
+        output.seek(0)
+
+        headers = {
+            'Content-Disposition': 'attachment; filename="execute_detail_all.xlsx"'
+        }
+        return StreamingResponse(output, headers=headers, media_type='application/octet-stream')
 
 
 @app.get("/")
@@ -72,48 +108,48 @@ def read_root():
 
 @app.get("/movexoopstostage")
 def movexoopstostage(designerid: str = "0", caseid: str = "0"):
+    with dataset.connect(connstr) as db:
+        db.query(
+            "replace INTO stage._hdesigner SELECT * FROM xoops._hdesigner WHERE hdesigner_id IN ('" + designerid.replace(',', "','")+"');")
+        db.query(
+            "replace INTO stage._hcase SELECT * FROM xoops._hcase WHERE hcase_id IN ('"+caseid.replace(',', "','")+"');")
+        db.query(
+            "replace INTO stage._hcase_img SELECT * FROM xoops._hcase_img WHERE hcase_id IN ('"+caseid.replace(',', "','")+"');")
 
-    ExecuteQuery(
-        "replace INTO stage._hdesigner SELECT * FROM xoops._hdesigner WHERE hdesigner_id IN ('" + designerid.replace(',', "','")+"');")
-    ExecuteQuery(
-        "replace INTO stage._hcase SELECT * FROM xoops._hcase WHERE hcase_id IN ('"+caseid.replace(',', "','")+"');")
-    ExecuteQuery(
-        "replace INTO stage._hcase_img SELECT * FROM xoops._hcase_img WHERE hcase_id IN ('"+caseid.replace(',', "','")+"');")
-
-    return {"success"}
+        return {"success"}
 
 
 @app.get("/movepxoopstostage")
 def movepxoopstostage(brandid: str = "0", productid: str = "0"):
+    with dataset.connect(connstr) as db:
+        db.query(
+            "replace INTO stage._hbrand SELECT * FROM xoops._hbrand WHERE hbrand_id IN ('" + brandid.replace(',', "','")+"');")
+        db.query(
+            "replace INTO stage._hbrand_page SELECT * FROM xoops._hbrand_page WHERE hbrand_id IN ('" + brandid.replace(',', "','")+"');")
+        db.query(
+            "replace INTO stage._hproduct SELECT * FROM xoops._hproduct WHERE id IN ('"+productid.replace(',', "','")+"');")
+        db.query(
+            "replace INTO stage._hproduct_img SELECT * FROM xoops._hproduct_img WHERE hproduct_id IN ('"+productid.replace(',', "','")+"');")
 
-    ExecuteQuery(
-        "replace INTO stage._hbrand SELECT * FROM xoops._hbrand WHERE hbrand_id IN ('" + brandid.replace(',', "','")+"');")
-    ExecuteQuery(
-        "replace INTO stage._hbrand_page SELECT * FROM xoops._hbrand_page WHERE hbrand_id IN ('" + brandid.replace(',', "','")+"');")
-    ExecuteQuery(
-        "replace INTO stage._hproduct SELECT * FROM xoops._hproduct WHERE id IN ('"+productid.replace(',', "','")+"');")
-    ExecuteQuery(
-        "replace INTO stage._hproduct_img SELECT * FROM xoops._hproduct_img WHERE hproduct_id IN ('"+productid.replace(',', "','")+"');")
-
-    return {"success"}
+        return {"success"}
 
 
 @app.get("/movecxoopstostage")
 def movecxoopstostage(columnid: str = "0"):
+    with dataset.connect(connstr) as db:
+        db.query(
+            "replace INTO stage._hcolumn SELECT * FROM xoops._hcolumn WHERE hcolumn_id IN ('" + columnid.replace(',', "','")+"');")
+        db.query(
+            "replace INTO stage._hcolumn_img SELECT * FROM xoops._hcolumn_img WHERE hcolumn_id IN ('" + columnid.replace(',', "','")+"');")
+        db.query(
+            "replace INTO stage._hcolumn_page SELECT * FROM xoops._hcolumn_page WHERE hcolumn_id IN ('" + columnid.replace(',', "','")+"');")
 
-    ExecuteQuery(
-        "replace INTO stage._hcolumn SELECT * FROM xoops._hcolumn WHERE hcolumn_id IN ('" + columnid.replace(',', "','")+"');")
-    ExecuteQuery(
-        "replace INTO stage._hcolumn_img SELECT * FROM xoops._hcolumn_img WHERE hcolumn_id IN ('" + columnid.replace(',', "','")+"');")
-    ExecuteQuery(
-        "replace INTO stage._hcolumn_page SELECT * FROM xoops._hcolumn_page WHERE hcolumn_id IN ('" + columnid.replace(',', "','")+"');")
-
-    return {"success"}
+        return {"success"}
 
 
 @app.get("/genjson")
 def genjson(filename: str = "realtime.json"):
-
+    
     jData = json.load(open(hhhMBPath+'/json/data.json', encoding='utf8'))
 
     records = ExecuteQuery("SELECT * FROM _had where (now() between start_time and end_time or ( start_time is null and end_time is null) or ( start_time = '0000-00-00 00:00:00' and end_time = '0000-00-00 00:00:00')) and onoff='1' and adtype like '首八大%' ")
@@ -122,6 +158,7 @@ def genjson(filename: str = "realtime.json"):
 
         # 頂部輪播區-新刊頭
         if x['id'] == 0:
+
             records = ExecuteQuery("""SELECT adlogo lo,adlogo_mobile mlo, adhref lk, adlogo_mobile_webp lomwebp, adlogo_webp dwebp FROM _had
                         WHERE adtype LIKE '新刊頭%'
                         AND onoff='1'
@@ -164,7 +201,7 @@ def genjson(filename: str = "realtime.json"):
             a = {'tab': '最夯設計', 'data': []}
             for c in records:
                 ad = {'imgUrl': c['IMG'], 'link': c['LK'],
-                      'title': c['TT'], 'description': c['txt']}
+                    'title': c['TT'], 'description': c['txt']}
                 a['data'].append(ad)
             x["data"].append(a)
 
@@ -181,7 +218,7 @@ def genjson(filename: str = "realtime.json"):
                 tid = extract.video_id(c['IMG'])
                 timg = "https://img.youtube.com/vi/" + tid+"/hqdefault.jpg"
                 ad = {'imgUrl': timg, 'link': c['LK'],
-                      'title': c['name'], 'description': c['TT']}
+                    'title': c['name'], 'description': c['TT']}
                 a['data'].append(ad)
             x["data"].append(a)
 
@@ -194,7 +231,7 @@ def genjson(filename: str = "realtime.json"):
             a = {'tab': '專欄文章', 'data': []}
             for c in records:
                 ad = {'imgUrl': c['IMG'], 'link': c['LK'],
-                      'title': c['TT'], 'description': c['cdesc']}
+                    'title': c['TT'], 'description': c['cdesc']}
                 a['data'].append(ad)
             x["data"].append(a)
             # print(x["data"])
@@ -272,7 +309,7 @@ UNION
 
             x["data"] = []
             for c in records:
-                print(c)
+                #print(c)
                 if c['iframe'] is None:
                     if isinstance(c['J'], bytearray) or isinstance(c['J'], bytes):
                         c['J'] = c['J'].decode('utf8')
@@ -281,7 +318,7 @@ UNION
                     if isinstance(c['short_desc'], bytearray) or isinstance(c['short_desc'], bytes):
                         c['short_desc'] = c['short_desc'].decode('utf8')
                     a = {'imgUrl': c['J'], 'link': c['url'], 'title': c['caption'],
-                         'description': c['short_desc'], 'video': 'false'}
+                        'description': c['short_desc'], 'video': 'false'}
                 else:
                     tid = extract.video_id(str(c['iframe']))
                     timg = "https://img.youtube.com/vi/" + tid+"/hqdefault.jpg"
@@ -297,7 +334,7 @@ UNION
                         else:
                             cdescription = str(c['short_desc'])
                     a = {'imgUrl': timg, 'link': c['url'], 'title': ccaption,
-                         'description': cdescription, 'video': tid}
+                        'description': cdescription, 'video': tid}
                 x["data"].append(a)
             # print(x["data"])
 
@@ -334,7 +371,7 @@ ORDER BY outer_set, inner_sort
                     if isinstance(c['short_desc'], bytearray) or isinstance(c['short_desc'], bytes):
                         c['short_desc'] = c['short_desc'].decode('utf8')
                     a = {'imgUrl': c['J'], 'link': c['url'], 'title': c['caption'],
-                         'description': c['short_desc'], 'video': 'false'}
+                        'description': c['short_desc'], 'video': 'false'}
                 else:
                     tid = extract.video_id(str(c['iframe']))
                     timg = "https://img.youtube.com/vi/" + tid+"/hqdefault.jpg"
@@ -350,7 +387,7 @@ ORDER BY outer_set, inner_sort
                         else:
                             cdescription = str(c['short_desc'])
                     a = {'imgUrl': timg, 'link': c['url'], 'title': ccaption,
-                         'description': cdescription, 'video': tid}
+                        'description': cdescription, 'video': tid}
                 x["data"].append(a)
             # print(x["data"])
 
@@ -388,7 +425,7 @@ ORDER BY outer_set, inner_sort
                     if isinstance(c['short_desc'], bytearray) or isinstance(c['short_desc'], bytes):
                         c['short_desc'] = c['short_desc'].decode('utf8')
                     a = {'imgUrl': c['J'], 'link': c['url'], 'title': c['caption'],
-                         'description': c['short_desc'], 'video': 'false'}
+                        'description': c['short_desc'], 'video': 'false'}
                 else:
                     tid = extract.video_id(str(c['iframe']))
                     timg = "https://img.youtube.com/vi/" + tid+"/hqdefault.jpg"
@@ -404,7 +441,7 @@ ORDER BY outer_set, inner_sort
                         else:
                             cdescription = str(c['short_desc'])
                     a = {'imgUrl': timg, 'link': c['url'], 'title': ccaption,
-                         'description': cdescription, 'video': tid}
+                        'description': cdescription, 'video': tid}
                 x["data"].append(a)
             # print(x["data"])
 
@@ -431,7 +468,7 @@ ORDER BY outer_set, inner_sort
                 # print(id)
 
     # print(jData)
-    if not os.path.exists(hhhMBPath):
+    """ if not os.path.exists(hhhMBPath):
         os.mkdir(hhhMBPath)
     with open(hhhMBPath+'/json/' + filename, 'w', encoding='utf-8') as f:
         json.dump(jData, f, ensure_ascii=False, indent=4)
@@ -439,10 +476,456 @@ ORDER BY outer_set, inner_sort
     if not os.path.exists(hhhPCPath):
         os.mkdir(hhhPCPath)
     with open(hhhPCPath+'/json/' + filename, 'w', encoding='utf-8') as f:
-        json.dump(jData, f, ensure_ascii=False, indent=4)
-
+        json.dump(jData, f, ensure_ascii=False, indent=4) """
+    
     return jData
 
 
+@app.get("/gencase")
+def gencase(id: str = "14151", sort: str = "new", page: str="1"):
+
+    with dataset.connect(connstr) as db:
+        jData = json.load(open(hhhMBPath+'/json/cases.json', encoding='utf8'))
+
+        records = db.query("""SELECT *, c.style cstyle, c.style2 cstyle2 FROM _hcase c
+    LEFT JOIN _hdesigner d ON c.hdesigner_id = d.hdesigner_id
+    WHERE c.hcase_id = '""" + id + """'  AND c.onoff='1' AND d.onoff='1' and c.sdate < now() """)
+
+        # print(jData)
+        for x in jData:
+            tmpCaseDetail = []
+            icount = 0
+            for c in records:
+                icount += 1
+                #tmpCaseDetail.append({"CaseDetailImg": c["cimg"]})
+            #x["CaseDetail"] = tmpCaseDetail
+                if c != None:
+                    x["designerid"] = str(c["hdesigner_id"])
+                    x["CaseId"] = str(c["hcase_id"])
+                    x["Casetitle"] = c["caption"]
+                    x["CaseTeamName"] = c["name"]
+                    x["CaseCompany"] = c["title"]
+                    x["CaseCompanyAddress"] = c["address"]
+                    x["CaseCompanyTel"] = c["phone"]
+                    x["CaseCompanyEmail"] = c["mail"]
+                    x["CaseCompanyWeb"] = c["website"]
+                    x["CaseDate"] = str(c["sdate"])
+                    x["CaseViews"] = c["viewed"]
+                    x["CaseCoverImg"] = c["cover"]
+                    x["CaseImgAmount"] = icount
+                    x["CaseStyle"] = c["cstyle"]
+                    x["CaseHouse"] = c["layout"]
+                    x["CaseSize"] = c["area"]
+                    x["CaseProject"] = ""
+                    x["CaseDataMember"] = c["member"]
+                    x["CaseDataSize"] = c["area"]
+                    x["CaseDataStyle"] = c["cstyle"] + c["cstyle2"]
+                    x["CaseDataType"] = c["type"]
+                    x["CaseDataSituation"] = c["condition"]
+                    x["CaseDataImgProvide"] = c["provider"]
+                    x["CaseDataSpace"] = c["layout"]
+                    x["CaseDataMaterial"] = c["materials"]
+                    x["ContactFreeTel"] = c["service_phone"]
+                    x["ContactDesignerImg"] = c["img_path"]
+                    x["CasePageLink"] = ""
+                    x["CasePageprev"] = ""
+                    #x["CaseTag"]= []
+                    
+                    #相同設計師的個案
+                    sql = """SELECT * FROM _hcase c
+            WHERE hdesigner_id = '""" + x["designerid"] + """' and hcase_id <> '""" + x["CaseId"] + """' and sdate < now()  AND c.onoff='1'
+            ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+            LIMIT """ + str((int(page) - 1)*12) + """,12
+            """
+                    cases = db.query(sql)
+                
+                    tmpOtherCases = []
+                    for other in cases:
+                        tmpOtherCase = {}
+                        tmpOtherCase["designerid"] = str(other["hdesigner_id"])
+                        tmpOtherCase["casesid"] = str(other["hcase_id"])
+                        tmpOtherCase["Views"] = other["viewed"]
+                        tmpOtherCase["ProfileImg"] = other["cover"]
+                        tmpTags = []
+                        for tag in other["tag"].split(','):
+                            tmpTags.append({"Tag": tag , "TagLink": "" })
+                        tmpOtherCase["ProfileTag"] = tmpTags
+                        tmpOtherCases.append(tmpOtherCase)
+                        
+                    x["DesignerProfile"] = tmpOtherCases
+
+                    #相同風格的個案
+                    sql = """SELECT * FROM _hcase c
+            WHERE style = '""" + x["CaseStyle"] + """' and hcase_id <> '""" + x["CaseId"] + """' and sdate < now()  AND c.onoff='1'
+            ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+            LIMIT """ + str((int(page) - 1)*12) + """,12
+            """
+                    cases = db.query(sql)
+                    
+                    tmpOtherCases = []
+                    for other in cases:
+                        tmpOtherCase = {}
+                        tmpOtherCase["designerid"] = str(other["hdesigner_id"])
+                        tmpOtherCase["casesid"] = str(other["hcase_id"])
+                        tmpOtherCase["Views"] = other["viewed"]
+                        tmpOtherCase["ProfileImg"] = other["cover"]
+                        tmpTags = []
+                        for tag in other["tag"].split(','):
+                            tmpTags.append({"Tag": tag , "TagLink": "" })
+                        tmpOtherCase["ProfileTag"] = tmpTags
+                        tmpOtherCases.append(tmpOtherCase)
+                        
+                    x["StyleProfile"] = tmpOtherCases
+
+                    #相同風格的RANDOM 10筆
+                    #cases = db.query("""SELECT * FROM _hcase c
+            #WHERE style = '""" + x["CaseStyle"] + """' and hcase_id <> '""" + x["CaseId"] + """' and sdate < now()  AND c.onoff='1'
+            #ORDER BY RAND()
+            #LIMIT 10
+            #""")
+                    """ tmpOtherCases = []
+                    for other in cases:
+                        tmpOtherCase = {}
+                        tmpOtherCase["designerid"] = str(other["hdesigner_id"])
+                        tmpOtherCase["casesid"] = str(other["hcase_id"])
+                        tmpOtherCase["PortfoliolImg"] = other["cover"]
+                        tmpOtherCase["PortfoliolLink"] = ""
+                        tmpOtherCase["PortfoliolImgAlt"] = other["caption"]
+                        tmpOtherCases.append(tmpOtherCase)
+                    x["OtherStylePortfolio"]= tmpOtherCases """
+
+        # print(x)
+
+        # print(jData)
+        """ if not os.path.exists(hhhMBPath):
+            os.mkdir(hhhMBPath)
+        with open(hhhMBPath+'/json/cases-' + id + '.json', 'w', encoding='utf-8') as f:
+            json.dump(jData, f, ensure_ascii=False, indent=4) """
+
+        return jData
+
+@app.get("/gendesigner")
+def gendesigner(id: str = "447", sort: str = "new", page: str = "1"):
+
+    with dataset.connect(connstr) as db:
+        jData = json.load(open(hhhMBPath+'/json/designers.json', encoding='utf8'))
+
+        records = db.query("""SELECT * FROM _hdesigner d
+    WHERE d.hdesigner_id = '""" + id + """' AND d.onoff='1' """)
+
+        # print(jData)
+        for x in jData:
+            tmpCaseDetail = []
+            icount = 0
+            for c in records:
+                icount += 1
+                # tmpCaseDetail.append({"CaseDetailImg":c["cimg"]})
+
+            if page == "1":
+                x["id"] = c["hdesigner_id"]
+                x["BannerImg"] = c["background"]
+                x["CompanyName"] = c["title"]
+                x["DesignerName"] = c["name"]
+                x["Designerimg"] = c["img_path"]
+                x["Description"] = c["seo"]
+                x["Approve"] = c["position"]
+                x["FB_link"] = c["fbpageurl"]
+                x["Basics"] = [
+                    {"title": "免費專線:",
+                        "link": c["service_phone"], "data": c["service_phone"]},
+                    {"title": "諮詢專線:", "link": c["phone"], "data": c["phone"]},
+                    {"title": "諮詢專線:", "link": c["phone"], "data": c["phone"]},
+                    {"title": "公司傳真:", "link": c["fax"], "data": c["fax"]},
+                    {"title": "公司地址:", "link": c["address"], "data": c["address"]},
+                    {"title": "電子信箱:", "link": c["mail"], "data": c["mail"]},
+                    {"title": "公司網址:", "link": c["website"], "data": c["website"]}
+                ]
+                x["FreeCall"] = c["service_phone"]
+                x["ConsoleCall_1"] = c["phone"]
+                x["ConsoleCall_2"] = c["phone"]
+                x["Fax"] = c["fax"]
+                x["Address"] = c["address"]
+                x["Email"] = c["mail"]
+                x["Web"] = c["website"]
+                
+                x["Branches"] = []
+                branches = db.query("""SELECT * FROM designer_branch br 
+    WHERE br.designer_id = '""" + id + """' """)
+                
+                for branch in branches:
+                    tmpobj = {
+                        "title": branch["title"],
+                        "address": branch["address"],
+                        "tel": branch["tel"],
+                        "fax": branch["fax"]
+                    }
+                    x["Branches"].append(tmpobj)
+                
+                x["Budget"] = c["budget"]
+                x["Square"] = c["area"]
+                x["SpecialCase"] = c["special"]
+                x["Charge"] = c["charge"]
+                x["Pay"] = c["payment"]
+                x["WorkLoc"] = c["region"]
+                x["WorkType"] = c["type"]
+                x["WorkStyle"] = c["style"]
+                x["WorkBudget"] = c["budget"]
+                x["Terms"] = [
+                    {"title": "接案預算:", "data": c["budget"]},
+                    {"title": "接案坪數:", "data": c["area"]},
+                    {"title": "特殊接案:", "data": c["special"]},
+                    {"title": "收費方式:", "data": c["charge"]},
+                    {"title": "付費方式:", "data": c["payment"]},
+                    {"title": "接案區域:", "data": c["region"]},
+                    {"title": "接案類型:", "data": c["type"]},
+                    {"title": "接案風格:", "data": c["style"]}
+                ]
+                x["scMedia"] = [
+                    {"name": "Facebook", "img": "https://hhh.com.tw/assets/images/rv_web/fb.svg",
+                        "link": c["fbpageurl"]},
+                    {"name": "Line", "img": "https://hhh.com.tw/assets/images/rv_web/line.svg",
+                        "link": c["line_link"]},
+                    {"name": "Wechat", "img": "https://hhh.com.tw/assets/images/rv_web/wechat.svg",
+                        "link": c["fbpageurl"]},
+                    {"name": "email", "img": "https://hhh.com.tw/assets/images/rv_web/share.svg",
+                        "link": c["mail"]},
+                    {"name": "Like", "img": "https://hhh.com.tw/assets/images/rv_web/like-o.svg", "link": ""}
+                ]
+                x["Content"] = [
+                    {
+                        "Title": "設計師作品",
+                        "mb_title": "作品",
+                        "Tabtag": "intro",
+                        "Display_mb": "true",
+                        "isActive": "true",
+                        "Carddata": []
+                    },
+                    {
+                        "Title": "設計師影音",
+                        "mb_title": "影音",
+                        "Tabtag": "video",
+                        "Display_mb": "true",
+                        "isActive": "true",
+                        "Carddata": []
+                    },
+                    {
+                        "Title": "設計師專欄",
+                        "mb_title": "專欄",
+                        "Tabtag": "columns",
+                        "Display_mb": "true",
+                        "isActive": "true",
+                        "Carddata": []
+                    },
+                    {
+                        "Title": "VR360",
+                        "mb_title": "",
+                        "Tabtag": "vr360",
+                        "Display_mb": "false",
+                        "isActive": "true",
+                        "Carddata": []
+                    },
+                    {
+                        "Title": "設計師公司簡介",
+                        "mb_title": "公司簡介",
+                        "Tabtag": "company",
+                        "Display_mb": "true",
+                        "isActive": "true",
+                        "Carddata": [],
+                        "info": [
+                            {"title": "設計理念", "data": c["idea"]},
+                            {"title": "公司統編", "data": c["taxid"]},
+                            {"title": "相關經歷", "data": c["career"]},
+                            {"title": "專業證照", "data": c["license"]},
+                            {"title": "獲獎紀錄", "data": c["awards"]}
+                        ]
+                    }
+                ]
+
+            # 設計師作品
+            x["Content"][0]["Carddata"] = []
+            cases = db.query("""SELECT tag,cover,caption,hcase_id,viewed,sdate FROM _hcase c
+    WHERE c.hdesigner_id = '""" + id + """' AND c.onoff='1' 
+    ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+    LIMIT """ + str((int(page) - 1)*12) + """,12
+    """)
+
+            for case in cases:
+                tmpobj = {
+                    "url": "https://hhh.com.tw/cases/detail/d/"+str(case["hcase_id"]),
+                    "imgURL": case["cover"],
+                    "title": case["caption"],
+                    "tag": [{"name": tag, "link": ""} for tag in case["tag"].split(',')],
+                    "views": case["viewed"],
+                    "dateSort": str(case["sdate"])
+                }
+                x["Content"][0]["Carddata"].append(tmpobj)
+
+            # 設計師影音
+            # https://i.ytimg.com/vi/y6VmaLC7O9Y/hqdefault.jpg
+            x["Content"][1]["Carddata"] = []
+            videos = db.query("""SELECT tag_vpattern,iframe,title,hvideo_id,viewed,display_datetime FROM _hvideo v
+    WHERE v.hdesigner_id = '""" + id + """' AND display_datetime < NOW() 
+    ORDER BY """ + ("display_datetime" if sort == 'new' else 'viewed') + """ DESC
+    LIMIT """ + str((int(page) - 1)*12) + """,12
+    """)
+
+            for video in videos:
+                tmpobj = {
+                    "url": "https://hhh.com.tw/video-post.php?id="+str(video['hvideo_id']),
+                    "imgURL": "https://i.ytimg.com/vi/" + extract.video_id(str(video['iframe']))+"/hqdefault.jpg",
+                    "title": video["title"],
+                    "tag": [{"name": tag, "link": ""} for tag in video["tag_vpattern"].split(',')],
+                    "views": video["viewed"],
+                    "dateSort": str(video["display_datetime"])
+                }
+                x["Content"][1]["Carddata"].append(tmpobj)
+
+            # 設計師專欄
+            x["Content"][2]["Carddata"] = []
+            columns = db.query("""SELECT tag,clogo,ctitle,hcolumn_id,viewed,sdate FROM _hcolumn c
+    WHERE onoff=1 AND (hdesigner_ids LIKE '""" + id + """,%' OR hdesigner_ids LIKE '%,""" + id + """,%' OR hdesigner_ids LIKE '%,""" + id + """' OR hdesigner_ids = '""" + id + """') 
+    ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+    LIMIT """ + str((int(page) - 1)*12) + """,12
+    """)
+
+            for column in columns:
+                tmpobj = {
+                    "url": "https://hhh.com.tw/video-post.php?id="+str(video['hvideo_id']),
+                    "imgURL": column['clogo'],
+                    "title": column["ctitle"],
+                    "tag": [] if not column["tag"] else [{"name": tag, "link": ""} for tag in column["tag"].split(',')],
+                    "views": column["viewed"],
+                    "dateSort": str(column["sdate"])
+                }
+                x["Content"][2]["Carddata"].append(tmpobj)
+
+            # VR360
+            x["Content"][3]["Carddata"] = []
+            cases = db.query("""SELECT tag,cover,caption,hcase_id,viewed,sdate FROM _hcase c
+    WHERE c.hdesigner_id = '""" + id + """' and istaging != '' AND c.onoff='1' 
+    ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+    LIMIT """ + str((int(page) - 1)*12) + """,12
+    """)
+
+            for case in cases:
+                tmpobj = {
+                    "url": "https://hhh.com.tw/cases/detail/d/"+str(case["hcase_id"]),
+                    "imgURL": case["cover"],
+                    "title": case["caption"],
+                    "tag": [{"name": tag, "link": ""} for tag in case["tag"].split(',')],
+                    "views": case["viewed"],
+                    "dateSort": str(case["sdate"])
+                }
+                x["Content"][3]["Carddata"].append(tmpobj)
+
+            # 設計公司簡介
+            #x["Content"][4]["Carddata"] = []
+            #cases = db.query("")
+
+            """ for case in cases:
+                tmpobj = {
+                    "imgURL":case["cover"],
+                    "title":case["caption"],
+                    "tag":[{"name": tag, "link": ""} for tag in case["tag"].split(',')],
+                    "views":case["viewed"],
+                    "dateSort":str(case["sdate"])
+                    }
+                x["Content"][4]["Carddata"].append(tmpobj) """
+
+        # print(x)
+
+        # print(jData)
+        """ if not os.path.exists(hhhMBPath):
+            os.mkdir(hhhMBPath)
+        with open(hhhMBPath+'/json/designers-' + id + '.json', 'w', encoding='utf-8') as f:
+            json.dump(jData, f, ensure_ascii=False, indent=4) """
+
+        return jData
+
+@app.get("/gencolumn")
+def gencolumn(id: str = "6392", sort: str = "new", page: str="1"):
+
+    with dataset.connect(connstr) as db:
+        jData = json.load(open(hhhMBPath+'/json/Columns.json', encoding='utf8'))
+
+        records = db.query("""SELECT * FROM _hcolumn c
+    WHERE c.hcolumn_id = '""" + id + """'  AND c.onoff='1' """)
+
+        #print(id)
+        for x in jData:
+            icount = 0
+            c = None
+            for c in records:
+                icount += 1
+                if c != None:
+                    x["Columnsid"] = str(c["hcolumn_id"])
+                    x["Columnstitle"] = c["ctitle"]
+                    x["ColumnsCoverImg"] = c["clogo"]
+                    x["ColumnsDate"] = str(c["sdate"])
+                    x["ColumnsViews"] = str(c["viewed"])
+                    if page == "1":
+                        x["ColumnsContent"] = c["page_content"]
+                    tmpTags = []
+                    for tag in c["ctag"].split(','):
+                        tmpTags.append({"Tag": tag})
+                    x["ColumnsTag"] = tmpTags
+                    x["author_inf"] = c["extend_str"]
+                    
+                    #相同類別的最新12筆
+                    sql = """SELECT * FROM _hcolumn c
+            WHERE (c.ctype like '%""" + str(c["ctype"]) + """%' and c.ctype_sub like '%""" + str(c["ctype_sub"]) + """%') and hcolumn_id <> '""" + str(c["hcolumn_id"]) + """' and sdate < now()  AND c.onoff='1'
+            ORDER BY """ + ("sdate" if sort == 'new' else 'viewed') + """ DESC
+            LIMIT """ + str((int(page) - 1)*12) + """,12
+            """
+                    ctypes = db.query(sql)
+                    tmpOtherCols = []
+                    for other in ctypes:
+                        tmpOtherCol = {}
+                        tmpOtherCol["Columnsid"] = str(other["hcolumn_id"])
+                        tmpOtherCol["ColumnsCoverImg"] = other["clogo"]
+                        tmpOtherCol["Views"] = other["viewed"]
+                        tmpOtherCol["Columnstitle"] = other["ctitle"]
+                        tmpTags = []
+                        for tag in other["ctag"].split(','):
+                            tmpTags.append({"Tag": tag})
+                        tmpOtherCol["ColumnsTag"] = tmpTags
+                        tmpOtherCols.append(tmpOtherCol)
+                    x["OtherColumns"] = tmpOtherCols
+            
+        #print(x)
+
+        # print(jData)
+        """ if not os.path.exists(hhhMBPath):
+            os.mkdir(hhhMBPath)
+        with open(hhhMBPath+'/json/Columns-' + id + '.json', 'w', encoding='utf-8') as f:
+            json.dump(jData, f, ensure_ascii=False, indent=4) """
+
+        return jData
+
+
+@app.get("/getColumnAds")
+def getColumnAds():
+    with dataset.connect(connstr) as db:
+        ads = []
+        
+        records = db.query("""SELECT adlogo_mobile imgUrl, adlogo DimgUrl, adhref link
+    FROM _had hh
+    WHERE adtype LIKE '專欄首大%'
+    AND hh.onoff='1' 
+    and NOW() BETWEEN start_time AND end_time
+    ORDER BY cast(SUBSTR(adtype, 4) AS DECIMAL) """)
+        
+        """ for x in records:
+            ads.append(x) """
+
+        ads.extend(records)
+        rData = json.loads(json.dumps(ads))      
+        #print(json.dumps(ads))
+        return rData
+        
+    
+
+#print(getColumnAds())
+
 """ if __name__ == "__main__":
     uvicorn.run(app, host="0.0.0.0", port=8000) """

+ 188 - 0
hhh-home-mb/json/Columns.json

@@ -0,0 +1,188 @@
+[
+    {
+        "Columnsid":"6392",
+        "Columnstitle":"烤漆玻璃、噴砂玻璃、強化玻璃…玻璃種類比你想得還多!選對類型節能、省電、隔音又美觀",
+        "ColumnsCoverImg":"https://m.hhh.com.tw/upload/_hcolumn/content_20220125163555_0.jpg",
+        "ColumnsDate":"2021-12-30",
+        "ColumnsViews":"49",
+        "ColumnsContent":"",
+        "author_inf": "", 
+        "ColumnsTag":[
+            {
+                "Tag":"玻璃"
+
+            },
+            {
+                "Tag":"烤漆玻璃"
+            },
+            {
+                "Tag":"噴砂玻璃"
+            },
+            {
+                "Tag":"強化玻璃"
+            },
+            {
+                "Tag":"琉璃"
+            },
+            {
+                "Tag":"節能玻璃"
+            },
+            {
+                "Tag":"清玻璃"
+            },
+            {
+                "Tag":"安全玻璃"
+            },
+            {
+                "Tag":"夾絲玻璃"
+            },
+            {
+                "Tag":"膠合玻璃"
+            },
+            {
+                "Tag":"熱反射玻璃"
+            },
+            {
+                "Tag":"建材"
+            }
+        ],
+
+        "OtherColumns":[
+            {
+                "Columnsid":"6392",
+                "Views":1000,
+                "ColumnsCoverImg": "https://cloud.hhh.com.tw/upload/_hcolumn/content_20220113101218_0.jpg",
+                "Columnstitle":"擁擠小宅變身會呼吸的家!頂級日系廚具、珊瑚塗料演繹機能美學",
+                "ColumnsTag":[
+                    {
+                        "Tag":"伸達"
+                    },
+                    {
+                        "Tag":"廚具"
+                    },
+                    {
+                        "Tag":"無毒"
+                    },
+                    {
+                        "Tag":"竹桓"
+                    },
+                    {
+                        "Tag":"塗料"
+                    }
+                ]
+            },
+            {
+                "Columnsid":"6384",
+                "Views":1000,
+                "ColumnsCoverImg": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point03_99_02-1.jpg",
+                "Columnstitle":" 石英磚、文化石磚、馬賽克磚.....等磁磚是怎麼製作的?裝修前簡單了解它們的身世吧!",
+                "ColumnsTag":[
+                    {
+                        "Tag":"建材"
+                    },
+                    {
+                        "Tag":"磁磚"
+                    },
+                    {
+                        "Tag":"馬賽克磚"
+                    },
+                    {
+                        "Tag":"玻化磚"
+                    },
+                    {
+                        "Tag":"文化石"
+                    }
+                ]
+            },
+            {
+                "Columnsid":"6368",
+                "Views":1000,
+                "ColumnsCoverImg": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point03_98_03.jpg",
+                "Columnstitle":"十分鐘快速了解磁磚種類、尺寸、機能、挑選方法!",
+                "ColumnsTag":[
+                    {
+                        "Tag":"磁磚"
+                    },
+                    {
+                        "Tag":"挑選"
+                    },
+                    {
+                        "Tag":"現代風"
+                    },
+                    {
+                        "Tag":"北歐風"
+                    },
+                    {
+                        "Tag":"鄉村風"
+                    }
+                ]
+            },   
+            {
+                "Columnsid":"6325",
+                "Views":1000,
+                "ColumnsCoverImg": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point03_92_01.jpg",
+                "Columnstitle":"【跟動物一起住】有毛小孩的家,空間建材這樣挑",
+                "ColumnsTag":[
+                    {
+                        "Tag":"建材"
+                    },
+                    {
+                        "Tag":"寵物"
+                    },
+                    {
+                        "Tag":"地板"
+                    },
+                    {
+                        "Tag":"家具"
+                    }
+                ]
+            },
+            {
+                "Columnsid":"6298",
+                "Views":1000,
+                "ColumnsCoverImg": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point03_88_06.jpg",
+                "Columnstitle":"【建材知識】超耐磨木地板、PVC塑膠地板、SPC石塑地板?優缺一次看!",
+                "ColumnsTag":[
+                    {
+                        "Tag":"建材知識"
+                    },
+                    {
+                        "Tag":"超耐磨木地板"
+                    },
+                    {
+                        "Tag":"PVC塑膠地板"
+                    },
+                    {
+                        "Tag":"SPC石塑地板"
+                    },
+                    {
+                        "Tag":"木地板"
+                    }
+                ]
+            },   
+            {
+                "Columnsid":"6294",
+                "Views":1000,
+                "ColumnsCoverImg": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point03_86_01.jpg",
+                "Columnstitle":"想自己做木工DIY?那你一定要認識實木、集成材與三合板!",
+                "ColumnsTag":[
+                    {
+                        "Tag":"木工"
+                    },
+                    {
+                        "Tag":"diy"
+                    },
+                    {
+                        "Tag":"實木"
+                    },
+                    {
+                        "Tag":"集成材"
+                    },
+                    {
+                        "Tag":"三合板"
+                    }
+                ]
+            }
+        ]
+    }
+]

+ 137 - 0
hhh-home-mb/json/cases.json

@@ -0,0 +1,137 @@
+[
+    {
+        "CaseId":"",
+        "Casetitle":"一生一世|工業風|25坪",
+        "CaseTeamName":"Otis設計團隊",
+        "CaseCompany":"歐提系統家具有限公司",
+        "CaseCompanyAddress":"新竹市東區建中一路20號1樓",
+        "CaseCompanyMap":"http://maps.google.com.tw/maps?q=%E6%96%B0%E7%AB%B9%E5%B8%82%E6%9D%B1%E5%8D%80%E5%BB%BA%E4%B8%AD%E4%B8%80%E8%B7%AF20%E8%99%9F1%E6%A8%93",
+        "CaseCompanyTel":"03-5748866",
+        "CaseCompanyEmail":"eggerboard@gmail.com",
+        "CaseCompanyWeb":"https://www.otis-design.com",
+        "CaseDate":"2021-12-30",
+        "CaseViews":"49",
+        "CaseCoverImg":"https://cloud.hhh.com.tw/upload/_hcase_img/name_14151_20211230150533.jpg",
+        "CaseImgAmount":"8",
+        "CaseStyle":"工業風",
+        "CaseHouse":"三房、兩廳、兩衛",
+        "CaseSize":"25坪",
+        "CaseProject":"尚未提供",
+        "CaseDataMember":"大人x2",
+        "CaseDataSize":"25坪",
+        "CaseDataStyle":"工業風、暗色系流淌工業風",
+        "CaseDataType":"標準格局",
+        "CaseDataSituation":"新成屋",
+        "CaseDataImgProvide":"歐提系統家具有限公司",
+        "CaseDataSpace":"3房、2廳、2衛",
+        "CaseDataMaterial":"系統櫃、軌道燈、樂土灰泥、超耐磨木地板、吊扇、單車架",
+        "ContactFreeTel":"0809-000-123#26526",
+        "ContactDesignerImg":"https://m.hhh.com.tw/upload/_hdesigner/img_path_779_20211230102606.jpg",
+        "CasePageLink":"",
+        "CasePageprev":"",
+        "CaseTag":[
+            {
+                "Tag":"工業風",
+                "TagLink":""
+
+            },
+            {
+                "Tag":"新成屋",
+                "TagLink":""
+            },
+            {
+                "Tag":"大坪數",
+                "TagLink":""
+            }
+        ],
+        "DesignerProfile":[
+            {
+                "designerid":"",
+                "casesid":"",
+                "Views":1000,
+                "ProfileImg": "https://cloud.hhh.com.tw/upload/_hcase_img_orig/name_14155_20211230151618.jpg",
+                "ProfileTag":[
+                    {
+                        "Tag":"工業風",
+                        "TagLink":""
+                    },
+                    {
+                        "Tag":"新成屋",
+                        "TagLink":""
+                    },
+                    {
+                        "Tag":"標準格局",
+                        "TagLink":""
+                    }
+                ],
+                "ProfileLink":""
+            },
+            {
+                "designerid":"",
+                "casesid":"",
+                "Views":1000,
+                "ProfileImg": "https://cloud.hhh.com.tw/upload/_hcase_img_orig/name_14154_20211230151111.jpg",
+                "ProfileTag":[
+                    {
+                        "Tag":"北歐風",
+                        "TagLink":""
+                    },
+                    {
+                        "Tag":"新成屋",
+                        "TagLink":""
+                    },
+                    {
+                        "Tag":"大坪數",
+                        "TagLink":""
+                    }
+                ],
+                "ProfileLink":""
+            }
+        ],
+    
+        "StyleProfile":[
+            {
+                "designerid":"",
+                "casesid":"",
+                "Views":1000,
+                "ProfileImg": "https://cloud.hhh.com.tw/upload/_hcase_img_orig/name_14155_20211230151618.jpg",
+                "ProfileTag":[
+                    {
+                        "Tag":"工業風",
+                        "TagLink":""
+                    },
+                    {
+                        "Tag":"新成屋",
+                        "TagLink":""
+                    },
+                    {
+                        "Tag":"標準格局",
+                        "TagLink":""
+                    }
+                ],
+                "ProfileLink":""
+            },
+            {
+                "designerid":"",
+                "casesid":"",
+                "Views":1000,
+                "ProfileImg": "https://cloud.hhh.com.tw/upload/_hcase_img_orig/name_14154_20211230151111.jpg",
+                "ProfileTag":[
+                    {
+                        "Tag":"北歐風",
+                        "TagLink":""
+                    },
+                    {
+                        "Tag":"新成屋",
+                        "TagLink":""
+                    },
+                    {
+                        "Tag":"大坪數",
+                        "TagLink":""
+                    }
+                ],
+                "ProfileLink":""
+            }
+        ]
+    }
+]

+ 388 - 0
hhh-home-mb/json/designers.json

@@ -0,0 +1,388 @@
+[
+  {
+      "_comment": "設計師",
+      "id": 0,
+      "BannerImg": "https://cloud.hhh.com.tw/upload/_hdesigner/background_769_20211122142507.jpg",
+      "CompanyName": "恆岳空間設計",
+      "DesignerName": "蔡岳儒",
+      "Designerimg": "https://cloud.hhh.com.tw/gs/designer/designer494_00.jpg",
+      "Description": "恆岳空間設計|蔡岳儒 室內設計師,為台北老屋翻新好評推薦的室內設計師, 將老屋妙手回春成現代風小豪宅,亦擅長置入日式精闢手工藝術融入室內空間設計中。",
+      "Approve": "★老屋翻新‧住宅改造",
+      "Basics": [
+        {"title": "免費專線:", "link": "tel:0809-000-123#18890", "data": "0809-000-123#18890"},
+        {"title": "諮詢專線:", "link": "tel:02-2562-7755", "data": "02-2562-7755"},
+        {"title": "諮詢專線:", "link": "tel:0937-070-794", "data": "0937-070-794"},
+        {"title": "公司傳真:", "link": "tel:02-2562-7002", "data": "02-2562-7002"},
+        {"title": "公司地址:", "link": "台北市中山區林森北路50號4樓之一", "data": "台北市中山區林森北路50號4樓之一"},
+        {"title": "電子信箱:", "link": "mailto:hengyuehdesign@gmail.com,gakuju@gmail.com", "data": "hengyuehdesign@gmail.com,gakuju@gmail.com"},
+        {"title": "公司網址:", "link": "https://www.star-interiordesign.com", "data": "https://www.star-interiordesign.com"}
+      ],
+      "FreeCall": "0809-000-123#18890",
+      "ConsoleCall_1": "02-2562-7755",
+      "ConsoleCall_2": "0937-070-794",
+      "Fax": "02-2562-7002",
+      "Address": "台北市中山區林森北路50號4樓之一",
+      "Email": "hengyuehdesign@gmail.com,gakuju@gmail.com",
+      "Web": "https://www.star-interiordesign.com",
+      "Branches": [
+        {"title": "分公司地址:", "link": "台北市中山區林森北路50號4樓之一", "data": "台北市中山區林森北路50號4樓之一"},
+        {"title": "分公司電話:", "link": "tel:02-2562-7755", "data": "02-2562-7755"},
+        {"title": "分公司傳真:", "link": "tel:02-2562-7002", "data": "02-2562-7002"},
+        {"title": "分公司地址:", "link": "上海市闵行区东川路2688号", "data": "上海市闵行区东川路2688号"}
+      ],
+      "Budget": "不限",
+      "Square": "不限",
+      "SpecialCase": "不限",
+      "Charge": "請來電洽詢 / 【丈量費】NT$5,000元(透天別墅另計) *此費用含實地丈量、需求訪談、初步平面配置與風格提案 *以上費用於簽設計合約時,可全額折抵",
+      "Pay": "簽約付30%、依工程進度分兩次,各付30%、完工驗收收10%",
+      "WorkLoc": "北區,中區,南區,大陸",
+      "WorkType": "小坪數,標準格局,別墅,大坪數,樓中樓,商業空間,工作空間,餐飲空間,民宿旅館,公共空間",
+      "WorkStyle": "現代風,鄉村風,古典風,休閒多元,美式風,奢華風,新古典,日式禪風,東方風,混搭風,前衛風,北歐風,工業風,異國風",
+      "WorkBudget": "100萬以上",
+      "Terms": [
+        {"title": "接案預算:", "data": "不限"},
+        {"title": "接案坪數:", "data": "不限"},
+        {"title": "特殊接案:", "data": "不限"},
+        {"title": "收費方式:", "data": "請來電洽詢 / 【丈量費】NT$5,000元(透天別墅另計) *此費用含實地丈量、需求訪談、初步平面配置與風格提案 *以上費用於簽設計合約時,可全額折抵"},
+        {"title": "付費方式:", "data": "簽約付30%、依工程進度分兩次,各付30%、完工驗收收10%"},
+        {"title": "接案區域:", "data": "北區,中區,南區,大陸"},
+        {"title": "接案類型:", "data": "小坪數,標準格局,別墅,大坪數,樓中樓,商業空間,工作空間,餐飲空間,民宿旅館,公共空間"},
+        {"title": "接案風格:", "data": "現代風,鄉村風,古典風,休閒多元,美式風,奢華風,新古典,日式禪風,東方風,混搭風,前衛風,北歐風,工業風,異國風"}
+      ],
+      "scMedia": [
+        {"name": "Facebook","img": "https://hhh.com.tw/assets/images/rv_web/fb.svg", "link": "https://www.facebook.com/Sdesign2018"},
+        {"name": "Line","img": "https://hhh.com.tw/assets/images/rv_web/line.svg", "link": "https://www.facebook.com/Sdesign2018"},
+        {"name": "Wechat","img": "https://hhh.com.tw/assets/images/rv_web/wechat.svg", "link": "https://www.facebook.com/Sdesign2018"},
+        {"name": "email","img": "https://hhh.com.tw/assets/images/rv_web/share.svg", "link": "https://www.facebook.com/Sdesign2018"},
+        {"name": "Like","img": "https://hhh.com.tw/assets/images/rv_web/like-o.svg", "link": ""}
+      ],
+      "Content": [
+        {
+          "Title": "設計師作品",
+          "mb_title": "作品",
+          "Tabtag": "intro",
+          "Display_mb": true,
+          "isActive": true,
+          "Carddata": [
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│999坪",
+              "tags": [
+                {
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 999,
+              "dateSort": 1
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│1030坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 1030,
+              "dateSort": 2
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 1011,
+              "dateSort": 3
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 990,
+              "dateSort": 4
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 899,
+              "dateSort": 5
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 800,
+              "dateSort": 6
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 950,
+              "dateSort": 7
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 920,
+              "dateSort": 8
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 940,
+              "dateSort": 9
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 970,
+              "dateSort": 10
+            },
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ],
+              "views": 985,
+              "dateSort": 11
+            }
+          ]
+        },
+        {
+          "Title": "設計師影音",
+          "mb_title": "影音",
+          "Tabtag": "video",
+          "Display_mb": true,
+          "isActive": true,
+          "Carddata": [
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "Title": "設計師專欄",
+          "mb_title": "專欄",
+          "Tabtag": "columns",
+          "Display_mb": true,
+          "isActive": true,
+          "Carddata": [
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "Title": "VR360",
+          "mb_title": "",
+          "Tabtag": "vr360",
+          "Display_mb": false,
+          "isActive": true,
+          "Carddata": [
+            { 
+              "imgURL": "https://images.hhh.com.tw/uploads/_hcase_orig/designer494_39_05.jpg",
+              "title": "藏岳│混搭風│26坪",
+              "tags": [
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                { 
+                  "name": "混搭風",
+                  "link": ""
+                },
+                {
+                  "name": "混搭風",
+                  "link": ""
+                }
+              ]
+            }
+          ]
+        },
+        {
+          "Title": "設計師公司簡介",
+          "mb_title": "公司簡介",
+          "Tabtag": "company",
+          "Display_mb": true,
+          "isActive": true,
+          "Carddata": [
+          ],
+          "info": [
+            { "title": "設計理念", "data": "空間設計的美學藝術,蔡岳儒總監更能將日式精闢的手工藝術融入台灣的設計與工程,更將留日所學發揚光大明確的把結構、 動線、收納、光線與品味融入建築、景觀與室內三大空間之中,藉由點線面展現出空間的獨特性,並賦予空間延續的生命活力。"},
+            { "title": "公司統編", "data": "經濟部/財政部登記有案:54290717"},
+            { "title": "相關經歷", "data": "蔡岳儒<br>◆現任/恆岳空間設計 主持設計師<br>◆學歷/東京デザイナー学院卒業<br>◆經歷/十餘年設計、工程經歷。"},
+            { "title": "專業證照", "data": "建築師證書 高恒悌 (101) 專高建字第000013號<br>建築物室內裝修專業技術人員登記證 高恒悌 第40EC116787號"},
+            { "title": "獲獎紀錄", "data": "2020年雪梨設計獎SYDNEY Design Awards GIOD-Quality Arena<br>2020年雪梨設計獎SYDNEY Design Awards SELECTION- Life Savoring"}
+          ]
+        }
+      ]
+  }
+]

+ 327 - 207
hhh-home-mb/json/realtime.json

@@ -4,83 +4,82 @@
         "id": 0,
         "block": "topCarousel",
         "data": [
-            {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15664_1619582521.jpg",
-                "link": "https://hhh.com.tw/designer-index.php?designer_id=23",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15664_1619582509.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15664_1619582537.webp"
-            },
             {
                 "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15672_1605260703.jpg",
                 "link": "https://hhh.com.tw/designer-index.php?designer_id=28",
                 "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15672_1605260690.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15672_1605260747.webp"
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15672_1605260747.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15672_1605260741.webp"
             },
             {
                 "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15662_1607045625.jpg",
                 "link": "https://hhh.com.tw/designer-index.php?designer_id=447",
                 "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15662_1607045611.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15662_1607045687.webp"
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15662_1607045687.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15662_1607045683.webp"
             },
             {
                 "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15673_1603096869.jpg",
                 "link": "https://hhh.com.tw/designer-index.php?designer_id=31",
                 "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15673_1603096869.jpg",
-                "webp": ""
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15673_1603096869.jpg.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15673_1603855335.webp"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16076_1625209654.jpg",
-                "link": "https://hhh.com.tw/designers/cases/586/1-page/new-sort/",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16076_1625209580.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16076_1625209663.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16230_1640843333.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6381/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16230_1640843326.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16230_1640843342.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16230_1640843339.webp"
             },
             {
                 "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15666_1627961097.jpg",
                 "link": "https://hhh.com.tw/designer-index.php?designer_id=32",
                 "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15666_1627961071.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15666_1627961107.webp"
-            },
-            {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16002_1617866880.jpg",
-                "link": "https://hhh.com.tw/brand-index.php?brand_id=202",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16002_1617866862.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16002_1617866888.webp"
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15666_1627961107.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15666_1627961102.webp"
             },
             {
                 "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16051_1623138395.png",
                 "link": "https://hhh.com.tw/designers/cases/33/1-page/new-sort/",
                 "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16051_1623138372.png",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16051_1623141226.png"
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16051_1634264137.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16051_1634264092.webp"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16108_1628669736.jpg",
-                "link": "https://hhh.com.tw/designers/cases/452/1-page/new-sort/",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16108_1628669721.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16108_1628669767.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16399_1655366849.jpg",
+                "link": "https://hhh.com.tw/designers/cases/770/1-page/new-sort/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16399_1655366832.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16399_1655366865.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16399_1655366858.jpg"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16115_1629356235.png",
-                "link": "https://hhh.com.tw/designers/cases/438/1-page/new-sort/",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16115_1629356225.png",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16115_1629356246.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16368_1652347634.jpg",
+                "link": "https://xn--fhqx1vv5q4mv.com/?gclid=CjwKCAjwur-SBhB6EiwA5sKtjnrA_r6SDLh-ANtnAosGO7_twyyPIfFaVXksA_1s4Q4D_bIRXUDyUxoC9ooQAvD_BwE",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16368_1652347617.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16368_1652347652.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16368_1652347645.jpg"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16138_1631259916.jpg",
-                "link": "https://hhh.com.tw/designers/cases/182/1-page/new-sort/",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16138_1631259909.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16138_1631259938.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16212_1639015666.png",
+                "link": "http://click.world.taobao.com/QVf",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16212_1639015655.png",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16212_1639015681.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16212_1639015675.webp"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16139_1631597917.jpg",
-                "link": "https://hhh.com.tw/columns/detail/6072/",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16139_1631597907.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16139_1631597927.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16406_1655692928.jpg",
+                "link": "https://hhh.com.tw/designers/cases/23/1-page/new-sort/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16406_1655692913.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16406_1655692952.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16406_1655692939.jpg"
             },
             {
                 "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16107_1628644159.jpg",
                 "link": "https://hhh.com.tw/deco/",
                 "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16107_1628644143.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16107_1628644166.webp"
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16107_1628644166.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16107_1628644163.webp"
             }
         ]
     },
@@ -93,78 +92,69 @@
                 "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15660_1604643433.jpg",
                 "link": "https://hhh.com.tw/designer-index.php?designer_id=28",
                 "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15660_1604643425.jpg",
-                "webp": ""
-            },
-            {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16057_1631764389.jpg",
-                "link": "https://hhh.com.tw/columns/detail/4290/",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16057_1631764374.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16057_1631764401.webp"
-            },
-            {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16093_1629944189.jpg",
-                "link": "https://v.hhh.com.tw/",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16093_1629944183.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16093_1629944200.webp"
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15660_1604643433.jpg.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15660_1604643440.webp"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16082_1627804898.jpg",
-                "link": "https://hhh.com.tw/topic/detail/402/",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16082_1627804906.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16082_1627804929.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16407_1655705496.jpg",
+                "link": "https://hhh.com.tw/columns/detail/5947/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16407_1655705468.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16407_1655705507.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16407_1655705501.webp"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16142_1631782259.jpg",
-                "link": "https://event.hhh.com.tw/2021-Top-Brands/page.php?id=182",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16142_1631782224.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16142_1631782273.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16400_1655367565.jpg",
+                "link": "https://event.hhh.com.tw/topglory/designer_752.html",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16400_1655367544.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16400_1655367578.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16400_1655367572.jpg"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16143_1631782091.jpg",
-                "link": "https://event.hhh.com.tw/topglory/designer_54.html",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16143_1631782085.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16143_1631782161.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16401_1655367590.jpg",
+                "link": "https://hhh.com.tw/designers/cases/55/1-page/new-sort/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16401_1655367584.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16401_1655367602.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16401_1655367596.jpg"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16140_1631782123.jpg",
-                "link": "https://event.hhh.com.tw/topglory/designer_382.html",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16140_1631782117.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16140_1631782136.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16402_1655367616.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/case.php?id=784&title=%E6%98%8A%E5%8F%B8%E8%A8%AD%E8%A8%88x%E8%8F%AF%E8%BA%8D%E5%B7%A5%E7%A8%8B",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16402_1655367622.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16402_1655367646.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16402_1655367632.jpg"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16141_1631782111.jpg",
-                "link": "https://hhh.com.tw/designers/cases/441/1-page/new-sort/",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16141_1631782101.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16141_1631782147.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16403_1655367667.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/case.php?id=312&title=%E6%B0%B4%E8%A8%AD%E5%AE%A4%E5%85%A7%E8%A8%AD%E8%A8%88%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16403_1655367656.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16403_1655367685.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16403_1655367677.jpg"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16144_1631782077.jpg",
-                "link": "https://event.hhh.com.tw/2021-Most-Favorite-Designers/case.php?id=131",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16144_1631782071.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16144_1631782178.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16404_1655367707.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/case.php?id=500&title=%E7%9F%A5%E5%9F%9F%E8%A8%AD%E8%A8%88%C3%97%E4%B8%80%E5%B7%B1%E7%A9%BA%E9%96%93%E5%88%B6%E4%BD%9C",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16404_1655367693.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16404_1655367721.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16404_1655367713.jpg"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16145_1631782064.jpg",
-                "link": "https://event.hhh.com.tw/2021-Most-Favorite-Designers/case.php?id=688",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16145_1631782040.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16145_1631782190.webp"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16405_1655367735.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/case.php?id=474&title=%E9%9B%8B%E7%AF%89%E7%A9%BA%E9%96%93%E8%A8%AD%E8%A8%88",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16405_1655367727.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16405_1655367750.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16405_1655367745.jpg"
             },
             {
                 "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16099_1627623476.jpg",
                 "link": "https://hhh.com.tw/deco/",
                 "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16099_1627623458.jpg",
-                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16099_1627623493.webp"
-            },
-            {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15781_1601366572.jpg",
-                "link": "https://hhh.com.tw/softouch",
-                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15781_1601366572.jpg",
-                "webp": ""
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16099_1627623493.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16099_1627623482.webp"
             }
         ]
     },
     {
-        "_comment": "tab區塊-最夯設計, 影音實錄, 專欄文章",
+        "_comment": "tab區塊-最夯設計, 影音實錄, 專欄文章,(txt為部分內容段落)",
         "id": 2,
         "block": "sec03",
         "data": [
@@ -172,19 +162,22 @@
                 "tab": "最夯設計",
                 "data": [
                     {
-                        "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_13759_20210917173552.jpg",
-                        "link": "https://www.hhh.com.tw/cases/detail/13759/",
-                        "description": "文居│現代美式風│95坪"
+                        "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14703_20220622183730.jpg",
+                        "link": "https://hhh.com.tw/cases/detail/14703/",
+                        "title": "愛貓獨享!透天別墅裡的小天地 混搭風格溫馨有愛│現代風",
+                        "description": ""
                     },
                     {
-                        "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_13754_20210917152545.jpg",
-                        "link": "https://www.hhh.com.tw/cases/detail/13754/",
-                        "description": "詼-鵲|現代禪風|32坪"
+                        "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14702_20220622174939.jpg",
+                        "link": "https://hhh.com.tw/cases/detail/14702/",
+                        "title": "低奢美式新古典 信任堅持成就好宅│美式新古典風│63坪",
+                        "description": ""
                     },
                     {
-                        "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_13753_20210917145902.jpg",
-                        "link": "https://www.hhh.com.tw/cases/detail/13753/",
-                        "description": "率性況味 定格靜境|工業風|28坪"
+                        "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14701_20220622155418.jpg",
+                        "link": "https://hhh.com.tw/cases/detail/14701/",
+                        "title": "全毛胚高端訂製 生活綠意藝術宅│現代風│141坪",
+                        "description": "對京璽國際而言,空間不僅僅是一種結構或形式,而是生活的延展、審美的傳達、思想的再現,是「人」的一部份。設計以人為軸心,在滿足功能的同時,周彥如設計總監亦從藝術裡吸收細膩的美學語言、從綠意中尋找自由的生活範本,將居者的情感與情緒融入環境,在擾攘不安的時代,為居者砌築一處安放靈魂、滋潤心靈的歸宿。"
                     }
                 ]
             },
@@ -192,19 +185,22 @@
                 "tab": "影音實錄",
                 "data": [
                     {
-                        "imgUrl": "https://img.youtube.com/vi/bN2cRRkke_c/hqdefault.jpg",
-                        "link": "https://www.hhh.com.tw/video-post.php?id=4184",
-                        "description": "全視屏居家辦公新體驗  沉浸感影音收視再進化"
+                        "imgUrl": "https://img.youtube.com/vi/c0wYed8ARv4/hqdefault.jpg",
+                        "link": "https://hhh.com.tw/video-post.php?id=4433",
+                        "title": "奇葩裝潢家_ep.3.mp4",
+                        "description": "這裝潢比監獄還扯!在家也能體驗坐牢的感覺|【奇葩裝潢家】Ep.3"
                     },
                     {
-                        "imgUrl": "https://img.youtube.com/vi/iW65jWwAX_s/hqdefault.jpg",
-                        "link": "https://www.hhh.com.tw/video-post.php?id=4183",
-                        "description": "雅致英式 奢華中的平靜氣度"
+                        "imgUrl": "https://img.youtube.com/vi/1ccpqRBHn8w/hqdefault.jpg",
+                        "link": "https://hhh.com.tw/video-post.php?id=4432",
+                        "title": "樂沐60秒.mp4",
+                        "description": "療癒居住者的空間貼身顧問|幸福60秒"
                     },
                     {
-                        "imgUrl": "https://img.youtube.com/vi/me4KutyUoT4/hqdefault.jpg",
-                        "link": "https://www.hhh.com.tw/video-post.php?id=4182",
-                        "description": "居家改造大公開 我的完整 因為有你|LG x Sunny 王陽明"
+                        "imgUrl": "https://img.youtube.com/vi/0Ubs-G_513M/hqdefault.jpg",
+                        "link": "https://hhh.com.tw/video-post.php?id=4431",
+                        "title": "馥築達人(士林).mp4",
+                        "description": "點線面全方位放大空間 精緻設計打造小坪數機能宅"
                     }
                 ]
             },
@@ -212,74 +208,80 @@
                 "tab": "專欄文章",
                 "data": [
                     {
-                        "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index04_474.jpg",
-                        "link": "https://www.hhh.com.tw/column/detail/6083/",
-                        "description": "【風水特輯】門對門解法?鏤空樓梯是禁忌?最實用的風水避雷指南!"
+                        "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point02_421_03.jpg",
+                        "link": "https://hhh.com.tw/columns/detail/6668/",
+                        "title": "居家綠化計畫!不出錯的3個植物佈置秘訣",
+                        "description": "你是否經常困惑,為什麼軟裝設計師用植物擺設時,總是可以妝點得恰到好處,讓室內好看又有質感?今天我們就要來揭開他們的軟裝佈置秘訣,讓居家空間與植物盆栽搭配時不再超級違和。"
                     },
                     {
-                        "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index02_283.jpg",
-                        "link": "https://www.hhh.com.tw/column/detail/6081/",
-                        "description": "化身高雅貴族 走進電影中的歐風居家!"
+                        "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point05_392_01.jpg",
+                        "link": "https://hhh.com.tw/columns/detail/6667/",
+                        "title": "日光系智慧質感訂製宅,詮釋色彩美學自「訂」義!",
+                        "description": "居家設計不僅為了美學而生,更重要的是描摹生活的輪廓。近年來,訂製宅的概念盛行,與眾不同的視覺、觸覺感受更考驗設計師的想法與創意,光舍丰計創意總監周語華在瞭解屋主喜好後,便決定以大自然為設計主軸,將大面採光、風景引入室內,使自然系的日光與色彩交疊,創造出虛實交錯的美感,而光與影的敘事鋪陳透過玻璃窗灑進室內,使整個場域氛圍都恣意從容,不需要過於繁雜的設計就能將人與空間連結,詮釋家的樣貌。"
                     },
                     {
-                        "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point02_282_01.jpg",
-                        "link": "https://www.hhh.com.tw/column/detail/6080/",
-                        "description": "【好宅開箱分享】重整格局,讓陽光走進家!超舒適北歐療癒宅開箱記"
+                        "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point04_646_01.jpg",
+                        "link": "https://hhh.com.tw/columns/detail/6666/",
+                        "title": "臥房「這樣做」可能引小三入門!4大不利夫妻感情的風水禁忌",
+                        "description": "雖說風水不是絕對,但多少有其中的道理,有些狀況最好能避則避,以下分享4種不利夫妻感情的風水情況,建議大家謹慎處理為妙。"
                     }
                 ]
             }
         ]
     },
     {
-        "_comment": "主題企劃區",
+        "_comment": "主題企劃區,(title為主題標題,description為部分內容段落)",
         "id": 3,
         "block": "sec06",
         "data": [
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer546_81_07.jpg",
-                "link": "https://www.hhh.com.tw/case/13320/detail/"
-            },
-            {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer737_03_01.jpg",
-                "link": "https://www.hhh.com.tw/case/12997/detail/"
-            },
-            {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/name_12422_20200601145042.jpg",
-                "link": "https://www.hhh.com.tw/case/12422/detail/"
+                "imgUrl": "https://m.hhh.com.tw/upload/_htopic/logo_410_20220510140600.jpg",
+                "link": "https://hhh.com.tw/topic/detail/410/",
+                "video": "false",
+                "description": "每個女人在生活中都扮演著多重角色,上班時要成為好員工、好主管或好同事,回家須扮演好媽媽、好女兒、好媳婦或好老婆,早上需處理公務,晚上需做家事,日常時光充實而忙碌。不過,再忙也別忘了抽一段時光,投入熱愛的事物中,徹底放鬆紓壓,做回真正的自己!一起跟著《幸福空間》,依循烹飪、閱讀、運動等興趣,打造一方專屬的廚房、書房、健身房……,為心靈挹注充沛能量吧!",
+                "title": "譜寫靜「女子」時光 找回快樂"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index02_241.jpg",
-                "link": "https://www.hhh.com.tw/column/5926/detail/"
+                "imgUrl": "https://m.hhh.com.tw/upload/_htopic/logo_409_20220419141654.jpg",
+                "link": "https://hhh.com.tw/topic/detail/409/",
+                "video": "false",
+                "description": "面對工作與生活的繁雜,人們總想回歸自然,享受芬多精,而自然綠意是可以「搬」進生活空間之中,為生活增添一絲愜意。透過在家中種植花草、援引綠意景緻入室,搭配原木與石料等自然質材,都能輕鬆打造療癒森林系住宅,為長時間忙於奔波的我們,帶來沉澱身心的舒爽從容。(圖片提供/格綸設計)",
+                "title": "邀綠意納景 回歸自然的空間設計"
             },
             {
-                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcolumn/clogo_5763_20210528143431.jpg",
-                "link": "https://www.hhh.com.tw/column/5763/detail/"
-            },
-            {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index01_312.jpg",
-                "link": "https://www.hhh.com.tw/column/5650/detail/"
+                "imgUrl": "https://m.hhh.com.tw/upload/_htopic/logo_408_20220302151733.jpg",
+                "link": "https://hhh.com.tw/topic/detail/408/",
+                "video": "false",
+                "description": "越來越多人,嚮往純粹簡單的「鹽系設計」,他們不設限風格,不愛複雜設計與滿滿收納櫃體,反而希望回歸生活本質,讓家裡有幾分留白,呈現溫暖清新的樣子,使家人擁有足夠活動空間,盡情放鬆、舒展身心,釋放因工作或課業積累的壓力。你也喜歡這種簡約自然的生活哲學嗎?一起跟著《幸福空間》腳步,看看設計師們如何打造會呼吸的家吧!",
+                "title": "用鹽系設計打造會呼吸的家!"
             }
         ]
     },
     {
-        "_comment": "編輯精選",
+        "_comment": "編輯精選,(txt為部分內容段落)",
         "id": 4,
         "block": "sec07",
         "data": [
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index01_356.jpg",
-                "link": "https://www.hhh.com.tw/columns/detail/6072/",
-                "description": "2022得利絕美年度色「晴空藍Bright Skies」!為空間注入清新能量,完美晴空就在身旁"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_386.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6649/",
+                "title": "同步日系生活美學 高顏質電冰箱體現下廚時光的優雅品味",
+                "video": "false",
+                "description": "現代的居家坪數,壓縮人們對傳統廚房的需求,轉而選擇開放式廚房,面對後疫情生活,人們在忙碌工作之餘,也拉長在家的時間,廚房不再只是烹煮的場所,而是凝聚一家人的生活場域,不少人嚮往將極簡日式生活型態轉譯家中,領略簡約時尚美學的優雅生活,因而選對家電顯得十分重要!"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_284.jpg",
-                "link": "https://www.hhh.com.tw/columns/detail/6076/",
-                "description": "揮別單調!超吸睛衛浴配件單品色彩學"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_395.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6652/",
+                "title": "將義式前衛奢華美學帶回家 演繹廚房高雅精品質感",
+                "video": "false",
+                "description": "將都會氛圍與細膩品味融入廚房領域,2022年Poliform最新廚具系列「Alea Pro」,以中島結合ㄇ字型廚具延伸出對稱大器的態勢;門板納入大理石紋陶瓷以及鍍鈦不鏽鋼質地,透過萬千變化的石紋結合前衛的金屬光澤,使「Alea Pro」在現代風中盡現華奢典範。而兼顧收納與設計感的牆板收納系統「Shaker」,對應倒T型油煙機與照明展示層架,皆將Poliform義式前衛美學貫徹其中。「Alea Pro」運用左右對稱手法,自廚具底櫃延伸出ㄇ字型櫥櫃配置,結合特殊加高至天花板的櫃體,型塑出豪奢氣場。藉由兩側高櫃的全隱蔽方式將廚房設備收納於內;垂直延伸而出的玻璃展示櫃在直束燈條的光源裝飾下,讓擺飾物件在不間斷的光線暈染中體現豪宅的氣派都會感,搭配嵌入式電器設備令廚房機能趨於完善。此外中島結合具備用餐功能的吧檯設計,以天然胡桃木紋的柔和溫潤與品味,進而讓廚房兼顧日常社交生活的溫暖互動。"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_283.jpg",
-                "link": "https://www.hhh.com.tw/columns/detail/6064/",
-                "description": "懶人居家必備智能神器!下班好累不想動,就交給Google Nest 智慧音箱"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_393.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6650/",
+                "title": "質感生活的最佳提案!AI風控除油煙機獨家機型限量上市",
+                "video": "false",
+                "description": "近年因疫情提升國人對健康意識的重視,廚衛居家產業領導品牌台灣櫻花升級產品推出AI風控渦輪變頻歐化除油煙機XR01,智能偵測煮食溫度,不只能自動調節最適風速,有效快速排除油煙;更增加貼心溫度提醒功能,在油溫到達最佳料理溫度時提醒消費者,避免油溫過高產生變質及大量油煙的風險,提供消費者更順暢的料理體驗之外,也營造出更健康的料理環境。"
             }
         ]
     },
@@ -289,16 +291,39 @@
         "block": "sec08",
         "data": [
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15356_1588832058.jpg",
-                "link": "https://event.hhh.com.tw/2021-Most-Favorite-Designers/?utm_source=INDEX_BANNER&adid=15356"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15356_1645425875.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/index.php",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15356_1645425865.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15356_1645425953.webp",
+                "Dwebp": ""
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16293_1652164949.jpg",
+                "link": "https://hhh.com.tw/topic/detail/410/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16293_1652164525.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16293_1652165025.jpg",
+                "Dwebp": ""
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15927_1627805018.jpg",
-                "link": "https://hhh.com.tw/topic/detail/402/"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16155_1635149999.jpg",
+                "link": "https://dawho.tw/hot/mortgage/financialloan/?utm_source=gorgeous&utm_medium=banner&utm_term=paid&utm_content=b&utm_campaign=mortgage202107#financial",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16155_1635149991.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16155_1635149999.jpg.webp",
+                "Dwebp": ""
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15984_1627623581.jpg",
+                "link": "https://hhh.com.tw/deco/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15984_1627623575.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15984_1627623581.jpg.webp",
+                "Dwebp": ""
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16106_1628489482.jpg",
-                "link": "https://c.hhh.com.tw/?utm_source=homepage&utm_medium=banner&utm_campaign=0809"
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15782_1601366873.jpg",
+                "link": "https://hhh.com.tw/softouch",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15782_1601366873.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15782_1601366873.jpg.webp",
+                "Dwebp": ""
             }
         ]
     },
@@ -308,119 +333,199 @@
         "block": "sec09",
         "data": [
             {
-                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2384_20210803162337.png",
-                "link": "https://www.hhh.com.tw/product-post.php?id=2384/",
-                "description": "Sunline 特殊型塑鋁百葉窗"
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2445_20220622151846.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2445",
+                "title": "Sunline 實木百葉窗",
+                "description": "",
+                "video": "false"
             },
             {
-                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2383_20210816182839.png",
-                "link": "https://www.hhh.com.tw/product-post.php?id=2383/",
-                "description": "Sunline 折疊門"
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2444_20220622151656.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2444",
+                "title": "Sunline戶外型全鋁製百葉窗",
+                "description": "",
+                "video": "false"
             },
             {
-                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2382_20210803161842.png",
-                "link": "https://www.hhh.com.tw/product-post.php?id=2382/",
-                "description": "Sunline 推拉門"
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2443_20220622150708.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2443",
+                "title": "美式拉桿塑鋁百葉窗",
+                "description": "",
+                "video": "false"
             },
             {
-                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2381_20210527160349.png",
-                "link": "https://www.hhh.com.tw/product-post.php?id=2381/",
-                "description": "MIT鐵桌腳"
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2442_20220622150518.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2442",
+                "title": "Sunline 澳式隱藏拉桿塑鋁百葉窗",
+                "description": "",
+                "video": "false"
             },
             {
-                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2380_20210527160130.png",
-                "link": "https://www.hhh.com.tw/product-post.php?id=2380/",
-                "description": "實木長凳"
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2441_20220622150156.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2441",
+                "title": "Sunline雙層塑鋁百葉窗",
+                "description": "",
+                "video": "false"
             },
             {
-                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2379_20210527155756.png",
-                "link": "https://www.hhh.com.tw/product-post.php?id=2379/",
-                "description": "實木小家具"
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2440_20220622150021.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2440",
+                "title": "Sunline 推拉門",
+                "description": "",
+                "video": "false"
             }
         ]
     },
     {
-        "_comment": "本週推薦",
+        "_comment": "本週推薦,(txt為部分內容段落)",
         "id": 7,
         "block": "sec10",
         "data": [
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/name_12458_20200616152204.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/12458/",
-                "description": "簡約沐光宅 暖色調營造家的恬靜溫度",
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_394.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6651",
+                "title": "製材所│採日本古老傳統工法「燒杉」打造古樸空間風情",
+                "description": "製材所南屯門市選擇使用燒杉板作為整體空間的基調,燒杉是一種源於日本的古老傳統工法,以火燒的方式進行木材的表面處理使其碳化,因為內部結構的改變,能夠增加穩定度,並且達到天然的防潮與防腐、防蟲效果。",
                 "video": "false"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/name_11965_20191231153835.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/11965/",
-                "description": "連結城市風華 坐擁浪漫夜景(上)",
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2434_20220510171016.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2434",
+                "title": "日本製洗衣機Cuble",
+                "description": "顏色:晶燦白<br>\r\n商品特點:40°C溫泡洗、低溫風乾燥、七道噴射水流、nanoeX雙效自動槽洗淨、30度溫水槽洗淨、金級省水標章、ECONAVI智慧節能科技、slim size美型設計、大投入口設計。",
                 "video": "false"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer519_26_02.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/13088/",
-                "description": "整合鄉村元素 營造日常的暖馨溫度|30坪|3+1 房、2廳、2衛",
+                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14671_20220614155432.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14671",
+                "title": "19坪北歐風小宅 消除隔牆空間超優化",
+                "description": "和諧漾彩與溫潤的木質元素,不僅共譜北歐居家愜意舒心、雋永宜人的經典樣貌,更串起年輕夫妻及男童仨人最真摯、深刻的情感悸動;20坪不到的三口之家,承載成員碩大豐盈的生活甜蜜。",
                 "video": "false"
             },
             {
-                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_13319_20210528165925.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/13319/",
-                "description": "現代日式混搭佐日光 構畫敞朗質感好生活",
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_14223_20220125101746.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14223",
+                "title": "氣質白金微奢華 精工細琢優雅宅",
+                "description": "香檳燦金於無垠雪白中閃耀瑰麗丰彩,點染奢美意境,亦在屋主心中綻放璀璨光輝。擅長多種風格的允庭室內裝修設計張舜淵設計師,此次為寵妻的屋主,於空間中揉入溫婉歐式圓弧造型、簡約線板與金色元素,創造唯美優雅的浪漫世界,讓女主人恣意優游其中,隨手拍出人人人稱羨的網美照,盡情享受如夢似幻的愜意生活。",
                 "video": "false"
             },
             {
-                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_13728_20210913165321.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/13728/",
-                "description": "微光島嶼。Dusky Island│現代風│50坪",
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2288_20201120153553.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2288",
+                "title": "休閒度假宅 活用系統櫃收納",
+                "description": "居住成員:大人×2<br>\r\n房屋坪數:約30坪<br>\r\n個案風格:休閒風<br>\r\n個案屋況:新成屋<br>\r\n空間格局:3 房 2 廳 2 衛<br>\r\n主要建材:系統櫃、木工、文化石、大理石、裱布、磚形壁板、鋁鐵件、架高木地板",
                 "video": "false"
             },
             {
-                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_13737_20210914183731.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/13737/",
-                "description": "譜出音符律動的宅邸 回家就像歌劇院|現代風|26坪",
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_13203_20210416171101.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/13203",
+                "title": "詩的生活│美式風│30坪│3房、2廳、2衛",
+                "description": "結束繁忙的一天,總渴望投奔溫馨靜謐的心靈綠洲,將壓力、疲憊暫且忘卻,切換到最放鬆的休憩模式。對於一家三口來說,原境國際室內設計邱郁雯設計師打造的美式詩境,即是如此療癒身心的存在。\r\n\r\n設計團隊以低彩度色系渲染沉穩氣韻,並透過簡約線板勾勒歐式風情,特殊拼接木地板導入溫暖質調,塑造出簡約純淨的日常容器。自然而不造作的空間,使得貓咪與人們都能盡情嶄露最真實的本性,以最舒適的樣態生活,逐光而居、各自安好,過得自由自在。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer800_05_07.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14644",
+                "title": "解放拘禁心靈 超脫狂想透天厝",
+                "description": "家是生活的容器,人們往往把對於理想住居生活的投射,烙印在日常所處的環境;有時,甚至連內心最深處的情感記憶也一覽無遺。例如本案業主,即藉由緬懷母親的真摯眷戀,化作具象的文字裝飾,豐富娛樂空間各角。細心擘劃的過程中,由里室內設計總監傅瓊慧發現,就某方面而言,娛樂存在之目的其實在救贖你我的身心靈,遂憑此概念延伸,誕生多功能休閒遊憩場域;無論是鏡面巧思、天花板霓虹燈設計,或牆面上精緻的火焰女神彩繪,皆賦予觀者充沛的正能量,教人全然沉浸熱鬧歡快的愉悅氣氛,進而放鬆舒壓。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_14545_20220517101432.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14545",
+                "title": "現代質韻 演繹沉穩淨雅大宅之風│45坪",
+                "description": "",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point05_398_00.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6661",
+                "title": "雜誌風格櫥窗,以原木家具幫街角下標",
+                "description": "走到製材所南屯門市的戶外,首先能看到製材所將三角櫥窗做成像是雜誌封面的排版風格,隨著內部展示的替換,就像是不同期數的雜誌封面一般,不僅能成為一個拍照打卡點,也藉由櫥窗上的標題向市民宣告:這真的是一間原木家具店!",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_14380_20220422111727.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14380",
+                "title": "優雅輕奢個性宅 溫故知新完美轉譯",
+                "description": "用故事闡述空間,敘寫下一則則溫暖且耐人尋味的篇章,是素來有「溫故知新 創造師」美稱的星葉室內裝修設計林峰安設計總監的初衷理念。精耕設計領域逾 20 年的深厚經驗,使總監始終秉承「溫故知新」的初心,企盼在一次次的設計中,從人、材質與空間三者之間,不斷地採取出新的元素、新的細節、新的體驗與感受,不一樣的故事背景,卻有著一樣的感動。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2391_20211025162313.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2391",
+                "title": "DAWHO理財型房貸",
+                "description": "DAWHO理財型房貸,當你的百寶貸!<br>\r\n房貸利率1.59%起,成數最高85成,期限最長40年!<br>\r\n動用利率2.14%起,每動用100萬元,每天利息只要約59元起。<br>",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14635_20220606101215.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14635",
+                "title": "舞出人生下半場 愛上生活自在宅│美式新古典",
+                "description": "輕奢浪漫、夢幻綺麗的氛圍,隨著信步晃蕩,於四周瀰漫流轉;眼前構築的理想境地,宛如力道柔韌的婀娜舞姿,恰如其分地呼應為熱愛國標舞的夫妻量身打造、專屬兩人世界的奢華居家。然而,20多坪的空間雖方正,原搭載之三房格局卻稍嫌侷促,但凡尺寸稍大的傢具傢飾、陳設擺件皆無法適切置入,好在經由當代空間設計巧手擘劃,捨去其中兩房,賦予機能更為完整的主臥、客餐廳及廚房。事實上,一進到此風格場域,便會受明敞的玄關吸引。鍾情跳舞的屋主,最初在設計構想時提到希望能融入舞蹈元素,于懷晴設計師故運用大理石水切詮釋地坪的肌理,藉此描繪俐落、流暢的舞姿。另考量屋主因國標舞需求有許多雙鞋子,玄關也預留較深的櫃體,方便收納。",
                 "video": "false"
             }
         ]
     },
     {
-        "_comment": "粉絲推薦",
+        "_comment": "粉絲推薦,(txt為部分內容段落)",
         "id": 8,
         "block": "sec11",
         "data": [
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/name_12458_20200616152204.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/12458/",
-                "description": "簡約沐光宅 暖色調營造家的恬靜溫度",
+                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14621_20220602103945.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14621",
+                "title": "華麗不失優雅 實用好宅風格不設限│現代混搭風",
+                "description": "秉持著「堅持於品質,執著於設計」的理念,IS國際設計陳嘉鴻設計師專注於每個個案的細節,希望用最高品質的建材、最熨貼生活的機能來呈現最精美的設計。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer484_55_01.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14071",
+                "title": "從此告別租房生活,以自然純粹盛裝美好日常|現代風|30坪",
+                "description": "本案的年輕夫妻靠著己力,終於告別租房生活,買下屬於一家三口的溫暖歸宿,也因此對室內裝潢格外上心,在認真篩選後,決定將第一間新房託付給重視人本的廣延空間設計,「我們在乎的是使用者的真實感受,只有將設計配合生活,才能為他們量身訂做出符合未來人生的家。」陳偉立設計師語重心長地說道。",
                 "video": "false"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/name_11965_20191231153835.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/11965/",
-                "description": "連結城市風華 坐擁浪漫夜景(上)",
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_14593_20220525191104.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14593",
+                "title": "悠然休閒度假宅 共享家的幸福感│42坪",
+                "description": "為了給全家人在日常工作之餘,有一處全然獨立的休憩度假空間,湯鎮安設計師以休閒簡約的風格為核心出發,為屋主一家四口勾勒一畔恬淡閒適的悠然自在情境,屋主得以乘風慢騎舒活筋骨、孩子也能自在地演奏樂器,打造全家人共享愜意假期生活的幸福場景。",
                 "video": "false"
             },
             {
-                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer519_26_02.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/13088/",
-                "description": "整合鄉村元素 營造日常的暖馨溫度|30坪|3+1 房、2廳、2衛",
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer274_43_06.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14338",
+                "title": "異國鄉村風美宅 樸實溫潤中又見優雅│60坪",
+                "description": "女屋主相當喜歡西班牙及異國風古堡氛圍,室內約60坪數全毛胚屋,希望設計團隊能將空間妥善分配,並在餐廳&廚房空間營造大器感,並運用石材及異材質拼接來塑造空間的層次感。",
                 "video": "false"
             },
             {
-                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_13319_20210528165925.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/13319/",
-                "description": "現代日式混搭佐日光 構畫敞朗質感好生活",
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer96_68_02.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/13387",
+                "title": "音樂藝術展覽廳 滿足居家五感體驗|高雄都廳苑|92坪",
+                "description": "流淌於室的淡雅清香、素雅地毯的輕柔觸感、藝術品釋放的雅緻氣韻與兀自律動的光影,共同醞釀出深邃清寧謐境,帶來澹然無憂的平靜。尚藝室內裝修以感官設計強化人與空間的連結、昇華生活體驗,令居者自然而然卸除所有牽掛,徹底休憩放鬆。",
                 "video": "false"
             },
             {
-                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_13728_20210913165321.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/13728/",
-                "description": "微光島嶼。Dusky Island│現代風│50坪",
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/name_12410_20200528162733.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/12410",
+                "title": "簡練美學思維 構築雅致芳華逸境",
+                "description": "素澹柔美的莫蘭迪色是芬芳宜人的前味,在渾然天成的自然紋理調和下,釋放靈動活力,伴隨溫暖木質調與光亮金屬綴飾,交織出雅而不膩的獨特風韻。YS暘昇國際室內裝修李宗育設計師透過簡單俐落的設計語彙,營造屬於屋主的生活品味,創造宛若法式香氛般,餘韻悠長的雅致空間,帶來明朗輕快的幸福感。",
                 "video": "false"
             },
             {
-                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_13737_20210914183731.jpg",
-                "link": "https://www.hhh.com.tw/cases/detail/13737/",
-                "description": "譜出音符律動的宅邸 回家就像歌劇院|現代風|26坪",
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer357_67_03.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14414",
+                "title": "走出韓劇名媛 上流社會美式輕奢宅",
+                "description": "時尚優雅又甜美的女屋主,十分欣賞摩登雅舍室內裝修設計作品,加入了摩登家族後,透過王思文與汪忠錠兩位設計師的巧手擘劃,以她喜愛的簡約美式低調奢華風格作為空間主要調性,落實在新宅裡。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14666_20220613195845.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14666",
+                "title": "景程禾雅│現代風│20坪",
+                "description": "「在家裡植入一個晶片,提供回復的能量與工作的效率。」對於有科技業背景且現在為SOHO族的業主來說,家不只是休息,也是生產的場域。以晶片為核心概念,晶片運算啟動了一切,而串連到晶片的所有路徑,即為空間規劃。我們拆解晶片的空間元素:以路徑為基礎,斜面增加空間效率,區塊形塑機能。20坪的居宅,打通原先封閉隔間,並製作一張長達四米三的大桌,重整出能容納親朋好友來家同樂的場域,也是彈性辦公室、工作室的空間,打造出住辦合一的宅居環境。",
                 "video": "false"
             }
         ]
@@ -429,7 +534,22 @@
         "_comment": "video最新影音區",
         "id": 9,
         "block": "video",
-        "title": "全視屏居家辦公新體驗  沉浸感影音收視再進化",
-        "yt": "bN2cRRkke_c"
+        "title": "衣櫃收納超詳細教學!改造7坪大學生套房|街訪開箱路人家|【路人家計劃】Ep.2實踐大學 ft.Mr.許&樂高LEGO",
+        "yt": "xTb0T4ZzdV8"
+    },
+    {
+        "_comment": "熱搜關鍵字",
+        "id": 10,
+        "block": "trending",
+        "data": [
+            "客變",
+            "小坪數",
+            "老屋翻新",
+            "收納",
+            "軟裝佈置",
+            "新手裝修",
+            "風水",
+            "北歐風"
+        ]
     }
 ]

+ 555 - 0
hhh-home-pc/json/realtime.json

@@ -0,0 +1,555 @@
+[
+    {
+        "_comment": "頂部輪播區",
+        "id": 0,
+        "block": "topCarousel",
+        "data": [
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15672_1605260703.jpg",
+                "link": "https://hhh.com.tw/designer-index.php?designer_id=28",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15672_1605260690.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15672_1605260747.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15672_1605260741.webp"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15662_1607045625.jpg",
+                "link": "https://hhh.com.tw/designer-index.php?designer_id=447",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15662_1607045611.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15662_1607045687.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15662_1607045683.webp"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15673_1603096869.jpg",
+                "link": "https://hhh.com.tw/designer-index.php?designer_id=31",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15673_1603096869.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15673_1603096869.jpg.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15673_1603855335.webp"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16230_1640843333.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6381/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16230_1640843326.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16230_1640843342.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16230_1640843339.webp"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15666_1627961097.jpg",
+                "link": "https://hhh.com.tw/designer-index.php?designer_id=32",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15666_1627961071.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15666_1627961107.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15666_1627961102.webp"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16051_1623138395.png",
+                "link": "https://hhh.com.tw/designers/cases/33/1-page/new-sort/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16051_1623138372.png",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16051_1634264137.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16051_1634264092.webp"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16399_1655366849.jpg",
+                "link": "https://hhh.com.tw/designers/cases/770/1-page/new-sort/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16399_1655366832.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16399_1655366865.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16399_1655366858.jpg"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16368_1652347634.jpg",
+                "link": "https://xn--fhqx1vv5q4mv.com/?gclid=CjwKCAjwur-SBhB6EiwA5sKtjnrA_r6SDLh-ANtnAosGO7_twyyPIfFaVXksA_1s4Q4D_bIRXUDyUxoC9ooQAvD_BwE",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16368_1652347617.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16368_1652347652.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16368_1652347645.jpg"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16212_1639015666.png",
+                "link": "http://click.world.taobao.com/QVf",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16212_1639015655.png",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16212_1639015681.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16212_1639015675.webp"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16406_1655692928.jpg",
+                "link": "https://hhh.com.tw/designers/cases/23/1-page/new-sort/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16406_1655692913.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16406_1655692952.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16406_1655692939.jpg"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16107_1628644159.jpg",
+                "link": "https://hhh.com.tw/deco/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16107_1628644143.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16107_1628644166.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16107_1628644163.webp"
+            }
+        ]
+    },
+    {
+        "_comment": "主要輪播區",
+        "id": 1,
+        "block": "sec02",
+        "data": [
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15660_1604643433.jpg",
+                "link": "https://hhh.com.tw/designer-index.php?designer_id=28",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15660_1604643425.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15660_1604643433.jpg.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_15660_1604643440.webp"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16407_1655705496.jpg",
+                "link": "https://hhh.com.tw/columns/detail/5947/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16407_1655705468.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16407_1655705507.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16407_1655705501.webp"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16400_1655367565.jpg",
+                "link": "https://event.hhh.com.tw/topglory/designer_752.html",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16400_1655367544.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16400_1655367578.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16400_1655367572.jpg"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16401_1655367590.jpg",
+                "link": "https://hhh.com.tw/designers/cases/55/1-page/new-sort/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16401_1655367584.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16401_1655367602.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16401_1655367596.jpg"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16402_1655367616.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/case.php?id=784&title=%E6%98%8A%E5%8F%B8%E8%A8%AD%E8%A8%88x%E8%8F%AF%E8%BA%8D%E5%B7%A5%E7%A8%8B",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16402_1655367622.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16402_1655367646.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16402_1655367632.jpg"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16403_1655367667.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/case.php?id=312&title=%E6%B0%B4%E8%A8%AD%E5%AE%A4%E5%85%A7%E8%A8%AD%E8%A8%88%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16403_1655367656.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16403_1655367685.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16403_1655367677.jpg"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16404_1655367707.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/case.php?id=500&title=%E7%9F%A5%E5%9F%9F%E8%A8%AD%E8%A8%88%C3%97%E4%B8%80%E5%B7%B1%E7%A9%BA%E9%96%93%E5%88%B6%E4%BD%9C",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16404_1655367693.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16404_1655367721.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16404_1655367713.jpg"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16405_1655367735.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/case.php?id=474&title=%E9%9B%8B%E7%AF%89%E7%A9%BA%E9%96%93%E8%A8%AD%E8%A8%88",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16405_1655367727.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16405_1655367750.jpg",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16405_1655367745.jpg"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16099_1627623476.jpg",
+                "link": "https://hhh.com.tw/deco/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16099_1627623458.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16099_1627623493.webp",
+                "Dwebp": "https://images.hhh.com.tw/uploads/_had/adlogo_16099_1627623482.webp"
+            }
+        ]
+    },
+    {
+        "_comment": "tab區塊-最夯設計, 影音實錄, 專欄文章,(txt為部分內容段落)",
+        "id": 2,
+        "block": "sec03",
+        "data": [
+            {
+                "tab": "最夯設計",
+                "data": [
+                    {
+                        "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14703_20220622183730.jpg",
+                        "link": "https://hhh.com.tw/cases/detail/14703/",
+                        "title": "愛貓獨享!透天別墅裡的小天地 混搭風格溫馨有愛│現代風",
+                        "description": ""
+                    },
+                    {
+                        "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14702_20220622174939.jpg",
+                        "link": "https://hhh.com.tw/cases/detail/14702/",
+                        "title": "低奢美式新古典 信任堅持成就好宅│美式新古典風│63坪",
+                        "description": ""
+                    },
+                    {
+                        "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14701_20220622155418.jpg",
+                        "link": "https://hhh.com.tw/cases/detail/14701/",
+                        "title": "全毛胚高端訂製 生活綠意藝術宅│現代風│141坪",
+                        "description": "對京璽國際而言,空間不僅僅是一種結構或形式,而是生活的延展、審美的傳達、思想的再現,是「人」的一部份。設計以人為軸心,在滿足功能的同時,周彥如設計總監亦從藝術裡吸收細膩的美學語言、從綠意中尋找自由的生活範本,將居者的情感與情緒融入環境,在擾攘不安的時代,為居者砌築一處安放靈魂、滋潤心靈的歸宿。"
+                    }
+                ]
+            },
+            {
+                "tab": "影音實錄",
+                "data": [
+                    {
+                        "imgUrl": "https://img.youtube.com/vi/c0wYed8ARv4/hqdefault.jpg",
+                        "link": "https://hhh.com.tw/video-post.php?id=4433",
+                        "title": "奇葩裝潢家_ep.3.mp4",
+                        "description": "這裝潢比監獄還扯!在家也能體驗坐牢的感覺|【奇葩裝潢家】Ep.3"
+                    },
+                    {
+                        "imgUrl": "https://img.youtube.com/vi/1ccpqRBHn8w/hqdefault.jpg",
+                        "link": "https://hhh.com.tw/video-post.php?id=4432",
+                        "title": "樂沐60秒.mp4",
+                        "description": "療癒居住者的空間貼身顧問|幸福60秒"
+                    },
+                    {
+                        "imgUrl": "https://img.youtube.com/vi/0Ubs-G_513M/hqdefault.jpg",
+                        "link": "https://hhh.com.tw/video-post.php?id=4431",
+                        "title": "馥築達人(士林).mp4",
+                        "description": "點線面全方位放大空間 精緻設計打造小坪數機能宅"
+                    }
+                ]
+            },
+            {
+                "tab": "專欄文章",
+                "data": [
+                    {
+                        "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point02_421_03.jpg",
+                        "link": "https://hhh.com.tw/columns/detail/6668/",
+                        "title": "居家綠化計畫!不出錯的3個植物佈置秘訣",
+                        "description": "你是否經常困惑,為什麼軟裝設計師用植物擺設時,總是可以妝點得恰到好處,讓室內好看又有質感?今天我們就要來揭開他們的軟裝佈置秘訣,讓居家空間與植物盆栽搭配時不再超級違和。"
+                    },
+                    {
+                        "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point05_392_01.jpg",
+                        "link": "https://hhh.com.tw/columns/detail/6667/",
+                        "title": "日光系智慧質感訂製宅,詮釋色彩美學自「訂」義!",
+                        "description": "居家設計不僅為了美學而生,更重要的是描摹生活的輪廓。近年來,訂製宅的概念盛行,與眾不同的視覺、觸覺感受更考驗設計師的想法與創意,光舍丰計創意總監周語華在瞭解屋主喜好後,便決定以大自然為設計主軸,將大面採光、風景引入室內,使自然系的日光與色彩交疊,創造出虛實交錯的美感,而光與影的敘事鋪陳透過玻璃窗灑進室內,使整個場域氛圍都恣意從容,不需要過於繁雜的設計就能將人與空間連結,詮釋家的樣貌。"
+                    },
+                    {
+                        "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point04_646_01.jpg",
+                        "link": "https://hhh.com.tw/columns/detail/6666/",
+                        "title": "臥房「這樣做」可能引小三入門!4大不利夫妻感情的風水禁忌",
+                        "description": "雖說風水不是絕對,但多少有其中的道理,有些狀況最好能避則避,以下分享4種不利夫妻感情的風水情況,建議大家謹慎處理為妙。"
+                    }
+                ]
+            }
+        ]
+    },
+    {
+        "_comment": "主題企劃區,(title為主題標題,description為部分內容段落)",
+        "id": 3,
+        "block": "sec06",
+        "data": [
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_htopic/logo_410_20220510140600.jpg",
+                "link": "https://hhh.com.tw/topic/detail/410/",
+                "video": "false",
+                "description": "每個女人在生活中都扮演著多重角色,上班時要成為好員工、好主管或好同事,回家須扮演好媽媽、好女兒、好媳婦或好老婆,早上需處理公務,晚上需做家事,日常時光充實而忙碌。不過,再忙也別忘了抽一段時光,投入熱愛的事物中,徹底放鬆紓壓,做回真正的自己!一起跟著《幸福空間》,依循烹飪、閱讀、運動等興趣,打造一方專屬的廚房、書房、健身房……,為心靈挹注充沛能量吧!",
+                "title": "譜寫靜「女子」時光 找回快樂"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_htopic/logo_409_20220419141654.jpg",
+                "link": "https://hhh.com.tw/topic/detail/409/",
+                "video": "false",
+                "description": "面對工作與生活的繁雜,人們總想回歸自然,享受芬多精,而自然綠意是可以「搬」進生活空間之中,為生活增添一絲愜意。透過在家中種植花草、援引綠意景緻入室,搭配原木與石料等自然質材,都能輕鬆打造療癒森林系住宅,為長時間忙於奔波的我們,帶來沉澱身心的舒爽從容。(圖片提供/格綸設計)",
+                "title": "邀綠意納景 回歸自然的空間設計"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_htopic/logo_408_20220302151733.jpg",
+                "link": "https://hhh.com.tw/topic/detail/408/",
+                "video": "false",
+                "description": "越來越多人,嚮往純粹簡單的「鹽系設計」,他們不設限風格,不愛複雜設計與滿滿收納櫃體,反而希望回歸生活本質,讓家裡有幾分留白,呈現溫暖清新的樣子,使家人擁有足夠活動空間,盡情放鬆、舒展身心,釋放因工作或課業積累的壓力。你也喜歡這種簡約自然的生活哲學嗎?一起跟著《幸福空間》腳步,看看設計師們如何打造會呼吸的家吧!",
+                "title": "用鹽系設計打造會呼吸的家!"
+            }
+        ]
+    },
+    {
+        "_comment": "編輯精選,(txt為部分內容段落)",
+        "id": 4,
+        "block": "sec07",
+        "data": [
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_386.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6649/",
+                "title": "同步日系生活美學 高顏質電冰箱體現下廚時光的優雅品味",
+                "video": "false",
+                "description": "現代的居家坪數,壓縮人們對傳統廚房的需求,轉而選擇開放式廚房,面對後疫情生活,人們在忙碌工作之餘,也拉長在家的時間,廚房不再只是烹煮的場所,而是凝聚一家人的生活場域,不少人嚮往將極簡日式生活型態轉譯家中,領略簡約時尚美學的優雅生活,因而選對家電顯得十分重要!"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_395.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6652/",
+                "title": "將義式前衛奢華美學帶回家 演繹廚房高雅精品質感",
+                "video": "false",
+                "description": "將都會氛圍與細膩品味融入廚房領域,2022年Poliform最新廚具系列「Alea Pro」,以中島結合ㄇ字型廚具延伸出對稱大器的態勢;門板納入大理石紋陶瓷以及鍍鈦不鏽鋼質地,透過萬千變化的石紋結合前衛的金屬光澤,使「Alea Pro」在現代風中盡現華奢典範。而兼顧收納與設計感的牆板收納系統「Shaker」,對應倒T型油煙機與照明展示層架,皆將Poliform義式前衛美學貫徹其中。「Alea Pro」運用左右對稱手法,自廚具底櫃延伸出ㄇ字型櫥櫃配置,結合特殊加高至天花板的櫃體,型塑出豪奢氣場。藉由兩側高櫃的全隱蔽方式將廚房設備收納於內;垂直延伸而出的玻璃展示櫃在直束燈條的光源裝飾下,讓擺飾物件在不間斷的光線暈染中體現豪宅的氣派都會感,搭配嵌入式電器設備令廚房機能趨於完善。此外中島結合具備用餐功能的吧檯設計,以天然胡桃木紋的柔和溫潤與品味,進而讓廚房兼顧日常社交生活的溫暖互動。"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_393.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6650/",
+                "title": "質感生活的最佳提案!AI風控除油煙機獨家機型限量上市",
+                "video": "false",
+                "description": "近年因疫情提升國人對健康意識的重視,廚衛居家產業領導品牌台灣櫻花升級產品推出AI風控渦輪變頻歐化除油煙機XR01,智能偵測煮食溫度,不只能自動調節最適風速,有效快速排除油煙;更增加貼心溫度提醒功能,在油溫到達最佳料理溫度時提醒消費者,避免油溫過高產生變質及大量油煙的風險,提供消費者更順暢的料理體驗之外,也營造出更健康的料理環境。"
+            }
+        ]
+    },
+    {
+        "_comment": "活動頁banners區",
+        "id": 5,
+        "block": "sec08",
+        "data": [
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15356_1645425875.jpg",
+                "link": "https://event.hhh.com.tw/2022-Most-Favorite-Designers/index.php",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15356_1645425865.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15356_1645425953.webp",
+                "Dwebp": ""
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16293_1652164949.jpg",
+                "link": "https://hhh.com.tw/topic/detail/410/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16293_1652164525.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16293_1652165025.jpg",
+                "Dwebp": ""
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16155_1635149999.jpg",
+                "link": "https://dawho.tw/hot/mortgage/financialloan/?utm_source=gorgeous&utm_medium=banner&utm_term=paid&utm_content=b&utm_campaign=mortgage202107#financial",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_16155_1635149991.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_16155_1635149999.jpg.webp",
+                "Dwebp": ""
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15984_1627623581.jpg",
+                "link": "https://hhh.com.tw/deco/",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15984_1627623575.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15984_1627623581.jpg.webp",
+                "Dwebp": ""
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15782_1601366873.jpg",
+                "link": "https://hhh.com.tw/softouch",
+                "DimgUrl": "https://images.hhh.com.tw/uploads/_had/adlogo_15782_1601366873.jpg",
+                "webp": "https://images.hhh.com.tw/uploads/_had/adlogo_15782_1601366873.jpg.webp",
+                "Dwebp": ""
+            }
+        ]
+    },
+    {
+        "_comment": "來選好物區",
+        "id": 6,
+        "block": "sec09",
+        "data": [
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2445_20220622151846.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2445",
+                "title": "Sunline 實木百葉窗",
+                "description": "",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2444_20220622151656.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2444",
+                "title": "Sunline戶外型全鋁製百葉窗",
+                "description": "",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2443_20220622150708.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2443",
+                "title": "美式拉桿塑鋁百葉窗",
+                "description": "",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2442_20220622150518.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2442",
+                "title": "Sunline 澳式隱藏拉桿塑鋁百葉窗",
+                "description": "",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2441_20220622150156.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2441",
+                "title": "Sunline雙層塑鋁百葉窗",
+                "description": "",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hproduct_img/name_2440_20220622150021.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2440",
+                "title": "Sunline 推拉門",
+                "description": "",
+                "video": "false"
+            }
+        ]
+    },
+    {
+        "_comment": "本週推薦,(txt為部分內容段落)",
+        "id": 7,
+        "block": "sec10",
+        "data": [
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point-index05_394.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6651",
+                "title": "製材所│採日本古老傳統工法「燒杉」打造古樸空間風情",
+                "description": "製材所南屯門市選擇使用燒杉板作為整體空間的基調,燒杉是一種源於日本的古老傳統工法,以火燒的方式進行木材的表面處理使其碳化,因為內部結構的改變,能夠增加穩定度,並且達到天然的防潮與防腐、防蟲效果。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2434_20220510171016.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2434",
+                "title": "日本製洗衣機Cuble",
+                "description": "顏色:晶燦白<br>\r\n商品特點:40°C溫泡洗、低溫風乾燥、七道噴射水流、nanoeX雙效自動槽洗淨、30度溫水槽洗淨、金級省水標章、ECONAVI智慧節能科技、slim size美型設計、大投入口設計。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14671_20220614155432.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14671",
+                "title": "19坪北歐風小宅 消除隔牆空間超優化",
+                "description": "和諧漾彩與溫潤的木質元素,不僅共譜北歐居家愜意舒心、雋永宜人的經典樣貌,更串起年輕夫妻及男童仨人最真摯、深刻的情感悸動;20坪不到的三口之家,承載成員碩大豐盈的生活甜蜜。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_14223_20220125101746.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14223",
+                "title": "氣質白金微奢華 精工細琢優雅宅",
+                "description": "香檳燦金於無垠雪白中閃耀瑰麗丰彩,點染奢美意境,亦在屋主心中綻放璀璨光輝。擅長多種風格的允庭室內裝修設計張舜淵設計師,此次為寵妻的屋主,於空間中揉入溫婉歐式圓弧造型、簡約線板與金色元素,創造唯美優雅的浪漫世界,讓女主人恣意優游其中,隨手拍出人人人稱羨的網美照,盡情享受如夢似幻的愜意生活。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2288_20201120153553.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2288",
+                "title": "休閒度假宅 活用系統櫃收納",
+                "description": "居住成員:大人×2<br>\r\n房屋坪數:約30坪<br>\r\n個案風格:休閒風<br>\r\n個案屋況:新成屋<br>\r\n空間格局:3 房 2 廳 2 衛<br>\r\n主要建材:系統櫃、木工、文化石、大理石、裱布、磚形壁板、鋁鐵件、架高木地板",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_13203_20210416171101.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/13203",
+                "title": "詩的生活│美式風│30坪│3房、2廳、2衛",
+                "description": "結束繁忙的一天,總渴望投奔溫馨靜謐的心靈綠洲,將壓力、疲憊暫且忘卻,切換到最放鬆的休憩模式。對於一家三口來說,原境國際室內設計邱郁雯設計師打造的美式詩境,即是如此療癒身心的存在。\r\n\r\n設計團隊以低彩度色系渲染沉穩氣韻,並透過簡約線板勾勒歐式風情,特殊拼接木地板導入溫暖質調,塑造出簡約純淨的日常容器。自然而不造作的空間,使得貓咪與人們都能盡情嶄露最真實的本性,以最舒適的樣態生活,逐光而居、各自安好,過得自由自在。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer800_05_07.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14644",
+                "title": "解放拘禁心靈 超脫狂想透天厝",
+                "description": "家是生活的容器,人們往往把對於理想住居生活的投射,烙印在日常所處的環境;有時,甚至連內心最深處的情感記憶也一覽無遺。例如本案業主,即藉由緬懷母親的真摯眷戀,化作具象的文字裝飾,豐富娛樂空間各角。細心擘劃的過程中,由里室內設計總監傅瓊慧發現,就某方面而言,娛樂存在之目的其實在救贖你我的身心靈,遂憑此概念延伸,誕生多功能休閒遊憩場域;無論是鏡面巧思、天花板霓虹燈設計,或牆面上精緻的火焰女神彩繪,皆賦予觀者充沛的正能量,教人全然沉浸熱鬧歡快的愉悅氣氛,進而放鬆舒壓。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_14545_20220517101432.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14545",
+                "title": "現代質韻 演繹沉穩淨雅大宅之風│45坪",
+                "description": "",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcolumn_orig/point05_398_00.jpg",
+                "link": "https://hhh.com.tw/columns/detail/6661",
+                "title": "雜誌風格櫥窗,以原木家具幫街角下標",
+                "description": "走到製材所南屯門市的戶外,首先能看到製材所將三角櫥窗做成像是雜誌封面的排版風格,隨著內部展示的替換,就像是不同期數的雜誌封面一般,不僅能成為一個拍照打卡點,也藉由櫥窗上的標題向市民宣告:這真的是一間原木家具店!",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_14380_20220422111727.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14380",
+                "title": "優雅輕奢個性宅 溫故知新完美轉譯",
+                "description": "用故事闡述空間,敘寫下一則則溫暖且耐人尋味的篇章,是素來有「溫故知新 創造師」美稱的星葉室內裝修設計林峰安設計總監的初衷理念。精耕設計領域逾 20 年的深厚經驗,使總監始終秉承「溫故知新」的初心,企盼在一次次的設計中,從人、材質與空間三者之間,不斷地採取出新的元素、新的細節、新的體驗與感受,不一樣的故事背景,卻有著一樣的感動。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hproduct_img/name_2391_20211025162313.png",
+                "link": "https://hhh.com.tw/product-post.php?id=2391",
+                "title": "DAWHO理財型房貸",
+                "description": "DAWHO理財型房貸,當你的百寶貸!<br>\r\n房貸利率1.59%起,成數最高85成,期限最長40年!<br>\r\n動用利率2.14%起,每動用100萬元,每天利息只要約59元起。<br>",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14635_20220606101215.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14635",
+                "title": "舞出人生下半場 愛上生活自在宅│美式新古典",
+                "description": "輕奢浪漫、夢幻綺麗的氛圍,隨著信步晃蕩,於四周瀰漫流轉;眼前構築的理想境地,宛如力道柔韌的婀娜舞姿,恰如其分地呼應為熱愛國標舞的夫妻量身打造、專屬兩人世界的奢華居家。然而,20多坪的空間雖方正,原搭載之三房格局卻稍嫌侷促,但凡尺寸稍大的傢具傢飾、陳設擺件皆無法適切置入,好在經由當代空間設計巧手擘劃,捨去其中兩房,賦予機能更為完整的主臥、客餐廳及廚房。事實上,一進到此風格場域,便會受明敞的玄關吸引。鍾情跳舞的屋主,最初在設計構想時提到希望能融入舞蹈元素,于懷晴設計師故運用大理石水切詮釋地坪的肌理,藉此描繪俐落、流暢的舞姿。另考量屋主因國標舞需求有許多雙鞋子,玄關也預留較深的櫃體,方便收納。",
+                "video": "false"
+            }
+        ]
+    },
+    {
+        "_comment": "粉絲推薦,(txt為部分內容段落)",
+        "id": 8,
+        "block": "sec11",
+        "data": [
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14621_20220602103945.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14621",
+                "title": "華麗不失優雅 實用好宅風格不設限│現代混搭風",
+                "description": "秉持著「堅持於品質,執著於設計」的理念,IS國際設計陳嘉鴻設計師專注於每個個案的細節,希望用最高品質的建材、最熨貼生活的機能來呈現最精美的設計。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer484_55_01.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14071",
+                "title": "從此告別租房生活,以自然純粹盛裝美好日常|現代風|30坪",
+                "description": "本案的年輕夫妻靠著己力,終於告別租房生活,買下屬於一家三口的溫暖歸宿,也因此對室內裝潢格外上心,在認真篩選後,決定將第一間新房託付給重視人本的廣延空間設計,「我們在乎的是使用者的真實感受,只有將設計配合生活,才能為他們量身訂做出符合未來人生的家。」陳偉立設計師語重心長地說道。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://cloud.hhh.com.tw/upload/_hcase_img/name_14593_20220525191104.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14593",
+                "title": "悠然休閒度假宅 共享家的幸福感│42坪",
+                "description": "為了給全家人在日常工作之餘,有一處全然獨立的休憩度假空間,湯鎮安設計師以休閒簡約的風格為核心出發,為屋主一家四口勾勒一畔恬淡閒適的悠然自在情境,屋主得以乘風慢騎舒活筋骨、孩子也能自在地演奏樂器,打造全家人共享愜意假期生活的幸福場景。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer274_43_06.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14338",
+                "title": "異國鄉村風美宅 樸實溫潤中又見優雅│60坪",
+                "description": "女屋主相當喜歡西班牙及異國風古堡氛圍,室內約60坪數全毛胚屋,希望設計團隊能將空間妥善分配,並在餐廳&廚房空間營造大器感,並運用石材及異材質拼接來塑造空間的層次感。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer96_68_02.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/13387",
+                "title": "音樂藝術展覽廳 滿足居家五感體驗|高雄都廳苑|92坪",
+                "description": "流淌於室的淡雅清香、素雅地毯的輕柔觸感、藝術品釋放的雅緻氣韻與兀自律動的光影,共同醞釀出深邃清寧謐境,帶來澹然無憂的平靜。尚藝室內裝修以感官設計強化人與空間的連結、昇華生活體驗,令居者自然而然卸除所有牽掛,徹底休憩放鬆。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/name_12410_20200528162733.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/12410",
+                "title": "簡練美學思維 構築雅致芳華逸境",
+                "description": "素澹柔美的莫蘭迪色是芬芳宜人的前味,在渾然天成的自然紋理調和下,釋放靈動活力,伴隨溫暖木質調與光亮金屬綴飾,交織出雅而不膩的獨特風韻。YS暘昇國際室內裝修李宗育設計師透過簡單俐落的設計語彙,營造屬於屋主的生活品味,創造宛若法式香氛般,餘韻悠長的雅致空間,帶來明朗輕快的幸福感。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://images.hhh.com.tw/uploads/_hcase/designer357_67_03.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14414",
+                "title": "走出韓劇名媛 上流社會美式輕奢宅",
+                "description": "時尚優雅又甜美的女屋主,十分欣賞摩登雅舍室內裝修設計作品,加入了摩登家族後,透過王思文與汪忠錠兩位設計師的巧手擘劃,以她喜愛的簡約美式低調奢華風格作為空間主要調性,落實在新宅裡。",
+                "video": "false"
+            },
+            {
+                "imgUrl": "https://m.hhh.com.tw/upload/_hcase_img/name_14666_20220613195845.jpg",
+                "link": "https://hhh.com.tw/cases/detail/d/14666",
+                "title": "景程禾雅│現代風│20坪",
+                "description": "「在家裡植入一個晶片,提供回復的能量與工作的效率。」對於有科技業背景且現在為SOHO族的業主來說,家不只是休息,也是生產的場域。以晶片為核心概念,晶片運算啟動了一切,而串連到晶片的所有路徑,即為空間規劃。我們拆解晶片的空間元素:以路徑為基礎,斜面增加空間效率,區塊形塑機能。20坪的居宅,打通原先封閉隔間,並製作一張長達四米三的大桌,重整出能容納親朋好友來家同樂的場域,也是彈性辦公室、工作室的空間,打造出住辦合一的宅居環境。",
+                "video": "false"
+            }
+        ]
+    },
+    {
+        "_comment": "video最新影音區",
+        "id": 9,
+        "block": "video",
+        "title": "衣櫃收納超詳細教學!改造7坪大學生套房|街訪開箱路人家|【路人家計劃】Ep.2實踐大學 ft.Mr.許&樂高LEGO",
+        "yt": "xTb0T4ZzdV8"
+    },
+    {
+        "_comment": "熱搜關鍵字",
+        "id": 10,
+        "block": "trending",
+        "data": [
+            "客變",
+            "小坪數",
+            "老屋翻新",
+            "收納",
+            "軟裝佈置",
+            "新手裝修",
+            "風水",
+            "北歐風"
+        ]
+    }
+]

+ 1 - 1
spam_livemail.py

@@ -92,7 +92,7 @@ for x in range(i):
 
     lst = re.findall(r'To: [\w.+-]+@[\w-]+\.[\w.-]+', raw_email.decode('UTF-8'))
     
-    if local_date + datetime.timedelta(days=1) > datetime.datetime.now():
+    if local_date + datetime.timedelta(days=8) > datetime.datetime.now():
         if email_from.find('complaint') >= 0:
             #print(local_date)
             print(lst)

+ 3 - 0
test.puml

@@ -0,0 +1,3 @@
+@startuml for test
+Alice -> Bob: test
+@enduml

+ 2 - 2
tgBot/MyTelegramBot.py

@@ -36,8 +36,8 @@ updater = Updater('1773608337:AAF0TVRKXQu4vB3ii7JkM5kuV2vsXkvX7ss', use_context=
 j = updater.job_queue
 dispatcher = updater.dispatcher
 
-dispatcher.add_handler(CommandHandler('start', start))
-dispatcher.add_handler(CallbackQueryHandler(answer))
+""" dispatcher.add_handler(CommandHandler('start', start))
+dispatcher.add_handler(CallbackQueryHandler(answer)) """
 
 def echo(update, context):
     context.bot.send_message(chat_id=update.effective_chat.id, text=update.message.text)

+ 41 - 0
yo1.html

@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta name="description" content="Webpage description goes here" />
+    <meta charset="utf-8">
+    <title>Change_me</title>
+    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="author" content="">
+
+</head>
+
+<body>
+
+    <div class="container">
+        <div id='info'></div>
+        <table>
+            <tr>
+                <td><input type="hidden" value="3" />3</td>
+                <td><input type="hidden" value="1" />1</td>
+                <td><input id="tar" type="text" value="2" onchange="checkRange(this);" /></td>
+            </tr>
+        </table>
+    </div>
+    <script>
+        function checkRange(ele)
+        {
+            if(parseFloat(ele.value) > parseFloat(ele.parentNode.previousElementSibling.previousElementSibling.childNodes[0].value))
+                $('#info')[0].innerHTML = "超出上限";
+            else if(parseFloat(ele.value) < parseFloat(ele.parentNode.previousElementSibling.childNodes[0].value))
+                $('#info')[0].innerHTML = "超出下限";
+            else
+                $('#info')[0].innerHTML = "";
+            //console.log(ele.parentNode.previousSibling);
+        }
+        //console.log($('#tar')[0].parentNode);
+    </script>
+</body>
+
+</html>

Some files were not shown because too many files changed in this diff