(tuanId, stk = '_time,activeId,tuanId')
| 1088 | } |
| 1089 | |
| 1090 | function JoinTuan(tuanId, stk = '_time,activeId,tuanId') { |
| 1091 | return new Promise((resolve) => { |
| 1092 | const body = `activeId=${escape(tuanActiveId)}&tuanId=${escape(tuanId)}`; |
| 1093 | const options = taskTuanUrl(`JoinTuan`, body, '_time,activeId,tuanId') |
| 1094 | $.get(options, async (err, resp, data) => { |
| 1095 | try { |
| 1096 | if (err) { |
| 1097 | console.log(`${JSON.stringify(err)}`) |
| 1098 | console.log(`${$.name} API请求失败,请检查网路重试`); |
| 1099 | } else { |
| 1100 | if (safeGet(data)) { |
| 1101 | data = JSON.parse(data); |
| 1102 | if (data['ret'] === 0) { |
| 1103 | console.log(`参团成功:${JSON.stringify(data)}\n`); |
| 1104 | } else if (data['ret'] === 10005 || data['ret'] === 10206) { |
| 1105 | //火爆,或者今日参团机会已耗尽 |
| 1106 | console.log(`参团失败:${JSON.stringify(data)}\n`); |
| 1107 | $.canHelp = false; |
| 1108 | } else { |
| 1109 | console.log(`参团失败:${JSON.stringify(data)}\n`); |
| 1110 | } |
| 1111 | } |
| 1112 | } |
| 1113 | } catch (e) { |
| 1114 | $.logErr(e, resp) |
| 1115 | } finally { |
| 1116 | resolve(); |
| 1117 | } |
| 1118 | }) |
| 1119 | }) |
| 1120 | } |
| 1121 | //查询所有的团情况(自己开团以及参加别人的团) |
| 1122 | function QueryAllTuan() { |
| 1123 | return new Promise((resolve) => { |
no test coverage detected