test.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="container">
  3. <view class="tabs">
  4. <scroll-view scroll-x class="bg-white nav">
  5. <view class="flex text-center">
  6. <view class="cu-item flex-sub" :class="index==current?'text-base text-xl text-bold ':'text-lg'"
  7. v-for="(item,index) in tabs" :key="index" @tap="tabChange(index)">
  8. {{item.name}}
  9. </view>
  10. </view>
  11. </scroll-view>
  12. </view>
  13. <view style="height: 100%;">
  14. <swiper style="height: 100%;" :current="current" @change="swiperChange" @animationfinish="animationfinish">
  15. <swiper-item v-for="(item,index) in tabs" :key="index">
  16. <scroll-view scroll-y style="height: 100%;">
  17. <view class="head_box u-flex u-row-center u-col-center">
  18. <view class="card-box">
  19. <view class="card-head u-flex u-col-center">
  20. <view class="card-title u-m-r-10">可提现金额(元)</view>
  21. <view class="u-iconfont uicon-eye" style="color: #fff;font-size: 50rpx;"></view>
  22. </view>
  23. <view class="money-num u-p-t-50">10.00</view>
  24. <view class="padding-top-40 text-white text-df">
  25. <text>总收益:¥ 88</text>
  26. <text class="margin-left-30">今日收益:¥ 8</text>
  27. </view>
  28. <button class="u-reset-button withdraw-btn">提现</button>
  29. </view>
  30. </view>
  31. <view class="flex justify-between" style="font-size: 24rpx;color: #666666;">
  32. <view class="bg-white cu-btn round margin-30 sm">
  33. <text >2021-09</text>
  34. <text class="cuIcon-triangledownfill text-gray" style="font-size: 50rpx;"></text>
  35. </view>
  36. <view class="total-box">收入¥0.00 支出¥0.00</view>
  37. </view>
  38. <u-sticky offset-top="0" :enable="true">
  39. <view class="u-flex nav-box">
  40. <view class="state-item u-flex-1 " v-for="(state, index) in statusList" :key="state.value" @tap="onTab(state.value)">
  41. <text class="state-title" :class="{ 'title-active': stateCurrent === state.value }">{{ state.name }}</text>
  42. <text class="underline" :class="{ 'underline-active': stateCurrent === state.value }"></text>
  43. </view>
  44. </view>
  45. </u-sticky>
  46. </scroll-view>
  47. </swiper-item>
  48. </swiper>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. components:{
  55. },
  56. data() {
  57. return {
  58. id: '',
  59. detail: {},
  60. tags: [],
  61. current: 0,
  62. swiperCurrent: 0,
  63. tabs: [{
  64. name: '账户明细',
  65. value: 0
  66. },
  67. {
  68. name: '积分明细',
  69. value: 1
  70. },
  71. {
  72. name: '积分明细',
  73. value: 2
  74. }
  75. ],
  76. stateCurrent: 'all', //默认
  77. statusList: [
  78. {
  79. name: '全部',
  80. value: 'all'
  81. },
  82. {
  83. name: '收入',
  84. value: 'add'
  85. },
  86. {
  87. name: '支出',
  88. value: 'reduce'
  89. }
  90. ],
  91. }
  92. },
  93. onLoad() {
  94. },
  95. methods: {
  96. fetchDetail() {
  97. this.api.shop.detail({
  98. id: this.id
  99. }).then(res => {
  100. this.detail = res.data
  101. this.tags = this.detail.labelNames.split(',')
  102. })
  103. },
  104. tabChange(index) {
  105. this.current = index
  106. },
  107. swiperChange(e) {
  108. uni.pageScrollTo({
  109. scrollTop: 0,
  110. duration: 0
  111. });
  112. this.current = e.detail.current
  113. },
  114. animationfinish({
  115. detail: {
  116. current
  117. }
  118. }) {
  119. this.swiperCurrent = current;
  120. this.current = current;
  121. },
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .text-xl {
  127. font-size: 34rpx;
  128. }
  129. .container {
  130. height: calc(100vh);
  131. background-color: #F6F6F6;
  132. padding: 78rpx 0rpx 0rpx;
  133. .tabs {
  134. position: fixed;
  135. top: -10rpx;
  136. left: 0;
  137. width: 100%;
  138. background-color: #FFFFFF;
  139. box-sizing: border-box;
  140. z-index: 3;
  141. }
  142. }
  143. .head_box {
  144. font-weight: 300;
  145. background-color: #fff;
  146. padding: 30rpx 0;
  147. .card-box {
  148. width: 700rpx;
  149. min-height: 300rpx;
  150. padding: 40rpx 40rpx 0rpx;
  151. background-color: #ff9201;
  152. box-shadow: 1rpx 5rpx 16rpx 0 rgba(255, 148, 71,.6);
  153. border-radius: 30rpx;
  154. overflow: hidden;
  155. position: relative;
  156. .card-head {
  157. color: #fff;
  158. font-size: 30rpx;
  159. }
  160. .money-num {
  161. font-size: 70rpx;
  162. line-height: 70rpx;
  163. font-weight: 500;
  164. color: #ffffff;
  165. }
  166. .reduce-num {
  167. font-size: 26rpx;
  168. font-weight: 400;
  169. color: #ffffff;
  170. }
  171. .withdraw-btn {
  172. width: 120rpx;
  173. height: 60rpx;
  174. line-height: 60rpx;
  175. background: #ffffff;
  176. border-radius: 30px;
  177. font-size: 24rpx;
  178. font-weight: 500;
  179. color: #ff9201;
  180. position: absolute;
  181. right: 30rpx;
  182. top: 40rpx;
  183. }
  184. }
  185. }
  186. .total-box {
  187. display: flex;
  188. justify-content: center;
  189. align-items: center;
  190. margin-right: 40rpx;
  191. font-size: 24rpx;
  192. font-weight: 500;
  193. color: #999999;
  194. }
  195. .state-item {
  196. height: 100%;
  197. display: flex;
  198. flex-direction: column;
  199. align-items: center;
  200. justify-content: center;
  201. background-color: #fff;
  202. .state-title {
  203. color: #666;
  204. font-weight: 500;
  205. font-size: 28rpx;
  206. line-height: 90rpx;
  207. }
  208. .title-active {
  209. color: #333;
  210. }
  211. .underline {
  212. display: block;
  213. width: 68rpx;
  214. height: 4rpx;
  215. background: #fff;
  216. border-radius: 2rpx;
  217. }
  218. .underline-active {
  219. font-weight: 800;
  220. background: #ff9447;
  221. display: block;
  222. width: 68rpx;
  223. height: 4rpx;
  224. border-radius: 2rpx;
  225. }
  226. }
  227. </style>