HaniBlindBox/docs/前端适配调整/接口对照表.md
2026-01-03 15:21:36 +08:00

11 KiB
Raw Blame History

前端接口对照表

1. 接口完整对照

1.1 用户认证模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
微信登录 /login /api/login POST JSON 已实现
手机号登录 /mobileLogin /api/mobileLogin POST JSON 已实现
获取用户信息 /user /api/user POST JSON 已实现
更新用户信息 /update_userinfo /api/update_userinfo POST JSON 已实现
微信绑定手机号 /login_bind_mobile /api/login_bind_mobile POST JSON 已实现
验证码绑定手机号 /bindMobile /api/bindMobile POST JSON 已实现
记录登录 /login_record /api/login_record GET/POST JSON 已实现
账号注销 /user_log_off /api/user_log_off POST JSON 已实现

1.2 配置模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
系统配置 /config /api/config GET - 已实现
平台配置 /getPlatformConfig /api/getPlatformConfig GET - 已实现
广告列表 /getAdvert /api/getAdvert GET/POST Query 已实现
单页内容 /getDanye /api/getDanye GET Query 已实现

1.3 商品模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
商品列表 /goods /api/goods_list POST JSON 已实现
商品详情 /goodsdetail /api/goods_detail POST JSON 已实现
子奖品列表 /goods_children /api/goods_children POST JSON 已实现
商品扩展配置 /goods_extend /api/goods_extend POST JSON 已实现
箱号列表 /goods_num_list /api/goods_num_list POST JSON 已实现
箱号详情 /goods_num_detail /api/goods_num_detail POST JSON 已实现
奖品数量统计 /goodslist_count /api/goods_prize_count POST JSON 已实现
奖品内容 /goodslist_content /api/goods_prize_content POST JSON 已实现
中奖记录 /shang_log /api/goods_prize_logs POST JSON 已实现

1.4 订单模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
一番赏金额计算 /ordermoney /api/ordermoney POST JSON 已实现
一番赏下单 /orderbuy /api/orderbuy POST JSON 已实现
无限赏金额计算 /infinite_ordermoney /api/infinite_ordermoney POST JSON 已实现
无限赏下单 /infinite_orderbuy /api/infinite_orderbuy POST JSON 已实现
商城金额计算 /mall_ordermoney /api/mall_ordermoney POST JSON 已实现
订单列表 /order_list /api/order_list POST JSON 已实现
订单详情 /order_detail /api/order_detail POST JSON 已实现

1.5 抽奖结果模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
一番赏抽奖结果 /prizeorderlog /api/prizeorderlog POST JSON 已实现
无限赏抽奖结果 /infinite_prizeorderlog /api/infinite_prizeorderlog POST JSON 已实现
无限赏中奖记录 /infinite_shang_log /api/infinite_shang_log POST JSON 已实现
无限赏用户记录 /infinite_prizerecords /api/infinite_prizerecords POST JSON 已实现
道具卡抽奖 /item_card_chou /api/item_card_chou POST JSON 已实现

1.6 仓库模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
仓库首页 /warehouse_index /api/warehouse_index POST JSON 已实现
回收奖品 /warehouse_recovery /api/warehouse_recovery POST JSON 已实现
发货奖品 /warehouse_send /api/warehouse_send POST JSON 已实现
确认发货 /warehouse_send_confirm /api/warehouse_send_confirm POST JSON 已实现
发货记录 /warehouse_send_record /api/warehouse_send_record POST JSON 已实现
发货详情 /warehouse_send_record_detail /api/warehouse_send_record_detail POST JSON 已实现
回收记录 /warehouse_recovery_record /api/warehouse_recovery_record POST JSON 已实现
物流信息 /warehouse_order_logistics /api/warehouse_order_logistics POST JSON 已实现

1.7 优惠券模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
优惠券列表 /coupon_list /api/coupon_list POST JSON 已实现
优惠券详情 /coupon_detail /api/coupon_detail POST JSON 已实现
领取优惠券 /coupon_ling /api/coupon_ling POST JSON 已实现
分享优惠券 /coupon_share /api/coupon_share POST JSON 已实现
合成优惠券 /coupon_synthesis /api/coupon_synthesis POST JSON 已实现
计算合成 /coupon_ji_suan /api/coupon_ji_suan POST JSON 已实现

