兼兼街公众号代码
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.

159 lines
3.1 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/address-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. }
  55. },
  56. onLoad() {
  57. this.studyList = [];
  58. this.params.labelClass = "0";
  59. this.params.pageNo = 1;
  60. this.params.total = null;
  61. this.params.isLock = true;
  62. this.queryPageListJobRelease();
  63. },
  64. // 隐藏微信h5的标题栏
  65. onReady() {
  66. this.$com.displayNav()
  67. },
  68. onPullDownRefresh() {
  69. this.studyList = [];
  70. this.params.pageNo = 1;
  71. this.params.total = null;
  72. this.params.isLock = true;
  73. this.queryPageListJobRelease()
  74. },
  75. onReachBottom() {
  76. if(this.params.isLock){
  77. this.params.isLock = false;
  78. if(this.params.total !== null && this.params.pageNo * this.params.pageSize >= this.params.total){
  79. this.$Toast('没有更多数据了哦!');
  80. setTimeout(()=>{
  81. this.params.isLock = true;
  82. },3000)
  83. return
  84. }
  85. this.params.pageNo+=1;
  86. this.$Toast('数据加载成功!');
  87. this.queryPageListJobRelease();
  88. }
  89. },
  90. methods:{
  91. queryPageListJobRelease(){//学习列表
  92. if(this.pageNo>1){
  93. uni.showLoading({})
  94. }
  95. this.$api('getAddressList',this.params)
  96. .then(res=>{
  97. if(res.code == 200){
  98. if(this.params.total== null) {
  99. this.params.total = res.result.total
  100. }
  101. if(this.params.pageNo>1){
  102. uni.hideLoading();
  103. }
  104. this.studyList = this.studyList.concat(res.result.records);
  105. this.params.isLock = true;
  106. }else {
  107. if(this.params.pageNo>1){
  108. uni.hideLoading();
  109. }
  110. this.params.isLock = true;
  111. }
  112. })
  113. },
  114. tabClick(e){
  115. this.params.labelClass = e.id;
  116. this.params.pageNo =1;
  117. this.studyList = [];
  118. this.queryPageListJobRelease();
  119. },
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .home-pages {
  125. padding: 28rpx 29rpx 0;
  126. background-color: #F7F7F7;
  127. .swiper{
  128. position: relative;
  129. height: calc(100% -7vh);
  130. width: 100%;
  131. height: 1800px;
  132. }
  133. .scroll-Y {
  134. height: calc(300vh - 660rpx);
  135. padding-top: 20rpx;
  136. }
  137. .home-content {
  138. .active-card{
  139. margin-top: 20rpx;;
  140. border-radius: 0;
  141. border: none;
  142. border-style: none;
  143. box-shadow: none;
  144. }
  145. }
  146. }
  147. </style>