123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <template>
- <view>
- <view class="my_top">
- <image src="../../static/images/top-bg.png" class="bg"></image>
- </view>
- <view class="list animated fadeInDown">
- <view class="uni-flex uni-row center">
- <view class="wallet">
- <h1 style="color: blue;">{{ user.wallet }}</h1>
- </view>
- </view>
- </view>
- <view class="uni-flex uni-row" style="padding:1rem; ">
- <button type="primary" style="-webkit-flex: 1;flex: 1;"
- @click="goto('/pages/wallet/topup/edit')">充值</button>
- <view class="text" style="width: 15rpx;"></view>
- <button type="default" style="-webkit-flex: 1;flex: 1;"
- @click="goto('/pages/wallet/topdown/edit')">兑现</button>
- </view>
- <view class="tab">
- <u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
- </view>
- <view class="goodsList">
- <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
- <view class="title">{{ item.tagTypeName }}
- <view class="state" v-if="item.tagType == 1 ">
- <text class="icon" style="color:#13ce66"></text>
- <text>+{{ item.amount }}</text>
- </view>
- <view class="state" v-if="item.tagType == 2 ">
- <text class="icon" style="color:#FF2222"></text>
- <text>-{{ item.amount }}</text>
- </view>
- <view class="state" v-if="item.tagType == 3 ">
- <text class="icon" style="color:#CC8855"></text>
- <text>-{{ item.amount }}</text>
- </view>
- </view>
- <view class="op">
- <view class="date">{{ item.recordTime }}</view>
- </view>
- </view>
- <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
- <u-empty v-if="!loadMore && list.length == 0"></u-empty>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- user: {},
- tab: [{
- name: '全部',
- tagType: ''
- },
- {
- name: '充值',
- tagType: '1'
- },
- {
- name: '兑现',
- tagType: '2'
- },
- {
- name: '扣除',
- tagType: '3'
- }
- ],
- param: {
- pageNo: 1,
- pageSize: 10,
- status:2,
- tagType: ''
- },
- list: [],
- loadMore: true,
- };
- },
- onLoad() {
- this.user = this.getUser()
- },
- onShow() {
- this.user = this.getUser();
- this.getData();
- },
- methods: {
- getData() {
- this.param.peopleId = this.user.fkId;
- this.http.request({
- url: '/level-one-server/app/WalletManage/getList',
- loading: 'false',
- data: this.param,
- success: res => {
- this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
- if (res.data.data) {
- this.list = res.data.data;
- }
- }
- });
- },
- // 点击tab切换
- click(e) {
- this.param.tagType = e.tagType;
- this.refresh()
- },
- detail(item) {
- let urlStr = ''
- if (item.tagType == 1) {
- urlStr = '/pages/wallet/topup/detail?id='
- }
- if (item.tagType == 2) {
- urlStr = '/pages/wallet/topdown/detail?id='
- }
- if (item.tagType == 3) {
- urlStr = '/pages/wallet/detail?id='
- }
- uni.navigateTo({
- url: urlStr + item.id
- });
- },
- goto(url) {
- uni.navigateTo({
- url: url
- });
- },
- // 刷新数据
- refresh() {
- this.loadMore = true;
- this.param.pageNo = 1;
- this.list = [];
- this.getData();
- }
- },
- //下拉刷新
- onPullDownRefresh() {
- setTimeout(() => {
- this.refresh();
- uni.stopPullDownRefresh();
- }, 1000);
- },
- //上拉加载
- onReachBottom() {
- if (this.loadMore) {
- this.param.pageNo++;
- this.getData();
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background-color: #f5f5f5;
- }
- .my_top {
- position: relative;
- overflow: hidden;
- image {
- width: 100%;
- }
- }
- .uni-flex {
- display: flex;
- flex-direction: row;
- }
- .uni-flex-item {
- flex: 1;
- }
- .uni-row {
- flex-direction: row;
- }
- .list {
- position: relative;
- padding: 0px 20px 10px 20px;
- margin-top: -226px;
- .center {
- -webkit-justify-content: center;
- justify-content: center;
- text-align: center;
- .wallet {
- display: flex;
- flex-direction: column;
- background-color: white;
- width: 5rem;
- height: 5rem;
- line-height: 5rem;
- border-radius: 50%;
- .num {
- color: #0000CC;
- font-size: 43px;
- }
- }
- .rbtn {
- padding-left: 15px;
- width: 60%;
- }
- }
- }
- .state {
- margin-right: -70px;
- }
- .down_btn {
- color: #f0f4f7;
- width: 100px;
- background: #f9ae3d;
- text-align: center;
- border-radius: 10px;
- font-size: 12px;
- padding: 2px 5px;
- }
- </style>
|