---
# System prepended metadata

title: D-37 Offer to Sell
tags: [biz]

---

# D-37 Offer to Sell

###### tags: `biz`
> [name=RoyHuang]


------------------------------------------------------------------------
## API 清單

No    | API                                                                                                   | Desc                               | 執行順序 | 執行條件                               | 參考
------|-------------------------------------------------------------------------------------------------------|------------------------------------|----------|----------------------------------------|--------------------
~~1~~ | [~~URI-D-03~~](https://hackmd.io/nfLULT7pSxyh1vMvmtGQdw?view#URI-D-03-Prepare-no-login-data)          | ~~Prepare biz data~~               | ~~1~~    | ~~page init~~                          | ~~無~~
2     | [URI-D-04](https://hackmd.io/nfLULT7pSxyh1vMvmtGQdw?view#URI-D-04-Check-agent-right)                  | Check agent right                  | None     | when submit                            | 無
3     | [URI-O-01](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-01-Prepare-appellation-data)           | Prepare appellation data           | 1        | page init                              | URI-054，需擴充
4     | [URI-O-03](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-03-Prepare-country-data)               | Prepare country data               | 1        | page init                              | URI-054，需擴充，欄位多加上國碼
5     | [URI-O-06](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-06-file-upload)                        | file upload                        | None     | when submit and upload file have data  | 無
6     | [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)                 | Prepare login data                 | None     | when login                             | 無
7     | [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)                       | add business                       | None     | when submit                            | 無
8     | [URI-O-13](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-13-Prepare-catalog2-code-data)         | Prepare catalog2 code data         | 1        | only 客製商機                          | URI-049
9     | [URI-O-14](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-14-Prepare-catalog4-code-data)         | Prepare catalog4 code data         | None     | only 客製商機，when click catalog2 list | URI-049
10    | [URI-O-15](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-15-Prepare-catalog6-code-data)         | Prepare catalog6 code data         | None     | only 客製商機，when click catalog4 list | URI-049
11    | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)         | Prepare language label tag         | 1        | page init                              | 無
12    | [URI-O-18](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-18-Prepare-Custom-Header-data)         | Prepare Custom Header data         | 1        | only 客製商機，page init                | 無
13    | [URI-O-19](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-19-Search-Suggestions-data)            | Search Suggestions data            | None     | only 客製商機                          | 無
14    | [URI-O-20](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-20-Serach-Catalog-or-Suggestions-data) | Serach Catalog or Suggestions data | None     | only 客製商機，when click 放大鏡        | 無
15    | [URI-O-21](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-21-Get-file-data-by-id)                | Get file data by id                | None     | when login                             | 無


------------------------------------------------------------------------
## 原頁面網址
- https://www.ttstaging.com.tw/business/TradingPost

- 相關程式
  - front
    - com.hyweb.tt.cms.front.rest.ContactSupplierResource.java
  - adm
    - com.hyweb.tt.cms.cm.webservice.BizEnhanceWebservice.java

## 原頁面 URL 解析
- https://www.ttstaging.com.tw/business/TradingPost


------------------------------------------------------------------------
## 頁面解說
### 頁面區塊說明
以區塊方式說明使用到的 API


![](https://i.imgur.com/w6fuVL2.png)
- Header Service
參考[`L01`](https://docs.google.com/spreadsheets/d/1FfU1adulMCzdWNQNjagsm5rHYhokRwhKfzY-Lurvw9Q/edit#gid=1382704913)

------------------------------------------------------------------------
![](https://i.imgur.com/uIXWPqV.png)
- D-37-01、D-37-02

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag) | Prepare language label tag


------------------------------------------------------------------------
![](https://i.imgur.com/osb1gXp.png)
- D-37-03、D-37-04

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag) | Prepare language label tag


------------------------------------------------------------------------
![](https://i.imgur.com/W0n5hG9.png)
- D-37-05

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag) | Prepare language label tag


- D-37-06

No | API                                                                                                   | Desc
---|-------------------------------------------------------------------------------------------------------|-----------------------------------
1  | [URI-O-13](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-13-Prepare-catalog2-code-data)         | Prepare catalog2 code data
2  | [URI-O-14](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-14-Prepare-catalog4-code-data)         | Prepare catalog4 code data
3  | [URI-O-15](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-15-Prepare-catalog6-code-data)         | Prepare catalog6 code data
4  | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)         | Prepare language label tag
5  | [URI-O-20](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-20-Serach-Catalog-or-Suggestions-data) | Serach Catalog or Suggestions data


- D-37-07

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag) | Prepare language label tag



- D-37-08

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-21](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-21-Get-file-data-by-id)        | Get file data by id
2  | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag) | Prepare language label tag



