newgroupingList.vue 9.2 KB

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