searchlist.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <view class="content">
  3. <pcNav></pcNav>
  4. <view style="height: 72px;"></view>
  5. <view class="gotop" @click="gotoTop">
  6. <image src="../../static/pcimg/btn_top@2x.png" mode="" class="gotopImg"></image>
  7. </view>
  8. <view class="main">
  9. <view class="searchBox">
  10. <view class="searchInputBox">
  11. <input class="searchInput" type="text" v-model="title" placeholder="请输入您想搜索到内容~" placeholder-style="color:#CCCCCC" @confirm="search"/>
  12. </view>
  13. <view class="searchBtn" @click="search">查询</view>
  14. <!-- <image src="../../static/pcimg/icon_sousuo@2x.png" mode="" class="searchBtn" @click="search"></image> -->
  15. </view>
  16. <view class="ssjg" v-if="sstype">为你找到“{{sstitle}}”相关结果共{{TotalSize}}条</view>
  17. <view class="cont2">
  18. <view class="contBox">
  19. <view class="contL" v-show="list.length!=0&&sstype">
  20. <view class="wxLine" v-for="(wz,wzindex) in list" @click="goDetail(wz)">
  21. <view class="wzLineLeft">
  22. <image :src="wz.LogoImg" class="wzLeftIMg"></image>
  23. </view>
  24. <view class="wzLineRight">
  25. <view class="wzTitle2">{{wz.Title}}</view>
  26. <view class="wzComment">{{wz.Comment}}</view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="nodata" v-show="list.length==0&&sstype">
  31. <image src="../../static/pcimg/pic_empty_search@2x.png" mode="" class="nodataImg"></image>
  32. <view class="nodataTitle">暂无数据</view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- -->
  38. <view class="pageView" v-show="TotalSize">
  39. <page-pagination :pageSize="pageSize" :size="'small'" :total="TotalSize" :numAround="true" @change="pageChange"></page-pagination>
  40. </view>
  41. <!-- <view>
  42. <a class="table-btn" href="http://phone.66km.cn:8088/marketing/training/940C4BF0A2E04542A1A1AD244EAFB6E2.xlsx" target='_blank'>下载入口</a>
  43. </view> -->
  44. </view>
  45. </template>
  46. <script>
  47. import pcNav from '../../components/pcNav/pcNav.vue'
  48. export default {
  49. components: {
  50. pcNav,
  51. },
  52. data() {
  53. return {
  54. list:[],
  55. title:'',
  56. page:1,
  57. sstype:false,
  58. TotalSize:0,
  59. pageSize:20,
  60. sstitle:'',
  61. }
  62. },
  63. onLoad(opt) {
  64. // this.getcategoryPageData()
  65. },
  66. methods: {
  67. search(){
  68. var params={
  69. title:this.title,
  70. limit:this.pageSize,
  71. page:this.page,
  72. }
  73. uni.showLoading({
  74. title: '加载中'
  75. })
  76. this.$http('/trainingOpenApi/searchPageData', params, 'GET').then(res => {
  77. this.sstitle=this.title;
  78. this.sstype=true;
  79. uni.hideLoading();
  80. this.list=res.data.Items;
  81. this.TotalSize=res.data.TotalSize;
  82. })
  83. },
  84. goDetail(wz){
  85. // 1分类2文章
  86. if (wz.Type == 1) {
  87. uni.navigateTo({
  88. url:'groupingList?parentCode='+wz.Code+'&name='+wz.Name+'&title='+wz.Title+'&topName='
  89. })
  90. }else{
  91. uni.navigateTo({
  92. url:'detail?id='+wz.ID+'&topName=&twoName='
  93. })
  94. }
  95. //console.log(wz)
  96. },
  97. gotoTop(){
  98. uni.pageScrollTo({
  99.    scrollTop: 0, duration: 300
  100. });
  101. },
  102. tabBtn(index,item){
  103. this.tabIndex=index;
  104. //console.log(item)
  105. this.parentCode=item.code;
  106. this.getcategoryPageData()
  107. },
  108. pageChange(e){
  109. console.log(e)
  110. this.page=e;
  111. this.getcategoryPageData()
  112. },
  113. getcategoryPageData(){
  114. var params={
  115. parentCode:this.parentCode,
  116. topCode:this.topCode,
  117. limit:this.pageSize,
  118. page:this.page,
  119. }
  120. uni.showLoading({
  121. title: '加载中'
  122. })
  123. this.$http('/trainingOpenApi/categoryPageData', params, 'GET').then(res => {
  124. uni.hideLoading();
  125. this.list=res.data.Items;
  126. this.TotalSize=res.data.TotalSize;
  127. var arr=[
  128. {
  129. 'name':'全部','code':'',
  130. }
  131. ]
  132. this.dynamicCol=arr.concat(res.data.dynamicCol);
  133. })
  134. }
  135. }
  136. }
  137. </script>
  138. <style scoped>
  139. .content{
  140. background: #F4F5F7;
  141. min-height: 100vh;
  142. font-family: PingFangSC-Regular, PingFang SC;
  143. }
  144. .searchTitle{
  145. font-size: 20px;
  146. font-weight: 500;
  147. color: #3C3C3C;
  148. padding-bottom: 30px;
  149. }
  150. .ssjg{
  151. font-size: 16px;
  152. color: #666666;
  153. padding-top: 20px;
  154. }
  155. .contBox{
  156. min-height: 60vh;
  157. }
  158. .searchInput{
  159. width: 520px;
  160. height: 40px;
  161. padding-left: 20px;
  162. line-height: 40px;
  163. border: 2px solid #EEEEEE;
  164. border-radius: 6px;
  165. border-right: none;
  166. background: #FFFFFF;
  167. }
  168. .searchBtn{
  169. width: 72px;
  170. height: 42px;
  171. background: #FF4F00;
  172. border-radius: 0px 6px 6px 0px;
  173. line-height: 42px;
  174. color: #FFFFFF;
  175. font-size: 16px;
  176. text-align: center;
  177. cursor: pointer;
  178. margin-left: -5px;
  179. }
  180. .searchBox{
  181. display: flex;
  182. justify-content: center;
  183. padding-top: 20px;
  184. }
  185. *{
  186. padding: 0;
  187. margin: 0;
  188. }
  189. .gotopImg{
  190. width: 60px;
  191. height: 60px;
  192. }
  193. .gotop{
  194. position: fixed;
  195. right:5vh ;
  196. bottom: 60px;
  197. cursor: pointer;
  198. }
  199. .topName{
  200. text-align: center;
  201. font-size: 24px;
  202. font-weight: 500;
  203. color: #3C3C3C;
  204. line-height: 33px;
  205. padding-top: 30px;
  206. }
  207. .comment{
  208. text-align: center;
  209. font-size: 14px;
  210. font-weight: 400;
  211. color: #999999;
  212. line-height: 20px;
  213. width: 500px;
  214. padding-top: 10px;
  215. margin: 0 auto;
  216. }
  217. .main{
  218. width: 1200px;
  219. margin: 0 auto;
  220. padding-top: 30px;
  221. }
  222. .dynamicColLeft{
  223. display: flex;
  224. }
  225. .dynamicColLIne{
  226. padding-right: 44px;
  227. font-size: 16px;
  228. color: #3C3C3C;
  229. cursor: pointer;
  230. }
  231. .qhImg{
  232. width: 28px;
  233. height: 28px;
  234. margin-left: 8px;
  235. cursor: pointer;
  236. }
  237. .dynamicCol{
  238. display: flex;
  239. justify-content: space-between;
  240. }
  241. .activeTab{
  242. color: #FF4F00;
  243. }
  244. .mainwzImg{
  245. width: 276px;
  246. height: 184px;
  247. }
  248. .mainwzImgBox{
  249. border-radius: 15px;
  250. overflow: hidden;
  251. }
  252. .contf{
  253. display: flex;
  254. flex-wrap: wrap;
  255. }
  256. .contL{
  257. background: #FFFFFF;
  258. padding:0px 20px;
  259. margin-top: 30px;
  260. border-radius: 8px;
  261. }
  262. .mainwzline{
  263. width: 276px;
  264. height: 260px;
  265. background: #FFFFFF;
  266. margin-right: 32px;
  267. padding-top: 33px;
  268. cursor: pointer;
  269. }
  270. .mainwzlineR{
  271. margin-right: 0px;
  272. }
  273. .wztitle{
  274. width: 250px;
  275. font-size: 16px;
  276. color: #333333;
  277. line-height: 22px;
  278. height: 44px;
  279. text-overflow: -o-ellipsis-lastline;
  280. overflow: hidden;
  281. text-overflow: ellipsis;
  282. display: -webkit-box;
  283. -webkit-line-clamp: 2;
  284. line-clamp: 2;
  285. -webkit-box-orient: vertical;
  286. padding-top: 16px;
  287. padding:0 13px ;
  288. }
  289. .wzLeftIMg{
  290. width: 200px;
  291. height: 132px;
  292. }
  293. .wxLine{
  294. display: flex;
  295. padding: 20px 0;
  296. cursor: pointer;
  297. border-bottom: 1px solid #EEEEEE;
  298. }
  299. .wzLineLeft{
  300. border-radius: 6px;
  301. overflow: hidden;
  302. width: 200px;
  303. height: 132px;
  304. }
  305. .wzLineRight{
  306. padding-left: 16px;
  307. width: 788px;
  308. }
  309. .wzTitle2{
  310. font-size: 16px;
  311. color: #3C3C3C;
  312. width: 948px;
  313. height: 20px;
  314. line-height: 20px;
  315. text-overflow: -o-ellipsis-lastline;
  316. overflow: hidden;
  317. text-overflow: ellipsis;
  318. display: -webkit-box;
  319. -webkit-line-clamp: 1;
  320. line-clamp: 1;
  321. -webkit-box-orient: vertical;
  322. }
  323. .wzComment{
  324. font-size: 14px;
  325. font-family: PingFangSC-Regular, PingFang SC;
  326. font-weight: 400;
  327. color: #999999;
  328. line-height: 20px;
  329. padding-top: 10px;
  330. width: 948px;
  331. height: 80px;
  332. text-overflow: -o-ellipsis-lastline;
  333. overflow: hidden;
  334. text-overflow: ellipsis;
  335. display: -webkit-box;
  336. -webkit-line-clamp: 4;
  337. line-clamp: 4;
  338. -webkit-box-orient: vertical;
  339. }
  340. .pageView{
  341. margin-top: 20px;
  342. cursor: pointer;
  343. padding-bottom: 20px;
  344. }
  345. .nodataImg{
  346. width: 300px;
  347. height: 203px;
  348. }
  349. .nodata{
  350. text-align: center;
  351. padding-top: 100px;
  352. }
  353. .nodataTitle{
  354. font-size: 16px;
  355. padding-top: 16px;
  356. font-weight: 400;
  357. color: #999999;
  358. }
  359. </style>