| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <template>
- <view class="container">
- <view class="tabs">
- <scroll-view scroll-x class="bg-white nav">
- <view class="flex text-center">
- <view class="cu-item flex-sub" :class="index==current?'text-base text-xl text-bold ':'text-lg'"
- v-for="(item,index) in tabs" :key="index" @tap="tabChange(index)">
- {{item.name}}
- </view>
- </view>
- </scroll-view>
- </view>
- <view style="height: 100%;">
- <swiper style="height: 100%;" :current="current" @change="swiperChange" @animationfinish="animationfinish">
- <swiper-item v-for="(item,index) in tabs" :key="index">
- <scroll-view scroll-y style="height: 100%;">
- <view class="head_box u-flex u-row-center u-col-center">
- <view class="card-box">
- <view class="card-head u-flex u-col-center">
- <view class="card-title u-m-r-10">可提现金额(元)</view>
- <view class="u-iconfont uicon-eye" style="color: #fff;font-size: 50rpx;"></view>
- </view>
- <view class="money-num u-p-t-50">10.00</view>
-
- <view class="padding-top-40 text-white text-df">
- <text>总收益:¥ 88</text>
- <text class="margin-left-30">今日收益:¥ 8</text>
- </view>
- <button class="u-reset-button withdraw-btn">提现</button>
- </view>
- </view>
-
- <view class="flex justify-between" style="font-size: 24rpx;color: #666666;">
- <view class="bg-white cu-btn round margin-30 sm">
- <text >2021-09</text>
- <text class="cuIcon-triangledownfill text-gray" style="font-size: 50rpx;"></text>
- </view>
-
- <view class="total-box">收入¥0.00 支出¥0.00</view>
- </view>
-
-
- <u-sticky offset-top="0" :enable="true">
- <view class="u-flex nav-box">
- <view class="state-item u-flex-1 " v-for="(state, index) in statusList" :key="state.value" @tap="onTab(state.value)">
- <text class="state-title" :class="{ 'title-active': stateCurrent === state.value }">{{ state.name }}</text>
- <text class="underline" :class="{ 'underline-active': stateCurrent === state.value }"></text>
- </view>
- </view>
- </u-sticky>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </view>
- </template>
- <script>
- export default {
- components:{
- },
- data() {
- return {
- id: '',
- detail: {},
- tags: [],
- current: 0,
- swiperCurrent: 0,
- tabs: [{
- name: '账户明细',
- value: 0
- },
- {
- name: '积分明细',
- value: 1
- },
- {
- name: '积分明细',
- value: 2
- }
- ],
-
- stateCurrent: 'all', //默认
- statusList: [
- {
- name: '全部',
- value: 'all'
- },
- {
- name: '收入',
- value: 'add'
- },
- {
- name: '支出',
- value: 'reduce'
- }
- ],
- }
- },
- onLoad() {
- },
- methods: {
- fetchDetail() {
- this.api.shop.detail({
- id: this.id
- }).then(res => {
- this.detail = res.data
- this.tags = this.detail.labelNames.split(',')
- })
- },
- tabChange(index) {
- this.current = index
- },
- swiperChange(e) {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 0
- });
- this.current = e.detail.current
- },
- animationfinish({
- detail: {
- current
- }
- }) {
- this.swiperCurrent = current;
- this.current = current;
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .text-xl {
- font-size: 34rpx;
- }
- .container {
- height: calc(100vh);
- background-color: #F6F6F6;
- padding: 78rpx 0rpx 0rpx;
- .tabs {
- position: fixed;
- top: -10rpx;
- left: 0;
- width: 100%;
- background-color: #FFFFFF;
- box-sizing: border-box;
- z-index: 3;
- }
- }
-
-
- .head_box {
- font-weight: 300;
- background-color: #fff;
- padding: 30rpx 0;
- .card-box {
- width: 700rpx;
- min-height: 300rpx;
- padding: 40rpx 40rpx 0rpx;
- background-color: #ff9201;
- box-shadow: 1rpx 5rpx 16rpx 0 rgba(255, 148, 71,.6);
- border-radius: 30rpx;
- overflow: hidden;
- position: relative;
- .card-head {
- color: #fff;
- font-size: 30rpx;
- }
- .money-num {
- font-size: 70rpx;
- line-height: 70rpx;
- font-weight: 500;
- color: #ffffff;
- }
- .reduce-num {
- font-size: 26rpx;
- font-weight: 400;
- color: #ffffff;
- }
-
- .withdraw-btn {
- width: 120rpx;
- height: 60rpx;
- line-height: 60rpx;
- background: #ffffff;
- border-radius: 30px;
- font-size: 24rpx;
- font-weight: 500;
- color: #ff9201;
- position: absolute;
- right: 30rpx;
- top: 40rpx;
- }
- }
- }
-
- .total-box {
- display: flex;
- justify-content: center;
- align-items: center;
- margin-right: 40rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #999999;
- }
-
- .state-item {
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- background-color: #fff;
- .state-title {
- color: #666;
- font-weight: 500;
- font-size: 28rpx;
- line-height: 90rpx;
- }
- .title-active {
- color: #333;
- }
- .underline {
- display: block;
- width: 68rpx;
- height: 4rpx;
- background: #fff;
- border-radius: 2rpx;
- }
- .underline-active {
- font-weight: 800;
- background: #ff9447;
- display: block;
- width: 68rpx;
- height: 4rpx;
- border-radius: 2rpx;
- }
- }
- </style>
|