(cids, page, pageSize, type, state)
| 170 | } |
| 171 | |
| 172 | function getGoodListByCond(cids, page, pageSize, type, state) { |
| 173 | return new Promise((resolve, reject) => { |
| 174 | let option = taskurl(`${selfDomain}/activity/list?pb=1&cids=${cids}&page=${page}&pageSize=${pageSize}&type=${type}&state=${state}`) |
| 175 | delete option.headers['Cookie'] |
| 176 | $.get(option, (err, resp, data) => { |
| 177 | try { |
| 178 | if (err) { |
| 179 | console.log(`🚫 ${arguments.callee.name.toString()} API请求失败,请检查网路\n${JSON.stringify(err)}`) |
| 180 | } else { |
| 181 | data = JSON.parse(data) |
| 182 | if (data.success) { |
| 183 | $.totalPages = data.data.pages |
| 184 | allGoodList = allGoodList.concat(data.data.data) |
| 185 | } else { |
| 186 | console.log(`💩 获得 ${cids} ${page} 列表失败: ${data.message}`) |
| 187 | } |
| 188 | } |
| 189 | } catch (e) { |
| 190 | reject(`⚠️ ${arguments.callee.name.toString()} API返回结果解析出错\n${e}\n${JSON.stringify(data)}`) |
| 191 | } finally { |
| 192 | resolve() |
| 193 | } |
| 194 | }) |
| 195 | }) |
| 196 | } |
| 197 | |
| 198 | async function getGoodList() { |
| 199 | if (args.cidsList.length === 0) args.cidsList.push("全部商品") |
no test coverage detected