------------------------------------------------------------------------
![](https://i.imgur.com/GuDZHzJ.png)
- D-37-09

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-01](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-01-Prepare-appellation-data)   | Prepare appellation data
2  | [URI-O-03](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-03-Prepare-country-data)       | Prepare country data
3  | [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)         | Prepare login data
4  | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag) | Prepare language label tag


------------------------------------------------------------------------
![](https://i.imgur.com/jjTcPmD.png)
- D-37-10
無

- D-37-11

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-D-04](https://hackmd.io/nfLULT7pSxyh1vMvmtGQdw?view#URI-D-04-Check-agent-right)          | Check agent right
2  | [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)               | add business
3  | [URI-O-06](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-06-file-upload)                | file upload
4  | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag) | Prepare language label tag



------------------------------------------------------------------------
### 頁面欄位說明

![](https://i.imgur.com/D8uZyTw.png)
![](https://i.imgur.com/JQKxC9n.png)
![](https://i.imgur.com/xXjap5h.png)
![](https://i.imgur.com/umSAf2W.png)


#### 藍1
- 第一層，Home
  - 點選超連結至首頁: `{front url}`
  - 資料來源，多語標籤
    - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
    ```=
    home
    ```
- 第二層，Customized Sourcing Services
  - 超連結：無
  - 資料來源，多語標籤
    - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
    ```=
    customizedsourcing
    ```
- 第三層，Offer to Sell
  - 超連結：無
  - 資料來源，多語標籤
    - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
    ```=
    offertosell
    ```
- 第四層，Post Your Offer
  - 超連結：無
  - 資料來源，多語標籤
    - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
    ```=
    postyouroffer
    ```


#### 藍2
頁籤(由左至右)
- Trade Inquiry
  - 多語：home
  - 超連結：`{front url}`//business/TradeInquiry
  - 超連結：無
- Meet Suppliers Online
  - 多語：meetsuppliersonline
  - 超連結：`{front url}`//business/MeetSupplierOnline
- Meet Suppliers In Taiwan
  - 多語：meetsuppliersintaiwan
  - 超連結：`{front url}`//business/MeetSupplierInTaiwan
- Offer to Sell
  - 多語：offertosell
  - 超連結：無


#### 藍3
Post your selling offer, and let interested buyers contact you directly. 
- 資料來源
  - API： [URI-O-18](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-18-Prepare-Custom-Header-data) 
  ```=
  content
  ```


#### 藍4
Step 1 Fill in the form
- UI 邏輯: 下商機的頁面，文字需要 highlight
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  ez_step1 + fillintheform
  ```


#### 藍5
Step 2 Completion
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  ez_step2 + completion
  ```


#### 藍6
Product Name
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  多語：productionname
  ```


#### 藍7
Product Name - field
- UI 邏輯
  - require: Y
  - type: string
  - field: text
    - maxlength: 80
    - DB: VARCHAR2(400)
- 資料來源，關鍵字
  - API： [URI-O-19](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-19-Search-Suggestions-data)
  ```=
  -- Array(Object)
  {
     "seq"           : <int>,
     "catalog6Id"    : <int>,
     "catalog6Name"  : <string>,
     "alias2Code"    : <string>,
     "alias4Code"    : <string>,
     "word"          : <string>, 
     "hasTopKeyword" : <boolean>
  }
  ```
  
  - 動態顯示下拉選單
    - 套件使用，jquery autocomplete
    - 若有產業別資料的 `catalog6Id > 0`，則需要改成 `word + " in " +  catalog6Name`，word 有關鍵字都要用粗體顯示。
    - 若有產業別和無產業別，中間需要用分隔線做區隔
    - 產業別資料最多 3 筆，其他用無產業別補齊，至多共 10 筆
  ![](https://i.imgur.com/HWivLlG.png)
  - 若動態顯示下拉選單有點選，會取代 藍18 選單的 4、6 碼產業別清單取代，並 highlight 各自的產業別，並將 藍17 產業別補上
    - 1) 查出 4 碼產業別清單
      - API: [URI-O-14](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-14-Prepare-catalog4-code-data)
      - https://tt-api.taiwantrade.com/taitracodes/42/6/{alias2Code}
      - EX: https://tt-api.taiwantrade.com/taitracodes/42/4/51
    - 2) 查出 6 碼產業別清單
      - API: [URI-O-15](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-15-Prepare-catalog6-code-data)
      - https://tt-api.taiwantrade.com/taitracodes/42/6/{alias2Code}/{alias4Code}
      - EX: https://tt-api.taiwantrade.com/taitracodes/42/6/51/5105
  
  ![](https://i.imgur.com/siaUCod.png)


- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  ```=
  subject
  ```


#### 藍8
Product Category
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  choosethecategoryitbelongsto
  ```


#### 藍9
Product Category(型錄產業別) - field
- UI 邏輯:
  - require: Y
  - type: string
  - field: text，屬性為 readonly
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  - 資料透過 藍18 取得，只取 6 碼的產業別id
  ```=
  catalogId
  ```


#### 藍10
Select a Catagory - button
- UI 邏輯:
  - field: button
  - click
    - 若 藍17 已有資料，則會顯示 2、4、6 碼下拉選單
    - 若 藍17 無資料
      - 預設先帶出 2 碼的產業別清單。點選 2 碼帶出 4 碼，點選 4 碼帶出 6 碼，點選 6 碼 會把資料回寫至 藍17
  - 無套件，目前是套用設計師使用的雛形
  - 圖
  ![](https://i.imgur.com/r4D3gX2.png)

  ![](https://i.imgur.com/qxJh3RM.png)
- 資料來源
  - 2碼資料
    - [URI-O-13](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-13-Prepare-catalog2-code-data)
    - EX: https://tt-api.taiwantrade.com/taitracodes/41/2
    ```=
    -- Array(Object)
    trees.nodes
    ```
  - 4碼資料
    - [URI-O-14](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-14-Prepare-catalog4-code-data)
    - EX: https://tt-api.taiwantrade.com/taitracodes/41/4/51
    ```=
    -- Array(Object)
    trees.nodes
    ```
  - 6碼資料 
    - [URI-O-15](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-15-Prepare-catalog6-code-data)
    - EX: https://tt-api.taiwantrade.com/taitracodes/41/6/51/5105
    ```=
    -- Array(Object)
    trees.nodes
    ```


#### 藍11
Product Details
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  productdetails
  ```


#### 藍12
Message - field
- 邏輯:
  - require: Y
  - type: string
  - field: textarea
  - 至多 1500 個字，超過不能填
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  ```=
  message
  ```


#### 藍13
計算 Message 字數，0/1500
- UI 邏輯:
  - 0，是動態計算，以字數計算
  - 1500，是最大字數，寫死
  - 數字超過移除，不顯示


#### 藍14
上傳附件
- UI 邏輯:
  - require: N
  - type: file
  - field: file
  - 使用套件: dropzone.js
  - 檔案數量: 0 ~ 3個
  - 檔案格式: htm, html, doc, docx, pdf, txt, jpg, gif, png, odt, ods
  - 檔案容量: 10 MB
  - click
    - 有 privew 檔案功能。若有圖檔要顯示圖
    - 滑鼠移標到檔案時，要顯示檔案名稱
    - 需要有移除檔案功能，右上角有個『x』可移除
    - ~~只有在 submit 送出時，才會上傳檔案至系統~~
    - 直接上傳，目前先放入暫存檔案
- 新增附件
  - API: [URI-O-06](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-06-file-upload)
  - require: N
  - type: uploadFile
  ```=
  message
  ```

- 登入後，取得附件資料
  - API: [URI-O-21](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-21-Get-file-data-by-id)
  - require: 看有檔案id，才處理

- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: N
  - type: string
  - 商機附件id(至多3個，用逗號區隔)，Ex: `1,2,3`
  ```=
  attachs
  ```


#### 藍15
Drop files here to upload
- UI 邏輯:
  - dropzone.js 預設文


#### 藍16
File formats
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  fileuploadlimit
  ```


#### 藍17
: htm, html, doc, docx, pdf, txt, jpg, gif, png, odt, ods. Max 3 files (10MB in total).
- UI 邏輯:
  - 『: htm, html, doc, docx, pdf, txt, jpg, gif, png, odt, ods.』，寫死
  - 『 (10MB in total).』
    - 資料來源
      - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
      ```=
      maxfileslimit
      ```

#### 藍18
Total size
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  totalsizet
  ```


#### 藍19
計算檔案大小
- UI 邏輯:
  - 預設 0
  - 以 MB 為單位計算


#### 藍30
Contact Information
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  contactinformation
  ```


#### 藍21
Send as Member profile - button
- UI 邏輯
  - field: button
  - 寫死的文字
  - when click，會將登入者的資訊帶入 Contact Information 區塊
    - 除了 Make this offer expire on (藍39) 外，其餘欄位有值都會帶入
    - Contact Person 的值同 Full Name
    - Email(29) 同 Email(42)


#### 藍22
View and Modify、Collapse
- UI 邏輯
  - field: button
  - 只有登入時會顯示
  - 預設是合
  - 合，顯示 View and Modify
    - Full Name 下面那行都隱藏
  - 開，顯示 Collapse
- View and Modify
  - 資料來源，多語標籤
    - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
    ```=
    多語：viewandmodify
    ```
- Collapse
  - 資料來源，多語標籤
    - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
    ```=
    collapse
    ```


#### 藍23
Company Name
- 資料來源
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  companyname
  ```


#### 藍24
Company Name - field
- UI 邏輯
  - require: Y
  - type: string
  - field: text
  - 若 Send as Member profile，有 click 會帶入資料
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: string
  ```=
  data.companyName
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  ```=
  companyName
  ```


#### 藍25
Contact Person Name
- 資料來源
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  contactperson
  ```


#### 藍26
Contact Person 稱謂 - field
- UI 邏輯
  - require: Y
  - field: select
  - 下拉選單可選擇稱謂列表，如沒資料預設給下第一個順位
  - 若 Send as Member profile，有 click 會帶入資料
- 資料來源，下拉選單
  - API： [URI-O-01](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-01-Prepare-appellation-data)
  ```=
  -- Array(Object)
  label
  ```
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: number
  - 用登入者稱謂id 比對下拉選單，有則選擇，無則給預設下拉選單第一個順位
  ```=
  data.userTitleCode
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  ```=
  userTitleCode
  ```


#### 藍27
Contact Person 名稱 - field
- UI 邏輯
  - require: Y
  - type: string
  - field: text
  - 若 Send as Member profile，有 click 會帶入資料
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: string
  ```=
  data.userName
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  ```=
  userName
  ```


#### 藍28
Email
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  email
  ```


#### 藍29
Email - field
- UI 邏輯:
  - require: Y
  - type: string
  - field: text
  - 若 Send as Member profile，有 click 會帶入資料
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  ```=
  data.userEmail
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  - 檢查是否為合法的 email 格式
  ```=
  userEmail
  ```


#### 藍30
Country/Region
- 資料來源
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  countryregion
  ```


#### 藍31
Country/Region(公司所屬的國家) - field
- UI 邏輯
  - require: Y
  - field: select
  - 下拉選單可選擇國家列表，如沒資料預設給第一個順位
    - 第一個選單是多語標籤 Select
    - 若有異動下拉選單，
      - (1) 將國碼寫入 藍33
  - 若 Send as Member profile，有 click 會帶入資料
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  ez_pleaseselect
  ```
- 資料來源，下拉選單
  - API： [URI-O-03](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-03-Prepare-country-data)
  ```=
  -- Array(Object)
  label
  ```
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: number
  - 用公司所屬的國家id 比對下拉選單，有則選擇，無則給預設下拉選單第一個順位
  ```=
  data.officeNationCode
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  ```=
  officeNationCode
  ```


#### 藍32
Business Phone Number
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  tel1
  ```


#### 藍33
Business Phone Number(公司電話 - 國碼) - field
- UI 邏輯
  - require: N
  - type: string
  - field: text
  - 至多 3 碼
  - 若 Send as Member profile，有 click 會帶入資料
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: string
  ```=
  data.officeTelCountry
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: N
  - type: string
  - 需驗證字串為 0-9 的數字
  ```=
  officeTelCountryCode
  ```


#### 藍34
Business Phone Number(公司電話) - field
- UI 邏輯
  - require: N
  - type: string
  - field: text
  - 若 Send as Member profile，有 click 會帶入資料
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: string
  ```=
  data.officeTel
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: N
  - type: string
  - 需驗證字串為 0-9 的數字
  ```=
  officeTel
  ```


#### 藍35
Business Phone Number(公司電話 - 分機) - field
- UI 邏輯
  - require: N
  - type: string
  - field: text
  - 若 Send as Member profile，有 click 會帶入資料
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: string
  ```=
  data.officeTelExt
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: N
  - type: string
  - 需驗證字串為 0-9 的數字
  ```=
  officeTelExt
  ```



#### 藍36
Company Site
- 資料來源，多語標籤
  - API： [URI-O-03](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-03-Prepare-country-data)
  ```=
  companysite
  ```


#### 藍37
Company Site(公司網址) - field
- UI 邏輯
  - require: Y
  - HTML field: `url`
  - 若 Send as Member profile，有 click 會帶入資料
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: string
  ```=
  data.companyWebsite
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  - 需要驗證是否為合法的 url
    - `https://` 或 `http://` 開頭即可
    - jquery validator 會實作驗證 url rule，[參考](https://www.runoob.com/jquery/jquery-plugin-validate.html)
  ```=
  companyWebsite
  ```


#### 藍38
Make this offer expire on
- 資料來源，多語標籤
  - API： [URI-O-03](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-03-Prepare-country-data)
  ```=
  makethisofferexpireon
  ```


#### 藍39
『Make this offer expire on』- field
- UI 邏輯
  - require: Y
  - type: string
  - field: date
  - format: YYYY/MM/DD
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  - format: YYYYMMDD
  ```=
  expiryDate
  ```


------------------------------------------------------------------------
#### 藍40
Post Member information
- UI 邏輯
  - 寫死文字


#### 藍41
Email
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  email
  ```


#### 藍42
Email(待刊者)
- UI 邏輯:
  - require: Y
  - type: string
  - field: text
  - readyonly
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  ```=
  data.userEmail
  ```
- 新增商機
  - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)
  - require: Y
  - type: string
  - 檢查是否為合法的 email 格式
  ```=
  agentUserId
  ```


#### 藍25
Full Name
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  fullname
  ```


#### 藍26
代刊者稱謂 - field
- UI 邏輯
  - require: Y
  - field: select
  - readonly
  - 下拉選單可選擇稱謂列表，如沒資料預設給下第一個順位
  ```
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: number
  - 用登入者稱謂id 比對下拉選單，有則選擇，無則給預設下拉選單第一個順位
  ```=
  data.userTitleCode
  ```
- 新增商機
  - 無


#### 藍27
代刊者名稱 - field
- UI 邏輯
  - require: Y
  - type: string
  - field: text
  - readonly
- 資料來源，登入
  - API: [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)
  - type: string
  ```=
  data.userName
  ```
- 新增商機
  - 無



#### 藍46
google recaptcha
- UI 邏輯
  - require: Y
  - 目前使用 V2
  - 需驗證合法性
  - google key 放在 front(server)


#### 藍47
Submit
- UI 邏輯
  - field: button
  - 表單驗證規則
    - 必填欄位驗證
    - google recaptcha 驗證
    - 會先送出上傳檔案，回傳拿到上傳檔案id 後，才新增商機
    - 商機新增成功後，會連結至商機成功頁面
- 資料來源，多語標籤
  - API： [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag)
  ```=
  ok
  ```
- 新增商機流程
  - 1) 檢查是否有待刊者權限
    - API: [URI-D-04](https://hackmd.io/nfLULT7pSxyh1vMvmtGQdw?view#URI-D-04-Check-agent-right)
  - 2) 新增附件
    - API: [URI-O-06](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-06-file-upload)
  - 3) 新增商機
    - API: [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)



------------------------------------------------------------------------
### 頁面邏輯說明
- 下商機身份
  - 已知會員登入
    - TT 會員
    - 第三方註冊的會員
- 商機成功會導入商機成功頁面

- 流程
  - 登入

```mermaid
graph TB;
  id1("登入") --> id2("submit");
  id2 --> id3{"檢查是否有待刊者權限"};
  id3 --> id4("有待刊者權限");
  id3 --> id5("無待刊者權限");
  id4 --> id6("新增附件");
  id6 --> id7("新增商機");
  id7 --> id8("商機成功頁");
```

  - 未登入
```mermaid
graph TB;
  id1("未登入") --> id2("submit");
  id2 --> id3{"檢查是否<br>登入"};
  id3 --> id4("Sign In"); 
  id4 --> id5{"檢查是否有待刊者權限"};
  id5 --> id6("有待刊者權限");
  id5 --> id20("無待刊者權限");
  id6 --> id8("新增附件");
  id8 --> id9("新增商機");
  id9 --> id10("商機成功頁");
```


------------------------------------------------------------------------
### 頁面輸出
- init

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-18](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-18-Prepare-Custom-Header-data) | Prepare Custom Header data


- 登入

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-01](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-01-Prepare-appellation-data)   | Prepare appellation data
2  | [URI-O-03](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-03-Prepare-country-data)       | Prepare country data
3  | [URI-O-05](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#Prepare-template-data)               | Prepare template data
4  | [URI-O-10](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-10-Prepare-login-data)         | Prepare login data
5  | [URI-O-17](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-17-Prepare-language-label-tag) | Prepare language label tag
6  | [URI-O-21](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-21-Get-file-data-by-id)        | Get file data by id


------------------------------------------------------------------------
- 2碼產業別

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-13](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-13-Prepare-catalog2-code-data) | Prepare catalog2 code data


------------------------------------------------------------------------
- 4碼產業別

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-14](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-14-Prepare-catalog4-code-data) | Prepare catalog2 code data


------------------------------------------------------------------------
- 6碼產業別

No | API                                                                                           | Desc
---|-----------------------------------------------------------------------------------------------|---------------------------
1  | [URI-O-15](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-15-Prepare-catalog6-code-data) | Prepare catalog2 code data


------------------------------------------------------------------------
- product name > 關鍵字收尋

No | API                                                                                        | Desc
---|--------------------------------------------------------------------------------------------|------------------------
1  | [URI-O-19](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-19-Search-Suggestions-data) | Search Suggestions data


------------------------------------------------------------------------
- 放大鏡 > 6碼產業別

No | API                                                                                                   | Desc
---|-------------------------------------------------------------------------------------------------------|-----------------------------------
1  | [URI-O-20](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-20-Serach-Catalog-or-Suggestions-data) | Serach Catalog or Suggestions data



------------------------------------------------------------------------
- file upload

No | API                                                                            | Desc
---|--------------------------------------------------------------------------------|------------
1  | [URI-O-06](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-06-file-upload) | file upload


------------------------------------------------------------------------
- add business

No | API                                                                                  | Desc
---|--------------------------------------------------------------------------------------|------------------
1  | [URI-D-04](https://hackmd.io/nfLULT7pSxyh1vMvmtGQdw?view#URI-D-04-Check-agent-right) | Check agent right
2  | [URI-O-11](https://hackmd.io/cCmvIP36SCyTsLbZCPrbhg?view#URI-O-11-add-business)      | add business

