## _电子烟接口文档_ —————————————————————————————————————————————————————————— ##### 接口功能 > 1.发送邮箱验证码 ##### URL > `{host}/index.php?s=/api/Captcha/sendEmailCaptcha` ##### HTTP 请求方式 > POST ##### 请求参数 > | 参数 | 必选 | 类型 | 说明 | > | :---- | :--- | :----- | ---------- | > | form | ture | object | 请求的对象 | > | email | true | string | 邮箱地址 | ```javascript { "form": { "email":"541469799@qq.com", } } ``` ##### 返回字段 > | 返回字段 | 字段类型 | 说明 | > | :------- | :------- | :------------------------------------ | > | status | int | 返回结果状态。200:正常;其它:错误。 | > | message | string | 接口信息 | > | data | array | 数据 | ```javascript { "status": 200, "message": "Sent Successful!Please check your new mails.", "data": [] } ``` ———————————————— ##### 接口功能 > 2.登录 ##### URL > `http://vapeshop.com/index.php?s=/api/passport/login` ##### HTTP 请求方式 > POST ##### 请求参数 > | 参数 | 必选 | 类型 | 说明 | > | :-------- | :--- | :------ | -------------------------------- | > | mobile | 是 | string | 登录邮箱 | > | smsCode | 是 | int | 邮箱验证码 | > | isParty | 否 | boolean | 是否第三方登录,true:是,false:否 | > | partyData | 否 | object | 第三方登录数据 | ```javascript { "form": { "mobile": "541469799@qq.com", "smsCode": "439554", "isParty": false, "partyData": [] } } ``` ##### 返回字段 > | 返回字段 | 字段类型 | 说明 | > | :------- | :------- | :------------------------------- | > | status | int | 返回结果状态。0:正常;1:错误。 | > | message | string | 接口消息 | > | data | object | 数据 | > | userId | int | 用户ID | > | token | string | 用户token | ```javascript { "status": 200, "message": "登录成功", "data": { "userId": 1, "token": "7b06840972b7f1896c68d4fc4f64cbbc" } } ``` ———————————————— ##### 接口功能 > 3.首页商品列表 ##### URL > `http://vapeshop.com/index.php?s=/api/goods/list` ##### HTTP 请求方式 > GET ##### 请求参数 > | 参数 | 必选 | 类型 | 说明 | > | :--- | :--- | :----- | --------------------------------------- | > | page | 否 | int | 页数 | > | type | 否 | int | 暂留 | ##### 返回字段 > | 返回字段 | 字段类型 | 说明 | > | :------- | :------- | :------------------------------- | > | status | int | 返回结果状态。0:正常;1:错误。 | > | message | string | 所属公司名 | > | data | string | 数据 | > | list | object | 分页数据 | > | data | array | 商品 | > | goods_sales | int | 商品销量 | > | goods_name | int | 商品名称 | > | goods_price_min | int | 商品实际售价 | > | goods_image | string | 商品图片 | ```javascript { "status": 200, "message": "success", "data": { "list": { "total": 1, "per_page": 15, "current_page": 1, "last_page": 1, "data": [ { "goods_sales": 0, "goods_id": 10001, "goods_type": 10, "goods_name": "Banana Vape", "goods_no": "10000001", "video_id": 0, "video_cover_id": 0, "selling_point": "", "spec_type": 10, "goods_price_min": "19.00", "goods_price_max": "19.00", "line_price_min": "28.00", "line_price_max": "28.00", "stock_total": 100, "is_restrict": 0, "restrict_total": 0, "restrict_single": 0, "delivery_id": 10001, "is_points_gift": 0, "is_points_discount": 1, "is_alone_points_discount": 0, "points_discount_config": "", "is_enable_grade": 0, "is_alone_grade": 0, "alone_grade_equity": [], "is_ind_delivery_type": 0, "delivery_type": [ 10 ], "status": 10, "goods_image": "http://vapeshop.com/uploads/10001/20240226/7b96f812559616af230b55d0e81ac50a.jpg", "is_user_grade": false } ] } } } ``` ———————————————— ##### 接口功能 > 4.商品详情页 ##### URL > `http://vapeshop.com/index.php?s=/api/goods/detail` ##### HTTP 请求方式 > GET ##### 请求参数 > | 参数 | 必选 | 类型 | 说明 | > | :-------- | :--- | :------ |------| > | goodsId | 是 | string | 商品ID | ##### 返回字段 > | 返回字段 | 字段类型 | 说明 | > | :------- | :------- | :------------------------------- | > | status | int | 返回结果状态。0:正常;1:错误。 | > | message | string | 接口消息 | > | data | object | 数据 | > | userId | int | 用户ID | > | token | string | 用户token | ```javascript { "status": 200, "message": "success", "data": { "detail": { "goods_id": 10001, "goods_type": 10, "goods_name": "Banana Vape", "goods_no": "10000001", "video_id": 0, "video_cover_id": 0, "selling_point": "", "spec_type": 10, "goods_price_min": "19.00", "goods_price_max": "19.00", "line_price_min": "28.00", "line_price_max": "28.00", "stock_total": 100, "is_restrict": 0, "restrict_total": 0, "restrict_single": 0, "content": "

dddfffffffffffffffff


