groupingList.vue 8.3 KB

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