| 166 | |
| 167 | // 答题 |
| 168 | function answer() { |
| 169 | return new Promise((resolve) => { |
| 170 | const answerVal = getKey()['key'] + '/question/qustion/answer.apiactivityCode='+$.questionCode+'&answer=%7b%221%22%3a%22'+escape(`${$.answer}`).toLowerCase()+'%22%7d' |
| 171 | mx_api['ts'] = getKey()['ts'] |
| 172 | mx_api['check'] = hex_md5(answerVal) |
| 173 | const url = { |
| 174 | url:'https://activity-api-mx.wandafilm.com/question/qustion/answer.api', |
| 175 | headers:{ |
| 176 | 'MX-API':JSON.stringify(mx_api), |
| 177 | }, |
| 178 | body : 'activityCode='+$.questionCode+'&answer=%7B%221%22%3A%22'+encodeURI(`${$.answer}`) + '%22%7D' |
| 179 | } |
| 180 | $.post(url, (err, resp, data) => { |
| 181 | try { |
| 182 | $.answer = JSON.parse(data) |
| 183 | } catch (e) { |
| 184 | $.logErr(e, resp) |
| 185 | } finally { |
| 186 | resolve() |
| 187 | } |
| 188 | }) |
| 189 | }) |
| 190 | } |
| 191 | |
| 192 | // 答题后抽奖 |
| 193 | function drawprize_ans() { |