newsearchlist.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  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('/trainingOpenApi/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. linkType:'',
  101. linkUrl:'',
  102. }
  103. console.log(wz)
  104. if(wz.LinkType==1){
  105. item.linkType=wz.LinkType
  106. item.linkUrl=wz.LinkUrl
  107. }
  108. console.log(item)
  109. this.$emit("goDetail",item)
  110. /* uni.navigateTo({
  111. url:'detail?id='+wz.ID+'&topName=&twoName='
  112. }) */
  113. }
  114. },
  115. gotoTop(){
  116. uni.pageScrollTo({
  117.    scrollTop: 0, duration: 300
  118. });
  119. },
  120. tabBtn(index,item){
  121. this.tabIndex=index;
  122. //console.log(item)
  123. this.parentCode=item.code;
  124. this.getcategoryPageData()
  125. },
  126. pageChange(e){
  127. console.log(e)
  128. this.page=e;
  129. this.getcategoryPageData()
  130. },
  131. getcategoryPageData(){
  132. var params={
  133. parentCode:this.parentCode,
  134. topCode:this.topCode,
  135. limit:this.pageSize,
  136. page:this.page,
  137. }
  138. uni.showLoading({
  139. title: '加载中'
  140. })
  141. this.$http('/trainingOpenApi/categoryPageData', params, 'GET').then(res => {
  142. uni.hideLoading();
  143. this.list=res.data.Items;
  144. this.TotalSize=res.data.TotalSize;
  145. var arr=[
  146. {
  147. 'name':'全部','code':'',
  148. }
  149. ]
  150. this.dynamicCol=arr.concat(res.data.dynamicCol);
  151. })
  152. }
  153. }
  154. }
  155. </script>
  156. <style scoped>
  157. .content2{
  158. background: #F4F5F7;
  159. min-height: 100vh;
  160. font-family: PingFangSC-Regular, PingFang SC;
  161. }
  162. .searchTitle{
  163. font-size: 20px;
  164. font-weight: 500;
  165. color: #3C3C3C;
  166. padding-bottom: 30px;
  167. }
  168. .ssjg{
  169. font-size: 16px;
  170. color: #666666;
  171. padding-top: 20px;
  172. }
  173. .contBox{
  174. min-height: 60vh;
  175. }
  176. .searchInput{
  177. width: 520px;
  178. height: 40px;
  179. padding-left: 20px;
  180. line-height: 40px;
  181. border: 2px solid #EEEEEE;
  182. border-radius: 6px;
  183. border-right: none;
  184. background: #FFFFFF;
  185. }
  186. .searchBtn{
  187. width: 72px;
  188. height: 42px;
  189. background: #FF4F00;
  190. border-radius: 0px 6px 6px 0px;
  191. line-height: 42px;
  192. color: #FFFFFF;
  193. font-size: 16px;
  194. text-align: center;
  195. cursor: pointer;
  196. margin-left: -5px;
  197. }
  198. .searchBox{
  199. display: flex;
  200. justify-content: center;
  201. padding-top: 20px;
  202. }
  203. *{
  204. padding: 0;
  205. margin: 0;
  206. }
  207. .gotopImg{
  208. width: 60px;
  209. height: 60px;
  210. }
  211. .gotop{
  212. position: fixed;
  213. right:5vh ;
  214. bottom: 60px;
  215. cursor: pointer;
  216. }
  217. .topName{
  218. text-align: center;
  219. font-size: 24px;
  220. font-weight: 500;
  221. color: #3C3C3C;
  222. line-height: 33px;
  223. padding-top: 30px;
  224. }
  225. .comment{
  226. text-align: center;
  227. font-size: 14px;
  228. font-weight: 400;
  229. color: #999999;
  230. line-height: 20px;
  231. width: 500px;
  232. padding-top: 10px;
  233. margin: 0 auto;
  234. }
  235. .main{
  236. width: 1200px;
  237. margin: 0 auto;
  238. padding-top: 30px;
  239. }
  240. .dynamicColLeft{
  241. display: flex;
  242. }
  243. .dynamicColLIne{
  244. padding-right: 44px;
  245. font-size: 16px;
  246. color: #3C3C3C;
  247. cursor: pointer;
  248. }
  249. .qhImg{
  250. width: 28px;
  251. height: 28px;
  252. margin-left: 8px;
  253. cursor: pointer;
  254. }
  255. .dynamicCol{
  256. display: flex;
  257. justify-content: space-between;
  258. }
  259. .activeTab{
  260. color: #FF4F00;
  261. }
  262. .mainwzImg{
  263. width: 276px;
  264. height: 184px;
  265. }
  266. .mainwzImgBox{
  267. border-radius: 15px;
  268. overflow: hidden;
  269. }
  270. .contf{
  271. display: flex;
  272. flex-wrap: wrap;
  273. }
  274. .contL{
  275. background: #FFFFFF;
  276. padding:0px 20px;
  277. margin-top: 30px;
  278. border-radius: 8px;
  279. }
  280. .mainwzline{
  281. width: 276px;
  282. height: 260px;
  283. background: #FFFFFF;
  284. margin-right: 32px;
  285. padding-top: 33px;
  286. cursor: pointer;
  287. }
  288. .mainwzlineR{
  289. margin-right: 0px;
  290. }
  291. .wztitle{
  292. width: 250px;
  293. font-size: 16px;
  294. color: #333333;
  295. line-height: 22px;
  296. height: 44px;
  297. text-overflow: -o-ellipsis-lastline;
  298. overflow: hidden;
  299. text-overflow: ellipsis;
  300. display: -webkit-box;
  301. -webkit-line-clamp: 2;
  302. line-clamp: 2;
  303. -webkit-box-orient: vertical;
  304. padding-top: 16px;
  305. padding:0 13px ;
  306. }
  307. .wzLeftIMg{
  308. width: 200px;
  309. height: 132px;
  310. }
  311. .wxLine{
  312. display: flex;
  313. padding: 20px 0;
  314. cursor: pointer;
  315. border-bottom: 1px solid #EEEEEE;
  316. }
  317. .wzLineLeft{
  318. border-radius: 6px;
  319. overflow: hidden;
  320. width: 200px;
  321. height: 132px;
  322. }
  323. .wzLineRight{
  324. padding-left: 16px;
  325. width: 788px;
  326. }
  327. .wzTitle2{
  328. font-size: 16px;
  329. color: #3C3C3C;
  330. width: 948px;
  331. height: 20px;
  332. line-height: 20px;
  333. text-overflow: -o-ellipsis-lastline;
  334. overflow: hidden;
  335. text-overflow: ellipsis;
  336. display: -webkit-box;
  337. -webkit-line-clamp: 1;
  338. line-clamp: 1;
  339. -webkit-box-orient: vertical;
  340. }
  341. .wzComment{
  342. font-size: 14px;
  343. font-family: PingFangSC-Regular, PingFang SC;
  344. font-weight: 400;
  345. color: #999999;
  346. line-height: 20px;
  347. padding-top: 10px;
  348. width: 948px;
  349. height: 80px;
  350. text-overflow: -o-ellipsis-lastline;
  351. overflow: hidden;
  352. text-overflow: ellipsis;
  353. display: -webkit-box;
  354. -webkit-line-clamp: 4;
  355. line-clamp: 4;
  356. -webkit-box-orient: vertical;
  357. }
  358. .pageView{
  359. margin-top: 20px;
  360. cursor: pointer;
  361. padding-bottom: 20px;
  362. }
  363. .nodataImg{
  364. width: 300px;
  365. height: 203px;
  366. }
  367. .nodata{
  368. text-align: center;
  369. padding-top: 100px;
  370. }
  371. .nodataTitle{
  372. font-size: 16px;
  373. padding-top: 16px;
  374. font-weight: 400;
  375. color: #999999;
  376. }
  377. </style>