# 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