Rockz-Home 3 месяцев назад
Родитель
Сommit
8f271e0994
1 измененных файлов с 123 добавлено и 8 удалено
  1. 123 8
      card/sdk/API_SERVER.md

+ 123 - 8
card/sdk/API_SERVER.md

@@ -74,10 +74,13 @@
     *   **configJson 字段说明 (示例)**:
     *   **configJson 字段说明 (示例)**:
         *   `css`: `string`,动态注入到页面的 CSS 样式。
         *   `css`: `string`,动态注入到页面的 CSS 样式。
         *   `tabActiveColor`: `string`,Tab 栏选中颜色,如 "#FF5733"。
         *   `tabActiveColor`: `string`,Tab 栏选中颜色,如 "#FF5733"。
-        *   `popupRuleConfig`: `object`,弹窗组件的样式配置,如 `{ "height": "500px", "theme": "light" }`。
-        *   `popupHelpConfig`, `popupWarnConfig`, `popupExchgConfig`, `popupMessageConfig`: `object`,其他类型弹窗的配置。
+        *   `teamType`: `int`,队伍类型 (0:默认, 1:学生/家长)。
+        *   `popupRuleConfig`: `object`,规则弹窗组件的样式配置,如 `{ "height": "500px", "theme": "light" }`。
+        *   `popupMessageConfig`: `object`,消息弹窗组件的样式配置。
+        *   `popupHelpConfig`, `popupWarnConfig`, `popupExchgConfig`: `object`,其他类型弹窗的配置。
         *   `popupRuleList`: `array<object|string>`,规则弹窗的内容列表,元素可以是 `{ "type": 1, "data": { "title": "标题", "content": "HTML 内容", "logo": {"src": "...", "width": "..."} } }`,也可以是字符串 "default" 或 "default2" (表示加载预设内容)。
         *   `popupRuleList`: `array<object|string>`,规则弹窗的内容列表,元素可以是 `{ "type": 1, "data": { "title": "标题", "content": "HTML 内容", "logo": {"src": "...", "width": "..."} } }`,也可以是字符串 "default" 或 "default2" (表示加载预设内容)。
         *   `popupExchgList`, `popupHelpList`: `array<object>`,其他类型弹窗的内容列表。
         *   `popupExchgList`, `popupHelpList`: `array<object>`,其他类型弹窗的内容列表。
+        *   `popupDataList`: `array<object|string>`,通用弹窗内容列表,用于显示自定义弹窗信息,支持 `default` / `default2` 关键字加载预设内容。
         *   *注意:`configJson` 结构灵活,字段是动态的,取决于后台配置,开发者应做好判空处理。*
         *   *注意:`configJson` 结构灵活,字段是动态的,取决于后台配置,开发者应做好判空处理。*
 
 
 *   **1.3 用户个性化配置查询**
 *   **1.3 用户个性化配置查询**
@@ -109,7 +112,9 @@
             "beginSecond": 1700000000,
             "beginSecond": 1700000000,
             "endSecond": 1700090000,
             "endSecond": 1700090000,
             "teamNum": 0, // 0:个人, >0:团队
             "teamNum": 0, // 0:个人, >0:团队
-            "coiName": "已报名单位名称"
+            "coiId": 1, // 已报名单位ID
+            "coiName": "已报名单位名称",
+            "ocaId": 201 // 关联活动详情ID (用于跳转)
         }
         }
         ```
         ```
 
 
@@ -152,6 +157,43 @@
                 { "name": "phone", "label": "手机号", "type": "text", "required": true }
                 { "name": "phone", "label": "手机号", "type": "text", "required": true }
             ]
             ]
         }
         }