1.8 资产模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
余额明细 /profitMoney /api/profitMoney POST JSON 已实现
吧唧币明细 /profitIntegral /api/profitIntegral POST JSON 已实现
积分明细 /profitScore /api/profitScore POST JSON 已实现
支付记录 /profitPay /api/profitPay POST JSON 已实现

1.9 VIP模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
VIP信息 /vip_list /api/vip_list POST JSON 已实现

1.10 福利模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
福利屋列表 /welfare_house_list /api/welfare_house_list POST JSON 已实现
福利屋详情 /welfare_house_detail /api/welfare_house_detail POST JSON 已实现
福利屋下单 /welfare_house_buy /api/welfare_house_buy POST JSON 已实现
签到信息 /sign_info /api/sign_info POST JSON 已实现
执行签到 /sign_do /api/sign_do POST JSON 已实现
任务列表 /task_list /api/task_list POST JSON 已实现
领取任务奖励 /task_receive /api/task_receive POST JSON 已实现

1.11 收藏模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
收藏列表 /collection_list /api/collection_list POST JSON 已实现
添加收藏 /collection_add /api/collection_add POST JSON 已实现
取消收藏 /collection_cancel /api/collection_cancel POST JSON 已实现
收藏状态 /goods_collection_status /api/goods_collection_status POST JSON 已实现

1.12 排行榜模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
排行榜列表 /rank_list /api/rank_list POST JSON 已实现

1.13 邀请模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
邀请信息 /invitation_info /api/invitation_info POST JSON 已实现
邀请记录 /invitation_record /api/invitation_record POST JSON 已实现

1.14 兑换码模块

功能 PHP 旧接口 C# 新接口 请求方式 请求格式 状态
兑换码使用 /redeem_code /api/redeem_code POST JSON 已实现

2. 接口路径变更汇总

以下接口路径发生了变化,前端需要更新:

旧路径 新路径 说明
/goods /api/goods_list 商品列表
/goodsdetail /api/goods_detail 商品详情
/goodslist_count /api/goods_prize_count 奖品统计
/goodslist_content /api/goods_prize_content 奖品内容
/shang_log /api/goods_prize_logs 中奖记录
/userInfo /api/user 用户信息(前端 user.js 中使用)

3. 请求参数字段变更

3.1 商品列表

// 旧参数
{
    page: 1,
    type: 0,
    keyword: ""
}

// 新参数(保持一致)
{
    page: 1,
    type: 0,
    keyword: "",
    pageSize: 15  // 新增可选参数
}

3.2 订单列表

// 旧参数
{
    page: 1,
    page_size: 20
}

// 新参数
{
    page: 1,
    pageSize: 20  // 字段名变更page_size -> pageSize
}

3.3 中奖记录

// 旧参数
{
    goods_id: 1001,
    goods_num: 0,
    shang_id: 0,
    page: 1,
    page_size: 15
}

// 新参数
{
    goodsId: 1001,      // 字段名变更
    goodsNum: 0,        // 字段名变更
    shangId: 0,         // 字段名变更
    page: 1,
    pageSize: 15        // 字段名变更
}

4. 响应格式对比

4.1 通用响应格式(保持一致)

{
    "status": 1,
    "msg": "success",
    "data": {}
}

4.2 分页响应格式

// PHP 旧版
{
    "status": 1,
    "data": {
        "data": [],
        "total": 100,
        "current_page": 1,
        "last_page": 10
    }
}

// C# 新版(保持一致)
{
    "status": 1,
    "data": {
        "data": [],
        "total": 100,
        "currentPage": 1,  // 字段名可能有变化
        "lastPage": 10
    }
}

5. 前端文件修改清单

文件路径 修改内容 优先级
common/request.js Content-Type 改为 JSON
common/server/user.js 接口路径和请求方式
common/server/config.js 检查接口路径
common/server/mall.js 检查接口路径
common/server/order.js 检查接口路径
pages/*/ 各页面文件 检查直接调用的接口