没有搜索结果! 响应:本
感谢http://www.apiopen.top提供的接口
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title >书籍搜索</ title > </ head > < body > < style > [aui-view] * { visibility: hidden; } body { cursor: default; } p, div, ul, li { margin: 0; padding: 0; } .navbar-search { margin: 0 auto; width: 300px; text-align: center; } .navbar-search input { width: 200px; height: 30px; padding: 0; margin: 6px; outline: none; border: 1px solid #333; } .navbar-search button { width: 80px; height: 30px; padding: 0; margin: 0; border: 1px solid #333; } .navbar-search .keyList { list-style-type: none; font-size: 14px; } .navbar-search .keyList li { padding-left: 8px; margin-bottom: 6px; font-size: 14px; } .bookResultView { max-width: 800px; margin: 0 auto; } .bookResultView ul li { position: relative; display: block; float: left; margin: 8px; width: 210px; height: 280px; list-style-type: none; border-radius: 6px; overflow: hidden; } .bookResultView ul li .content-trigger { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .bookResultView ul li .content-trigger .content { position: absolute; top: 0; left: 0; display: none; padding: 8px; width: calc(100% - 16px); height: 100%; background-color:#FFFFFF; opacity: 0.8; overflow: hidden; } .bookResultView ul li .content-trigger:hover .content { display: block; } .bookResultView .content .author { padding: 8px; font-size: 16px; } .bookResultView .content .desc { font-size: 12px; } </ style > < div class = "box" > < div class = "navbar-search" > < h2 >AForm书籍搜索示例</ h2 > < input class = "aui-form" aui-input = "name" aui-attrValue = "value" type = "text" value = "鲁滨孙漂流记" placeholder = "书名" aui-notnull = "true" aui-action = "https://www.apiopen.top/novelSearchApi" aui-event = "change" aui-scope = ".navbar-search" aui-for = "input" aui-result = "view:searchKeyListView" /> < button class = "aui-form" aui-action = "https://www.apiopen.top/novelInfoApi" aui-scope = ".box" aui-for = "input" aui-result = "view:bookResultView" >搜索</ button > < ul class = "keyList" aui-view = "searchKeyListView" > < li aui-if = "__searchKeyListView.result.data != null" aui-text = "__keyText" aui-item = "__keyText" aui-each = "__searchKeyListView.result.data" ></ li > </ ul > </ div > < div class = "bookResultView" aui-view = "bookResultView" > <!--<p aui-text="__bookResultView.result"></p>--> < p aui-switch="__bookResultView.result.data.data.length > 0"> < span aui-case = "false" >没有搜索结果!</ span > < span aui-case = "true" >响应:< span aui-text = "__bookResultView.result.data.data.length" ></ span >本</ span > </ p > < ul > < li aui-item = "__bookResultView_book" aui-each = "__bookResultView.result.data.data" > < img aui-src = "__bookResultView_book.cover" /> < div class = "content-trigger" > < div class = "content" aui-onclick = "'alert(\' ' + __bookResultView_book.title + ' \');'" > < p class = "author" >作者:< span aui-text = "__bookResultView_book.author" ></ span ></ p > < p class = "desc" aui-text = "__bookResultView_book.desc" ></ p > </ div > </ div > </ li > </ ul > </ div > </ div > < script type = "text/javascript" src = "js/aFormv1.1.js" ></ script > < script > var a$ = new A$({ requestFilter: { "seachLoadQFilter": { urlPatterns: "/*", doFilter: function(filterChain, url, data, elem, xhr, aform) { elem.disabled = true; elem.innerText = "搜索中..."; filterChain.doFilter(url, data, elem, xhr, aform); } } }, resultFilter: { "seachLoadEFilter": { urlPatterns: "/*", doFilter: function(filterChain, url, data, elem, xhr, aform) { elem.disabled = false; elem.innerText = "搜索"; filterChain.doFilter(url, data, elem, xhr, aform); } } }, from: { checkErrorFunction: function(elem, attrName, attrValue, paramName, paramValue) { alert("数据校验错误:" + attrName); return false; } } }); a$.load(); </ script > </ body > </ html > |