team.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="container">
  3. <tui-tabs :top="0" :tabs="statusType" :isFixed="scrollTop>=0" :currentTab="currentTab" selectedColor="#E41F19"
  4. sliderBgColor="#E41F19" @change="statusTap" itemWidth="50%"></tui-tabs>
  5. <!--选项卡逻辑自己实现即可,此处未做处理-->
  6. <view :class="{'tui-order-list':scrollTop>=0}">
  7. <view class="tui-order-item" v-for="(item,Index) in datalist" :key="Index">
  8. <tui-list-cell :hover="false" :lineLeft="false">
  9. <view class="tui-goods-title">
  10. <view>{{item.nickname}}</view>
  11. <view class="tui-order-status">{{ item.regdate }}</view>
  12. </view>
  13. </tui-list-cell>
  14. </view>
  15. </view>
  16. <!--加载loadding-->
  17. <tui-loadmore v-if="loadding" :index="3" type="red"></tui-loadmore>
  18. <tui-nomore v-if="!pullUpOn" backgroundColor="#fafafa"></tui-nomore>
  19. <!--加载loadding-->
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. statusType: [{
  27. name: "一级",
  28. num: 0,
  29. }, {
  30. name: "二级",
  31. num: 0,
  32. }],
  33. currentType: 0,
  34. currentTab: 0,
  35. pageIndex: 1,
  36. loadding: false,
  37. pullUpOn: true,
  38. scrollTop: 0,
  39. number1: 0,
  40. number2: 0,
  41. members: [],
  42. datalist: []
  43. }
  44. },
  45. onLoad: function(e) {
  46. let _this = this
  47. },
  48. onShow: function(e) {
  49. this.getteam();
  50. },
  51. methods: {
  52. statusTap: function(e) {
  53. this.currentTab = e.index
  54. this.currentType = this.statusType[this.currentTab].id;
  55. if (this.currentTab == 0) {
  56. this.datalist = this.members.first;
  57. } else {
  58. this.datalist = this.members.second;
  59. }
  60. },
  61. getteam: function() {
  62. const _this = this
  63. _this.$request.post('member.team').then(res => {
  64. if (res.errno == 0) {
  65. _this.statusType[0].num = res.data.first.length;
  66. _this.statusType[1].num = res.data.second.length;
  67. _this.members = res.data
  68. _this.datalist = _this.members.first;
  69. }
  70. })
  71. }
  72. },
  73. onPullDownRefresh() {
  74. setTimeout(() => {
  75. uni.stopPullDownRefresh()
  76. }, 200);
  77. },
  78. onReachBottom() {
  79. //只是测试效果,逻辑以实际数据为准
  80. this.loadding = true
  81. this.pullUpOn = true
  82. setTimeout(() => {
  83. this.loadding = false
  84. this.pullUpOn = false
  85. }, 1000)
  86. },
  87. onPageScroll(e) {
  88. this.scrollTop = e.scrollTop;
  89. }
  90. }
  91. </script>
  92. <style>
  93. .container {
  94. padding-bottom: env(safe-area-inset-bottom);
  95. }
  96. .tui-order-list {
  97. margin-top: 80rpx;
  98. }
  99. .tui-order-item {
  100. margin-top: 20rpx;
  101. border-radius: 10rpx;
  102. overflow: hidden;
  103. }
  104. .tui-goods-title {
  105. width: 100%;
  106. font-size: 28rpx;
  107. display: flex;
  108. align-items: center;
  109. justify-content: space-between;
  110. }
  111. .tui-order-status {
  112. color: #888;
  113. font-size: 26rpx;
  114. }
  115. .tui-goods-item {
  116. width: 100%;
  117. padding: 20rpx 30rpx;
  118. box-sizing: border-box;
  119. display: flex;
  120. justify-content: space-between;
  121. }
  122. .tui-goods-img {
  123. width: 180rpx;
  124. height: 180rpx;
  125. display: block;
  126. flex-shrink: 0;
  127. }
  128. .tui-goods-center {
  129. flex: 1;
  130. padding: 20rpx 8rpx;
  131. box-sizing: border-box;
  132. }
  133. .tui-goods-name {
  134. max-width: 310rpx;
  135. word-break: break-all;
  136. overflow: hidden;
  137. text-overflow: ellipsis;
  138. display: -webkit-box;
  139. -webkit-box-orient: vertical;
  140. -webkit-line-clamp: 2;
  141. font-size: 26rpx;
  142. line-height: 32rpx;
  143. }
  144. .tui-color-red {
  145. color: #E41F19;
  146. padding-right: 30rpx;
  147. }
  148. .tui-goods-price {
  149. width: 100%;
  150. display: flex;
  151. align-items: flex-end;
  152. justify-content: flex-end;
  153. font-size: 24rpx;
  154. }
  155. .tui-size-24 {
  156. font-size: 24rpx;
  157. line-height: 24rpx;
  158. }
  159. .tui-price-large {
  160. font-size: 32rpx;
  161. line-height: 30rpx;
  162. font-weight: 500;
  163. }
  164. .tui-order-btn {
  165. width: 100%;
  166. display: flex;
  167. align-items: center;
  168. justify-content: flex-end;
  169. background: #fff;
  170. padding: 10rpx 30rpx 20rpx;
  171. box-sizing: border-box;
  172. }
  173. .tui-btn-ml {
  174. margin-left: 20rpx;
  175. }
  176. </style>