<?php 

/**
 * @api {get} common 公共参数说明
 * @apiVersion 1.0.0
 * @apiName common
 * @apiGroup Common
 *
 * @apiDescription 介绍公共参数
 *
 * @apiParam {Number} json 是否返回json格式的数据1为返回2为不返回
 * @apiParam {Number} signature 用于登录后的uid验证,每次都要传入,请登录后将这个值保存在本地
 * @apiParam {Number} pg 用于分页传参,比如请求第二页数据,则加上该参数pg=2,没有分页和瀑布流不需要该参数
 *
 * @apiSuccess {Number}   status  状态,1为有效2为无效
 * @apiSuccess {String}   msg 请求的数据是否成功的提示
 * @apiSuccess {String}   data 如果status为1,data有值
 * @apiSuccess {Object[]}   page 分页信息
 * @apiSuccess {Number}   page.total 分页总数
 * @apiSuccess {Number}   page.current_page 当前页
 * @apiSuccess {Number}   page.total_page 总页数
 * @apiSuccess {Number}   page.next_page 下一页
 * @apiSuccess {Number}   page.prev_page 上一页
 * @apiSuccess {Number}   page.status 是否有下一页数据,0为没有
 */


/**
 * @api {get} passport/?l=applet.bind 用户登录
 * @apiVersion 1.0.0
 * @apiName applet.bind
 * @apiGroup Passport
 *
 * @apiDescription 用户登录
 *
 * @apiParam {String} code 微信登录返回的code
 *
 * @apiSuccess {Number}   vid  微信id,请保存在本地
 * @apiSuccess {Number}   uid  用户id,请保存在本地
 * @apiSuccess {String}   signature 用于登录后的uid验证,每次都要传入,请登录后将这个值保存在本地
 */

/**
 * @api {get} passport/?l=applet.update 更新用户信息
 * @apiVersion 1.0.0
 * @apiName applet.update
 * @apiGroup Passport
 *
 * @apiDescription 更新用户信息
 *
 * @apiParam {String} nickname 用户昵称
 * @apiParam {String} avatarurl 用户头像
 * @apiParam {String} iv 微信的加密参数
 * @apiParam {String} encryptedData 微信的加密参数
 * @apiParam {Number} vid 微信id
 * @apiParam {Number} uid 用户id
 * @apiParam {String} signature signature
 *
 *
 * @apiSuccess {Number}   vid  微信id,请保存在本地
 * @apiSuccess {Number}   uid  用户id,请保存在本地
 * @apiSuccess {String}   signature 用于登录后的uid验证,每次都要传入,请登录后将这个值保存在本地
 */


/**
 * @api {get} passport/?l=applet.mobile 更新用户手机号-微信绑定
 * @apiVersion 1.0.0
 * @apiName applet.mobile
 * @apiGroup Passport
 *
 * @apiDescription 更新用户手机号-微信绑定
 *
 * @apiParam {String} iv 微信的加密参数
 * @apiParam {String} encryptedData 微信的加密参数
 * @apiParam {Number} vid 微信id
 * @apiParam {Number} uid 用户id
 * @apiParam {String} signature signature
 *
 *
 * @apiSuccess {Number}   vid  微信id,请保存在本地
 * @apiSuccess {Number}   uid  用户id,请保存在本地
 * @apiSuccess {String}   signature 用于登录后的uid验证,每次都要传入,请登录后将这个值保存在本地
 */

/**
 * @api {get} passport/?l=applet.bind_mobile 绑定手机号-验证码绑定
 * @apiVersion 1.0.0
 * @apiName applet.bind_mobile
 * @apiGroup Passport
 *
 * @apiDescription 绑定手机号-验证码绑定
 *
 * @apiParam {Number} uid 用户id
 * @apiParam {Number} mobile 手机号
 * @apiParam {String} mcode 验证码
 * @apiParam {String} signature signature
 *

 * @apiSuccess {Number}   uid  用户id,请保存在本地
 * @apiSuccess {String}   signature 用于登录后的uid验证,每次都要传入,请登录后将这个值保存在本地
 */

/**
 * @api {get} passport/?l=reg.getMCode 获取手机验证码
 * @apiVersion 1.0.0
 * @apiName reg.getMCode
 * @apiGroup Passport
 *
 * @apiDescription 获取手机验证码
 *
 * @apiParam {Number} mobile 手机号
 * @apiParam {String} signature signature
 *
 * @apiSuccess {String}   msg 验证码已发送至您的手机,请注意查收,十分钟之内有效
 */

