MCPcopy Create free account
hub / github.com/Semporia/Scripts / GetCommodityDetails

Function GetCommodityDetails

jd_dreamFactory.js:662–688  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

660}
661//查询当前生产的商品名称
662function GetCommodityDetails() {
663 return new Promise(async resolve => {
664 // const url = `/dreamfactory/diminfo/GetCommodityDetails?zone=dream_factory&sceneval=2&g_login_type=1&commodityId=${$.commodityDimId}`;
665 $.get(taskurl('diminfo/GetCommodityDetails', `commodityId=${$.commodityDimId}`, `_time,commodityId,zone`), (err, resp, data) => {
666 try {
667 if (err) {
668 console.log(`${JSON.stringify(err)}`)
669 console.log(`${$.name} API请求失败,请检查网路重试`)
670 } else {
671 if (safeGet(data)) {
672 data = JSON.parse(data);
673 if (data['ret'] === 0) {
674 data = data['data'];
675 $.productName = data['commodityList'][0].name;
676 } else {
677 console.log(`GetCommodityDetails异常:${JSON.stringify(data)}`)
678 }
679 }
680 }
681 } catch (e) {
682 $.logErr(e, resp)
683 } finally {
684 resolve();
685 }
686 })
687 })
688}
689// 查询已完成商品
690function GetShelvesList(pageNo = 1) {
691 return new Promise(async resolve => {

Callers 1

userInfoFunction · 0.85

Calls 5

taskurlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected