newsearchlist.vue 7.6 KB

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