+
+
+*   **2.6 卡片对应线上赛多个活动查询 (用户赛事结果详情)**
+    *   **API 方法**: `API.getMatchRsDetail(ecId)`
+    *   **参数**: `ecId` (int)
+    *   **返回数据**: (Array) - 返回用户在卡片关联的各个赛事中的具体成绩详情
+        ```json
+        [
+            {
+                "mcId": 101,
+                "mcName": "赛事名称",
+                "mcType": 1,
+                "beginSecond": 1700000000,
+                "endSecond": 1700090000,
+                "status": 1, // 状态
+                "nickName": "用户昵称", // 用户在赛事中的昵称
+                "totalNum": 10, // 总场次/次数
+                "totalDistanct": 5000, // 总距离 (米)
+                "totalDistanctRankNum": 5, // 总距离排名
+                "totalCp": 20, // 总打点数
+                "totalCpRankNum": 3, // 总打点数排名
+                "totalSysPoint": 100, // 总积分/百味豆
+                "totalSysPointRankNum": 10, // 总积分排名
+                "fastPace": 300, // 最快配速 (秒/公里)
+                "fastPaceRankNum": 8 // 最快配速排名
+            }
+        }
+        ```
+
+*   **2.7 用户在卡片对应赛事是否新用户**
+    *   **API 方法**: `API.isNewUserInCardComp(ecId)`
+    *   **参数**: `ecId` (int)
+    *   **返回数据**:
+        ```json
+        {
+            "isNew": true // true: 是新用户, false: 不是
+        }
         ```
         ```
 
 
 #### 3. 排名与成就
 #### 3. 排名与成就
@@ -176,7 +218,7 @@
           ```
           ```
 
 
 *   **3.1.1 月挑战排名查询 (月榜)**
 *   **3.1.1 月挑战排名查询 (月榜)**
-    *   **API 方法**: `API.request('MonthRankDetailQuery', { year, month, dispArrStr })`
+    *   **API 方法**: `API.getMonthRankDetail({ year, month, dispArrStr })`
     *   **参数**:
     *   **参数**:
         *   `year` (int): 年份,如 2025
         *   `year` (int): 年份,如 2025
         *   `month` (int): 月份,1-12
         *   `month` (int): 月份,1-12
@@ -244,6 +286,35 @@
         ]
         ]
         ```
         ```
 
 
+*   **3.5 赛事总成绩统计查询**
+    *   **API 方法**: `API.getCompStatistic(ecId)`
+    *   **参数**: `ecId` (int)
+    *   **返回数据**:
+        ```json
+        {
+            "totalDistance": 123.45, // 总里程
+            "totalPeople": 1000, // 总参与人数
+            "totalRightAnswerNum": 500, // 总正确答题数
+            "totalAnswerNum": 800, // 总答题数
+            "totalCp": 2000, // 总打点数
+            "totalSysPoint": 5000 // 总积分/百味豆
+        }
+        ```
+
+*   **3.6 玩家当前月挑战记录查询**
+    *   **API 方法**: `API.getCurrentMonthlyChallenge(year, month)`
+    *   **参数**: 
+        *   `year` (int): 可选,默认当年
+        *   `month` (int): 可选,默认当月
+    *   **返回数据**:
+        ```json
+        {
+            "month": 11,
+            "realNum": 10, // 实际完成次数
+            "targetNum": 20 // 目标次数
+        }
+        ```
+
 #### 4. 积分与兑换
 #### 4. 积分与兑换
 
 
 *   **4.1 卡片内可用积分查询**
 *   **4.1 卡片内可用积分查询**
@@ -274,8 +345,8 @@
         ```
         ```
 
 
 *   **4.3 积分兑换商品**
 *   **4.3 积分兑换商品**
-    *   **API 方法**: `API.exchangeGoods(ecId, goodsId)`
-    *   **参数**: `ecId` (int), `goodsId` (int)
+    *   **API 方法**: `API.exchangeGoods(ecId, goodsId, exchNum)`
+    *   **参数**: `ecId` (int), `goodsId` (int), `exchNum` (int, 可选, 默认1)
     *   **返回数据**: `{}` (成功)
     *   **返回数据**: `{}` (成功)
 
 
 *   **4.4 玩家兑换记录查询**
 *   **4.4 玩家兑换记录查询**
@@ -293,6 +364,40 @@
         ]
         ]
         ```
         ```
 
 
+*   **4.5 玩家兑换详情查询**
+    *   **API 方法**: `API.getExchangeDetail(ecId, exchangeId)`
+    *   **参数**: `ecId` (int), `exchangeId` (int)
+    *   **返回数据**:
+        ```json
+        {
+            "exchangeId": 1,
+            "goodsName": "商品名称",
+            "createTime": 1700000000,
+            "status": 1,
+            "address": "收货地址",
+            "receiver": "收件人",
+            "phone": "联系电话"
+        }
+        ```
+
+*   **4.6 积分可兑换商品详情**
+    *   **API 方法**: `API.getGoodsDetail(ecId, goodsId)`
+    *   **参数**: `ecId` (int), `goodsId` (int)
+    *   **返回数据**:
+        ```json
+        {
+            "goodsId": 1, 
+            "goodsName": "商品名称", 
+            "goodsPic": "http://...", 
+            "corrScore": 500, // 所需积分
+            "goodsLeftNum": 99, // 剩余库存
+            "goodsUnit": "个", // 单位
+            "goodsDesc": "HTML描述内容", 
+            "exchDesc": "HTML兑换说明", 
+            "exchLimit": 3 // 个人兑换上限
+        }
+        ```
+
 #### 5. 消息与通知
 #### 5. 消息与通知
 
 
 *   **5.1 未读消息列表查询**
 *   **5.1 未读消息列表查询**
@@ -326,6 +431,11 @@
         ]
         ]
         ```
         ```
 
 
+*   **5.3 标记消息已读**
+    *   **API 方法**: `API.readMessage(mqIdListStr)`
+    *   **参数**: `mqIdListStr` (string) - 消息ID列表字符串,如 "1,2,3"
+    *   **返回数据**: `{}` (成功)
+
 #### 6. 网格游戏
 #### 6. 网格游戏
 
 
 *   **6.1 网格卡片信息查询**
 *   **6.1 网格卡片信息查询**
@@ -346,8 +456,13 @@
                     "orderNum": 1, // 格子序号
                     "orderNum": 1, // 格子序号
                     "isComplete": 1, // 1:点亮 0:未点亮
                     "isComplete": 1, // 1:点亮 0:未点亮
                     "showName": "格子1",
                     "showName": "格子1",
-                    "relationType": 1, // 1:活动详情 2:列表
-                    "ocaId": 201 // 关联ID
+                    "relationType": 1, // 1:活动详情 2:活动列表 3:地图列表
+                    "ocaId": 201, // 关联活动ID (relationType=1时有效)
+                    "mapId": 0, // 关联地图ID (relationType=2时有效)
+                    "description": "描述信息",
+                    "popupImg": "http://...", // 弹窗图片
+                    "longitude": 117.0,
+                    "latitude": 36.0
                 }
                 }
             ]
             ]
         }
         }