$(function () { // 搜索结果页 function getSearchList (keyword) { const val = keyword $('#result-input').val(val) $('.keyword').text(`“${val}”`) $.ajax({ url: `/console/v1/help?keywords=${val}`, method: 'get', success: function (res) { const temp = res.data.list.reduce((all, cur) => { const helps = cur.helps.filter(fil => fil.search) all.push(...helps) return all }, []) $('.search-result').html('') if (temp.length > 0) { temp.forEach((item, index) => { $('.keyword-box').show() $('.search-result').append( `
抱歉,没有搜索到,请重新搜索