MCPcopy Create free account
hub / github.com/Moli-X/Resources / priceSummary

Function priceSummary

Script/TBPrice.js:79–93  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

77}
78
79function priceSummary(data) {
80 let summary = ""
81 let listPriceDetail = data.PriceRemark.ListPriceDetail.slice(0,4)
82 let list = listPriceDetail.concat(historySummary(data.single))
83 list.forEach((item, index) => {
84 if (item.Name == "双11价格") {
85 item.Name = "双十一价格"
86 } else if (item.Name == "618价格") {
87 item.Name = "六一八价格"
88 }
89 let price = String(parseInt(item.Price.substr(1)));
90 summary += `\n${item.Name} ${isNaN(price) ? "-" : "¥" + price} ${item.Date} ${item.Difference}`
91 })
92 return summary
93}
94
95function historySummary(single) {
96 const rexMatch = /\[.*?\]/g;

Callers 1

TBPrice.jsFile · 0.70

Calls 1

historySummaryFunction · 0.70

Tested by

no test coverage detected