123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363 |
- <template>
- <view class="content">
- <view class="top-box">
- <image src="../../static/img/usert-bg.png" mode="" class="box-bg"></image>
- <view class="box-data">
- <view class="data-item">
- <view class="val">
- {{userInfo.now_money*1 || '0'}}
- </view>
- <view class="name">
- 消费积分
- </view>
- </view>
- <view class="line">
-
- </view>
- <view class="data-item">
- <view class="val">
- {{userInfo.max_pool*1|| '0'}}
- </view>
- <view class="name">
- 分红额度
- </view>
- </view>
- </view>
- </view>
- <view class="flex center-box ">
- <view class="flex center-item" @click="navto('/pages/user/xzdl?type=2')">
- <image src="../../static/icon/dh.png" mode=""></image>
- <view class="name">兑换</view>
- </view>
- <view class="line">
- </view>
- <view class="flex center-item" @click="navto('/pages/user/xzdl?type=1')">
- <image src="../../static/icon/hz.png" mode=""></image>
- <view class="name">互转</view>
- </view>
- <view class="line">
- </view>
- <view class="flex center-item" @click="toTx">
- <image src="../../static/icon/tx.png" mode=""></image>
- <view class="name">提现</view>
- </view>
- </view>
- <view class="tit">
- 我的資產
- </view>
- <view class="bottom-list" v-for="key in navList">
- <view class="flex list-item">
- <image :src="key.img" mode="" class="logo"></image>
- <view class="much">
- <view class="">
- {{key.name}}
- </view>
- <view class="val">
- 余额:{{userInfo[key.val]*1 || '0'}}
- </view>
- </view>
- <view class="btn" v-if="key.agent" @click="goft">
- 复投
- </view>
- <view class="more" @click="navto('/pages/user/sz?type=' + key.type)">
- 查看明细
- </view>
- <image src="../../static/icon/back.png" mode="" class="black"></image>
- </view>
- </view>
- <image src="../../static/img/xccg.gif" mode="" class="cg" @click="navto('/pages/user/xccg')"></image>
- </view>
- </template>
- <script>
- import {
- saveUrl,
- interceptor
- } from '@/utils/loginUtils.js';
- import {
- getUserInfo,
- userPool,
- goft
- } from '@/api/user.js';
- import {
- mapState,
- mapMutations
- } from 'vuex';
- export default {
- data() {
- return {
- navList: {
- ft: {
- name: '复投积分',
- val: 'resumption',
- type: 1,
- agent: true,
- img: '../../static/icon/xc1.png'
- },
- yj: {
- name: '佣金',
- val: 'brokerage_price',
- type: 2,
- agent: false,
- img: '../../static/icon/xc2.png'
- },
- fh: {
- name: '分红额度',
- val: 'max_pool',
- type: 3,
- agent: false,
- img: '../../static/icon/xc3.png'
- },
- xfjf: {
- name: '消费积分',
- val: 'now_money',
- type:4,
- agent: false,
- img: '../../static/icon/xc4.png'
- }
- }
- }
- },
- onLoad() {
-
- },
- onShow() {
- this.loadBaseData()
- },
- computed: {
- ...mapState('user',['userInfo','hasLogin'])
- },
- onPullDownRefresh() {
- this.loadBaseData('down')
- },
- methods: {
- ...mapMutations('user',['setUserInfo']),
- toTx() {
- let that = this
- if (!that.hasLogin) {
- // 保存地址
- saveUrl();
- // 登录拦截
- interceptor();
- } else {
- // uni.navigateTo({
- // url,
- // fail() {
- // uni.switchTab({
- // url
- // })
- // }
- // })
- if(that.userInfo.is_real == 1) {
- uni.showModal({
- title: "提示",
- content: '您提交的实名资料正在审核中,请耐心等待审核',
- showCancel:false
- })
- }else if(that.userInfo.is_real == 0) {
- uni.showModal({
- title: "提示",
- content: '您的账号未完成实名认证,是否立即完成实名认证?',
- complete(res) {
- if(res.confirm) {
- that.navto('/pages/user/smrz')
- }
- }
- })
- }else {
- that.navto('/pages/user/withdrawal')
- }
- }
- },
- loadBaseData(tit) {
- const obj = this
- getUserInfo({})
- .then(({
- data
- }) => {
- obj.setUserInfo(data);
- if(tit == 'down') {
- uni.stopPullDownRefresh();
- }
- })
- .catch(e => {
- console.log(e);
- if(tit == 'down') {
- uni.stopPullDownRefresh();
- }
- });
-
- },
- navto(url) {
-
- if (!this.hasLogin) {
- // 保存地址
- saveUrl();
- // 登录拦截
- interceptor();
- } else {
- uni.navigateTo({
- url,
- fail() {
- uni.switchTab({
- url
- })
- }
- })
- }
-
- },
- goft() {
- let that = this
- if(this.ftLoading) {
- return
- }
- this.ftLoading = true
- goft().then(res => {
- console.log(res);
- that.loadBaseData()
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #fff;
- min-height: 100%;
- height: auto;
- }
- .top-box {
- position: relative;
- .box-bg {
- width: 100%;
- height: 396rpx;
- }
- .box-data {
- width: 100%;
- height: 200rpx;
- position:absolute;
- top: 0;
- bottom: 0;
- margin: auto;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 37rpx;
- font-weight: bold;
- color: #fff;
- .data-item {
- flex-grow: 1;
- text-align: center;
- .val {
- font-size: 55rpx;
- font-weight: 800;
- padding-bottom: 15rpx;
- }
- }
- .line {
-
- width: 2rpx;
- height: 74rpx;
- background: #FFFFFF;
- opacity: 0.35;
- }
- }
- }
- .center-box {
- position: relative;
- width: 670rpx;
- height: 186rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50,50,52,0.06);
- border-radius: 20rpx;
- margin:-98rpx auto 0;
- font-size: 30rpx;
- font-weight: bold;
- color: #333333;
- .center-item {
- flex-grow: 1;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- image {
- width: 55rpx;
- height: 55rpx;
- }
- .name {
- padding-top: 10rpx;
- }
- }
- .line {
- width: 2rpx;
- height: 74rpx;
- background: #eff1f5;
- }
- }
- .bottom-list {
- .list-item {
- width: 670rpx;
- height: 127rpx;
- // background-color: red;
- border-bottom:1px solid #E8E8E8;
-
- margin: auto;
- .logo {
- width: 81rpx;
- height: 81rpx;
- }
- .much {
- padding-left: 14rpx;
- flex-grow: 1;
- font-size: 30rpx;
- font-weight: bold;
- color: #333333;
- .val {
- padding-top: 15rpx;
- font-size: 22rpx;
- font-weight: 500;
- color: #999999;
- }
- }
- .btn {
- width: 127rpx;
- height: 52rpx;
- border: 2px solid #ff5050;
- border-radius: 26rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 26rpx;
- font-weight: 500;
- color: #ff5050;
- margin-right: 24rpx;
- }
- .more {
- font-size: 24rpx;
- font-weight: 500;
- color: #999999;
- padding-right: 14rpx;
- }
- .black {
- width: 16rpx;
- height: 27rpx;
- }
- }
- }
- .cg {
- display: block;
- width: 706rpx;
- height: 193rpx;
- margin: 30rpx auto 0;
- }
- .tit {
-
- font-size: 36rpx;
- font-weight: bold;
- color: #333333;
- padding:46rpx 0;
- width: 750rpx-92rpx;
- margin: auto;
- }
- </style>
|