integral.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="container">
  3. <!-- 头部 -->
  4. <view class="header">
  5. <image src="../../static/img/img38.png" mode="scaleToFill"></image>
  6. <view class="money">3852</view>
  7. </view>
  8. <!-- 收入和支出 -->
  9. <view class="navbar">
  10. <view class="nav-item" v-for="(item, index) in navList" :key="index"
  11. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  12. </view>
  13. <swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab"
  14. >
  15. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  16. <!-- 空白页 -->
  17. <!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
  18. <!-- 推广奖励 -->
  19. <scroll-view class="scorll" scroll-y="true" >
  20. <view class="cost">
  21. <view class="award" v-for="item in 10">
  22. <view class="award-left">
  23. <view class="text">消费赠送</view>
  24. <view class="time">2021-8-26 09:30</view>
  25. </view>
  26. <view class="award-right">+200</view>
  27. </view>
  28. </view>
  29. </scroll-view>
  30. </swiper-item>
  31. </swiper>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data () {
  37. return {
  38. height: '',
  39. tabCurrentIndex: 0,
  40. navList: [{
  41. state: 1,
  42. text: '收入',
  43. loadingType: 'more',
  44. orderList: [],
  45. page: 1, //当前页数
  46. limit: 10 //每次信息条数
  47. },
  48. {
  49. state: 2,
  50. text: '支出',
  51. loadingType: 'more',
  52. orderList: [],
  53. page: 1, //当前页数
  54. limit: 10 //每次信息条数
  55. }
  56. ],
  57. list: [],
  58. money: ''
  59. }
  60. },
  61. methods: {
  62. //swiper 切换
  63. changeTab (e) {
  64. this.tabCurrentIndex = e.target.current;
  65. this.loadData('tabChange')
  66. },
  67. //顶部tab点击
  68. tabClick(index) {
  69. this.tabCurrentIndex = index;
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss">
  75. .container {
  76. width: 750rpx;
  77. height: 1334rpx;
  78. background-color: #f1f1f1;
  79. .header {
  80. image {
  81. width: 750rpx;
  82. height: 400rpx;
  83. }
  84. .money {
  85. font-size: 72rpx;
  86. font-family: PingFang SC;
  87. font-weight: 500;
  88. color: #3F7C1F;
  89. top: 15%;
  90. position: absolute;
  91. left: 50%;
  92. transform: translate(-50%);
  93. }
  94. }
  95. .swiper-box {
  96. height: calc(100% - 500rpx);
  97. background-color: #FFFFFF;
  98. }
  99. .scorll {
  100. height: 90%;
  101. }
  102. .navbar {
  103. display: flex;
  104. height: 100rpx;
  105. padding: 0 5rpx;
  106. background: #fff;
  107. box-shadow: 0 1rpx 5rpx rgba(0, 0, 0, 0.06);
  108. position: relative;
  109. z-index: 10;
  110. margin-top: 25rpx;
  111. .nav-item {
  112. flex: 1;
  113. display: flex;
  114. justify-content: center;
  115. align-items: center;
  116. height: 100%;
  117. font-size: 15px;
  118. color: #999999;
  119. position: relative;
  120. &.current {
  121. color: #333333;
  122. &:after {
  123. content: '';
  124. position: absolute;
  125. left: 50%;
  126. bottom: 0;
  127. transform: translateX(-50%);
  128. width: 44px;
  129. height: 0;
  130. border-bottom: 2px solid #3F7C1F;
  131. }
  132. }
  133. }
  134. }
  135. .cost {
  136. width: 750rpx;
  137. height: auto;
  138. background-color: #fff;
  139. .award {
  140. width: 701rpx;
  141. height: 132rpx;
  142. border-bottom: 1px solid #F0F4F8;
  143. margin-left: 25rpx;
  144. display: flex;
  145. justify-content: space-between;
  146. align-items: center;
  147. .award-left {
  148. width: 221rpx;
  149. height: 40rpx;
  150. margin-left: 30rpx;
  151. margin-bottom: 35rpx;
  152. .text {
  153. width: 182rpx;
  154. height: 30rpx;
  155. font-size: 30rpx;
  156. font-family: PingFang SC;
  157. font-weight: bold;
  158. color: #666666;
  159. margin-bottom: 16rpx;
  160. }
  161. .time {
  162. width: 221rpx;
  163. height: 20rpx;
  164. font-size: 26rpx;
  165. font-family: PingFang SC;
  166. font-weight: 500;
  167. color: #AEAEAE;
  168. }
  169. }
  170. .award-right {
  171. font-size: 36rpx;
  172. font-family: PingFang SC;
  173. font-weight: bold;
  174. color: #FF0000;
  175. margin-right: 30rpx;
  176. }
  177. }
  178. }
  179. }
  180. </style>