debug
This commit is contained in:
47
code/public/template/shikong/huiyuan/js/cctv/info.js
Normal file
47
code/public/template/shikong/huiyuan/js/cctv/info.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import CctvsJs from '../class/cctv';
|
||||
const Cctvs = new CctvsJs();
|
||||
import {
|
||||
getRandomElements
|
||||
} from '../public/commonFun.js';
|
||||
// cctv
|
||||
const InfoCctv = {
|
||||
|
||||
strPalaceGridHtml: '',
|
||||
|
||||
init(strLoadImg) {
|
||||
if($(".BodyClass365dh")){
|
||||
this.genCctvHtml(strLoadImg)
|
||||
$(".j-cctv-info-palace-grid").html(this.strPalaceGridHtml);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 随机宫格宫格 5个
|
||||
* @returns {string}
|
||||
*/
|
||||
genCctvHtml(strLoadImg, arrPageId = [300, 304]) {
|
||||
let arrRandCctvPalaceGrid = Cctvs.getDataByWhere(102, 214, arrPageId);
|
||||
if (arrRandCctvPalaceGrid.length > 0) {
|
||||
arrRandCctvPalaceGrid = getRandomElements(arrRandCctvPalaceGrid,5)
|
||||
arrRandCctvPalaceGrid.forEach(item => {
|
||||
|
||||
this.strPalaceGridHtml +=
|
||||
`
|
||||
<div class="list-item ${item.equipment_class} j-cctv-click"
|
||||
data-href="${item.href}" data-id="${item.id}"
|
||||
data-onsite-or-offsite="${item.onsite_or_offsite}">
|
||||
<p class="app-logo">
|
||||
<img class=" jqlazyload jqlazyload" style="width: 100%;height:100%;"
|
||||
src="${strLoadImg}"
|
||||
data-original="${item.cover}">
|
||||
</p>
|
||||
<p class="app-name">${item.title}</p>
|
||||
</div>
|
||||
`
|
||||
|
||||
});
|
||||
}
|
||||
return this.strBannerHtml;
|
||||
},
|
||||
}
|
||||
export default InfoCctv;
|
||||
Reference in New Issue
Block a user