# 1\. 試衣鏡接口
## 1.1. ProductCtl
程序地址 ./shop/controllers/ProductCtl.php @author guan[pm@shopcncc.com](mailto:xinze@live.cn)
### 1.1.1. 列表數據, 不論用戶是否登錄,收藏等等數據不做處理。
#### 1.1.1.1. 請求URL
[https://www.kwmall888.com/index.php?ctl=Product&met=lists&typ=json](https://www.kwmall888.com/index.php?ctl=Product&met=lists&typ=json)
#### 1.1.1.2. 請求參數
| 鍵值 | 類型 | 描述 |
| --- | --- | --- |
| store\_is\_selfsupport | int | 1:自營 |
| page | int | 當前頁碼 |
| rows | int | 每頁記錄條數 |
#### 1.1.1.3. 返回數據
~~~json
{
"cmd_id": -100,
"status": 200,
"msg": "success",
"code": 0,
"data": {
"page": 1,
"total": 5,
"records": 122,
"items": [{
"product_id": 16,
"product_name": "Littleswan\/小天鵝 10公斤洗烘干一體水魔方全自動家用洗衣機TD100-1616WMIDG",
"product_tips": "WIFI智控 節能省電 24h預約洗衣",
"store_id": 1001,
"store_name": "官方旗艦店",
"product_market_price": 1099,
"product_unit_price": 1099,
"product_cost_price": 0,
"product_image": "https:\/\/test.shopsuite.cn\/image.php\/shop\/data\/upload\/media\/store\/1001\/image\/20180426\/1524732743913874.jpg",
"product_video": "",
"transport_type_id": 1,
"product_seo_url": "",
"layout_route_id": 0,
"product_verify_id": 3001,
"product_state_id": 1001,
"product_sale_time": "2018-12-25 10:49:23",
"unit_id": 1009,
"product_add_time": 0,
"product_unit_points": 0,
"id": 16,
"is_virtual": false,
"kind_id": 1201,
"product_sale_num": 57,
"store_is_selfsupport": 1,
"activity_type_id": 1103,
"activity_type_name": "限時折扣",
"item_color": [{
"item_id": 32,
"item_name": [],
"product_id": 16,
"color_id": 0,
"item_is_default": 1,
"item_number": "rnLCaT",
"item_barcode": "",
"item_cost_price": 0,
"item_platform_price": 0,
"item_unit_price": 1099,
"item_market_price": 0,
"item_unit_points": 0,
"item_quantity": 995,
"item_quantity_frozen": 0,
"item_warn_quantity": 0,
"item_spec": [],
"item_enable": 1001,
"item_is_change": 0,
"item_weight": 0,
"item_fx_commission": 0,
"item_title": "",
"item_freetime": 0,
"id": 32,
"item_sale_price": 1099,
"price": 1099,
"url": "https:\/\/test.shopsuite.cn\/i\/32",
"color_image": "https:\/\/test.shopsuite.cn\/image.php\/shop\/data\/upload\/media\/store\/1001\/image\/20180426\/1524732743913874.jpg"
}],
"item_id": 32,
"item_quantity": 995,
"item_unit_price": 1099,
"item_market_price": 0,
"product_quantity": 995,
"item_consume_jb": 109.9
}]
}
}
~~~
### 1.1.2. 通過商品SKU編號獲取對應正反面圖片
#### 1.1.2.1. 請求URL
[https://www.kwmall888.com/index.php?ctl=Product&met=get2dBg&typ=json](https://www.kwmall888.com/index.php?ctl=Product&met=get2dBg&typ=json)
#### 1.1.2.2. 請求參數
| 鍵值 | 類型 | 描述 |
| --- | --- | --- |
| id | int | 商品編號 |
#### 1.1.2.3. 返回數據
~~~json
{
"cmd_id": -100,
"status": 200,
"msg": "",
"code": 0,
"data": {
"front_img": "正面圖片地址",
"back_img": "反面圖片地址"
}
}
~~~
#### 1.1.2.4. 接口返回結果描述
| 鍵值 | 類型 | 描述 |
| --- | --- | --- |
| status | int | 狀態 200:表示正確 250表示錯誤 |
| msg | string | 返回文字說明 |
| data | json | 返回數據 |
| data.front\_img | url | 正面圖片地址 |
| data.back\_img | url | 反面圖片地址 |
### 1.1.3. 獲得二維碼 - 打開商品,用戶下單購買
#### 1.1.3.1. 請求網址
[https://www.kwmall888.com/index.php?ctl=Product&met=getItemQrcode&typ=json](https://www.kwmall888.com/index.php?ctl=Product&met=getItemQrcode&typ=json)
#### 1.1.3.2. 請求參數
| 鍵值 | 類型 | 描述 |
| --- | --- | --- |
| id | int | 商品編號 |
| poster\_type | int | 2:小程序 |
#### 1.1.3.3. 返回數據
~~~json
{
"cmd_id": -100,
"status": 200,
"msg": "",
"code": 0,
"data": {
"qrcode": "二維碼URL"
}
}
~~~
### 1.1.4. 試衣鏡效果通過掃碼分享二維碼
#### 1.1.4.1. 請求網址
[https://www.kwmall888.com/index.php?ctl=Product&met=getShareQrcode&typ=json](https://www.kwmall888.com/index.php?ctl=Product&met=getShareQrcode&typ=json)
#### 1.1.4.2. 請求參數
| 鍵值 | 類型 | 描述 |
| --- | --- | --- |
| id | int | 商品編號 |
| url | string | 試衣效果圖網址 |
#### 1.1.4.3. 返回數據
~~~json
{
"cmd_id": -100,
"status": 200,
"msg": "",
"code": 0,
"data": {
"qrcode": "二維碼URL"
}
}
~~~
- 開發文檔
- /輸出格式化處理
- /MySQL.md
- /tpl.md
- /locale.md
- /試衣鏡.md
- /note.md
- /api/shop.md
- Table of Content
- shop 項目
- 1.1. ActivityCtl
- 1.2. CartCtl
- 1.3. CategoryCtl
- 1.4. ChainCtl
- 1.5. ChooseIndustryCtl
- 1.6. Distribution_UserCtl
- 1.7. IndexCtl
- 1.8. JoinController
- 1.9. JoinCtl
- 1.10. LoginCtl
- 1.11. MediaCtl
- 1.12. PageCtl
- 1.13. PlatformController
- 1.14. PointController
- 1.15. PointCtl
- 1.16. ProductCtl
- 1.17. SitemapCtl
- 1.18. StoreController
- 1.19. StoreCtl
- 1.20. UrlCtl
- 1.21. User_AccountCtl
- 1.22. User_ActivityCtl
- 1.23. User_AskCtl
- 1.24. User_CommentCtl
- 1.25. User_DeliveryAddressCtl
- 1.26. User_FavoritesCtl
- 1.27. User_FeedbackCtl
- 1.28. User_InvoiceCtl
- 1.29. User_OrderCtl
- 1.30. User_ResourceCtl
- 1.31. User_ReturnCtl
- 1.32. User_VoucherCtl
- 1.33. UserCenterController
- 1.34. UserCtl
- 1.35. VerifyCodeCtl
- 1.36. WechatCallbackCtl
- /框架核心說明.md