list.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="content">
  3. <pcNav></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">{{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="contf" v-if="qhIndex==2">
  26. <view class="mainwzline" v-for="(wz,wzindex) in list" :class="{'mainwzlineR':(wzindex+1)%4==0&&wzindex!=0}" @click="goDetail(wz)">
  27. <view class="mainwzImgBox">
  28. <img :src="wz.LogoImg" alt="" class="mainwzImg">
  29. </view>
  30. <view class="wztitle">{{wz.Title}}</view>
  31. </view>
  32. </view>
  33. <view class="contL" v-if="qhIndex==1">
  34. <view class="wxLine" v-for="(wz,wzindex) in list" @click="goDetail(wz)">
  35. <view class="wzLineLeft">
  36. <image :src="wz.LogoImg" class="wzLeftIMg"></image>
  37. </view>
  38. <view class="wzLineRight">
  39. <view class="wzTitle">{{wz.Name}}</view>
  40. <view class="wzComment">{{wz.Comment}}</view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- -->
  47. <view class="pageView">
  48. <page-pagination :pageSize="pageSize" :total="TotalSize" :numAround="true" @change="pageChange"></page-pagination>
  49. </view>
  50. <!-- <view>
  51. <a class="table-btn" href="http://phone.66km.cn:8088/marketing/training/940C4BF0A2E04542A1A1AD244EAFB6E2.xlsx" target='_blank'>下载入口</a>
  52. </view> -->
  53. </view>
  54. </template>
  55. <script>
  56. import pcNav from '../../components/pcNav/pcNav.vue'
  57. export default {
  58. components: {
  59. pcNav,
  60. },
  61. data() {
  62. return {
  63. list:[],
  64. comment:'',
  65. topName:'',
  66. parentCode:'',
  67. topCode:'',
  68. page:1,
  69. dynamicCol:[],
  70. qhIndex:1,
  71. tabIndex:0,
  72. TotalSize:0,
  73. pageSize:20,
  74. }
  75. },
  76. onLoad(opt) {
  77. this.topName=opt.topName;
  78. this.comment=opt.comment;
  79. this.topCode=opt.code;
  80. this.parentCode='';
  81. this.getcategoryPageData()
  82. },
  83. methods: {
  84. goDetail(wz){
  85. // 1分类2文章
  86. if (wz.Type == 1) {
  87. }else{
  88. uni.navigateTo({
  89. url:'detail?id='+wz.ID+'&topName='+this.topName+'&twoName='+this.dynamicCol[this.tabIndex].name
  90. })
  91. }
  92. //console.log(wz)
  93. },
  94. gotoTop(){
  95. uni.pageScrollTo({
  96.    scrollTop: 0, duration: 300
  97. });
  98. },
  99. tabBtn(index,item){
  100. this.tabIndex=index;
  101. //console.log(item)
  102. this.parentCode=item.code;
  103. this.getcategoryPageData()
  104. },
  105. pageChange(e){
  106. console.log(e)
  107. this.page=e;
  108. this.getcategoryPageData()
  109. },
  110. getcategoryPageData(){
  111. var params={
  112. parentCode:this.parentCode,
  113. topCode:this.topCode,
  114. limit:this.pageSize,
  115. page:this.page,
  116. }
  117. uni.showLoading({
  118. title: '加载中'
  119. })
  120. this.$http('/trainingOpenApi/categoryPageData', params, 'GET').then(res => {
  121. uni.hideLoading();
  122. this.list=res.data.Items;
  123. this.TotalSize=res.data.TotalSize;
  124. var arr=[
  125. {
  126. 'name':'全部','code':'',
  127. }
  128. ]
  129. this.dynamicCol=arr.concat(res.data.dynamicCol);
  130. })
  131. }
  132. }
  133. }
  134. </script>
  135. <style scoped>
  136. *{
  137. padding: 0;
  138. margin: 0;
  139. }
  140. .gotopImg{
  141. width: 60px;
  142. height: 60px;
  143. }
  144. .gotop{
  145. position: fixed;
  146. right:15vh ;
  147. bottom: 100px;
  148. cursor: pointer;
  149. }
  150. .topName{
  151. text-align: center;
  152. font-size: 24px;
  153. font-weight: 500;
  154. color: #3C3C3C;
  155. line-height: 33px;
  156. padding-top: 30px;
  157. }
  158. .comment{
  159. text-align: center;
  160. font-size: 14px;
  161. font-weight: 400;
  162. color: #999999;
  163. line-height: 20px;
  164. width: 500px;
  165. padding-top: 10px;
  166. margin: 0 auto;
  167. }
  168. .main{
  169. width: 1200px;
  170. margin: 0 auto;
  171. padding-top: 30px;
  172. }
  173. .dynamicColLeft{
  174. display: flex;
  175. }
  176. .dynamicColLIne{
  177. padding-right: 44px;
  178. font-size: 16px;
  179. color: #3C3C3C;
  180. cursor: pointer;
  181. }
  182. .qhImg{
  183. width: 28px;
  184. height: 28px;
  185. margin-left: 8px;
  186. cursor: pointer;
  187. }
  188. .dynamicCol{
  189. display: flex;
  190. justify-content: space-between;
  191. }
  192. .activeTab{
  193. color: #FF4F00;
  194. }
  195. .mainwzImg{
  196. width: 276px;
  197. height: 184px;
  198. }
  199. .mainwzImgBox{
  200. border-radius: 15px;
  201. overflow: hidden;
  202. }
  203. .contf{
  204. display: flex;
  205. flex-wrap: wrap;
  206. }
  207. .mainwzline{
  208. width: 276px;
  209. height: 260px;
  210. background: #FFFFFF;
  211. margin-right: 32px;
  212. padding-top: 33px;
  213. cursor: pointer;
  214. }
  215. .mainwzlineR{
  216. margin-right: 0px;
  217. }
  218. .wztitle{
  219. width: 250px;
  220. font-size: 16px;
  221. color: #333333;
  222. line-height: 22px;
  223. height: 44px;
  224. text-overflow: -o-ellipsis-lastline;
  225. overflow: hidden;
  226. text-overflow: ellipsis;
  227. display: -webkit-box;
  228. -webkit-line-clamp: 2;
  229. line-clamp: 2;
  230. -webkit-box-orient: vertical;
  231. padding-top: 16px;
  232. padding:0 13px ;
  233. }
  234. .wzLeftIMg{
  235. width: 200px;
  236. height: 132px;
  237. }
  238. .wxLine{
  239. display: flex;
  240. padding-top: 30px;
  241. cursor: pointer;
  242. }
  243. .wzLineLeft{
  244. border-radius: 10px;
  245. overflow: hidden;
  246. width: 200px;
  247. height: 132px;
  248. }
  249. .wzLineRight{
  250. padding-left: 16px;
  251. }
  252. .wzTitle{
  253. font-size: 16px;
  254. font-weight: 500;
  255. color: #3C3C3C;
  256. }
  257. .wzComment{
  258. font-size: 12px;
  259. font-family: PingFangSC-Regular, PingFang SC;
  260. font-weight: 400;
  261. color: #999999;
  262. line-height: 17px;
  263. padding-top: 10px;
  264. width: 1000px;
  265. }
  266. .pageView{
  267. margin-top: 20px;
  268. cursor: pointer;
  269. padding-bottom: 20px;
  270. }
  271. </style>