123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466 |
- <template>
- <view class="content">
- <view class="content-money">
- <image src="../../static/img/centerbg.png" mode="" class="bg"></image>
- <view class="money-box flex">
- <view class="money-item">
- <view class="money">{{ spend }}</view>
- <view class="text">{{ $t('foo.dqyzfk') }}</view>
- </view>
- <view class="money-item">
- <view class="money">{{ income }}</view>
- <view class="text">{{ $t('foo.dqszfk')}}</view>
- </view>
- </view>
- </view>
- <view class="navbar">
- <view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
- </view>
- <swiper :current="tabCurrentIndex" :style="{ height: maxheight }" class="swiper-box" duration="300" @change="changeTab">
- <swiper-item class="tab-content">
- <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
- <!-- 空白页 -->
- <!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
- <!-- 订单列表 -->
- <view class="apply-box" v-for="item in navList[0].orderList">
- <view class="box-top">
- <view class="left flex">
- <image :src="userInfo.avatar" mode="" class="user-img"></image>
- <view class="user-info">
- <view class="user-name clamp">{{ userInfo.nickname }}</view>
- <view class="user-phone">{{ userInfo.mobile }}</view>
- </view>
- </view>
- <view class="right">
- <view class="user-name clamp">¥{{ item.money * 1 }}</view>
- <view class="user-phone">{{ item.time }}</view>
- </view>
- </view>
- <view class="apply-info flex">
- <view class="img-wrap"><image :src="imgitem" mode="" class="upimg" v-for="imgitem in item.imagelist"></image></view>
- <view class="btn-wrap">{{ item.status == '1' ? $t('hea.ytg') : item.status == '0' ? $t('hea.dsh') : $t('hea.wtg') }}</view>
- </view>
- </view>
- <uni-load-more :status="navList[0].loadingType"></uni-load-more>
- </scroll-view>
- </swiper-item>
- <swiper-item class="tab-content">
- <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
- <!-- 空白页 -->
- <!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
- <!-- 订单列表 -->
- <view class="apply-box" v-for="item in navList[1].orderList">
- <view class="box-top">
- <view class="left flex">
- <image :src="item.user_info.avatar" mode="" class="user-img"></image>
- <view class="user-info">
- <view class="user-name clamp">{{ item.user_info.nickname }}</view>
- <view class="user-phone">{{ item.user_info.mobile }}</view>
- </view>
- </view>
- <view class="right">
- <view class="user-name clamp">¥{{ item.money * 1 }}</view>
- <view class="user-phone">{{ item.time }}</view>
- </view>
- </view>
- <view class="apply-info flex">
- <view class="img-wrap"><image :src="imgitem" mode="" class="upimg" v-for="imgitem in item.imagelist"></image></view>
- <view class="btn-wrap">{{ item.status == '1' ? $t('hea.ytg') : item.status == '0' ? $t('hea.dsh') : $t('hea.wtg') }}</view>
- </view>
- </view>
- <uni-load-more :status="navList[1].loadingType"></uni-load-more>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script>
- import { getApplyList, getMyList } from '@/api/apply.js';
- import { mapState, mapMutations } from 'vuex';
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import empty from '@/components/empty';
- import { getTime } from '@/utils/rocessor.js';
- export default {
- components: {
- empty,
- uniLoadMore
- },
- computed: {
- ...mapState(['lang']),
- ...mapState('user', ['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
- },
- 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.maxheight = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', obj.maxheight);
- });
- },
- fail: res => {}
- });
- },
- data() {
- return {
- // 头部图高度
- maxheight: '',
- tabCurrentIndex: 0,
- navList: [
- {
- state: 0,
- text: this.$t('foo.yzfk'),
- loadingType: 'more',
- orderList: [],
- page: 1, //当前页面
- limit: 10 //每次信息条数
- },
- {
- state: 1,
- text: this.$t('foo.syzfk'),
- loadingType: 'more',
- orderList: [],
- page: 1, //当前页面
- limit: 10 //每次信息条数
- }
- ],
- spend: '', //援助金额
- income: '' //受援助金额
- };
- },
- onLoad(options) {},
- watch: {
- lang(val) {
- this.$set(this.navList[0], 'text', this.$t('foo.yzfk'));
- this.$set(this.navList[1], 'text', this.$t('foo.syzfk'));
- }
- },
- onShow() {
- uni.setNavigationBarTitle({
- title:this.$t('foo.syzx')
- })
- this.spend = this.userInfo.spend;
- this.income = this.userInfo.income;
- this.loadData();
- },
- methods: {
- navto(e) {
- uni.navigateTo({
- url: e
- });
- },
- async loadData(source) {
- //这里时将订单挂载到tab列表下
- let index = this.tabCurrentIndex;
- let navItem = this.navList[index];
- let state = navItem.state;
- if (source === 'tabChange' && navItem.loaded === true) {
- //tab切换只有第一次需要加载数据
- return;
- }
- if (navItem.loadingType === 'loading') {
- //防止重复加载
- return;
- }
- //修改当前对象状态为加载中
- navItem.loadingType = 'loading';
- console.log(state, '123321');
- if (state == 1) {
- getApplyList({
- page: navItem.page,
- limit: navItem.limit,
- status: 8
- })
- .then(({ data }) => {
- data.list.forEach(e => {
- console.log(e);
- e.time = getTime(e.updatetime);
- if (e.voucherimages) {
- e.imagelist = e.voucherimages.split(',');
- }
- });
- if (data.list.length > 0) {
- navItem.orderList = navItem.orderList.concat(data.list);
- console.log(navItem.orderList);
- navItem.page++;
- }
- //判断是否还有数据, 有改为more, 没有改为noMore
- if (navItem.limit == data.list.length) {
- navItem.loadingType = 'more';
- return;
- } else {
- navItem.loadingType = 'noMore';
- }
- uni.hideLoading();
- this.$set(navItem, 'loaded', true);
- })
- .catch(e => {
- console.log(e);
- });
- } else {
- getMyList({ page: navItem.page, limit: navItem.limit })
- .then(({ data }) => {
- if (data.list.length > 0) {
- data.list.forEach(e => {
- console.log(e);
- e.time = getTime(e.updatetime);
- if (e.voucherimages) {
- e.imagelist = e.voucherimages.split(',');
- }
- });
- navItem.orderList = navItem.orderList.concat(data.list);
- console.log(navItem.orderList);
- navItem.page++;
- }
- //判断是否还有数据, 有改为more, 没有改为noMore
- if (navItem.limit == data.list.length) {
- navItem.loadingType = 'more';
- return;
- } else {
- navItem.loadingType = 'noMore';
- }
- uni.hideLoading();
- this.$set(navItem, 'loaded', true);
- })
- .catch(e => {
- console.log(e);
- });
- }
- },
- //swiper 切换
- changeTab(e) {
- this.tabCurrentIndex = e.target.current;
- this.loadData('tabChange');
- },
- //顶部tab点击
- tabClick(index) {
- this.tabCurrentIndex = index;
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background: #000;
- height: 100%;
- }
- .content-money {
- height: 430rpx;
- padding-bottom: 30rpx;
- background: $page-color-base;
- position: relative;
- .bg {
- position: absolute;
- width: 100%;
- height: 430rpx;
- }
- .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;
- align-items: center;
- .money-item {
- width: 50%;
- }
- .text {
- font-size: $font-sm;
- }
- .money {
- padding-top: 147rpx;
- font-size: 47px;
- font-family: PingFang SC;
- font-weight: bold;
- text {
- font-size: 24px;
- }
- }
- }
- .navbar {
- display: flex;
- height: 40px;
- padding: 0 5px;
- background: #000;
- box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
- position: relative;
- z-index: 10;
- .nav-item {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100%;
- font-size: 15px;
- color: #999999;
- position: relative;
- overflow: hidden;
- &.current {
- color: $base-color;
- &:after {
- content: '';
- position: absolute;
- left: 50%;
- bottom: 0;
- transform: translateX(-50%);
- width: 44px;
- height: 0;
- border-bottom: 2px solid $base-color;
- }
- }
- }
- }
- //列表
- .swiper-box {
- padding-top: 10rpx;
- .apply-box {
- height: 317rpx;
- width: 702rpx;
- // background-color: red;
- margin: 0 auto;
- border-bottom: 1px solid #6c6a68;
- padding-top: 30rpx;
- .box-top {
- height: 80rpx;
- // background-color: #bfa;
- display: flex;
- justify-content: space-between;
- .left {
- justify-content: flex-start;
- }
- .right {
- text-align: right;
- }
- .user-img {
- width: 80rpx;
- height: 80rpx;
- background-color: #eee;
- margin-right: 20rpx;
- flex-shrink: 0;
- border-radius: 50%;
- }
- .user-name {
- max-width: 500rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- }
- .user-phone {
- padding-top: 10rpx;
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #ffffff;
- }
- }
- .apply-info {
- padding: 25rpx 0 0 100rpx;
- justify-content: space-between;
- .img-wrap {
- .upimg {
- width: 153rpx;
- height: 152rpx;
- border-radius: 10rpx;
- background-color: #999;
- margin-left: 10rpx;
- }
- }
- .btn-wrap {
- align-self: flex-end;
- color: #fad6b0;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #fad6b0;
- .btn {
- width: 98rpx;
- line-height: 47rpx;
- text-align: center;
- }
- .btn-reject {
- border: 1px solid #fad6b0;
- border-radius: 5rpx;
- color: #fad6b0;
- }
- .btn-pass {
- background: linear-gradient(-74deg, #ce9c6d, #ffecd6);
- border-image: linear-gradient(115deg, #feebd5, #ffffff, #e1ad7d) 1 1;
- box-shadow: 3rpx 4rpx 5rpx 0rpx rgba(151, 118, 74, 0.5);
- border-radius: 5rpx;
- color: #874b19;
- margin-left: 10rpx;
- }
- }
- }
- }
- }
- .list-scroll-content {
- height: 100%;
- }
- .content {
- height: 100%;
- .empty-content {
- background-color: #ffffff;
- }
- }
- </style>
|