(placeId, pin, isMe)
| 196 | } |
| 197 | |
| 198 | function pickUpComponent(placeId, pin, isMe) { |
| 199 | return new Promise(async resolve => { |
| 200 | $.get(taskUrl('usermaterial/PickUpComponent', `pin=${pin}&placeId=${placeId}`, '_time,pin,placeId,zone'), (err, resp, data) => { |
| 201 | try { |
| 202 | const { msg, data: { increaseElectric } = {} } = JSON.parse(data); |
| 203 | $.log( |
| 204 | `\n拾取${isMe ? '自己' : '好友'}零件:${msg},获得电力 ${increaseElectric || 0}\n${$.showLog ? data : ''}`, |
| 205 | ); |
| 206 | if (!increaseElectric) { |
| 207 | resolve(true); |
| 208 | } else { |
| 209 | resolve(false); |
| 210 | } |
| 211 | } catch (e) { |
| 212 | $.logErr(e, resp); |
| 213 | } finally { |
| 214 | resolve(); |
| 215 | } |
| 216 | }); |
| 217 | }); |
| 218 | } |
| 219 | |
| 220 | function upgradeUserLevel() { |
| 221 | return new Promise(async resolve => { |
no test coverage detected