/**
 * @api {get} product/?l=api.home 获取首页数据
 * @apiVersion 1.0.0
 * @apiName api.home
 * @apiGroup Product
 *
 * @apiDescription 获取首页数据
 *
 * @apiParam {String} signature signature
 *
 *
 * @apiSuccess {Number}   uid  用户id 所有Service接口中都有该项
 * @apiSuccess {Object[]} config 基本配置 所有Service接口中都有该项
 * @apiSuccess {String}   config.name 小程序名称
 * @apiSuccess {String}   config.logo 小程序logo

 * @apiSuccess {Object[]} focus 焦点图 暂时无用
 * @apiSuccess {String}   focus.name 名称
 * @apiSuccess {String}   focus.pic 图片

 * @apiSuccess {Object[]} product 产品列表
 * @apiSuccess {String}   product.id 产品id
 * @apiSuccess {String}   product.name 名称
 * @apiSuccess {String}   product.pic 产品封面
 * @apiSuccess {String}   product.focus 产品轮播图 多个用逗号隔开
 * @apiSuccess {String}   product.content 内容
 * @apiSuccess {String}   product.price 显示价格
 * @apiSuccess {Number}   product.pay_price 支付价格
 * @apiSuccess {Number}   product.content 产品介绍
 */


/**
 * @api {get} product/?l=api.view 获取产品详情
 * @apiVersion 1.0.0
 * @apiName api.view
 * @apiGroup Product
 *
 * @apiDescription 获取产品详情
 *
 * @apiParam {String} signature signature
 * @apiParam {String} id 产品id

 * @apiSuccess {Object[]} focus 焦点图
 * @apiSuccess {String}   focus.name 名称
 * @apiSuccess {String}   focus.pic 图片

 * @apiSuccess {Object[]} product 产品信息
 * @apiSuccess {String}   product.id 产品id
 * @apiSuccess {String}   product.name 名称
 * @apiSuccess {String}   product.pic 产品封面
 * @apiSuccess {String}   product.focus 产品轮播图 多个用逗号隔开
 * @apiSuccess {String}   product.content 内容
 * @apiSuccess {String}   product.price 显示价格
 * @apiSuccess {Number}   product.pay_price 支付价格
 * @apiSuccess {Number}   product.content 产品介绍
 */

/**
 * @api {get} product/?l=api.order 我的订单
 * @apiVersion 1.0.0
 * @apiName api.order
 * @apiGroup Product
 *
 * @apiDescription 我的订单
 *
 * @apiParam {String} signature signature
 
 *
 * @apiSuccess {Object[]} order 订单信息
 * @apiSuccess {String}   order.name 名称
 * @apiSuccess {String}   order.order_id 订单编号
 * @apiSuccess {String}   order.del_status 产品在线状态1为在线2为已下线
 */


/**
 * @api {get} product/?l=api.code 提交兑换码
 * @apiVersion 1.0.0
 * @apiName api.code
 * @apiGroup Product
 *
 * @apiDescription 提交兑换码
 *
 * @apiParam {String} signature signature
 * @apiParam {String} product_id 产品id
 * @apiParam {String} code 兑换码
 * @apiParam {String} name 收货人姓名
 * @apiParam {String} address 收货人地址
 * @apiParam {String} mobile 收货人联系电话
 * @apiParam {Number} invite_uid 邀请人uid,scene参数中的uid
 */

/**
 * @api {get} product/?l=api.checkCode 根据兑换码获取产品信息
 * @apiVersion 1.0.0
 * @apiName api.checkCode
 * @apiGroup Product
 *
 * @apiDescription 根据兑换码获取产品信息
 *
 * @apiParam {String} signature signature
 * @apiParam {String} code 兑换码

 * @apiSuccess {Object[]} product 产品信息
 * @apiSuccess {String}   product.id 产品id
 * @apiSuccess {String}   product.name 名称
 * @apiSuccess {String}   product.pic 产品封面
 * @apiSuccess {String}   product.focus 产品轮播图 多个用逗号隔开
 * @apiSuccess {String}   product.content 内容
 * @apiSuccess {String}   product.price 显示价格
 * @apiSuccess {Number}   product.pay_price 支付价格
 * @apiSuccess {Number}   product.content 产品介绍

 * @apiSuccess {Object[]} address 收货地址
 * @apiSuccess {String}   address.name 收货人姓名
 * @apiSuccess {String}   address.address 收货人地址
 * @apiSuccess {String}   address.mobile 收货人联系电话
 */