", "delivery_id": 10001, "is_points_gift": 0, "is_points_discount": 1, "is_alone_points_discount": 0, "points_discount_config": "", "is_enable_grade": 0, "is_alone_grade": 0, "alone_grade_equity": [], "is_ind_delivery_type": 0, "delivery_type": [ 10 ], "status": 10, "goods_images": [ { "file_id": 10001, "file_type": 10, "preview_url": "http://vapeshop.com/uploads/10001/20240226/7b96f812559616af230b55d0e81ac50a.jpg", "external_url": "http://vapeshop.com/uploads/10001/20240226/7b96f812559616af230b55d0e81ac50a.jpg" } ], "goods_image": "http://vapeshop.com/uploads/10001/20240226/7b96f812559616af230b55d0e81ac50a.jpg", "goods_sales": 0, "is_user_grade": false, "specList": [], "skuList": [ { "id": 10001, "goods_sku_id": "0", "goods_id": 10001, "image_id": 0, "goods_sku_no": "", "goods_price": "19.00", "line_price": "28.00", "stock_num": 100, "goods_weight": 1, "goods_props": null, "spec_value_ids": null, "image_url": null } ], "video": null, "videoCover": null } } } ``` ———————————————— ##### 接口功能 > 4.获取用户信息 ##### URL > `http://vapeshop.com/index.php?s=/api/user/info` ##### HTTP 请求方式 > GET ##### 请求参数 > | 参数 | 必选 | 类型 | 说明 | > | :-------- | :--- | :------ |------| ##### 返回字段 > | 返回字段 | 字段类型 | 说明 | > | :------- | :------- | :------------------------------- | > | status | int | 返回结果状态。0:正常;1:错误。 | > | message | string | 接口消息 | > | data | object | 数据 | > | userInfo | int | 用户ID | ```javascript { "status": 200, "message": "success", "data": { "userInfo": { "user_id": 1, "mobile": "541469799@qq.com", "nick_name": "541****99@qq.com", "avatar_id": 0, "gender": "未知", "country": "", "province": "", "city": "", "address_id": 0, "balance": "0.00", "points": 0, "pay_money": "0.00", "expend_money": "0.00", "grade_id": 0, "platform": "1", "last_login_time": 1708943634, "avatar": null, "grade": null } } } ``` ———————————————— ##### 接口功能 > 5.商品加入购物车 ##### URL > `http://vapeshop.com/index.php?s=/api/cart/add` ##### HTTP 请求方式 > GET ##### 请求参数 > | 参数 | 必选 | 类型 | 说明 | > |:---| :--- |:--------|------| > | goodsId | int | 商品ID | > | goodsSkuId | int | 商品SKUID | > | goodsNum | int | 商品数量 | ```javascript { "goodsId": 10001, "goodsSkuId": "0", "goodsNum": 1 } ``` ##### 返回字段 > | 返回字段 | 字段类型 | 说明 | > | :------- | :------- |:------------------| > | status | int | 返回结果状态。0:正常;1:错误。 | > | message | string | 接口消息 | > | data | object | 数据 | > | cartTotal | int | 购物车商品数量 | ```javascript { "status": 200, "message": "加入购物车成功", "data": { "cartTotal": 1 } } ``` ———————————————— ##### 接口功能 > 6.下单接口 ##### URL > `http://vapeshop.com/index.php?s=/api/checkout/order` ##### HTTP 请求方式 > GET ##### 请求参数 > | 参数 | 必选 | 类型 | 说明 | > |:---|:---|:-------|------| > | platform | 否 | int | 当前请求的客户端(APP、小程序、H5等) | > | mode | 是 | string | 结算模式(buyNow立即购买 cart购物车) | > | delivery | 是 | int | 配送方式(10快递配送 20上门自提) | > | shopId | 是 | int | 自提门店ID | > | couponId | 是 | int | 优惠券ID | > | isUsePoints | 是 | int | 是否使用积分抵扣(1使用 0不使用 | > | cartIds | 是 | string | 购物车ID集 | ```javascript { "mode": 10001, "delivery": "0", "shopId": 1, "couponId": 0, "isUsePoints": 0, "cartIds": "1,2,3", } ``` ##### 返回字段 > | 返回字段 | 字段类型 | 说明 | > | :------- | :------- |:------------------| > | status | int | 返回结果状态。0:正常;1:错误。 | > | message | string | 接口消息 | > | data | object | 数据 | > | cartTotal | int | 购物车商品数量 | ```javascript { "status": 200, "message": "加入购物车成功", "data": { "cartTotal": 1 } } ``` ———————————————— ##### 接口功能 > 6.积分明细列表 ##### URL > `http://vapeshop.com/index.php?s=/api/points.log/list` ##### HTTP 请求方式 > GET ##### 请求参数 > | 参数 | 必选 | 类型 | 说明 | > |:---|:---|:-------|------| ##### 返回字段 > | 返回字段 | 字段类型 | 说明 | > | :------- | :------- |:------------------| > | status | int | 返回结果状态。0:正常;1:错误。 | > | message | string | 接口消息 | > | data | object | 数据 | > | list | int | 积分数据 | ```javascript { "status": 200, "message": "success", "data": { "list": { "total": 1, "per_page": 15, "current_page": 1, "last_page": 1, "data": [ { "log_id": 10001, "user_id": 1, "value": 99, "describe": "gold ", "remark": "good", "create_time": null } ] } } } ``` ———————————————— ##### 接口功能 > 7.我的订单列表 ##### URL > `http://vapeshop.com/index.php?s=/api/order/list` ##### HTTP 请求方式 > GET ##### 请求参数 > | 参数 | 必选 | 类型 | 说明 | > |:---|:-------|:------------|------| > | dataType | string | 订单类型,all:全部 | ##### 返回字段 > | 返回字段 | 字段类型 | 说明 | > | :------- | :------- |:------------------| > | status | int | 返回结果状态。0:正常;1:错误。 | > | message | string | 接口消息 | > | data | object | 数据 | > | list | int | 积分数据 | ```javascript { "status": 200, "message": "success", "data": { "list": { "total": 0, "per_page": 15, "current_page": 1, "last_page": 0, "data": [] } } } ```