123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- <template>
- <view class="content">
- <view class="content-money">
- <image src="../../static/img/promation.png" mode="" class="bg"></image>
- <view class="money-box">
- <view class="money">
- {{ all.all || 0 }}
- <text>{{$t('hea.ren')}}</text>
- </view>
- <view class="text">{{$t('hea.wdtgrs')}}</view>
- </view>
- </view>
- <view class="navbar flex">
- <view class="nav-item">
- <view class="num">{{ all.valid }}</view>
- <view class="font">{{$t('foo.jhrs')}}</view>
- </view>
- <view class="xian"></view>
- <view class="nav-item">
- <view class="num">{{ all.v2 }}</view>
- <view class="font">{{$t('foo.hzrs')}}</view>
- </view>
- </view>
- <view class="swiper-box" :style="{ height: height }">
- <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData" :style="{ height: height }">
- <!-- 空白页 -->
- <!-- <empty v-if="list.length === 0"></empty> -->
- <!-- 订单列表 -->
- <view class="order-item flex" v-for="(item, index) in list" :key="index">
- <view class="title-box flex_item">
- <view class="title-avatar"><image :src="item.avatar || '/static/error/missing-face.png'"></image></view>
- <view class="list_tpl">
- <view class="title">
- <text>{{ item.mobile || item.email }}</text>
- </view>
- <view class="time">
- <text>{{ item.time }}</text>
- </view>
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- import { spread_children,num } from '@/api/user.js';
- import { mapState, mapMutations } from 'vuex';
- import { getMoneyStyle, getTime } from '@/utils/rocessor.js';
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import empty from '@/components/empty';
- export default {
- components: {
- empty,
- uniLoadMore
- },
- onReady(res) {
- var obj = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.swiper-box').boundingClientRect();
- query.exec(function(res) {
- console.log(res, 'ddddddddddddd');
- obj.height = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', obj.height);
- });
- },
- fail: res => {}
- });
- },
- data() {
- return {
- // 头部图高度
- height: '',
- tabCurrentIndex: 0,
- all: '',
- list: [],
- loadingType: 'more',
- limit: 10,
- page: 1,
- id: ''
- };
- },
- onShow() {
- uni.setNavigationBarTitle({
- title:this.$t('foo.wdtg')
- })
- this.id = this.userInfo.id;
- num().then(({data}) =>{
- console.log(data)
- this.all = data
- })
- this.loadData();
- },
- computed: {
- ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
- },
- methods: {
- loadData() {
- const obj = this;
- if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
- return;
- }
- obj.loadingType == 'loading';
- spread_children({ limit: obj.limit, page: obj.page }, obj.id).then(({ data }) => {
- data.forEach(e => {
- e.time = getTime(e.createtime);
- });
- console.log(data,'123456');
- obj.list = obj.list.concat(data);
- // obj.list = data
- obj.page++;
- if (data.length == obj.limit) {
- obj.loadingType = 'more';
- return
- } else {
- obj.loadingType = 'noMore';
- }
- });
- },
- navto(e) {
- uni.navigateTo({
- url: e
- });
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background: #000;
- height: 100%;
- }
- .content-money {
- height: 480rpx;
- padding-bottom: 30rpx;
- background: $page-color-base;
- position: relative;
- .bg {
- position: absolute;
- width: 100%;
- }
- .moneyTx {
- position: absolute;
- top: 150rpx;
- right: 0rpx;
- width: 150rpx;
- padding: 10rpx 30rpx;
- border: 2px solid #ffffff;
- border-top-left-radius: 99rpx;
- border-bottom-left-radius: 99rpx;
- color: #ffffff;
- line-height: 1;
- font-size: $font-base;
- }
- .buttom-box {
- background-color: #ffffff;
- text-align: center;
- margin: 0 30rpx;
- padding: 20rpx 0;
- border-radius: $border-radius-sm;
- margin-top: -60rpx;
- .buttom {
- font-size: $font-lg;
- flex-grow: 1;
- }
- .interval {
- width: 2px;
- height: 60rpx;
- background-color: #eeeeee;
- }
- .icon {
- height: 50rpx;
- width: 48rpx;
- margin: 0 auto;
- .icon-img {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- .money-box {
- // background-color: $base-color;
- padding-top: var(--status-bar-height);
- height: 368rpx;
- color: #fad6b0;
- text-align: center;
- position: relative;
- .text {
- font-size: $font-sm;
- }
- .money {
- padding-top: 147rpx;
- font-size: 47px;
- font-family: PingFang SC;
- font-weight: bold;
- text {
- font-size: 24px;
- }
- }
- }
- .navbar {
- width: 702rpx;
- height: auto;
- padding: 20rpx 0;
- background: linear-gradient(90deg, #393326, #27221d);
- border: 2rpx solid #f5d2ad;
- border-radius: 10rpx;
- position: relative;
- z-index: 10;
- margin: 0 auto;
- .xian {
- width: 2rpx;
- height: 54rpx;
- background: #eeeeee;
- }
- .nav-item {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- height: 100%;
- font-size: 15px;
- color: #fff;
- position: relative;
- width: 50%;
- .num {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #fad6b0;
- }
- .font {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- }
- }
- }
- //列表
- .swiper-box {
- margin-top: 20rpx;
- .order-item {
- padding: 20rpx 30rpx;
- line-height: 1.5;
- .title-box {
- width: 100%;
- .title-avatar {
- width: 100rpx;
- height: 100rpx;
- margin-right: 25rpx;
- border-radius: 100%;
- image {
- width: 100%;
- height: 100%;
- border-radius: 100%;
- }
- }
- .list_tpl {
- width: 85%;
- .title {
- font-size: $font-lg;
- color: $font-color-base;
- overflow: hidden; //超出的文本隐藏
- text-overflow: ellipsis; //溢出用省略号显示
- white-space: nowrap;
- }
- .time {
- font-size: $font-base;
- color: $font-color-light;
- }
- }
- }
- .money {
- color: #db1935;
- font-size: $font-lg;
- }
- }
- }
- .content {
- height: 100%;
- .empty-content {
- background-color: #000;
- }
- }
- </style>
|