兼兼街公众号代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
3.3 KiB

  1. <template>
  2. <view class="home-pages">
  3. <view style="color: #707070;
  4. font-size: 28rpx;">
  5. </view>
  6. <view class="home-content">
  7. <u-tabs
  8. :list="tabList"
  9. lineWidth="70"
  10. lineHeight="3"
  11. lineColor= "#00CCCC"
  12. :activeStyle="{
  13. color: '#000000',
  14. fontWeight: 'bold',
  15. transform: 'scale(1.35)'
  16. }"
  17. :inactiveStyle="{
  18. color: '#000000',
  19. transform: 'scale(1)'
  20. }"
  21. itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"
  22. @click="tabClick"
  23. >
  24. </u-tabs>
  25. <scroll-view scroll-y="true" class="scroll-y"
  26. <card v-for="(item,i) in studyList" :item="item" :key="i" :i="i" @seeDetail="seeDetail"></card>
  27. </scroll-view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import card from '@/components/active-card/index-list.vue'
  33. export default{
  34. components:{
  35. card,
  36. },
  37. data(){
  38. return{
  39. params:{
  40. pageNo:1,
  41. labelClass:'0',
  42. pageSize:10,
  43. total: null,
  44. isLock: true
  45. },
  46. current:0,
  47. studyList:[],
  48. tabList: [
  49. {
  50. id:'0',
  51. name:'未审核'
  52. },
  53. {
  54. id:'1',
  55. name:'已审核'
  56. },
  57. {
  58. id:'2',
  59. name:'已发布'
  60. },
  61. {
  62. id:'3',
  63. name:'已驳回'
  64. }
  65. ]
  66. }
  67. },
  68. onLoad() {
  69. this.studyList = [];
  70. this.params.labelClass = "0";
  71. this.params.pageNo = 1;
  72. this.params.total = null;
  73. this.params.isLock = true;
  74. this.queryPageListJobRelease();
  75. },
  76. // 隐藏微信h5的标题栏
  77. onReady() {
  78. this.$com.displayNav()
  79. },
  80. onPullDownRefresh() {
  81. this.studyList = [];
  82. this.params.pageNo = 1;
  83. this.params.total = null;
  84. this.params.isLock = true;
  85. this.queryPageListJobRelease()
  86. },
  87. onReachBottom() {
  88. if(this.params.isLock){
  89. this.params.isLock = false;
  90. if(this.params.total !== null && this.params.pageNo * this.params.pageSize >= this.params.total){
  91. this.$Toast('没有更多数据了哦!');
  92. setTimeout(()=>{
  93. this.params.isLock = true;
  94. },3000)
  95. return
  96. }
  97. this.params.pageNo+=1;
  98. this.$Toast('数据加载成功!');
  99. this.queryPageListJobRelease();
  100. }
  101. },
  102. methods:{
  103. queryPageListJobRelease(){//学习列表
  104. if(this.pageNo>1){
  105. uni.showLoading({})
  106. }
  107. this.$api('queryPageListJobRelease',this.params)
  108. .then(res=>{
  109. if(res.code == 200){
  110. if(this.params.total== null) {
  111. this.params.total = res.result.total
  112. }
  113. if(this.params.pageNo>1){
  114. uni.hideLoading();
  115. }
  116. this.studyList = this.studyList.concat(res.result.records);
  117. this.params.isLock = true;
  118. }else {
  119. if(this.params.pageNo>1){
  120. uni.hideLoading();
  121. }
  122. this.params.isLock = true;
  123. }
  124. })
  125. },
  126. tabClick(e){
  127. this.params.labelClass = e.id;
  128. this.params.pageNo =1;
  129. this.studyList = [];
  130. this.queryPageListJobRelease();
  131. },
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. .home-pages {
  137. padding: 28rpx 29rpx 0;
  138. background-color: #F7F7F7;
  139. .swiper{
  140. position: relative;
  141. height: calc(100% -7vh);
  142. width: 100%;
  143. height: 1800px;
  144. }
  145. .scroll-Y {
  146. height: calc(300vh - 660rpx);
  147. padding-top: 20rpx;
  148. }
  149. .home-content {
  150. .active-card{
  151. margin-top: 20rpx;;
  152. border-radius: 0;
  153. border: none;
  154. border-style: none;
  155. box-shadow: none;
  156. }
  157. }
  158. }
  159. </style>