mobileWorksHome.zml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>秒绘彩页库</title>
  8. <link rel="stylesheet" href="/zinc/mobileWorks/css/mobileWorksPublic.css">
  9. <link rel="stylesheet" href="/zinc/mobileWorks/css/mobileWorksHome.css">
  10. <link rel="stylesheet" href="/zinc/mobileWorks/css/mui.min.css">
  11. <link rel="stylesheet" href="/zinc/mobileWorks/css/pagination.css">
  12. <script src="/zinc/mobileWorks/zepto/zepto.min.js"></script>
  13. <script src="/zinc/mobileWorks/js/mui.min.js"></script>
  14. <script src="/zinc/mobileWorks/js/mobileWorksHome.js"></script>
  15. <script src="/zinc/mobileWorks/js/pagination.js"></script>
  16. ${Scripts.src(zhiqim.js)}
  17. ${Scripts.src("/zinc/js/zhiqim_search_auto_list.js")}
  18. </head>
  19. <body>
  20. <!-- 头部搜索开始 -->
  21. <div class="header">
  22. <a href="javasrcipt:;" class="classify">分类</a>
  23. <div class="serch">
  24. <img src="./zinc/mobileWorks/images/search.png" onclick="doWorksSearchByKeyword();" alt="">
  25. <input type="text" id="searchinput" placeholder="请输入您要查找的内容">
  26. </div>
  27. <a href="javasrcipt:;" class="my-classify" onclick="doWorksSearchByKeyword();">搜索</a>
  28. </div>
  29. <!-- -->
  30. <!-- 头部选择模块开始 -->
  31. <div class="header-cater" style="line-height: 50px;">
  32. <div class="header-cater-rigth" onclick="doWorksSearch('BEST');">精品推荐</div>
  33. <div class="header-cater-left" onclick="doWorksSearch();">更多模板
  34. <!-- 先不展示 -->
  35. <!-- <i class="dom-arrow"></i> -->
  36. </div>
  37. </div>
  38. <!-- ************ -->
  39. <div style="width: 100%; height: 110px;"></div>
  40. <!-- 遮罩层 -->
  41. <div class="mui-backdrop one">
  42. <div class="select">
  43. <a id="heat_label_all" href="javasrcipt:;" class="text-value" onclick="doWorksSearchByLabel('label_all');">全部</a>
  44. <a id="heat_label_best" href="javasrcipt:;" class="text-value" onclick="doWorksSearchByLabel('label_best');">精品</a>
  45. <a id="heat_label_recommend" href="javasrcipt:;" class="text-value" onclick="doWorksSearchByLabel('label_recommend');">推荐</a>
  46. <a id="heat_label_hot" href="javasrcipt:;" class="text-value" onclick="doWorksSearchByLabel('label_hot');">热门</a>
  47. </div>
  48. </div>
  49. <!-- 商品部分开始 -->
  50. <div class="commodity-box" id="commodity-box">
  51. <ul class="box-size" id="list-box">
  52. <ul>
  53. </div>
  54. <div class="ht-page" id="ht-page" style="background-color: white; margin-top: 20px;"></div>
  55. <!-- 分类行业开始 -->
  56. <div class="cates-box">
  57. <!-- 阴影遮罩层 -->
  58. <div class="box-showdom"></div>
  59. <!-- 行业选择区域 -->
  60. <div class="box-white">
  61. <p class="catres">行业</p>
  62. <div class="my-style">
  63. <a id="clazz_ind_all" href="javasrcipt:;" class="catres-value">全部</a>
  64. <#for item : indList>
  65. <a id="clazz_ind_${item.getIndustryId()}" href="javasrcipt:;" class="catres-value">${item.getIndustryName()}</a>
  66. </#for>
  67. </div>
  68. <p class="catres">产品</p>
  69. <div class="my-style">
  70. <a id="clazz_ind_prdColorPage" href="javasrcipt:;" class="catres-value actives">彩页</a>
  71. <a id="clazz_ind_prdCart" href="./mobileTemplateHome.htm" class="catres-value">名片</a>
  72. </div>
  73. <button type="button" class="my-style-btn">确定</button>
  74. </div>
  75. </div>
  76. <!-- 返回顶部 -->
  77. <a href="javasrcipt:;" class="top">
  78. <img src="./zinc/mobileWorks/images/tx.png" alt="">
  79. <p class="top-text">顶部</p>
  80. </a>
  81. <!-- 搜索时候显示的结果 -->
  82. <div class="serch-show">
  83. 检索结果
  84. </div>
  85. </body>
  86. <script>
  87. // tabIndex[0: 精品推荐, 1: 更多模板]
  88. var tabIndex;
  89. var _tabType = "BEST";
  90. var _pageTotal = 100;
  91. var _pageSize = 10;
  92. var _pageNo = 1;
  93. Z.onload(function()
  94. {
  95. tabIndex = 0;
  96. doWorksSearch(_tabType, "", _pageNo);
  97. })
  98. // 移动端分页组件部分
  99. function pageChange(i)
  100. {
  101. // console.log("index is :" + i);
  102. doWorksSearch(_tabType, "", i+1);
  103. Pagination.Page($(".ht-page"), i, _pageTotal, _pageSize);
  104. }
  105. Pagination.init($(".ht-page"), pageChange);
  106. // 点击Tab查询作品
  107. function doWorksSearch(type, keyw, ppage)
  108. {
  109. _tabType = type;
  110. // 关键字
  111. var keyword = Z("#searchinput").val();
  112. // 行业
  113. var industryId = "";
  114. var indElem = $(".catres-value.actives");
  115. var indElemId = indElem[0].id;
  116. // 判断页面元素id是否为[全部]的id,否则根据行业id查询作品列表
  117. if(indElemId != "clazz_ind_all")
  118. {
  119. var indIdStrs = indElemId.split("clazz_ind_");
  120. industryId = indIdStrs[1];
  121. }
  122. // 热度标签
  123. var heatLabelId = "";
  124. var heatlbElem = $(".text-value.actives");
  125. var heatlbElemId = heatlbElem[0].id;
  126. if(heatlbElemId != "heat_label_all")
  127. {
  128. var heatlbIdStrs = heatlbElemId.split("heat_");
  129. heatLabelId = heatlbIdStrs[1];
  130. if (heatLabelId == "label_best")
  131. {
  132. heatLabelId = "1";
  133. }
  134. if (heatLabelId == "label_recommend")
  135. {
  136. heatLabelId = "2";
  137. }
  138. if (heatLabelId == "label_hot")
  139. {
  140. heatLabelId = "3";
  141. }
  142. }
  143. if (!type)
  144. {
  145. tabIndex = 1;
  146. }
  147. var ajax = new Z.Ajax();
  148. ajax.setClassName("MobileWorksPresenter");
  149. ajax.setMethodName("doWorksSearch");
  150. if (type == "BEST")
  151. {
  152. ajax.addParam("worksTypeIndex", "BEST");
  153. tabIndex = 0;
  154. }
  155. if (type == "KEYWORD")
  156. {
  157. if (tabIndex == 0)
  158. {
  159. ajax.addParam("worksTypeIndex", "BEST");
  160. }
  161. }
  162. if (type == "INDUSTRY")
  163. {
  164. if (tabIndex == 0)
  165. {
  166. ajax.addParam("worksTypeIndex", "BEST");
  167. }
  168. if (keyw)
  169. {
  170. ajax.addParam("industryId", keyw);
  171. }
  172. }
  173. if (type == "SEARCHLIKE")
  174. {
  175. if (tabIndex == 0)
  176. {
  177. ajax.addParam("worksTypeIndex", "BEST");
  178. }
  179. keyword = keyw;
  180. ajax.addParam("searchLike", "true");
  181. }
  182. if(industryId)
  183. {
  184. ajax.addParam("industryId", industryId);
  185. }
  186. if (type == "LABEL")
  187. {
  188. if (tabIndex == 0)
  189. {
  190. ajax.addParam("worksTypeIndex", "BEST");
  191. }
  192. if (keyw == "label_best")
  193. {
  194. ajax.addParam("labelStatus", "1");
  195. }
  196. if (keyw == "label_recommend")
  197. {
  198. ajax.addParam("labelStatus", "2");
  199. }
  200. if (keyw == "label_hot")
  201. {
  202. ajax.addParam("labelStatus", "3");
  203. }
  204. }
  205. if(heatLabelId)
  206. {
  207. ajax.addParam("labelStatus", heatLabelId);
  208. }
  209. // 分页
  210. if(ppage)
  211. {
  212. ajax.addParam("page", ppage);
  213. }
  214. ajax.addParam("keyword", keyword);
  215. ajax.setFailureAlert();
  216. ajax.setSuccess(function()
  217. {
  218. var resObj = Z.J.toObject(this.responseText);
  219. var resList = resObj.desWorksFileModels;
  220. _pageNo = resObj.pageNo - 1;
  221. _pageTotal = resObj.pageTotal;
  222. Pagination.Page($(".ht-page"), _pageNo, _pageTotal, _pageSize);
  223. var html = "";
  224. if (resList.length != 0)
  225. {
  226. Z("#ht-page").removeClass("ht-page-hide");
  227. for (var i = 0; i < resList.length; i++)
  228. {
  229. html +=
  230. `
  231. <li>
  232. <div class="son-box">
  233. <div class="son-box-item">
  234. <a href="./mobileWorkDetail.htm?worksId=` + resList[i].worksId + `"` + `>
  235. `;
  236. // 封面图片部分
  237. if (resList[i].thumbImagePath)
  238. {
  239. var imgPathArr = resList[i].thumbImagePath.split(",");
  240. for (var j = 0; j < imgPathArr.length; j++)
  241. {
  242. if (j == 0)
  243. {
  244. html +=
  245. ` <img src="` + imgPathArr[j] + `" alt="">`;
  246. }
  247. }
  248. }
  249. else
  250. {
  251. html +=
  252. ` <img src="/zinc/images/nopic.png" alt="">`;
  253. }
  254. // 热度红心部分
  255. html +=
  256. `
  257. </a>
  258. </div>
  259. <div class="son-box-item-bottom">
  260. <p class="idName">ID:` + resList[i].worksId + `</p>
  261. <p class="heat">
  262. <span>热度:</span>
  263. `;
  264. for (var k = 0; k < resList[i].worksHeatLabel + 1; k++)
  265. {
  266. html +=
  267. ` <img src="./zinc/mobileWorks/images/degree-red.png" alt="">
  268. `;
  269. }
  270. var grayLength = 5 - (resList[i].worksHeatLabel + 1);
  271. for (var n = 0; n < grayLength; n++)
  272. {
  273. html +=
  274. ` <img src="./zinc/mobileWorks/images/degree-gray.png" alt="">
  275. `;
  276. }
  277. // 找相似部分
  278. html +=
  279. ` </p>
  280. <div class="son-box-item-footer">
  281. <a href="javascript:;" class="one" style="width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;">`
  282. + resList[i].industrySubName + resList[i].attributeName + `</a>
  283. <a href="javascript:;" class="two" style="z-index: 996;" onclick="doWorksSearch('SEARCHLIKE', '` + resList[i].industrySubName + `', 1);">找相似</a>
  284. </div>
  285. </div>
  286. <span class="tag" style="display: `;
  287. // 热度标签部分
  288. if (resList[i].worksHeatLabel == 1)
  289. {
  290. html += `none`;
  291. }
  292. html += `;">`;
  293. if (resList[i].worksHeatLabel == 2)
  294. {
  295. html +=
  296. `
  297. <label>精品</label>
  298. `;
  299. }
  300. if (resList[i].worksHeatLabel == 3)
  301. {
  302. html +=
  303. `
  304. <label>推荐</label>
  305. `;
  306. }
  307. if (resList[i].worksHeatLabel == 4)
  308. {
  309. html +=
  310. `
  311. <label>热门</label>
  312. `;
  313. }
  314. html +=
  315. ` </span>
  316. </div>
  317. </li>
  318. `;
  319. }
  320. }
  321. else
  322. {
  323. Z("#ht-page").addClass("ht-page-hide");
  324. html = `<div style="height: 562px; width: 100%; margin-top: 150px; text-align: center;">暂时没有作品数据</div>`;
  325. }
  326. // console.dir(html);
  327. Z("#list-box").htmlc(html);
  328. });
  329. ajax.execute();
  330. }
  331. // 根据关键字查询作品
  332. function doWorksSearchByKeyword(keyword)
  333. {
  334. // console.log(keyword);
  335. doWorksSearch("KEYWORD", keyword);
  336. }
  337. // 根据行业id查询作品
  338. function doWorksSearchByIndustryId(industryId)
  339. {
  340. // console.log(industryId);
  341. doWorksSearch("INDUSTRY", industryId);
  342. }
  343. // 根据标签查询作品
  344. function doWorksSearchByLabel(label)
  345. {
  346. // console.log(label);
  347. doWorksSearch("LABEL", label);
  348. }
  349. </script>
  350. </html>