/**
 * @api {get} product/?l=api.buy 发起微信支付
 * @apiVersion 1.0.0
 * @apiName api.buy
 * @apiGroup Product
 *
 * @apiDescription 发起微信支付
 *
 * @apiParam {String} signature signature
 * @apiParam {String} product_id 产品id,多个用逗号隔开
 * @apiParam {String} num 产品数量,多个用逗号隔开
 * @apiParam {String} name 收货人姓名
 * @apiParam {String} address 收货人地址
 * @apiParam {String} mobile 收货人联系电话
 * @apiParam {Number} invite_uid 邀请人uid,scene参数中的uid
*
 * @apiSuccess {Object[]} pay 微信支付返回的数据
 * @apiSuccess {String}   pay.time 服务器时间戳
 * @apiSuccess {String}   pay.nonce_str 随机字符串
 * @apiSuccess {String}   pay.prepay_id 统一下单接口返回的 prepay_id 参数值,通过'prepay_id=' + prepay_id 拼装成package
 * @apiSuccess {String}   pay.sign_type 签名算法
 * @apiSuccess {String}   pay.sign 签名
 */


/**
 * @api {get} product/?l=api.writeFormId 记录formid,用于发送通知 请再按钮的地方加上该接口请求
 * @apiVersion 1.0.0
 * @apiName api.writeFormId
 * @apiGroup Product
 *
 * @apiDescription 记录formid,用于发送通知
 *
 * @apiParam {String} signature signature
 * @apiParam {String} product_id 产品id
 */


/**
 * @api {get} product/?l=api.poster 生成海报
 * @apiVersion 1.0.0
 * @apiName api.poster
 * @apiGroup Product
 *
 * @apiDescription 生成海报
 *
 * @apiParam {String} signature signature
 * @apiParam {String} product_id 产品id
 * @apiParam {String} path 生成的二维码跳转的path,请不要带上参数,该path会自动加上scene=uid,product_id,请直接在onLoad 的方法中解析该参数:const scene = decodeURIComponent(options.scene);scene = scene.split(',');var uid = scene[0];var product_id = scene[1];如果有该参数,请直接跳转到产品详情页。并且请本地记录下uid。支付或者兑换使用。
 *
 * @apiSuccess {String}   pic 直接返回海报图片
 */

/**
 * @api {get} product/?l=api.addCarts 添加产品到购物车
 * @apiVersion 1.0.0
 * @apiName api.addCarts
 * @apiGroup Product
 *
 * @apiDescription 添加产品到购物车
 *
 * @apiParam {String} signature signature
 * @apiParam {String} product_id 产品id
 * @apiParam {String} num 数量
 *
 * @apiSuccess {String}   data 返回ok
 */

/**
 * @api {get} product/?l=api.delCarts 从购物车删除产品
 * @apiVersion 1.0.0
 * @apiName api.delCarts
 * @apiGroup Product
 *
 * @apiDescription 从购物车删除产品
 *
 * @apiParam {String} signature signature
 * @apiParam {String} product_id 产品id
 *
 * @apiSuccess {String}   data 返回ok
 */


/**
 * @api {get} product/?l=api.carts 获取购物车列表
 * @apiVersion 1.0.0
 * @apiName api.carts
 * @apiGroup Product
 *
 * @apiDescription 获取购物车列表
 *
 * @apiParam {String} signature signature
*
 * @apiSuccess {Object[]} carts 购物车信息
 * @apiSuccess {String}   carts.product 产品信息
 * @apiSuccess {String}   carts.num 数量

 * @apiSuccess {Object[]} address 收货地址
 * @apiSuccess {String}   address.name 收货人姓名
 * @apiSuccess {String}   address.address 收货人地址
 * @apiSuccess {String}   address.mobile 收货人联系电话
 */


/**
 * @api {get} product/?l=api.addAddress 添加收货地址
 * @apiVersion 1.0.0
 * @apiName api.addAddress
 * @apiGroup Product
 *
 * @apiDescription 添加收货地址
 *
 * @apiParam {String} signature signature
 * @apiParam {String} name 收货人姓名
 * @apiParam {String} address 收货人地址
 * @apiParam {String} mobile 收货人联系电话
 *
 * @apiSuccess {String}   data 返回ok
 */