175 lines
7.6 KiB
Vue
175 lines
7.6 KiB
Vue
<template>
|
|
<view>
|
|
<!-- 钱包信息 -->
|
|
<view class="padding-main">
|
|
<view class="padding-main border-radius-main bg-white pr">
|
|
<view class="item oh">
|
|
<view class="fl cr-base">有效</view>
|
|
<view class="fl cr-main fw-b single-text margin-left-sm margin-right-sm">{{user_wallet.normal_money || '0.00'}}</view>
|
|
<view class="fl cr-gray unit">元</view>
|
|
</view>
|
|
<view class="item oh margin-top-sm">
|
|
<view class="fl cr-bas">冻结</view>
|
|
<view class="fl cr-red fw-b single-text margin-left-sm margin-right-sm">{{user_wallet.frozen_money || '0.00'}}</view>
|
|
<view class="fl cr-gray unit">元</view>
|
|
</view>
|
|
<view class="item oh margin-top-sm">
|
|
<view class="fl cr-base">赠送</view>
|
|
<view class="fl cr-base fw-b single-text margin-left-sm margin-right-sm">{{user_wallet.give_money || '0.00'}}</view>
|
|
<view class="fl cr-gray unit">元</view>
|
|
</view>
|
|
<view class="submit-container pa">
|
|
<navigator v-if="(data_base || null) != null && (data_base.is_enable_recharge || 0) == 1" class="dis-inline" url="/pages/plugins/wallet/recharge/recharge" hover-class="none">
|
|
<button class="round cr-white bg-green br-green text-size-sm" size="mini" type="default" hover-class="none">充值</button>
|
|
</navigator>
|
|
<navigator v-if="(data_base || null) != null && (data_base.is_enable_cash || 0) == 1" class="dis-inline" url="/pages/plugins/wallet/cash-auth/cash-auth" hover-class="none">
|
|
<button class="round cr-white bg-main br-main text-size-sm margin-left-lg" size="mini" type="default" hover-class="none">提现</button>
|
|
</navigator>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 导航 -->
|
|
<view v-if="nav_list.length > 0" class="nav oh">
|
|
<block v-for="(item, index) in nav_list" :key="index">
|
|
<view class="item fl tc padding-main border-radius-main bg-white">
|
|
<navigator :url="item.url" hover-class="none">
|
|
<image :src="item.icon" mode="scaleToFill" class="dis-block"></image>
|
|
<view class="tc cr-base margin-top-lg">{{item.title}}</view>
|
|
</navigator>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
|
|
<!-- 通知 -->
|
|
<view v-if="(data_base.user_center_notice || null) != null && data_base.user_center_notice.length > 0" class="padding-horizontal-main padding-bottom-main">
|
|
<view class="notice-content">
|
|
<view v-for="(item, index) in data_base.user_center_notice" :key="index" class="item">{{item}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
<script>
|
|
const app = getApp();
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
data_bottom_line_status: false,
|
|
data_list_loding_status: 1,
|
|
data_list_loding_msg: '',
|
|
data_base: null,
|
|
user_wallet: null,
|
|
submit_disabled_status: false,
|
|
// 导航
|
|
nav_list: []
|
|
};
|
|
},
|
|
|
|
components: {},
|
|
props: {},
|
|
|
|
onLoad(params) {},
|
|
|
|
onShow() {
|
|
this.set_nav_list();
|
|
this.init();
|
|
},
|
|
|
|
// 下拉刷新
|
|
onPullDownRefresh() {
|
|
this.get_data();
|
|
},
|
|
|
|
methods: {
|
|
init(e) {
|
|
var user = app.globalData.get_user_info(this, "init");
|
|
if (user != false) {
|
|
// 用户未绑定用户则转到登录页面
|
|
if (app.globalData.user_is_need_login(user)) {
|
|
uni.showModal({
|
|
title: '温馨提示',
|
|
content: '绑定手机号码',
|
|
confirmText: '确认',
|
|
cancelText: '暂不',
|
|
success: result => {
|
|
uni.stopPullDownRefresh();
|
|
if (result.confirm) {
|
|
uni.navigateTo({
|
|
url: "/pages/login/login?event_callback=init"
|
|
});
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
this.get_data();
|
|
}
|
|
}
|
|
},
|
|
|
|
// 导航
|
|
set_nav_list() {
|
|
var nav = [{
|
|
icon: "/static/images/plugins/wallet/user-center-wallet-log-icon.png",
|
|
title: "账户明细",
|
|
url: "/pages/plugins/wallet/wallet-log/wallet-log"
|
|
}, {
|
|
icon: "/static/images/plugins/wallet/user-center-recharge-icon.png",
|
|
title: "充值记录",
|
|
url: "/pages/plugins/wallet/user-recharge/user-recharge"
|
|
}, {
|
|
icon: "/static/images/plugins/wallet/user-center-cash-icon.png",
|
|
title: "提现记录",
|
|
url: "/pages/plugins/wallet/user-cash/user-cash"
|
|
}];
|
|
this.setData({
|
|
nav_list: nav
|
|
});
|
|
},
|
|
|
|
// 获取数据
|
|
get_data() {
|
|
uni.request({
|
|
url: app.globalData.get_request_url("index", "user", "wallet"),
|
|
method: "POST",
|
|
data: {},
|
|
dataType: "json",
|
|
success: res => {
|
|
uni.stopPullDownRefresh();
|
|
if (res.data.code == 0) {
|
|
var data = res.data.data;
|
|
this.setData({
|
|
data_base: data.base || null,
|
|
user_wallet: data.user_wallet || null,
|
|
data_list_loding_msg: '',
|
|
data_list_loding_status: 0,
|
|
data_bottom_line_status: false
|
|
});
|
|
} else {
|
|
this.setData({
|
|
data_bottom_line_status: false,
|
|
data_list_loding_status: 2,
|
|
data_list_loding_msg: res.data.msg
|
|
});
|
|
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
|
app.globalData.showToast(res.data.msg);
|
|
}
|
|
}
|
|
},
|
|
fail: () => {
|
|
uni.stopPullDownRefresh();
|
|
this.setData({
|
|
data_bottom_line_status: false,
|
|
data_list_loding_status: 2,
|
|
data_list_loding_msg: '服务器请求出错'
|
|
});
|
|
app.globalData.showToast("服务器请求出错");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
<style>
|
|
@import './user.css';
|
|
</style> |