作者 jinglong

修改接口分开

<?php
namespace app\api\controller;
use app\common\controller\Api;
use think\Validate;
/**
* 品牌接口
*/
class Brand extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
protected $uid = '';
public function _initialize()
{
parent::_initialize();
$this->uid = $this->auth->getUserId();
}
/**
* @ApiTitle (品牌分类)
* @ApiSummary (品牌分类)
* @ApiMethod (GET)
* @ApiRoute (/api/brand/brandType)
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1574939519",
"data": {
"data": [
{
"id": 1,//品牌分类id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/d36d8475bc3bdb999dff26d019c608ed.png",//图片路径
"name": "HEDRMAR1",//品牌名称
"address": "葡萄牙1"//品牌产地
},
{
"id": 2,
"image": "http://jinglong.springchunjia.cn/uploads/20191127/c53f07984e6d64d00e9bf1c9fb6ebf72.png",
"name": "HEDRMAR2",
"address": "葡萄牙2"
}
],
"images": [//品牌专区右侧轮播图
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
]
}
})
*/
public function brandType(){
if($this->request->isGet()){
$arr = [];
$res = Common::selectSoftData('btype','id,image,name,address');
foreach ($res as &$value){
$value['image'] = $this->auth->absolutionUrlOne($value['image']);
}
$arr['data'] = $res;
//品牌专区轮播图(暂时写死)
$arr['images'] = [
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
];
$this->success('成功',$arr);
}else{
$this->error('请求方式错误');
}
}
/**
* @ApiTitle (品牌详情)
* @ApiSummary (品牌详情)
* @ApiMethod (GET)
* @ApiRoute (/api/brand/brandDetail)
*
* @ApiParams (name="b_id", type="inter", required=true, description="品牌分类id")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1575007401",
"data": {
"id": 1,//品牌id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/d36d8475bc3bdb999dff26d019c608ed.png",//品牌图片路径
"name": "HEDRMAR1",//品牌名称
"address": "葡萄牙1",//品牌所属地
"introduce": "超百年历史的葡萄牙餐具",//品牌简介
"brand_explain": "",//品牌详情(富文本)
"file": "http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4",//视频路径
"image_long": "http://jinglong.springchunjia.cn/uploads/20191127/bf35ec1b42a6d1c95355ce22fa633a43.jpg"//长图路径
}
})
*/
public function brandDetail(){
if($this->request->isGet()){
$b_id = $this->request->get('b_id');
$rule = config('verify.brand_detail');
$validate = new Validate($rule['rule'],$rule['msg']);
if (!$validate->check(['b_id'=>$b_id])) {
$this->error($validate->getError());
}
$res = Common::findSoftWhereData('btype',['id'=>$b_id],'createtime,updatetime,deletetime',true);
if($res){
$res['image'] = $this->auth->absolutionUrlOne($res['image']);
$res['file'] = $this->auth->absolutionUrlOne($res['file']);
$res['image_long'] = $this->auth->absolutionUrlOne($res['image_long']);
}
$this->success('成功',$res);
}else{
$this->error('请求方式错误');
}
}
/**
* @ApiTitle (品牌商品列表)
* @ApiSummary (品牌商品列表)
* @ApiMethod (GET)
* @ApiRoute (/api/brand/brandGoodsList)
*
* @ApiParams (name="b_id", type="inter", required=true, description="品牌id")
* @ApiParams (name="page", type="inter", required=true, description="分页页码")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1574941706",
"data": {
"data": [
{
"id": 7,//商品id
"image": "http://jinglong.springchunjia.cn/uploads/20191128/8a677f5a0418059bf1b974c50026af13.png",//图片路径
"name": "MONENT 动感系列",//商品名称
"tag": [//商品标签
"日式简约",
"隐秘乡奢",
"家庭情侣"
],
"new_price": 2199,//新人价格(未登录,未购买记录(个人中心返是否有购买记录),显示该字段,另加“新人价”标签)
"sale_price": 2299//销售价格
"expense_price": //运费(0:显示包运费标签)
},
{
"id": 4,
"image": "http://jinglong.springchunjia.cn/uploads/20191128/93971e55b83d1a09c1831f8197514305.png",
"name": "MONENT 动感系列",
"tag": [
"AB级",
"ABX级",
"ABN级"
],
"new_price": 2499,
"sale_price": 2599
},
],
"total_page": 1
}
})
*/
public function brandGoodsList(){
if($this->request->isGet()){
$b_id = $this->request->get('b_id');
$page = $this->request->get('page');
$rule = config('verify.brand_goods');
$validate = new Validate($rule['rule'],$rule['msg']);
if (!$validate->check(['b_id'=>$b_id,'page'=>$page])) {
$this->error($validate->getError());
}
$where = ['type'=>1,'t_id'=>$b_id];
$arr = Common::goodsList($where,$page);
$this->success('成功',$arr);
}else{
$this->error('请求方式错误');
}
}
}
... ...
... ... @@ -13,21 +13,28 @@ namespace app\api\controller;
use think\Db;
/**
* @ApiInternal 无
* 公共方法
*/
class Common
{
//查找单条数据
public static function findData($table,$where,$field){
/**
* 查找单条数据(软删除)
* @ApiInternal
*/
public static function findSoftWhereData($table,$where,$field,$except=false){
$res = Db::name($table)
->where($where)
->field($field)
->field($field,$except)
->useSoftDelete('deletetime')
->find();
return $res;
}
//查找单条数据(有排序)
public static function findOrderData($table,$where,$field,$order){
/**
* 查找单条数据(有排序)
* @ApiInternal
*/
public static function findWhereData($table,$where,$field,$order='id desc'){
$res = Db::name($table)
->where($where)
->field($field)
... ... @@ -36,68 +43,95 @@ class Common
return $res;
}
//查找多条数据(无排序,无分页,无条件)
public static function selectNoPositionData($table,$field){
/**
* 查找多条数据(无条件)
* @ApiInternal
*/
public static function selectData($table,$field,$order='id desc'){
$res = Db::name($table)
->field($field)
->order($order)
->select();
return $res;
}
//查找多条数据(有分页,无条件)
public static function selectNoPositionPageData($table,$where,$field,$page,$order='id desc'){
$limit = config('verify.limit');
/**
* 查找多条数据(软删除)
* @ApiInternal
*/
public static function selectSoftData($table,$field,$order='id desc'){
$res = Db::name($table)
->where($where)
->field($field)
->page($page,$limit)
->order($order)
->useSoftDelete('deletetime')
->select();
return $res;
}
//查找多条数据(有限制条数)
public static function selectLimitData($table,$field,$limit){
/**
* 查找多条数据(软删除,分页)
* @ApiInternal
*/
public static function selectSoftWherePageData($table,$where,$field,$page,$order='id desc'){
$limit = config('verify.limit');
$res = Db::name($table)
->where($where)
->field($field)
->limit($limit)
->page($page,$limit)
->order($order)
->useSoftDelete('deletetime')
->select();
return $res;
}
//查找多条数据(有限制条数,软删除)
public static function selectSoftLimitData($table,$field,$limit){
/**
* 查找多条数据(软删除,限制条数)
* @ApiInternal
*/
public static function selectSoftWhereLimitData($table,$where,$field,$order='id desc'){
$limit = config('verify.limit');
$res = Db::name($table)
->where($where)
->field($field)
->limit($limit)
->order('id desc')
->order($order)
->useSoftDelete('deletetime')
->select();
return $res;
}
//查找多条数据(无排序,无分页)
public static function selectData($table,$where,$field){
/**
* 查找多条数据(软删除,无条件,限制条数)
* @ApiInternal
*/
public static function selectSoftLimitData($table,$field,$order='id desc'){
$limit = config('verify.limit');
$res = Db::name($table)
->where($where)
->field($field)
->limit($limit)
->order($order)
->useSoftDelete('deletetime')
->select();
return $res;
}
//查找多条数据(有排序,无分页)
public static function selectOrderData($table,$where,$field,$order){
/**
* 查找多条数据(限制条数)
* @ApiInternal
*/
public static function selectLimitData($table,$field,$limit){
$res = Db::name($table)
->where($where)
->field($field)
->order($order)
->limit($limit)
->select();
return $res;
}
//查找多条数据(有排序,有限制,无分页)
public static function selectOrderLimitData($table,$where,$field,$limit,$order){
/**
* 查找多条数据(有限制条数)
* @ApiInternal
*/
public static function selectWhereLimitData($table,$where,$field,$limit,$order='id desc'){
$res = Db::name($table)
->where($where)
->field($field)
... ... @@ -107,7 +141,10 @@ class Common
return $res;
}
//查询总条数
/**
* 查询总条数
* @ApiInternal
*/
public static function count($table,$where){
$limit = config('verify.limit');
$count = Db::name($table)
... ... @@ -116,4 +153,47 @@ class Common
return ceil($count/$limit);
}
/**
* 查询总条数(软删除)
* @ApiInternal
*/
public static function countSoft($table,$where){
$limit = config('verify.limit');
$count = Db::name($table)
->where($where)
->useSoftDelete('deletetime')
->count();
return ceil($count/$limit);
}
/**
* 商品列表
* @ApiInternal
*/
public static function goodsList($where,$page){
$arr = [];
$res = Common::selectSoftWherePageData('goods',$where,'id,image,name,tag,new_price,sale_price,expense_price',$page);
foreach ($res as &$value){
$value['image'] = self::absolutionUrlOne($value['image']);
$value['tag'] = explode('|',$value['tag']);
}
$arr['data'] = $res;
//总页数
$arr['total_page'] = Common::countSoft('goods',$where);
return $arr;
}
/**
* 单张相对路径转绝对路径
* @ApiInternal
*/
public static function absolutionUrlOne($image){
$url = '';
if(!empty($image)){
$host = config('verify.host');
$url = $host.$image;
}
return $url;
}
}
... ...
<?php
namespace app\api\controller;
use app\common\controller\Api;
use think\Validate;
/**
* 商品接口
*/
class Goods extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
protected $uid = '';
public function _initialize()
{
parent::_initialize();
$this->uid = $this->auth->getUserId();
}
/**
* @ApiTitle (商品详情)
* @ApiSummary (商品详情)
* @ApiMethod (GET)
* @ApiRoute (/api/goods/goodsDetail)
*
* @ApiParams (name="goods_id", type="inter", required=true, description="商品id")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1574993089",
"data": {
"id": 1,//商品id
"type": 1,
"t_id": 1,
"file": "http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4",//视频路径
"name": "MONENT 动感系列",//商品名称
"name_en": "Monent dynamic series",//商品名称(英文)
"new_price": 2499,//新人价格
"sale_price": 2599,//销售价格
"market_price": 2699,//市场价格
"expense_price": 0,//运费(0:显示包运费标签)
"style": [//商品规格
"主餐匙,茶匙各1件",
"古堡灰"
],
"tag": [//商品标签
"AB级",
"ABX级",
"ABN级"
],
"stock": 100,//商品库存
"introduce": "轻波款,为客厅缀上霞光淡雾",//商品简介
"detail": "",//商品详情(富文本)
"frame": [//视频第一到第六帧图片(无视频返回空数组)
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/1",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/2",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/3",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/4",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/5",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/6"
],
"b_type": {//所属品牌(品类则返回空字符串)
"id": 1,//品牌id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/d36d8475bc3bdb999dff26d019c608ed.png",//品牌图片路径
"name": "HEDRMAR1",//品牌名称
"address": "葡萄牙1"//品牌所属地
}
}
})
*/
public function goodsDetail(){
if($this->request->isGet()){
$goods_id = $this->request->get('goods_id');
$rule = config('verify.goods_detail');
$validate = new Validate($rule['rule'],$rule['msg']);
if (!$validate->check(['goods_id'=>$goods_id])) {
$this->error($validate->getError());
}
$res = Common::findSoftWhereData('goods',['id'=>$goods_id],'type_name,is_design,is_recommend,sort,image,createtime,updatetime,deletetime',true);
if($res){
if($res['file']){
//图片取视频帧
$frame = [];
for($i=1;$i<7;$i++){
$image_url = $this->auth->absolutionUrlOneFrame($res['file'],$i);
array_push($frame,$image_url);
}
$res['frame'] = $frame;
$res['file'] = $this->auth->absolutionUrlOne($res['file']);
}else{
$res['frame'] = [];
$res['file'] = '';
}
$res['style'] = explode('|',$res['style']);
$res['tag'] = explode('|',$res['tag']);
//所属品牌分类
if($res['type'] == 1){
//查询所属品牌
$b_type = Common::findSoftWhereData('btype',['id'=>$res['t_id']],'id,image,name,address');
$b_type['image'] = $this->auth->absolutionUrlOne($b_type['image']);
$res['b_type'] = $b_type;
}else{
$res['b_type'] = '';
}
}
$this->success('成功',$res);
}else{
$this->error('请求方式错误');
}
}
/**
* @ApiTitle (别人也在看商品列表)
* @ApiSummary (别人也在看商品列表)
* @ApiMethod (GET)
* @ApiRoute (/api/goods/otherBrowseGoodsList)
*
* @ApiParams (name="goods_id", type="inter", required=true, description="商品id")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1574941706",
"data": {
"data": [
{
"id": 7,//商品id
"image": "http://jinglong.springchunjia.cn/uploads/20191128/8a677f5a0418059bf1b974c50026af13.png",//图片路径
"name": "MONENT 动感系列",//商品名称
"tag": [//商品标签
"日式简约",
"隐秘乡奢",
"家庭情侣"
],
"new_price": 2199,//新人价格(未登录,未购买记录(个人中心返是否有购买记录),显示该字段,另加“新人价”标签)
"sale_price": 2299//销售价格
"expense_price": //运费(0:显示包运费标签)
},
{
"id": 4,
"image": "http://jinglong.springchunjia.cn/uploads/20191128/93971e55b83d1a09c1831f8197514305.png",
"name": "MONENT 动感系列",
"tag": [
"AB级",
"ABX级",
"ABN级"
],
"new_price": 2499,
"sale_price": 2599
},
],
"total_page": 1
}
})
*/
public function otherBrowseGoodsList(){
if($this->request->isGet()){
$goods_id = $this->request->get('goods_id');
$rule = config('verify.goods_detail');
$validate = new Validate($rule['rule'],$rule['msg']);
if (!$validate->check(['goods_id'=>$goods_id])) {
$this->error($validate->getError());
}
$result = Common::findSoftWhereData('goods',['id'=>$goods_id],'id,type,t_id');
$where = [];
if($result){
$where['type'] = $result['type'];
$where['t_id'] = $result['t_id'];
$where['id'] = ['<>',$result['id']];
}
$res = Common::selectSoftWhereLimitData('goods',$where,'id,image,name,tag,new_price,sale_price,expense_price');
foreach ($res as &$value){
$value['image'] = $this->auth->absolutionUrlOne($value['image']);
$value['tag'] = explode('|',$value['tag']);
}
$this->success('成功',$res);
}else{
$this->error('请求方式错误');
}
}
}
... ...
... ... @@ -3,7 +3,6 @@
namespace app\api\controller;
use app\common\controller\Api;
use think\Db;
use think\Validate;
/**
* 首页接口
... ... @@ -95,22 +94,21 @@ class Index extends Api
if($this->request->isGet()){
$arr = [];
//轮播图
$res_banner = Common::selectNoPositionData('banner','id,image');
$res_banner = Common::selectData('banner','id,image');
foreach ($res_banner as &$b_value){
$b_value['image'] = $this->auth->absolutionUrlOne($b_value['image']);
}
$arr['res_banner'] = $res_banner;
//首页广告位
$res_advert = Common::findOrderData('advert',['type'=>0],'id,image','id desc');
$res_advert = Common::findWhereData('advert',['type'=>0],'id,image');
if($res_advert){
$res_advert['image'] = $this->auth->absolutionUrlOne($res_advert['image']);
}
$arr['res_advert'] = $res_advert;
//设计师作品
$design_limit = config('verify.design_limit');
$res_design = Common::selectOrderLimitData('goods',['is_design'=>1],'id,name,introduce,sale_price,file',$design_limit,'sort desc');
$res_design = Common::selectSoftWhereLimitData('goods',['is_design'=>1],'id,name,introduce,sale_price,file','sort desc');
foreach ($res_design as &$d_value){
//获取视频帧
$d_value['image'] = $this->auth->absolutionUrlOneFrame($d_value['file'],2);
... ... @@ -119,16 +117,14 @@ class Index extends Api
$arr['res_design'] = $res_design;
//用户晒单
$u_list_limit = config('verify.u_list_limit');
$res_u_list = Common::selectSoftLimitData('ulist','id,images,title,nickname,address',$u_list_limit);
$res_u_list = Common::selectSoftLimitData('ulist','id,images,title,nickname,address');
foreach ($res_u_list as &$u_value){
$u_value['images'] = $this->auth->absolutionUrl($u_value['images']);
}
$arr['res_u_list'] = $res_u_list;
//大牌专区
$b_type_limit = config('verify.b_type_limit');
$res_b_type = Common::selectLimitData('btype','id,image,name,address,introduce',$b_type_limit);
$res_b_type = Common::selectSoftLimitData('btype','id,image,name,address,introduce');
foreach ($res_b_type as &$t_value){
$t_value['image'] = $this->auth->absolutionUrlOne($t_value['image']);
}
... ... @@ -141,106 +137,38 @@ class Index extends Api
}
/**
* @ApiTitle (品类分类)
* @ApiSummary (品类分类)
* @ApiTitle (弹窗广告位)
* @ApiSummary (弹窗广告位)
* @ApiMethod (GET)
* @ApiRoute (/api/index/sortType)
* @ApiRoute (/api/index/popupAdvert)
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1574939035",
"data": [
{
"id": 1,//品类分类id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/6b3a06ba3404d5cd74e2483a1b7e93b2.png",//图片路径
"images": [//轮播图路径
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
],
"name": "箱包"//品类分类名称
},
{
"id": 2,
"image": "http://jinglong.springchunjia.cn/uploads/20191127/287ca016a4d41a239ec77c91d982309d.png",
"images": [
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
],
"name": "配饰"
},
]
})
*/
public function sortType(){
if($this->request->isGet()){
$res = Common::selectNoPositionData('gtype','id,image,images,name');
foreach ($res as &$value){
$value['image'] = $this->auth->absolutionUrlOne($value['image']);
$value['images'] = $this->auth->absolutionUrl($value['images']);
}
$this->success('成功',$res);
}else{
$this->error('请求方式错误');
"time": "1574989615",
"data": {//没有则不显示
"id": 2,//弹窗广告位id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/0b20812d4f80307dd1025db71d690395.png"//图片路径
}
}
/**
* @ApiTitle (品牌分类)
* @ApiSummary (品牌分类)
* @ApiMethod (GET)
* @ApiRoute (/api/index/brandType)
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1574939519",
"data": {
"data": [
{
"id": 1,//品牌id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/d36d8475bc3bdb999dff26d019c608ed.png",//图片路径
"name": "HEDRMAR1",//品牌名称
"address": "葡萄牙1"//品牌产地
},
{
"id": 2,
"image": "http://jinglong.springchunjia.cn/uploads/20191127/c53f07984e6d64d00e9bf1c9fb6ebf72.png",
"name": "HEDRMAR2",
"address": "葡萄牙2"
},
],
"images": [//品牌专区右侧轮播图
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
]
}
})
})
*/
public function brandType(){
public function popupAdvert(){
if($this->request->isGet()){
$arr = [];
$res = Common::selectNoPositionData('btype','id,image,name,address');
foreach ($res as &$value){
$value['image'] = $this->auth->absolutionUrlOne($value['image']);
$res = Common::findWhereData('advert',['type'=>1],'id,image');
if($res){
$res['image'] = $this->auth->absolutionUrlOne($res['image']);
}
$arr['data'] = $res;
//品牌专区轮播图(暂时写死)
$arr['images'] = [
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
];
$this->success('成功',$arr);
$this->success('成功',$res);
}else{
$this->error('请求方式错误');
}
}
/**
* @ApiTitle (推荐商品)
* @ApiSummary (推荐商品)
* @ApiTitle (推荐商品列表)
* @ApiSummary (推荐商品列表)
* @ApiMethod (GET)
* @ApiRoute (/api/index/recommendGoods)
* @ApiRoute (/api/index/recommendGoodsList)
*
* @ApiParams (name="page", type="inter", required=true, description="分页页码")
*
... ... @@ -280,7 +208,7 @@ class Index extends Api
}
})
*/
public function recommendGoods(){
public function recommendGoodsList(){
if($this->request->isGet()){
$page = $this->request->get('page');
$rule = config('verify.page');
... ... @@ -289,18 +217,12 @@ class Index extends Api
$this->error($validate->getError());
}
$arr = [];
$res = Common::selectNoPositionPageData('goods',['is_recommend'=>1],'id,image,name,tag,new_price,sale_price,expense_price',$page);
foreach ($res as &$value){
$value['image'] = $this->auth->absolutionUrlOne($value['image']);
$value['tag'] = explode('|',$value['tag']);
}
$arr['data'] = $res;
//总页数
$arr['total_page'] = Common::count('goods',['is_recommend'=>1]);
$where = ['is_recommend'=>1];
$arr = Common::goodsList($where,$page);
$this->success('成功',$arr);
}else{
$this->error('请求方式错误');
}
}
}
... ...
<?php
namespace app\api\controller;
use app\common\controller\Api;
use think\Validate;
/**
* 品类接口
*/
class Sort extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
protected $uid = '';
public function _initialize()
{
parent::_initialize();
$this->uid = $this->auth->getUserId();
}
/**
* @ApiTitle (品类分类)
* @ApiSummary (品类分类)
* @ApiMethod (GET)
* @ApiRoute (/api/sort/sortType)
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1574939035",
"data": [
{
"id": 1,//品类分类id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/6b3a06ba3404d5cd74e2483a1b7e93b2.png",//图片路径
"images": [//轮播图路径
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
],
"name": "箱包"//品类分类名称
},
{
"id": 2,
"image": "http://jinglong.springchunjia.cn/uploads/20191127/287ca016a4d41a239ec77c91d982309d.png",
"images": [
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
],
"name": "配饰"
},
]
})
*/
public function sortType(){
if($this->request->isGet()){
$res = Common::selectData('gtype','id,image,images,name');
foreach ($res as &$value){
$value['image'] = $this->auth->absolutionUrlOne($value['image']);
$value['images'] = $this->auth->absolutionUrl($value['images']);
}
$this->success('成功',$res);
}else{
$this->error('请求方式错误');
}
}
/**
* @ApiTitle (品类商品列表)
* @ApiSummary (品类商品列表)
* @ApiMethod (GET)
* @ApiRoute (/api/sort/sortGoodsList)
*
* @ApiParams (name="s_id", type="inter", required=true, description="品类分类id")
* @ApiParams (name="page", type="inter", required=true, description="分页页码")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1574941706",
"data": {
"data": [
{
"id": 7,//商品id
"image": "http://jinglong.springchunjia.cn/uploads/20191128/8a677f5a0418059bf1b974c50026af13.png",//图片路径
"name": "MONENT 动感系列",//商品名称
"tag": [//商品标签
"日式简约",
"隐秘乡奢",
"家庭情侣"
],
"new_price": 2199,//新人价格(未登录,未购买记录(个人中心返是否有购买记录),显示该字段,另加“新人价”标签)
"sale_price": 2299//销售价格
"expense_price": //运费(0:显示包运费标签)
},
{
"id": 4,
"image": "http://jinglong.springchunjia.cn/uploads/20191128/93971e55b83d1a09c1831f8197514305.png",
"name": "MONENT 动感系列",
"tag": [
"AB级",
"ABX级",
"ABN级"
],
"new_price": 2499,
"sale_price": 2599
},
],
"total_page": 1
}
})
*/
public function sortGoodsList(){
if($this->request->isGet()){
$s_id = $this->request->get('s_id');
$page = $this->request->get('page');
$rule = config('verify.sort_goods');
$validate = new Validate($rule['rule'],$rule['msg']);
if (!$validate->check(['s_id'=>$s_id,'page'=>$page])) {
$this->error($validate->getError());
}
$where = ['type'=>0,'t_id'=>$s_id];
$arr = Common::goodsList($where,$page);
$this->success('成功',$arr);
}else{
$this->error('请求方式错误');
}
}
}
... ...
... ... @@ -21,12 +21,6 @@ return [
'host' => 'http://jinglong.springchunjia.cn',
//分页数
'limit' => 10,
//设计师分页
'design_limit' => 10,
//用户晒单分页
'u_list_limit' => 10,
//大牌专区分页
'b_type_limit' => 10,
//小程序登录
'user' => [
'rule' => [
... ... @@ -40,7 +34,7 @@ return [
'avatar' => '头像不能为空',
]
],
//城市分页
//分页
'page' => [
'rule' => [
'page' => 'require|number',
... ... @@ -50,4 +44,50 @@ return [
'page.number' => '分页页码必须为数字',
]
],
//品类商品列表
'sort_goods' => [
'rule' => [
's_id' => 'require|number',
'page' => 'require|number',
],
'msg' => [
's_id.require' => '品类分类id不能为空',
's_id.number' => '品类分类id必须为数字',
'page.require' => '分页页码不能为空',
'page.number' => '分页页码必须为数字',
]
],
//品类商品列表
'brand_goods' => [
'rule' => [
'b_id' => 'require|number',
'page' => 'require|number',
],
'msg' => [
'b_id.require' => '品牌分类id不能为空',
'b_id.number' => '品牌分类id必须为数字',
'page.require' => '分页页码不能为空',
'page.number' => '分页页码必须为数字',
]
],
//商品详情
'goods_detail' => [
'rule' => [
'goods_id' => 'require|number',
],
'msg' => [
'goods_id.require' => '商品id不能为空',
'goods_id.number' => '商品id必须为数字',
]
],
//品牌详情
'brand_detail' => [
'rule' => [
'b_id' => 'require|number',
],
'msg' => [
'b_id.require' => '品牌id不能为空',
'b_id.number' => '品牌id必须为数字',
]
],
];
\ No newline at end of file
... ...
... ... @@ -139,48 +139,757 @@
<!-- menu -->
<div id="sidebar">
<div class="list-group panel">
<a href="#@ApiInternal 无" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">@ApiInternal 无 <i class="fa fa-caret-down"></i></a>
<div class="child collapse" id="@ApiInternal 无">
<a href="#品牌接口" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">品牌接口 <i class="fa fa-caret-down"></i></a>
<div class="child collapse" id="品牌接口">
<a href="javascript:;" data-id="0" class="list-group-item">品牌分类</a>
<a href="javascript:;" data-id="1" class="list-group-item">品牌详情</a>
<a href="javascript:;" data-id="2" class="list-group-item">品牌商品列表</a>
</div>
<a href="#公共方法" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">公共方法 <i class="fa fa-caret-down"></i></a>
<div class="child collapse" id="公共方法">
</div>
<a href="#商品接口" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">商品接口 <i class="fa fa-caret-down"></i></a>
<div class="child collapse" id="商品接口">
<a href="javascript:;" data-id="3" class="list-group-item">商品详情</a>
<a href="javascript:;" data-id="4" class="list-group-item">别人也在看商品列表</a>
</div>
<a href="#首页接口" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">首页接口 <i class="fa fa-caret-down"></i></a>
<div class="child collapse" id="首页接口">
<a href="javascript:;" data-id="0" class="list-group-item">首页</a>
<a href="javascript:;" data-id="1" class="list-group-item">品类分类</a>
<a href="javascript:;" data-id="2" class="list-group-item">品牌分类</a>
<a href="javascript:;" data-id="3" class="list-group-item">推荐商品</a>
<a href="javascript:;" data-id="5" class="list-group-item">首页</a>
<a href="javascript:;" data-id="6" class="list-group-item">弹窗广告位</a>
<a href="javascript:;" data-id="7" class="list-group-item">推荐商品列表</a>
</div>
<a href="#品类接口" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">品类接口 <i class="fa fa-caret-down"></i></a>
<div class="child collapse" id="品类接口">
<a href="javascript:;" data-id="8" class="list-group-item">品类分类</a>
<a href="javascript:;" data-id="9" class="list-group-item">品类商品列表</a>
</div>
<a href="#个人中心接口" class="list-group-item" data-toggle="collapse" data-parent="#sidebar">个人中心接口 <i class="fa fa-caret-down"></i></a>
<div class="child collapse" id="个人中心接口">
<a href="javascript:;" data-id="4" class="list-group-item">小程序登录</a>
<a href="javascript:;" data-id="10" class="list-group-item">小程序登录</a>
</div>
</div>
</div>
<div class="panel-group" id="accordion">
<h2>@ApiInternal 无</h2>
<h2>品牌接口</h2>
<hr>
<div class="panel panel-default">
<div class="panel-heading" id="heading-0">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion0" href="#collapseOne0"> 品牌分类 <span class="text-muted">/api/brand/brandType</span></a>
</h4>
</div>
<div id="collapseOne0" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab0">
<li class="active"><a href="#info0" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox0" data-toggle="tab">在线测试</a></li>
<li><a href="#sample0" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info0">
<div class="well">
品牌分类 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>正文</strong></div>
<div class="panel-body">
</div>
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox0">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/brand/brandType" method="GET" name="form0" id="form0">
<div class="form-group">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="0">提交</button>
<button type="reset" class="btn btn-info" rel="0">重置</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>响应输出</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers0"></pre>
<pre id="response0"></pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>返回参数</strong></div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample0">
<div class="row">
<div class="col-md-12">
<pre id="sample_response0">{
"code": 1,
"msg": "成功",
"time": "1574939519",
"data": {
"data": [
{
"id": 1,//品牌分类id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/d36d8475bc3bdb999dff26d019c608ed.png",//图片路径
"name": "HEDRMAR1",//品牌名称
"address": "葡萄牙1"//品牌产地
},
{
"id": 2,
"image": "http://jinglong.springchunjia.cn/uploads/20191127/c53f07984e6d64d00e9bf1c9fb6ebf72.png",
"name": "HEDRMAR2",
"address": "葡萄牙2"
}
],
"images": [//品牌专区右侧轮播图
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
]
}
}</pre>
</div>
</div>
</div><!-- #sample -->
</div><!-- .tab-content -->
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" id="heading-1">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion1" href="#collapseOne1"> 品牌详情 <span class="text-muted">/api/brand/brandDetail</span></a>
</h4>
</div>
<div id="collapseOne1" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab1">
<li class="active"><a href="#info1" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox1" data-toggle="tab">在线测试</a></li>
<li><a href="#sample1" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info1">
<div class="well">
品牌详情 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>b_id</td>
<td>inter</td>
<td></td>
<td>品牌分类id</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>正文</strong></div>
<div class="panel-body">
</div>
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox1">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/brand/brandDetail" method="GET" name="form1" id="form1">
<div class="form-group">
<label class="control-label" for="b_id">b_id</label>
<input type="inter" class="form-control input-sm" id="b_id" required placeholder="品牌分类id" name="b_id">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="1">提交</button>
<button type="reset" class="btn btn-info" rel="1">重置</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>响应输出</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers1"></pre>
<pre id="response1"></pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>返回参数</strong></div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample1">
<div class="row">
<div class="col-md-12">
<pre id="sample_response1">{
"code": 1,
"msg": "成功",
"time": "1575007401",
"data": {
"id": 1,//品牌id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/d36d8475bc3bdb999dff26d019c608ed.png",//品牌图片路径
"name": "HEDRMAR1",//品牌名称
"address": "葡萄牙1",//品牌所属地
"introduce": "超百年历史的葡萄牙餐具",//品牌简介
"brand_explain": "",//品牌详情(富文本)
"file": "http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4",//视频路径
"image_long": "http://jinglong.springchunjia.cn/uploads/20191127/bf35ec1b42a6d1c95355ce22fa633a43.jpg"//长图路径
}
}</pre>
</div>
</div>
</div><!-- #sample -->
</div><!-- .tab-content -->
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" id="heading-2">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion2" href="#collapseOne2"> 品牌商品列表 <span class="text-muted">/api/brand/brandGoodsList</span></a>
</h4>
</div>
<div id="collapseOne2" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab2">
<li class="active"><a href="#info2" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox2" data-toggle="tab">在线测试</a></li>
<li><a href="#sample2" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info2">
<div class="well">
品牌商品列表 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>b_id</td>
<td>inter</td>
<td></td>
<td>品牌id</td>
</tr>
<tr>
<td>page</td>
<td>inter</td>
<td></td>
<td>分页页码</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>正文</strong></div>
<div class="panel-body">
</div>
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox2">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/brand/brandGoodsList" method="GET" name="form2" id="form2">
<div class="form-group">
<label class="control-label" for="b_id">b_id</label>
<input type="inter" class="form-control input-sm" id="b_id" required placeholder="品牌id" name="b_id">
</div>
<div class="form-group">
<label class="control-label" for="page">page</label>
<input type="inter" class="form-control input-sm" id="page" required placeholder="分页页码" name="page">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="2">提交</button>
<button type="reset" class="btn btn-info" rel="2">重置</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>响应输出</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers2"></pre>
<pre id="response2"></pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>返回参数</strong></div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample2">
<div class="row">
<div class="col-md-12">
<pre id="sample_response2">{
"code": 1,
"msg": "成功",
"time": "1574941706",
"data": {
"data": [
{
"id": 7,//商品id
"image": "http://jinglong.springchunjia.cn/uploads/20191128/8a677f5a0418059bf1b974c50026af13.png",//图片路径
"name": "MONENT 动感系列",//商品名称
"tag": [//商品标签
"日式简约",
"隐秘乡奢",
"家庭情侣"
],
"new_price": 2199,//新人价格(未登录,未购买记录(个人中心返是否有购买记录),显示该字段,另加“新人价”标签)
"sale_price": 2299//销售价格
"expense_price": //运费(0:显示包运费标签)
},
{
"id": 4,
"image": "http://jinglong.springchunjia.cn/uploads/20191128/93971e55b83d1a09c1831f8197514305.png",
"name": "MONENT 动感系列",
"tag": [
"AB级",
"ABX级",
"ABN级"
],
"new_price": 2499,
"sale_price": 2599
},
],
"total_page": 1
}
}</pre>
</div>
</div>
</div><!-- #sample -->
</div><!-- .tab-content -->
</div>
</div>
</div>
<h2>公共方法</h2>
<hr>
<h2>商品接口</h2>
<hr>
<div class="panel panel-default">
<div class="panel-heading" id="heading-3">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion3" href="#collapseOne3"> 商品详情 <span class="text-muted">/api/goods/goodsDetail</span></a>
</h4>
</div>
<div id="collapseOne3" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab3">
<li class="active"><a href="#info3" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox3" data-toggle="tab">在线测试</a></li>
<li><a href="#sample3" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info3">
<div class="well">
商品详情 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>goods_id</td>
<td>inter</td>
<td></td>
<td>商品id</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>正文</strong></div>
<div class="panel-body">
</div>
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox3">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/goods/goodsDetail" method="GET" name="form3" id="form3">
<div class="form-group">
<label class="control-label" for="goods_id">goods_id</label>
<input type="inter" class="form-control input-sm" id="goods_id" required placeholder="商品id" name="goods_id">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="3">提交</button>
<button type="reset" class="btn btn-info" rel="3">重置</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>响应输出</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers3"></pre>
<pre id="response3"></pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>返回参数</strong></div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample3">
<div class="row">
<div class="col-md-12">
<pre id="sample_response3">{
"code": 1,
"msg": "成功",
"time": "1574993089",
"data": {
"id": 1,//商品id
"type": 1,
"t_id": 1,
"file": "http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4",//视频路径
"name": "MONENT 动感系列",//商品名称
"name_en": "Monent dynamic series",//商品名称(英文)
"new_price": 2499,//新人价格
"sale_price": 2599,//销售价格
"market_price": 2699,//市场价格
"expense_price": 0,//运费(0:显示包运费标签)
"style": [//商品规格
"主餐匙,茶匙各1件",
"古堡灰"
],
"tag": [//商品标签
"AB级",
"ABX级",
"ABN级"
],
"stock": 100,//商品库存
"introduce": "轻波款,为客厅缀上霞光淡雾",//商品简介
"detail": "",//商品详情(富文本)
"frame": [//视频第一到第六帧图片(无视频返回空数组)
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/1",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/2",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/3",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/4",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/5",
"http://jinglong.springchunjia.cn/uploads/20191127/05d216e117e11bd3de352c155b42eaaa.mp4?vframe/jpg/offset/6"
],
"b_type": {//所属品牌(品类则返回空字符串)
"id": 1,//品牌id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/d36d8475bc3bdb999dff26d019c608ed.png",//品牌图片路径
"name": "HEDRMAR1",//品牌名称
"address": "葡萄牙1"//品牌所属地
}
}
}</pre>
</div>
</div>
</div><!-- #sample -->
</div><!-- .tab-content -->
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" id="heading-4">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion4" href="#collapseOne4"> 别人也在看商品列表 <span class="text-muted">/api/goods/otherBrowseGoodsList</span></a>
</h4>
</div>
<div id="collapseOne4" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab4">
<li class="active"><a href="#info4" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox4" data-toggle="tab">在线测试</a></li>
<li><a href="#sample4" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info4">
<div class="well">
别人也在看商品列表 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>goods_id</td>
<td>inter</td>
<td></td>
<td>商品id</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>正文</strong></div>
<div class="panel-body">
</div>
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox4">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/goods/otherBrowseGoodsList" method="GET" name="form4" id="form4">
<div class="form-group">
<label class="control-label" for="goods_id">goods_id</label>
<input type="inter" class="form-control input-sm" id="goods_id" required placeholder="商品id" name="goods_id">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="4">提交</button>
<button type="reset" class="btn btn-info" rel="4">重置</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>响应输出</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers4"></pre>
<pre id="response4"></pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>返回参数</strong></div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample4">
<div class="row">
<div class="col-md-12">
<pre id="sample_response4">{
"code": 1,
"msg": "成功",
"time": "1574941706",
"data": {
"data": [
{
"id": 7,//商品id
"image": "http://jinglong.springchunjia.cn/uploads/20191128/8a677f5a0418059bf1b974c50026af13.png",//图片路径
"name": "MONENT 动感系列",//商品名称
"tag": [//商品标签
"日式简约",
"隐秘乡奢",
"家庭情侣"
],
"new_price": 2199,//新人价格(未登录,未购买记录(个人中心返是否有购买记录),显示该字段,另加“新人价”标签)
"sale_price": 2299//销售价格
"expense_price": //运费(0:显示包运费标签)
},
{
"id": 4,
"image": "http://jinglong.springchunjia.cn/uploads/20191128/93971e55b83d1a09c1831f8197514305.png",
"name": "MONENT 动感系列",
"tag": [
"AB级",
"ABX级",
"ABN级"
],
"new_price": 2499,
"sale_price": 2599
},
],
"total_page": 1
}
}</pre>
</div>
</div>
</div><!-- #sample -->
</div><!-- .tab-content -->
</div>
</div>
</div>
<h2>首页接口</h2>
<hr>
<div class="panel panel-default">
<div class="panel-heading" id="heading-0">
<div class="panel-heading" id="heading-5">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion0" href="#collapseOne0"> 首页 <span class="text-muted">/api/index/index</span></a>
<a data-toggle="collapse" data-parent="#accordion5" href="#collapseOne5"> 首页 <span class="text-muted">/api/index/index</span></a>
</h4>
</div>
<div id="collapseOne0" class="panel-collapse collapse">
<div id="collapseOne5" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab0">
<li class="active"><a href="#info0" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox0" data-toggle="tab">在线测试</a></li>
<li><a href="#sample0" data-toggle="tab">返回示例</a></li>
<ul class="nav nav-tabs" id="doctab5">
<li class="active"><a href="#info5" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox5" data-toggle="tab">在线测试</a></li>
<li><a href="#sample5" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info0">
<div class="tab-pane active" id="info5">
<div class="well">
首页 </div>
<div class="panel panel-default">
... ... @@ -202,19 +911,19 @@
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox0">
<div class="tab-pane" id="sandbox5">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/index" method="GET" name="form0" id="form0">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/index" method="GET" name="form5" id="form5">
<div class="form-group">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="0">提交</button>
<button type="reset" class="btn btn-info" rel="0">重置</button>
<button type="submit" class="btn btn-success send" rel="5">提交</button>
<button type="reset" class="btn btn-info" rel="5">重置</button>
</div>
</form>
</div>
... ... @@ -224,8 +933,8 @@
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers0"></pre>
<pre id="response0"></pre>
<pre id="response_headers5"></pre>
<pre id="response5"></pre>
</div>
</div>
</div>
... ... @@ -240,10 +949,10 @@
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample0">
<div class="tab-pane" id="sample5">
<div class="row">
<div class="col-md-12">
<pre id="sample_response0">{
<pre id="sample_response5">{
"code": 1,
"msg": "成功",
"time": "1574935164",
... ... @@ -317,28 +1026,28 @@
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" id="heading-1">
<div class="panel-heading" id="heading-6">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion1" href="#collapseOne1"> 品类分类 <span class="text-muted">/api/index/sortType</span></a>
<a data-toggle="collapse" data-parent="#accordion6" href="#collapseOne6"> 弹窗广告位 <span class="text-muted">/api/index/popupAdvert</span></a>
</h4>
</div>
<div id="collapseOne1" class="panel-collapse collapse">
<div id="collapseOne6" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab1">
<li class="active"><a href="#info1" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox1" data-toggle="tab">在线测试</a></li>
<li><a href="#sample1" data-toggle="tab">返回示例</a></li>
<ul class="nav nav-tabs" id="doctab6">
<li class="active"><a href="#info6" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox6" data-toggle="tab">在线测试</a></li>
<li><a href="#sample6" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info1">
<div class="tab-pane active" id="info6">
<div class="well">
品类分类 </div>
弹窗广告位 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
... ... @@ -358,19 +1067,19 @@
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox1">
<div class="tab-pane" id="sandbox6">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/sortType" method="GET" name="form1" id="form1">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/popupAdvert" method="GET" name="form6" id="form6">
<div class="form-group">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="1">提交</button>
<button type="reset" class="btn btn-info" rel="1">重置</button>
<button type="submit" class="btn btn-success send" rel="6">提交</button>
<button type="reset" class="btn btn-info" rel="6">重置</button>
</div>
</form>
</div>
... ... @@ -380,8 +1089,8 @@
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers1"></pre>
<pre id="response1"></pre>
<pre id="response_headers6"></pre>
<pre id="response6"></pre>
</div>
</div>
</div>
... ... @@ -396,34 +1105,18 @@
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample1">
<div class="tab-pane" id="sample6">
<div class="row">
<div class="col-md-12">
<pre id="sample_response1">{
<pre id="sample_response6">{
"code": 1,
"msg": "成功",
"time": "1574939035",
"data": [
{
"id": 1,//品类分类id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/6b3a06ba3404d5cd74e2483a1b7e93b2.png",//图片路径
"images": [//轮播图路径
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
],
"name": "箱包"//品类分类名称
},
{
"id": 2,
"image": "http://jinglong.springchunjia.cn/uploads/20191127/287ca016a4d41a239ec77c91d982309d.png",
"images": [
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
],
"name": "配饰"
},
]
}</pre>
"time": "1574989615",
"data": {//没有则不显示
"id": 2,//弹窗广告位id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/0b20812d4f80307dd1025db71d690395.png"//图片路径
}
}</pre>
</div>
</div>
</div><!-- #sample -->
... ... @@ -433,28 +1126,28 @@
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" id="heading-2">
<div class="panel-heading" id="heading-7">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion2" href="#collapseOne2"> 品牌分类 <span class="text-muted">/api/index/brandType</span></a>
<a data-toggle="collapse" data-parent="#accordion7" href="#collapseOne7"> 推荐商品列表 <span class="text-muted">/api/index/recommendGoodsList</span></a>
</h4>
</div>
<div id="collapseOne2" class="panel-collapse collapse">
<div id="collapseOne7" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab2">
<li class="active"><a href="#info2" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox2" data-toggle="tab">在线测试</a></li>
<li><a href="#sample2" data-toggle="tab">返回示例</a></li>
<ul class="nav nav-tabs" id="doctab7">
<li class="active"><a href="#info7" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox7" data-toggle="tab">在线测试</a></li>
<li><a href="#sample7" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info2">
<div class="tab-pane active" id="info7">
<div class="well">
品牌分类 </div>
推荐商品列表 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
... ... @@ -464,7 +1157,24 @@
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>page</td>
<td>inter</td>
<td></td>
<td>分页页码</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
... ... @@ -474,19 +1184,20 @@
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox2">
<div class="tab-pane" id="sandbox7">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/brandType" method="GET" name="form2" id="form2">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/recommendGoodsList" method="GET" name="form7" id="form7">
<div class="form-group">
<label class="control-label" for="page">page</label>
<input type="inter" class="form-control input-sm" id="page" required placeholder="分页页码" name="page">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="2">提交</button>
<button type="reset" class="btn btn-info" rel="2">重置</button>
<button type="submit" class="btn btn-success send" rel="7">提交</button>
<button type="reset" class="btn btn-info" rel="7">重置</button>
</div>
</form>
</div>
... ... @@ -496,8 +1207,8 @@
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers2"></pre>
<pre id="response2"></pre>
<pre id="response_headers7"></pre>
<pre id="response7"></pre>
</div>
</div>
</div>
... ... @@ -512,34 +1223,162 @@
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample2">
<div class="tab-pane" id="sample7">
<div class="row">
<div class="col-md-12">
<pre id="sample_response2">{
<pre id="sample_response7">{
"code": 1,
"msg": "成功",
"time": "1574939519",
"time": "1574941706",
"data": {
"data": [
{
"id": 1,//品牌id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/d36d8475bc3bdb999dff26d019c608ed.png",//图片路径
"name": "HEDRMAR1",//品牌名称
"address": "葡萄牙1"//品牌产地
},
{
"id": 2,
"image": "http://jinglong.springchunjia.cn/uploads/20191127/c53f07984e6d64d00e9bf1c9fb6ebf72.png",
"name": "HEDRMAR2",
"address": "葡萄牙2"
},
{
"id": 7,//商品id
"image": "http://jinglong.springchunjia.cn/uploads/20191128/8a677f5a0418059bf1b974c50026af13.png",//图片路径
"name": "MONENT 动感系列",//商品名称
"tag": [//商品标签
"日式简约",
"隐秘乡奢",
"家庭情侣"
],
"new_price": 2199,//新人价格(未登录,未购买记录(个人中心返是否有购买记录),显示该字段,另加“新人价”标签)
"sale_price": 2299//销售价格
"expense_price": //运费(0:显示包运费标签)
},
{
"id": 4,
"image": "http://jinglong.springchunjia.cn/uploads/20191128/93971e55b83d1a09c1831f8197514305.png",
"name": "MONENT 动感系列",
"tag": [
"AB级",
"ABX级",
"ABN级"
],
"new_price": 2499,
"sale_price": 2599
},
],
"total_page": 1
}
}</pre>
</div>
</div>
</div><!-- #sample -->
</div><!-- .tab-content -->
</div>
</div>
</div>
<h2>品类接口</h2>
<hr>
<div class="panel panel-default">
<div class="panel-heading" id="heading-8">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion8" href="#collapseOne8"> 品类分类 <span class="text-muted">/api/sort/sortType</span></a>
</h4>
</div>
<div id="collapseOne8" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab8">
<li class="active"><a href="#info8" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox8" data-toggle="tab">在线测试</a></li>
<li><a href="#sample8" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info8">
<div class="well">
品类分类 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>正文</strong></div>
<div class="panel-body">
</div>
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox8">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/sort/sortType" method="GET" name="form8" id="form8">
<div class="form-group">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="8">提交</button>
<button type="reset" class="btn btn-info" rel="8">重置</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>响应输出</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers8"></pre>
<pre id="response8"></pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>返回参数</strong></div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample8">
<div class="row">
<div class="col-md-12">
<pre id="sample_response8">{
"code": 1,
"msg": "成功",
"time": "1574939035",
"data": [
{
"id": 1,//品类分类id
"image": "http://jinglong.springchunjia.cn/uploads/20191127/6b3a06ba3404d5cd74e2483a1b7e93b2.png",//图片路径
"images": [//轮播图路径
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
],
"images": [//品牌专区右侧轮播图
"name": "箱包"//品类分类名称
},
{
"id": 2,
"image": "http://jinglong.springchunjia.cn/uploads/20191127/287ca016a4d41a239ec77c91d982309d.png",
"images": [
"http://jinglong.springchunjia.cn/uploads/20191127/febfea9a34c918cb2f100f669ede2547.png",
"http://jinglong.springchunjia.cn/uploads/20191127/042a3256122af7b10e26efb5e7649904.png"
]
}
}</pre>
],
"name": "配饰"
},
]
}</pre>
</div>
</div>
</div><!-- #sample -->
... ... @@ -549,28 +1388,28 @@
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" id="heading-3">
<div class="panel-heading" id="heading-9">
<h4 class="panel-title">
<span class="label label-success">GET</span>
<a data-toggle="collapse" data-parent="#accordion3" href="#collapseOne3"> 推荐商品 <span class="text-muted">/api/index/recommendGoods</span></a>
<a data-toggle="collapse" data-parent="#accordion9" href="#collapseOne9"> 品类商品列表 <span class="text-muted">/api/sort/sortGoodsList</span></a>
</h4>
</div>
<div id="collapseOne3" class="panel-collapse collapse">
<div id="collapseOne9" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab3">
<li class="active"><a href="#info3" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox3" data-toggle="tab">在线测试</a></li>
<li><a href="#sample3" data-toggle="tab">返回示例</a></li>
<ul class="nav nav-tabs" id="doctab9">
<li class="active"><a href="#info9" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox9" data-toggle="tab">在线测试</a></li>
<li><a href="#sample9" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info3">
<div class="tab-pane active" id="info9">
<div class="well">
推荐商品 </div>
品类商品列表 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
... ... @@ -591,6 +1430,12 @@
</thead>
<tbody>
<tr>
<td>s_id</td>
<td>inter</td>
<td></td>
<td>品类分类id</td>
</tr>
<tr>
<td>page</td>
<td>inter</td>
<td></td>
... ... @@ -607,20 +1452,24 @@
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox3">
<div class="tab-pane" id="sandbox9">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/recommendGoods" method="GET" name="form3" id="form3">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/sort/sortGoodsList" method="GET" name="form9" id="form9">
<div class="form-group">
<label class="control-label" for="s_id">s_id</label>
<input type="inter" class="form-control input-sm" id="s_id" required placeholder="品类分类id" name="s_id">
</div>
<div class="form-group">
<label class="control-label" for="page">page</label>
<input type="inter" class="form-control input-sm" id="page" required placeholder="分页页码" name="page">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="3">提交</button>
<button type="reset" class="btn btn-info" rel="3">重置</button>
<button type="submit" class="btn btn-success send" rel="9">提交</button>
<button type="reset" class="btn btn-info" rel="9">重置</button>
</div>
</form>
</div>
... ... @@ -630,8 +1479,8 @@
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers3"></pre>
<pre id="response3"></pre>
<pre id="response_headers9"></pre>
<pre id="response9"></pre>
</div>
</div>
</div>
... ... @@ -646,10 +1495,10 @@
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample3">
<div class="tab-pane" id="sample9">
<div class="row">
<div class="col-md-12">
<pre id="sample_response3">{
<pre id="sample_response9">{
"code": 1,
"msg": "成功",
"time": "1574941706",
... ... @@ -695,26 +1544,26 @@
<h2>个人中心接口</h2>
<hr>
<div class="panel panel-default">
<div class="panel-heading" id="heading-4">
<div class="panel-heading" id="heading-10">
<h4 class="panel-title">
<span class="label label-primary">POST</span>
<a data-toggle="collapse" data-parent="#accordion4" href="#collapseOne4"> 小程序登录 <span class="text-muted">/api/user/login</span></a>
<a data-toggle="collapse" data-parent="#accordion10" href="#collapseOne10"> 小程序登录 <span class="text-muted">/api/user/login</span></a>
</h4>
</div>
<div id="collapseOne4" class="panel-collapse collapse">
<div id="collapseOne10" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab4">
<li class="active"><a href="#info4" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox4" data-toggle="tab">在线测试</a></li>
<li><a href="#sample4" data-toggle="tab">返回示例</a></li>
<ul class="nav nav-tabs" id="doctab10">
<li class="active"><a href="#info10" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox10" data-toggle="tab">在线测试</a></li>
<li><a href="#sample10" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info4">
<div class="tab-pane active" id="info10">
<div class="well">
小程序登录 </div>
<div class="panel panel-default">
... ... @@ -765,13 +1614,13 @@
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox4">
<div class="tab-pane" id="sandbox10">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/login" method="POST" name="form4" id="form4">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/login" method="POST" name="form10" id="form10">
<div class="form-group">
<label class="control-label" for="code">code</label>
<input type="string" class="form-control input-sm" id="code" required placeholder="小程序code" name="code">
... ... @@ -785,8 +1634,8 @@
<input type="string" class="form-control input-sm" id="avatar" required placeholder="小程序头像" name="avatar">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="4">提交</button>
<button type="reset" class="btn btn-info" rel="4">重置</button>
<button type="submit" class="btn btn-success send" rel="10">提交</button>
<button type="reset" class="btn btn-info" rel="10">重置</button>
</div>
</form>
</div>
... ... @@ -796,8 +1645,8 @@
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers4"></pre>
<pre id="response4"></pre>
<pre id="response_headers10"></pre>
<pre id="response10"></pre>
</div>
</div>
</div>
... ... @@ -812,10 +1661,10 @@
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample4">
<div class="tab-pane" id="sample10">
<div class="row">
<div class="col-md-12">
<pre id="sample_response4">{
<pre id="sample_response10">{
"code": 1,
"msg": "登录成功",
"time": "1553839125",
... ... @@ -841,7 +1690,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2019-11-28 20:04:00 </div>
Generated on 2019-11-29 14:36:44 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...