(strCardTypeIndex)
| 332 | }) |
| 333 | } |
| 334 | function UsePropCard(strCardTypeIndex) { |
| 335 | return new Promise((resolve) => { |
| 336 | let dwCardType = strCardTypeIndex.split("_")[0]; |
| 337 | $.get(taskUrl(`user/UsePropCard`, `dwCardType=${dwCardType}&strCardTypeIndex=${encodeURIComponent(strCardTypeIndex)}`), (err, resp, data) => { |
| 338 | try { |
| 339 | if (err) { |
| 340 | console.log(JSON.stringify(err)) |
| 341 | console.log(`${$.name} UsePropCard API请求失败,请检查网路重试`) |
| 342 | } else { |
| 343 | data = JSON.parse(data.replace(/\n/g, "").match(new RegExp(/jsonpCBK.?\((.*);*\)/))[1]); |
| 344 | if (data.iRet === 0) { |
| 345 | let cardName = strCardTypeIndex.split("_")[1]; |
| 346 | console.log(`使用道具卡【${cardName}】成功`) |
| 347 | } else { |
| 348 | console.log(`使用道具卡失败:${JSON.stringify(data)}`) |
| 349 | } |
| 350 | } |
| 351 | } catch (e) { |
| 352 | $.logErr(e, resp); |
| 353 | } finally { |
| 354 | resolve(); |
| 355 | } |
| 356 | }) |
| 357 | }) |
| 358 | } |
| 359 | |
| 360 | // 寻宝 |
| 361 | function TreasureHunt(strIndex) { |
no test coverage detected