list.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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. console.log(wz)
  86. },
  87. gotoTop(){
  88. uni.pageScrollTo({
  89.    scrollTop: 0, duration: 300
  90. });
  91. },
  92. tabBtn(index,item){
  93. this.tabIndex=index;
  94. //console.log(item)
  95. this.parentCode=item.code;
  96. this.getcategoryPageData()
  97. },
  98. pageChange(e){
  99. console.log(e)
  100. this.page=e;
  101. this.getcategoryPageData()
  102. },
  103. getcategoryPageData(){
  104. var params={
  105. parentCode:this.parentCode,
  106. topCode:this.topCode,
  107. limit:this.pageSize,
  108. page:this.page,
  109. }
  110. uni.showLoading({
  111. title: '加载中'
  112. })
  113. this.$http('/trainingOpenApi/categoryPageData', params, 'GET').then(res => {
  114. uni.hideLoading();
  115. this.list=res.data.Items;
  116. this.TotalSize=res.data.TotalSize;
  117. var arr=[
  118. {
  119. 'name':'全部','code':'',
  120. }
  121. ]
  122. this.dynamicCol=arr.concat(res.data.dynamicCol);
  123. })
  124. }
  125. }
  126. }
  127. </script>
  128. <style scoped>
  129. *{
  130. padding: 0;
  131. margin: 0;
  132. }
  133. .gotopImg{
  134. width: 60px;
  135. height: 60px;
  136. }
  137. .gotop{
  138. position: fixed;
  139. right:15vh ;
  140. bottom: 100px;
  141. cursor: pointer;
  142. }
  143. .topName{
  144. text-align: center;
  145. font-size: 24px;
  146. font-weight: 500;
  147. color: #3C3C3C;
  148. line-height: 33px;
  149. padding-top: 30px;
  150. }
  151. .comment{
  152. text-align: center;
  153. font-size: 14px;
  154. font-weight: 400;
  155. color: #999999;
  156. line-height: 20px;
  157. width: 500px;
  158. padding-top: 10px;
  159. margin: 0 auto;
  160. }
  161. .main{
  162. width: 1200px;
  163. margin: 0 auto;
  164. padding-top: 30px;
  165. }
  166. .dynamicColLeft{
  167. display: flex;
  168. }
  169. .dynamicColLIne{
  170. padding-right: 44px;
  171. font-size: 16px;
  172. color: #3C3C3C;
  173. cursor: pointer;
  174. }
  175. .qhImg{
  176. width: 28px;
  177. height: 28px;
  178. margin-left: 8px;
  179. cursor: pointer;
  180. }
  181. .dynamicCol{
  182. display: flex;
  183. justify-content: space-between;
  184. }
  185. .activeTab{
  186. color: #FF4F00;
  187. }
  188. .mainwzImg{
  189. width: 276px;
  190. height: 184px;
  191. }
  192. .mainwzImgBox{
  193. border-radius: 15px;
  194. overflow: hidden;
  195. }
  196. .contf{
  197. display: flex;
  198. flex-wrap: wrap;
  199. }
  200. .mainwzline{
  201. width: 276px;
  202. height: 260px;
  203. background: #FFFFFF;
  204. margin-right: 32px;
  205. padding-top: 33px;
  206. cursor: pointer;
  207. }
  208. .mainwzlineR{
  209. margin-right: 0px;
  210. }
  211. .wztitle{
  212. width: 250px;
  213. font-size: 16px;
  214. color: #333333;
  215. line-height: 22px;
  216. height: 44px;
  217. text-overflow: -o-ellipsis-lastline;
  218. overflow: hidden;
  219. text-overflow: ellipsis;
  220. display: -webkit-box;
  221. -webkit-line-clamp: 2;
  222. line-clamp: 2;
  223. -webkit-box-orient: vertical;
  224. padding-top: 16px;
  225. padding:0 13px ;
  226. }
  227. .wzLeftIMg{
  228. width: 200px;
  229. height: 132px;
  230. }
  231. .wxLine{
  232. display: flex;
  233. padding-top: 30px;
  234. cursor: pointer;
  235. }
  236. .wzLineLeft{
  237. border-radius: 10px;
  238. overflow: hidden;
  239. width: 200px;
  240. height: 132px;
  241. }
  242. .wzLineRight{
  243. padding-left: 16px;
  244. }
  245. .wzTitle{
  246. font-size: 16px;
  247. font-weight: 500;
  248. color: #3C3C3C;
  249. }
  250. .wzComment{
  251. font-size: 12px;
  252. font-family: PingFangSC-Regular, PingFang SC;
  253. font-weight: 400;
  254. color: #999999;
  255. line-height: 17px;
  256. padding-top: 10px;
  257. width: 1000px;
  258. }
  259. .pageView{
  260. margin-top: 20px;
  261. cursor: pointer;
  262. padding-bottom: 20px;
  263. }
  264. </style>