list.vue 8.2 KB

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