MCPcopy Create free account
hub / github.com/chavyleung/scripts / showmsg

Function showmsg

suning/suning.js:194–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192}
193
194function showmsg() {
195 let subTitle = ''
196 let detail = ''
197 let moreDetail = ''
198 if (signinfo.info && signinfo.info.code == '1') {
199 if (signinfo.info.data.todayFirstSignFlag == true) subTitle = '签到: 成功'
200 else subTitle = '签到: 重复'
201 //for (myinfo of signinfo.info.data) {
202 // detail += detail == '' ? '总共: ' : ', '
203 // detail += myinfo.showLabel
204 //}
205 if (signinfo.info.data.prizeLists) {
206 detail += typeof(signinfo.info.data.remainingPoint) == "undefined" ? '' : `, 说明: 还有${signinfo.info.data.remainingPoint}云钻待领取`
207 const prizeLists = signinfo.info.data.prizeLists
208 const customerDays = signinfo.info.data.customerDays
209 const prize = prizeLists[customerDays - 1]
210 moreDetail += moreDetail == '' ? '' : '\n'
211 moreDetail += '\n💎 每日签到: '
212 for (res of prize) moreDetail += `\n${res.prizeName}: ${res.prizeContent}`
213 }
214 } else {
215 subTitle = '签到: 失败'
216 chavy.log(`❌ ${cookieName} showmsg - 每日签到: ${JSON.stringify(signinfo.info)}`)
217 }
218
219 subTitle += subTitle == '' ? '' : ', '
220 if (signinfo.signweb) {
221 if (signinfo.signweb.respCode == '1') {
222 subTitle += '红包: 成功'
223 } else if (signinfo.signweb.respCode == '70512') {
224 subTitle += '红包: 重复'
225 } else {
226 subTitle += '红包: 失败'
227 chavy.log(`❌ ${cookieName} showmsg - 每日红包 - signweb: ${JSON.stringify(signinfo.signweb)}`)
228 }
229 } else {
230 subTitle += '红包: 失败'
231 chavy.log(`❌ ${cookieName} showmsg - 每日红包 - signweb: ${JSON.stringify(signinfo.signweb)}`)
232 }
233
234 subTitle += subTitle == '' ? '' : ', '
235 if (signinfo.signgame && signinfo.signgame.code == '1') {
236 if (signinfo.signgame.data.resultCode == 'SG0000') {
237 subTitle += '低价: 成功'
238 } else if (signinfo.signgame.data.resultCode == 'SG0103') {
239 subTitle += '低价: 重复'
240 } else {
241 subTitle += '低价: 失败'
242 chavy.log(`❌ ${cookieName} showmsg - 每日红包 - signgame: ${JSON.stringify(signinfo.signgame)}`)
243 }
244 } else {
245 subTitle += '低价: 失败'
246 chavy.log(`❌ ${cookieName} showmsg - 每日红包 - signgame: ${JSON.stringify(signinfo.signgame)}`)
247 }
248
249 if (signinfo.webinfo && signinfo.webinfo.respData) {
250 const currentIndex = signinfo.webinfo.respData.currentIndex
251 const detailTreeMap = signinfo.webinfo.respData.detailTreeMap

Callers 1

suning.jsFile · 0.70

Calls 2

logMethod · 0.45
msgMethod · 0.45

Tested by

no test coverage detected