1class ScriptActivityReductionInfo extends Script { 2 constructor(params) { 3 super(params) 4 this.$unit = document.querySelector(`#${this.attrId}`) 5 if (!this.$unit) return 6 this.$title = this.$unit.querySelector('.unit-activity-reduction-info__title') 7 this.$titelList = this.$unit.querySelector('.unit-activity-reduction-info__description') 8 this.$start = this.$unit.querySelector('.unit-activity-reduction-info__start') 9 this.$end = this.$unit.querySelector('.unit-activity-reduction-info__end') 10 this.$showDate = this.$unit.querySelector('.unit-activity-reduction-info__right') 11 } 12 async init() { 13 this.getReductionInfo().then(data => { 14 this.$titelList.innerHTML = '' 15 const list = data.list 16 if (list.length === 0) return 17 const htmlList = [] 18 list.forEach((item, index) => { 19 if (index === 0) this.$title.innerHTML = item 20 else htmlList.push(`<p>${item}</p>`) 21 }); 22 if (htmlList.length > 0) this.$titelList.innerHTML = htmlList.join('') 23 if (this.$start) this.$start.innerHTML = data.start_time 24 if (this.$end) this.$end.innerHTML = data.end_time 25 if (this.$showDate) this.$showDate.classList.remove('d-none') 26 }); 27 } 28 29 getReductionInfo() { 30 return new Promise((resolve) => { 31 this.utilts.request({ 32 url: '/reduction/detail', 33 method: 'GET', 34 params: { 35 site_id: window.app.info.site.site_id, 36 id: window.app.info.page.content_id, 37 } 38 }).then(res => { 39 const info = res.data || {} 40 const settingList = info.discount_setting || [] 41 const list = globalThis.Server.getReduction(settingList) 42 const data = { start_time: info.start_time, end_time: info.end_time, list } 43 resolve(data); 44 }) 45 }) 46 } 47}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.