**簡要說明**
- 獲取商品的屬性信息
**請求URL:**
- ` index/Goods/goodsAttr `
**參數:**
|參數名|必選|類型|說明|
|:---- |:---|:----- |----- |
|goods_id | 是 | int | 如果 type 為 normal ,是商品id;如果 type 不是 normal,是活動id |
**返回示例**
```
{
"code": 1,
"msg": "請求成功",
"data": {
"attr": [
{
"attr_name": "尺碼",
"attr_value": [
"s"
]
},
{
"attr_name": "顏色",
"attr_value": [
"黑色",
"白色"
]
}
],
"attr_value": [
{
"id": 438,
"goods_id": 1,
"value": "s,黑色",
"img": "/uploads/20200401/d718cc8ffbf6d75e306960956e5fc22e.jpg",
"stock": 120,
"sales": 0,
"price": "2500.00",
"cost_price": "1200.00"
},
{
"id": 439,
"goods_id": 1,
"value": "s,白色",
"img": "/uploads/20200401/d718cc8ffbf6d75e306960956e5fc22e.jpg",
"stock": 120,
"sales": 0,
"price": "2500.00",
"cost_price": "1200.00"
}
]
}
}
```
**data返回值說明**
|參數|類型|描述|
|:-------|:-------|:-------|
| - attr |object | 商品屬性|
| attr_name | string| 屬性名稱 |
| attr_value |object | 單個屬性的屬性值 |
| - attr_value |object | 商品屬性值 |
| id | number| 屬性id |
| goods_id | number| 商品id |
| value | string| 屬性值 |
| img | string| 屬性圖片 |
| stock | number| 該屬性商品的庫存 |
| sales | number| 該屬性商品的銷量 |
| price | string| 該屬性商品的售價 |
| cost_price | string| 無 |
- 文檔說明
- 商城部分
- 商城首頁(Index/index)
- 商品分類(Goods/cate)
- 商品列表(Goods/goodsList)
- 商品詳情(Goods/goodsDetail)
- 商品屬性獲取(Goods/goodsAttr)
- 收藏/取消收藏(Goods/goodsCollect)
- 加購物車(Goods/cartAdd)
- 立即購買(Goods/buyNow)
- 優惠券列表(Index/coupon)
- 領取優惠券(Index/couponGet)
- 文章列表(Index/articleList)
- 文章詳情(Index/articleSee)
- 簽到頁面(Index/signPageShow)
- 用戶簽到(Index/signIn)
- 簽到記錄(Index/signRecord)
- 文章分類(Index/articleCate)
- 商品評價列表(Goods/goodsComment)
- 登錄部分
- 獲取驗證碼(Login/getCode)
- 用戶注冊(Login/reg)
- 用戶登錄(Login/login)
- 找回密碼(Login/resetPass)
- 用戶協議(Login/agreement)
- 個人中心
- 個人首頁(User/index)
- 修改密碼(User/passReset)
- 修改頭像昵稱(User/userEdit)
- 地址列表(User/addressList)
- 地址操作(User/addressOperate)
- 收藏列表(User/collectList)
- 優惠券列表(User/userCoupon)
- 余額頁面(User/balancePage)
- 余額充值(User/balanceRecharge)
- 賬單列表(User/billList)
- 積分頁面(User/integralPage)
- 購物車部分
- 購物車列表(Cart/lists)
- 修改購物車商品數量(Cart/setNumber)
- 刪除購物車商品(Cart/del)
- 清空失效商品(Cart/unEffectiveDel)
- 訂單部分
- 訂單商品信息界面(Order/orderShow)
- 獲取訂單可用優惠券(Order/orderAvaCoupon)
- 提交訂單(Order/orderSub)
- 余額支付(Order/balancePay)
- 微信支付(Order/wxPay)
- 訂單列表(Order/OrderList)
- 訂單詳情(Order/orderDetail)
- 取消訂單(Order/orderCancel)
- 申請退款界面(Order/orderRefundShow)
- 提交退款申請(Order/refundApply)
- 查看物流(Order/orderLogistics)
- 確認收貨(Order/confirmReceipt)
- 評價訂單(Order/orderComment)
- 刪除訂單(Order/orderDel)
- 其他
- 上傳圖片(Upload/img)
- 獲取推薦商品(Goods/getRecGoods)