class Utils { $(className) { return document.querySelector(className); } _(className) { return document.querySelectorAll(className); } query(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return decodeURI(r[2]); return null; } footer () { var arr = [ { text: '首页', icon: 'icon-home', href: 'index.html' }, { text: '机构', icon: 'icon-jigou', href: 'mechanism.html' }, { text: '模特', icon: 'icon-me', href: 'model.html' }, { text: '我的', icon: 'icon-wo', href: 'my.html' }, ]; var liArr = ` ` $("body").innerHTML += liArr } item(father, arr) { arr.forEach(v => { father.innerHTML += `
${v.shuliang || v.total}
${v.title}
模特: ${v.user || v.renwulist[0].name}
${v.source || '来源机构:'+v.jigoulist[0].name}
${ (v.tags || v.biaoqianlist).map(item=>{ return `${item.title || item.name}` }).toString().replaceAll(",", "") }
` }) } header(title = "",rightHtml = "") { $("body").innerHTML += `
${title}
${rightHtml}
` $(".icon-back1").onclick = () => { history.back(); } } search () { $('body') .innerHTML +=` ` } } var { $, _, footer, item, header, query,search } = new Utils();