源文件
This commit is contained in:
32
pages/plugins/coin/cash-list/cash-list.css
Normal file
32
pages/plugins/coin/cash-list/cash-list.css
Normal file
@@ -0,0 +1,32 @@
|
||||
.cash .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
.recharge-del-btn {
|
||||
padding: 0 60rpx;
|
||||
font-size: 28rpx;
|
||||
margin: 0 0 0 20rpx;
|
||||
color: #0079ff !important;
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #0079ff;
|
||||
}
|
||||
|
||||
.recharge-del-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
518
pages/plugins/coin/cash-list/cash-list.vue
Normal file
518
pages/plugins/coin/cash-list/cash-list.vue
Normal file
@@ -0,0 +1,518 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="cash">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_recharge_status_open_event">
|
||||
<view>{{ recharge_status_name !== null && recharge_status_name !== $t('common.all') ? recharge_status_name : $t('invoice-detail.invoice-detail.rrfex6') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_recharge_status_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_network_open_event">
|
||||
<view>{{ network_name !== null && network_name !== $t('common.all') ? network_name : $t('cash-list.cash-list.2g251t') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_network_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view class="cr-grey-9 title">{{ item.add_time }}</view>
|
||||
<view :class="item.status == 0 ? 'cr-black' : item.status_type == 1 ? 'cr-grey-9' : 'cr-black'">{{ item.status_name }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.e6pffe')}}</text>
|
||||
<text class="fw-b warp">{{ item.cash_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b warp">{{ item.platform_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title title">{{$t('cash-list.cash-list.23ii8s')}}</text>
|
||||
<text class="fw-b warp">{{ item.network_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title title">{{$t('cash-list.cash-list.714g2h')}}</text>
|
||||
<text class="fw-b warp">{{ item.address }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.1o8838')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<div v-if="item.status == 0" class="br-t-dashed padding-top-main margin-top-main flex-row jc-e align-c">
|
||||
<button type="default" class="recharge-del-btn round margin-0" :data-id="item.id" @tap="cash_del_event">{{$t('common.del')}}</button>
|
||||
</div>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 类型 -->
|
||||
<component-popup :propShow="popup_recharge_status_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_recharge_status_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.t66tu3')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="recharge_status_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in recharge_status_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="recharge_status_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_recharge_status_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 网络 -->
|
||||
<component-popup :propShow="popup_network_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_network_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.311tt2')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="network_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in network_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.id" :data-index="index" @tap="network_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_network_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
// 类型
|
||||
popup_recharge_status_status: false,
|
||||
status: null,
|
||||
recharge_status_list_index: null,
|
||||
recharge_status_name: null,
|
||||
recharge_status_list: [],
|
||||
// 网络
|
||||
popup_network_status: false,
|
||||
network_id: null,
|
||||
network_list_index: null,
|
||||
network_name: null,
|
||||
network_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始数据
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
recharge_status_list: data.recharge_status_list || [],
|
||||
network_list: data.network_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = this.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
// 加载loding
|
||||
if (this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
var new_data = {
|
||||
accounts_id: this.accounts_id,
|
||||
network_id: this.network_id,
|
||||
status: this.status,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
popup_recharge_status_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 类型打开
|
||||
popup_recharge_status_open_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: !this.popup_recharge_status_status,
|
||||
popup_accounts_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型关闭
|
||||
popup_recharge_status_close_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型选择
|
||||
recharge_status_list_event(e) {
|
||||
this.setData({
|
||||
recharge_status_list_index: e.currentTarget.dataset.index,
|
||||
status: e.currentTarget.dataset.value,
|
||||
recharge_status_name: e.currentTarget.dataset.name,
|
||||
popup_recharge_status_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 网络打开
|
||||
popup_network_open_event() {
|
||||
this.setData({
|
||||
popup_network_status: !this.popup_network_status,
|
||||
popup_accounts_status: false,
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络关闭
|
||||
popup_network_close_event() {
|
||||
this.setData({
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络选择
|
||||
network_list_event(e) {
|
||||
this.setData({
|
||||
network_list_index: e.currentTarget.dataset.index,
|
||||
network_id: e.currentTarget.dataset.value,
|
||||
network_name: e.currentTarget.dataset.name,
|
||||
popup_network_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 删除支付
|
||||
cash_del_event(e) {
|
||||
// 是否再次确认
|
||||
if (e.alert_status != 0 && e.alert_status != 1) {
|
||||
app.globalData.alert({
|
||||
msg: this.$t('cash-list.cash-list.8hrc73'),
|
||||
is_show_cancel: 1,
|
||||
object: this,
|
||||
params: { id: e.currentTarget.dataset.id },
|
||||
method: 'cash_del_event',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (e.alert_status == 1) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: { ids: e.id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.del_success'), 'success');
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(this.$t('common.del_fail'));
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './cash-list.css';
|
||||
</style>
|
||||
118
pages/plugins/coin/cash/cash.css
Normal file
118
pages/plugins/coin/cash/cash.css
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.cash .title {
|
||||
background: radial-gradient(60% 70% at 90% 79%, rgba(33, 125, 239, 0.85) 0%, #A6C8F3 100%);
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
padding-bottom: 180rpx;
|
||||
}
|
||||
|
||||
.coin-dropdown {
|
||||
--height: 48rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 64rpx 0 32rpx;
|
||||
background: rgba(255, 255, 255, 0.23);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: 36rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.cash .detail {
|
||||
--height: 64rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
background: rgba(255, 255, 255, 0.34);
|
||||
border-radius: 200rpx 0 0 200rpx;
|
||||
padding: 0 32rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.cash .text {
|
||||
color: #EBF3FF;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.cash .content {
|
||||
margin-top: -200rpx;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
min-height: calc(100vh - 528rpx);
|
||||
/* #ifndef H5 */
|
||||
min-height: calc(100vh - 528rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
}
|
||||
.cash .recharge-content-input-bg,
|
||||
.cash .content-input-bg {
|
||||
background-color: #fafafc;
|
||||
}
|
||||
|
||||
.cash .price-item {
|
||||
--size: -10rpx;
|
||||
margin-left: var(--size);
|
||||
margin-right: var(--size);
|
||||
width: calc(100% - var(--size));
|
||||
}
|
||||
|
||||
.cash .price-list {
|
||||
background: #F5F7F9;
|
||||
border: 2rpx solid #F5F7F9;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 0;
|
||||
margin: 18rpx 10rpx;
|
||||
width: calc((100% / 3) - 24rpx);
|
||||
}
|
||||
|
||||
.cash .price-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.cash-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.cash-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.cash .content-tips .item::before {
|
||||
content: '';
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #30B3FC;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 12rpx;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 28rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟币弹窗
|
||||
*/
|
||||
.popup_coin_status_container .scroll-y {
|
||||
height: 40vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
362
pages/plugins/coin/cash/cash.vue
Normal file
362
pages/plugins/coin/cash/cash.vue
Normal file
@@ -0,0 +1,362 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back></component-nav-back>
|
||||
<block v-if="accounts_list.length > 0">
|
||||
<view class="cash">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="title flex-col padding-lg">
|
||||
<view class="margin-bottom-xxxl flex-row jc-sb margin-top-xl">
|
||||
<view v-if="(accounts || mull) != null" class="cr-white">
|
||||
<view class="flex-row align-e margin-bottom-main">
|
||||
<view class="flex-row align-c pr coin-dropdown" @tap="popup_coin_status_open_event">
|
||||
<image v-if="(accounts.platform_icon || null) != null" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-xs">{{ accounts.platform_name }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#fff"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-size-xs fw-b padding-left-main text">{{$t('cash.cash.zmhf3n')}}</view>
|
||||
</view>
|
||||
<view class="flex-row align-e">
|
||||
<view class="text-size-40 fw-b">{{ accounts.normal_coin }}</view>
|
||||
<view class="padding-left-sm margin-bottom-main cr-grey-d">{{ accounts.default_symbol }} {{ accounts.default_coin }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail pa right-0 fw-b cr-white" :data-value="'/pages/plugins/coin/cash-list/cash-list?id='+accounts.id" @tap="url_event">{{$t('pages.plugins-coin-cash-list')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content padding-main">
|
||||
<view class="padding-xxxl bg-white radius-md margin-bottom-main">
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main fw-b">{{$t('cash.cash.f6p4hm')}}</view>
|
||||
<view class="padding-vertical-main br-b-e flex-row align-c">
|
||||
<input type="digit" :value="coin_num" class="flex-1 flex-width" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('common.please_input')" @input="coin_num_change" />
|
||||
<view @tap.stop="all_cash_event">{{$t('cash.cash.6oc6e7')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('cash.cash.ucg8e2')}}</view>
|
||||
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c">
|
||||
<input type="text" name="coin_address" class="padding-right-sm flex-1 flex-width" :value="coin_address" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('cash.cash.i1f373')" @input="coin_address_change" />
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-main">{{$t('cash.cash.h9i16y')}}</view>
|
||||
<block v-if="network_list.length > 0">
|
||||
<picker class="content-input-bg padding-main margin-bottom-main border-radius-sm" @change="cash_event" :value="network_list_index" :range="network_list" range-key="name">
|
||||
<view class="picker arrow-bottom">
|
||||
{{ network_list[network_list_index]['name'] }}
|
||||
</view>
|
||||
</picker>
|
||||
</block>
|
||||
<view v-else class="cr-grey margin-bottom">{{$t('cash.cash.1g49wo')}}</view>
|
||||
<view class="content-input-bg padding-main border-radius-sm">
|
||||
<input type="text" name="user_note" :value="user_note" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('cash.cash.g05p4g')" @input="user_note_change" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="padding-main bg-white radius-md">
|
||||
<view class="padding-vertical-sm border-radius-sm flex-row align-c">
|
||||
<text class="text-size fw-b">支付密码</text>
|
||||
<view class="padding-left-lg">
|
||||
<input type="digit" name="coin" :value="pay_pwd" placeholder-class="text-size-md cr-grey-9" placeholder="请输入支付密码" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="padding-xxxl">
|
||||
<button type="default" class="cash-btn cr-white round" @tap="apply_for_cash_event">{{$t('cash.cash.42b37m')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index">
|
||||
<view class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item.id" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="accounts.id == item.id ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: {},
|
||||
|
||||
// 虚拟币
|
||||
coin_num: '',
|
||||
|
||||
// 账户
|
||||
accounts: {},
|
||||
|
||||
// 虚拟币下拉框探弹窗状态
|
||||
popup_coin_status: false,
|
||||
// 虚拟币下拉框list
|
||||
accounts_list: [],
|
||||
// 充币网络
|
||||
network_list_index: 0,
|
||||
network_list: [],
|
||||
// 提币地址
|
||||
coin_address: '',
|
||||
// 备注
|
||||
user_note: '',
|
||||
// 支付密码
|
||||
pay_pwd: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: {accounts_id : this.accounts.id || this.params.id || null},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts: data.accounts || {},
|
||||
accounts_list: data.accounts_list || [],
|
||||
network_list: data.network_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 显示隐藏虚拟币
|
||||
price_change() {
|
||||
this.setData({});
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
coin_checked_event(e) {
|
||||
this.setData({
|
||||
accounts: this.accounts_list[e.currentTarget.dataset.index],
|
||||
coin_num: '',
|
||||
popup_coin_status: false,
|
||||
});
|
||||
this.get_data();
|
||||
},
|
||||
popup_coin_status_open_event() {
|
||||
this.setData({
|
||||
popup_coin_status: !this.popup_coin_status,
|
||||
});
|
||||
},
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 充币网络切换
|
||||
cash_event(e) {
|
||||
this.setData({
|
||||
network_list_index: parseInt(e.detail.value || 0),
|
||||
});
|
||||
},
|
||||
|
||||
// 全部提现
|
||||
all_cash_event(e) {
|
||||
this.setData({
|
||||
coin_num: this.accounts.normal_coin || '',
|
||||
});
|
||||
},
|
||||
|
||||
// 提币地址
|
||||
coin_address_change(e) {
|
||||
this.setData({
|
||||
coin_address: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 提现数量
|
||||
coin_num_change(e) {
|
||||
this.setData({
|
||||
coin_num: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 备注
|
||||
user_note_change(e) {
|
||||
this.setData({
|
||||
user_note: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 申请提现
|
||||
apply_for_cash_event() {
|
||||
if(this.network_list.length == 0) {
|
||||
app.globalData.showToast(this.$t('cash.cash.en6vsa'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 表单数据
|
||||
var new_data = {
|
||||
accounts_id: this.accounts.id,
|
||||
network_id: this.network_list[this.network_list_index].id,
|
||||
address: this.coin_address,
|
||||
coin: this.coin_num,
|
||||
user_note: this.user_note,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'coin', msg: this.$t('cash.cash.w01qjc') },
|
||||
{ fields: 'address', msg: this.$t('cash.cash.i1f373') },
|
||||
];
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'cash', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/cash-list/cash-list', true);
|
||||
}, 1000);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// 复制文本
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './cash.css';
|
||||
</style>
|
||||
19
pages/plugins/coin/collection/collection.css
Normal file
19
pages/plugins/coin/collection/collection.css
Normal file
@@ -0,0 +1,19 @@
|
||||
.collection .qrcode {
|
||||
margin-bottom: 80rpx;
|
||||
margin-top: 52rpx;
|
||||
}
|
||||
|
||||
.collection .code {
|
||||
margin-bottom: 52rpx;
|
||||
}
|
||||
|
||||
.collection .code .num {
|
||||
padding: 20rpx 28rpx;
|
||||
word-break: break-all;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.collection .code .copy {
|
||||
padding: 40rpx;
|
||||
color: #635BFF;
|
||||
}
|
||||
87
pages/plugins/coin/collection/collection.vue
Normal file
87
pages/plugins/coin/collection/collection.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="collection">
|
||||
<view class="padding-main pr">
|
||||
<block v-if="(params.accounts_key || null) != null">
|
||||
<view class="padding-lg bg-white radius-md margin-bottom-main tc">
|
||||
<view class="flex-row jc-c qrcode">
|
||||
<w-qrcode :options="qrcode"></w-qrcode>
|
||||
</view>
|
||||
<view class="code br-c radius flex-row">
|
||||
<view class="num flex-1 flex-width flex-row align-c text-size-md">{{ params.accounts_key }}</view>
|
||||
<view class="copy br-l-c text-size fw-b" :data-value="params.accounts_key" @tap.stop="text_copy_event">{{$t('collection.collection.856g12')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cr-grey-9 margin-top-xxl flex-row">
|
||||
<view class="pr">
|
||||
<iconfont name="icon-sigh-o" size="32rpx"></iconfont>
|
||||
</view>
|
||||
<text class="margin-left-sm text-size-xs">{{$t('collection.collection.9p43lu')}}</text>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
params: {},
|
||||
qrcode: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
qrcode: {
|
||||
code: params.accounts_key || null,
|
||||
size: 280,
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 复制文本
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './collection.css';
|
||||
</style>
|
||||
18
pages/plugins/coin/convert-list/convert-list.css
Normal file
18
pages/plugins/coin/convert-list/convert-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.convert .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
408
pages/plugins/coin/convert-list/convert-list.vue
Normal file
408
pages/plugins/coin/convert-list/convert-list.vue
Normal file
@@ -0,0 +1,408 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="convert">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_send_accounts_open_event">
|
||||
<view>{{ send_accounts_name !== null && send_accounts_name !== $t('common.all') ? send_accounts_name : $t('convert-list.convert-list.q48666') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_send_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_receive_accounts_open_event">
|
||||
<view>{{ receive_accounts_name !== null && receive_accounts_name !== $t('common.all') ? receive_accounts_name : $t('convert-list.convert-list.47646p') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_receive_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-e align-c">
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.8813rd')}}</text>
|
||||
<text class="fw-b warp">{{ item.convert_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.c374ec')}}</text>
|
||||
<text class="fw-b warp">{{ item.convert_value }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.6mxu85')}}</text>
|
||||
<text class="fw-b warp">{{ item.send_accounts_id }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.733518')}}</text>
|
||||
<text class="fw-b warp">{{ item.receive_accounts_id }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.6347mw')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.9oy325')}}</text>
|
||||
<text class="fw-b warp">{{ item.note }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 发起账户 -->
|
||||
<component-popup :propShow="popup_send_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_send_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('convert-list.convert-list.q48666')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="send_accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="send_accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in send_accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="send_accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="send_accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_send_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 接收账户 -->
|
||||
<component-popup :propShow="popup_receive_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_receive_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('convert-list.convert-list.47646p')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="receive_accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="receive_accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in receive_accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="receive_accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="receive_accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_receive_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 发起账户
|
||||
popup_send_accounts_status: false,
|
||||
send_accounts_id: null,
|
||||
send_accounts_list_index: null,
|
||||
send_accounts_name: null,
|
||||
send_accounts_list: [],
|
||||
// 接收账户
|
||||
popup_receive_accounts_status: false,
|
||||
receive_accounts_id: null,
|
||||
receive_accounts_list_index: null,
|
||||
receive_accounts_name: null,
|
||||
receive_accounts_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
send_accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始数据
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
send_accounts_list: data.accounts_list || [],
|
||||
receive_accounts_list: data.accounts_list || [],
|
||||
});
|
||||
if (this.send_accounts_list.length > 0 && (this.send_accounts_id || null) != null) {
|
||||
var index = this.send_accounts_list.findIndex((item) => item.id == this.send_accounts_id);
|
||||
this.setData({
|
||||
send_accounts_list_index: index,
|
||||
send_accounts_id: this.send_accounts_list[index].id,
|
||||
send_accounts_name: this.send_accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
// 加载loding
|
||||
if (this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
var new_data = {
|
||||
send_accounts_id: this.send_accounts_id,
|
||||
receive_accounts_id: this.receive_accounts_id,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'convert', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_send_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_send_accounts_status: !this.popup_send_accounts_status,
|
||||
popup_receive_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_send_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_send_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
send_accounts_list_event(e) {
|
||||
this.setData({
|
||||
send_accounts_list_index: e.currentTarget.dataset.index,
|
||||
send_accounts_id: e.currentTarget.dataset.value,
|
||||
send_accounts_name: e.currentTarget.dataset.name,
|
||||
popup_send_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_receive_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_receive_accounts_status: !this.popup_receive_accounts_status,
|
||||
popup_send_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_receive_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_receive_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
receive_accounts_list_event(e) {
|
||||
this.setData({
|
||||
receive_accounts_list_index: e.currentTarget.dataset.index,
|
||||
receive_accounts_id: e.currentTarget.dataset.value,
|
||||
receive_accounts_name: e.currentTarget.dataset.name,
|
||||
popup_receive_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './convert-list.css';
|
||||
</style>
|
||||
77
pages/plugins/coin/convert/convert.css
Normal file
77
pages/plugins/coin/convert/convert.css
Normal file
@@ -0,0 +1,77 @@
|
||||
.coin-dropdown {
|
||||
--height: 72rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 52rpx 0 20rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 36rpx;
|
||||
width: 180rpx;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: 24rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.coin-num {
|
||||
--height: 72rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.num.input-br {
|
||||
border: 2rpx solid #F6F6F6;
|
||||
}
|
||||
|
||||
.coin-num .num {
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 20rpx 0 20rpx;
|
||||
border-radius: 36rpx;
|
||||
width: 196rpx;
|
||||
}
|
||||
|
||||
.coin-center-convert {
|
||||
--size: 82rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
margin-top: -54rpx;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border: 2rpx solid #e1e1e1;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.convert-icon {
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.convert_true {
|
||||
transform: rotate3d(1, 0, 0, 180deg);
|
||||
}
|
||||
|
||||
.convert_false {
|
||||
transform: rotate3d(1, 0, 0, 0deg);
|
||||
}
|
||||
|
||||
.convert-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.convert-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
342
pages/plugins/coin/convert/convert.vue
Normal file
342
pages/plugins/coin/convert/convert.vue
Normal file
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="accounts_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main pr">
|
||||
<view class="padding-lg bg-white radius-md margin-bottom-main">
|
||||
<view class="br-f5 margin-bottom-main radius-md padding-lg flex-row jc-sb">
|
||||
<view>
|
||||
<view class="flex-row align-c pr coin-dropdown" @tap="popup_coin_status_event(1)">
|
||||
<image v-if="accounts_list[send_accounts_id_index]['platform_icon']" :src="accounts_list[send_accounts_id_index]['platform_icon']" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-sm fw-b single-text">{{ accounts_list[send_accounts_id_index]['platform_name'] }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-main text-size-xs flex-row align-c">
|
||||
<text class="margin-right-sm">{{$t('convert.convert.o56h58')}}</text><text class="cr-blue">{{ accounts_list[send_accounts_id_index]['platform_symbol'] }} {{ accounts_list[send_accounts_id_index]['normal_coin'] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-num pr flex-col">
|
||||
<input type="digit" name="coin" :value="default_value" class="num input-br text-size" placeholder-class="text-size-sm cr-grey-9" :placeholder="$t('common.please_input')" @input="default_coin_change_event" />
|
||||
<view class="margin-top-main tr text-size-xs">{{ accounts_list[send_accounts_id_index]['platform_symbol'] }} {{ accounts_list[send_accounts_id_index]['default_coin'] }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-center-convert pa flex-row jc-c align-c" @tap="coin_center_convert_event(2)">
|
||||
<iconfont name="icon-convert" class="pa convert-icon" :class="convert_bool ? 'convert_true' : 'convert_false'" color="#1D7DEF" size="36rpx"></iconfont>
|
||||
</view>
|
||||
<view class="br-f5 margin-bottom-main radius-md padding-lg flex-row jc-sb">
|
||||
<view>
|
||||
<view class="flex-row align-c pr coin-dropdown" @tap="popup_coin_status_event">
|
||||
<image v-if="accounts_list[receive_accounts_id_index]['platform_icon']" :src="accounts_list[receive_accounts_id_index]['platform_icon']" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-sm fw-b single-text">{{ accounts_list[receive_accounts_id_index]['platform_name'] }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-main text-size-xs flex-row align-c">
|
||||
<text class="margin-right-sm">{{$t('convert.convert.o56h58')}}</text><text class="cr-blue">{{ accounts_list[receive_accounts_id_index]['platform_symbol'] }} {{ accounts_list[receive_accounts_id_index]['normal_coin'] }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-num pr flex-col">
|
||||
<input type="digit" :value="convert_value" class="num text-size" placeholder-class="text-size-sm cr-grey-9" disabled />
|
||||
<view class="margin-top-main tr text-size-xs">{{ accounts_list[receive_accounts_id_index]['platform_symbol'] }} {{ accounts_list[receive_accounts_id_index]['default_coin'] }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row align-c">
|
||||
<iconfont name="icon-recharge" color="#333" size="32rpx"></iconfont>
|
||||
<view class="margin-left-sm">{{ default_value || 0 }} * {{ accounts_list[send_accounts_id_index]['platform_rate'] }} = {{ Math.round(default_value * accounts_list[receive_accounts_id_index]['platform_rate'] * 100) / 100 }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="padding-main bg-white radius-md margin-bottom-xxxxl flex-row align-c">
|
||||
<text class="padding-right">支付密码</text>
|
||||
<input type="password" :value="pay_pwd" class="text-size flex-1 flex-width" placeholder-class="text-size-md cr-grey-9" placeholder="请输入支付密码" />
|
||||
</view> -->
|
||||
<view class="padding-main radius-md margin-bottom-main">
|
||||
<button type="default" class="convert-btn cr-white round" @tap="convert_submit">{{$t('convert.convert.4kcix6')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index" class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item.id" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="coin_index == index ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
||||
// 虚拟币状态
|
||||
coin_type: 1,
|
||||
coin_index: 0,
|
||||
// 下标
|
||||
send_accounts_id_index: 0,
|
||||
receive_accounts_id_index: 0,
|
||||
// id
|
||||
send_accounts_id: 0,
|
||||
receive_accounts_id: 0,
|
||||
popup_coin_status: false,
|
||||
accounts_list: [],
|
||||
// 是否转换
|
||||
convert_bool: false,
|
||||
// 输入默认币
|
||||
default_value: '',
|
||||
// 转换币
|
||||
convert_value: '0.00',
|
||||
// 支付密码
|
||||
pay_pwd: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'convert', 'coin'),
|
||||
method: 'POST',
|
||||
data: { send_accounts_id: this.send_accounts_id, receive_accounts_id: this.receive_accounts_id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var send_accounts = data.send_accounts || null;
|
||||
var receive_accounts = data.receive_accounts || null;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
accounts_list: data.accounts_list || [],
|
||||
convert_value: data.convert_value || '0',
|
||||
send_accounts_id: (send_accounts == null) ? 0 : send_accounts.id,
|
||||
receive_accounts_id: (receive_accounts == null) ? 0 : receive_accounts.id,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
if (data.accounts_list.length > 0) {
|
||||
this.setData({
|
||||
send_accounts_id_index: data.accounts_list.findIndex((item) => item.id == data.send_accounts.id),
|
||||
receive_accounts_id_index: data.accounts_list.findIndex((item) => item.id == data.receive_accounts.id),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
popup_coin_status_event(type) {
|
||||
this.setData({
|
||||
coin_type: type,
|
||||
receive_accounts_idsend_accounts_id_index: this.receive_accounts_id_index,
|
||||
popup_coin_status: true,
|
||||
});
|
||||
},
|
||||
// 切换账户
|
||||
coin_checked_event(e) {
|
||||
var index = parseInt(e.currentTarget.dataset.index || 0);
|
||||
var old_index = (this.coin_type == 1) ? this.receive_accounts_id_index : this.send_accounts_id_index;
|
||||
if(index == old_index) {
|
||||
app.globalData.showToast(this.$t('convert.convert.327y2v'));
|
||||
return false;
|
||||
}
|
||||
if (this.coin_type == 1) {
|
||||
this.setData({
|
||||
send_accounts_id_index: index,
|
||||
send_accounts_id: e.currentTarget.dataset.value,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
receive_accounts_id_index: index,
|
||||
receive_accounts_id: e.currentTarget.dataset.value,
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
coin_index: index,
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
// 关闭账户选择弹窗
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 虚拟货币调换
|
||||
coin_center_convert_event() {
|
||||
var send_index = this.send_accounts_id_index;
|
||||
var receive_index = this.receive_accounts_id_index;
|
||||
var send_id = this.send_accounts_id;
|
||||
var receive_id = this.receive_accounts_id;
|
||||
this.setData({
|
||||
receive_accounts_id_index: send_index,
|
||||
send_accounts_id_index: receive_index,
|
||||
receive_accounts_id: send_id,
|
||||
send_accounts_id: receive_id,
|
||||
convert_bool: !this.convert_bool,
|
||||
});
|
||||
},
|
||||
// 需要转换的值事件
|
||||
default_coin_change_event(e) {
|
||||
this.setData({
|
||||
default_value: e.detail.value,
|
||||
convert_value: Math.round(e.detail.value * this.accounts_list[this.receive_accounts_id_index]['platform_rate'] * 100) / 100,
|
||||
});
|
||||
},
|
||||
|
||||
// 立即转换
|
||||
convert_submit() {
|
||||
var new_data = {
|
||||
send_accounts_id: this.send_accounts_id,
|
||||
receive_accounts_id: this.receive_accounts_id,
|
||||
coin: this.default_value,
|
||||
};
|
||||
|
||||
// 数据校验
|
||||
var validation = [{ fields: 'coin', msg: this.$t('convert.convert.vyjy7s') }];
|
||||
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
// 远程请求
|
||||
this.setData({
|
||||
form_submit_loading: true,
|
||||
});
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'convert', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/convert-list/convert-list', true);
|
||||
}, 1000);
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './convert.css';
|
||||
</style>
|
||||
56
pages/plugins/coin/detail/detail.css
Normal file
56
pages/plugins/coin/detail/detail.css
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.coin-title {
|
||||
background: radial-gradient(60% 70% at 90% 79%, rgba(33, 125, 239, 0.41) 0%, rgba(222, 237, 255, 0.56) 100%);
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
border-bottom-left-radius: 60rpx;
|
||||
border-bottom-right-radius: 60rpx;
|
||||
}
|
||||
|
||||
.coin-oprate-list {
|
||||
--size: 76rpx;
|
||||
height: var(--size);
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.coin-content .coin-item {
|
||||
max-height: calc(100vh - 688rpx);
|
||||
/* #ifndef H5 */
|
||||
max-height: calc(100vh - 688rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 80rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟币弹窗
|
||||
*/
|
||||
.popup_coin_status_container .scroll-y {
|
||||
height: 40vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 明细弹窗
|
||||
*/
|
||||
.popup_user_detail_container .item {
|
||||
background: #EFF0F1;
|
||||
}
|
||||
348
pages/plugins/coin/detail/detail.vue
Normal file
348
pages/plugins/coin/detail/detail.vue
Normal file
@@ -0,0 +1,348 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back :propName="$t('detail.detail.yvmu0z')"></component-nav-back>
|
||||
<view v-if="accounts_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="coin-title flex-col padding-lg">
|
||||
<view v-if="accounts_list.length > 0 && (accounts || null) != null" class="margin-bottom-xxxxl padding-bottom-main flex-row jc-sb align-c">
|
||||
<view class="flex-row">
|
||||
<image v-if="(accounts.platform_icon || null) != null" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<view class="padding-left-main">
|
||||
<view class="coin-dropdown text-size-md pr margin-bottom-xs flex-row" @tap="popup_coin_status_open_event">
|
||||
<text class="cr-666">{{ accounts.platform_name }}</text>
|
||||
<view class="padding-left-sm">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#666"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="fw-b text-size">{{ is_price_show ? accounts.normal_coin : '***' }}</text>
|
||||
<text v-if="is_price_show" class="cr-grey-9 text-size-xs margin-left">{{ accounts.default_symbol }} {{ accounts.default_coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @tap="price_change">
|
||||
<iconfont :name="is_price_show ? 'icon-wodeqianbao-eye' : 'icon-eye-half'" size="44rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row jc-sb">
|
||||
<view v-for="(item, index) in coin_oprate_list" class="flex-1 padding-sm tc text-size-md" :key="index" :data-value="item.url" :data-method="item.method" @tap="url_event">
|
||||
<view class="coin-oprate-list bg-white flex-row align-c jc-c">
|
||||
<view class="pr top-xs">
|
||||
<iconfont :name="item.icon" size="28rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view class="margin-left-sm fw-b">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coin-content padding-lg pr">
|
||||
<block v-if="log_list.length > 0" >
|
||||
<view v-for="(item, index) in log_list" :key="index" class="bg-white radius-md padding-main margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{ item.coin_type_name }}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.4w20tq')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_type_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.s101d1')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.e30wj1')}}</text>
|
||||
<text class="fw-b warp">{{ item.original_coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9">{{$t('detail.detail.jdour8')}}</text>
|
||||
<text class="fw-b warp">{{ item.latest_coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc cr-grey cp" :data-value="'/pages/plugins/coin/transaction-list/transaction-list?id=' + accounts.id" @tap="url_event">
|
||||
<text class="va-m">{{$t('detail.detail.7fhy2u')}}</text>
|
||||
<view class="dis-inline-block va-m margin-top-xs margin-left-xs">
|
||||
<iconfont name="icon-arrow-right" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index">
|
||||
<view class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="accounts.id == item.id ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 明细 -->
|
||||
<component-popup :propShow="popup_user_detail_status" propPosition="bottom" @onclose="popup_user_detail_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<text class="text-size">{{$t('pages.plugins-coin-detail')}}</text>
|
||||
<view class="fr" @tap.stop="popup_user_detail_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="accounts_list.length > 0 && (accounts || null) != null" class="popup_user_detail_container padding-vertical-main flex-row flex-wrap align-c tc text-size">
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/recharge-list/recharge-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-recharge-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/transfer-list/transfer-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-transfer-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/transaction-list/transaction-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-transaction-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/cash-list/cash-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-cash-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" :data-value="'/pages/plugins/coin/convert-list/convert-list?id=' + accounts.id" @tap="url_event">{{$t('pages.plugins-coin-convert-list')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
||||
// 虚拟币下拉框探弹窗状态
|
||||
popup_coin_status: false,
|
||||
// 虚拟币下拉框list
|
||||
accounts_list: [],
|
||||
// 账户
|
||||
accounts: {},
|
||||
|
||||
// 是否显示虚拟币
|
||||
is_price_show: false,
|
||||
// 虚拟币操作列表
|
||||
coin_oprate_list: [],
|
||||
|
||||
// 明细弹窗
|
||||
popup_user_detail_status: false,
|
||||
|
||||
// 日志列表
|
||||
log_list: [],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'accounts', 'coin'),
|
||||
method: 'POST',
|
||||
data: {id: this.accounts.id || this.params.id || null},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
accounts: data.accounts || {},
|
||||
accounts_list: data.accounts_list || [],
|
||||
log_list: data.log_list || [],
|
||||
accounts_summary: data.accounts_summary || 0,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
});
|
||||
|
||||
// 操作导航
|
||||
var temp_coin_oprate_list = [];
|
||||
if(parseInt(this.accounts.platform_data.is_enable_transfer || 0) == 1) {
|
||||
temp_coin_oprate_list.push({
|
||||
name: this.$t('user.user.29f6n5'),
|
||||
icon: 'icon-transfer-count',
|
||||
url: '/pages/plugins/coin/transfer/transfer?id=' + this.accounts.id,
|
||||
});
|
||||
}
|
||||
temp_coin_oprate_list.push({
|
||||
name: this.$t('index.index.6941e7'),
|
||||
icon: 'icon-collection',
|
||||
url: '/pages/plugins/coin/collection/collection?accounts_key=' + this.accounts.accounts_key,
|
||||
});
|
||||
temp_coin_oprate_list.push({
|
||||
name: this.$t('pages.plugins-coin-detail'),
|
||||
icon: 'icon-detail',
|
||||
url: '',
|
||||
method: true,
|
||||
});
|
||||
this.setData({
|
||||
coin_oprate_list: temp_coin_oprate_list
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
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_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 显示隐藏虚拟币
|
||||
price_change() {
|
||||
this.setData({
|
||||
is_price_show: !this.is_price_show,
|
||||
});
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
coin_checked_event(e) {
|
||||
this.setData({
|
||||
accounts: this.accounts_list[e.currentTarget.dataset.index],
|
||||
popup_coin_status: false,
|
||||
log_list: [],
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
this.get_data();
|
||||
},
|
||||
popup_coin_status_open_event() {
|
||||
this.setData({
|
||||
popup_coin_status: !this.popup_coin_status,
|
||||
});
|
||||
},
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 明细弹窗打开
|
||||
popup_user_detail_open_event() {
|
||||
this.setData({
|
||||
popup_user_detail_status: true,
|
||||
});
|
||||
},
|
||||
// 明细弹窗关闭
|
||||
popup_user_detail_close_event(e) {
|
||||
this.setData({
|
||||
popup_user_detail_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
if (e.currentTarget.dataset.method) {
|
||||
this.popup_user_detail_open_event();
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './detail.css';
|
||||
</style>
|
||||
42
pages/plugins/coin/recharge-list/recharge-list.css
Normal file
42
pages/plugins/coin/recharge-list/recharge-list.css
Normal file
@@ -0,0 +1,42 @@
|
||||
.convert .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.recharge-apy-btn,
|
||||
.recharge-del-btn {
|
||||
padding: 0 60rpx;
|
||||
font-size: 28rpx;
|
||||
margin: 0 0 0 20rpx;
|
||||
}
|
||||
|
||||
.recharge-apy-btn:active,
|
||||
.recharge-del-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.recharge-del-btn {
|
||||
color: #0079ff !important;
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #0079ff;
|
||||
}
|
||||
|
||||
.recharge-apy-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%), #0079FF;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
523
pages/plugins/coin/recharge-list/recharge-list.vue
Normal file
523
pages/plugins/coin/recharge-list/recharge-list.vue
Normal file
@@ -0,0 +1,523 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="convert">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_recharge_status_open_event">
|
||||
<view>{{ recharge_status_name !== null && recharge_status_name !== $t('common.all') ? recharge_status_name : $t('invoice-detail.invoice-detail.rrfex6') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_recharge_status_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_network_open_event">
|
||||
<view>{{ network_name !== null && network_name !== $t('common.all') ? network_name : $t('cash-list.cash-list.2g251t') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_network_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{ item.status_name }}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.6b9399')}}</text>
|
||||
<text class="fw-b warp">{{ item.recharge_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b warp">{{ item.platform_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.23ii8s')}}</text>
|
||||
<text class="fw-b warp">{{ item.network_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.714g2h')}}</text>
|
||||
<text class="fw-b warp">{{ item.address }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.epd531')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<div v-if="item.status == 0" class="br-t-dashed padding-top-main margin-top-main flex-row jc-e align-c">
|
||||
<button type="default" class="recharge-del-btn round" :data-id="item.id" @tap="recharge_del_event">{{$t('common.del')}}</button>
|
||||
<button type="default" class="recharge-apy-btn round" :data-id="item.id" @tap="recharge_pay_event">{{$t('order.order.1i873j')}}</button>
|
||||
</div>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 类型 -->
|
||||
<component-popup :propShow="popup_recharge_status_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_recharge_status_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.t66tu3')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="recharge_status_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in recharge_status_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="recharge_status_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="recharge_status_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_recharge_status_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 网络 -->
|
||||
<component-popup :propShow="popup_network_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_network_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.311tt2')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="network_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in network_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="network_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.id" :data-index="index" @tap="network_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_network_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
// 类型
|
||||
popup_recharge_status_status: false,
|
||||
status: null,
|
||||
recharge_status_list_index: null,
|
||||
recharge_status_name: null,
|
||||
recharge_status_list: [],
|
||||
// 网络
|
||||
popup_network_status: false,
|
||||
network_id: null,
|
||||
network_list_index: null,
|
||||
network_name: null,
|
||||
network_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始数据
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
recharge_status_list: data.recharge_status_list || [],
|
||||
network_list: data.network_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = this.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
// 加载loding
|
||||
if (this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
var new_data = {
|
||||
accounts_id: this.accounts_id,
|
||||
network_id: this.network_id,
|
||||
status: this.status,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
popup_recharge_status_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 类型打开
|
||||
popup_recharge_status_open_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: !this.popup_recharge_status_status,
|
||||
popup_accounts_status: false,
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型关闭
|
||||
popup_recharge_status_close_event() {
|
||||
this.setData({
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 类型选择
|
||||
recharge_status_list_event(e) {
|
||||
this.setData({
|
||||
recharge_status_list_index: e.currentTarget.dataset.index,
|
||||
status: e.currentTarget.dataset.value,
|
||||
recharge_status_name: e.currentTarget.dataset.name,
|
||||
popup_recharge_status_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 网络打开
|
||||
popup_network_open_event() {
|
||||
this.setData({
|
||||
popup_network_status: !this.popup_network_status,
|
||||
popup_accounts_status: false,
|
||||
popup_recharge_status_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络关闭
|
||||
popup_network_close_event() {
|
||||
this.setData({
|
||||
popup_network_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 网络选择
|
||||
network_list_event(e) {
|
||||
this.setData({
|
||||
network_list_index: e.currentTarget.dataset.index,
|
||||
network_id: e.currentTarget.dataset.value,
|
||||
network_name: e.currentTarget.dataset.name,
|
||||
popup_network_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 删除
|
||||
recharge_del_event(e) {
|
||||
// 是否再次确认
|
||||
if (e.alert_status != 0 && e.alert_status != 1) {
|
||||
app.globalData.alert({
|
||||
msg: this.$t('recharge-list.recharge-list.l5g8m1'),
|
||||
is_show_cancel: 1,
|
||||
object: this,
|
||||
params: { id: e.currentTarget.dataset.id },
|
||||
method: 'recharge_del_event',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (e.alert_status == 1) {
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: { ids: e.id },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.del_success'), 'success');
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(this.$t('common.del_fail'));
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 支付
|
||||
recharge_pay_event(e) {
|
||||
app.globalData.url_open('/pages/plugins/coin/recharge-pay/recharge-pay?id=' + e.currentTarget.dataset.id);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge-list.css';
|
||||
</style>
|
||||
105
pages/plugins/coin/recharge-pay/recharge-pay.css
Normal file
105
pages/plugins/coin/recharge-pay/recharge-pay.css
Normal file
@@ -0,0 +1,105 @@
|
||||
.coin-dropdown {
|
||||
--height: 72rpx;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 52rpx 0 20rpx;
|
||||
background: #F6F6F6;
|
||||
border-radius: 36rpx;
|
||||
width: 168rpx;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: 24rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.coin-num {
|
||||
--height: 72rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.num.input-br {
|
||||
border: 2rpx solid #F6F6F6;
|
||||
}
|
||||
|
||||
.coin-num .num {
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 20rpx 0 20rpx;
|
||||
border-radius: 36rpx;
|
||||
width: 196rpx;
|
||||
}
|
||||
|
||||
.coin-center-convert {
|
||||
--size: 82rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
margin-top: -54rpx;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border: 2rpx solid #e1e1e1;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.convert-icon {
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.convert_true {
|
||||
transform: rotate3d(1, 0, 0, 180deg);
|
||||
}
|
||||
|
||||
.convert_false {
|
||||
transform: rotate3d(1, 0, 0, 0deg);
|
||||
}
|
||||
|
||||
.convert-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.convert-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
.cancel-btn,
|
||||
.submit-btn {
|
||||
width: 50%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.cancel-btn:active,
|
||||
.submit-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
border: 2rpx solid #0079FF;
|
||||
background-color: transparent;
|
||||
color: #0079FF !important;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background: linear-gradient(107deg, #3AB1F3 0%, #3C6BF7 100%);
|
||||
color: #fff !important;
|
||||
}
|
||||
243
pages/plugins/coin/recharge-pay/recharge-pay.vue
Normal file
243
pages/plugins/coin/recharge-pay/recharge-pay.vue
Normal file
@@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main pr page-bottom-fixed">
|
||||
<view class="padding-lg bg-white radius-md margin-bottom-main">
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.6b9399')}}</text>
|
||||
<text class="fw-b">{{ accounts.recharge_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.714g2h')}}</text>
|
||||
<text class="fw-b">{{ accounts.address }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.23ii8s')}}</text>
|
||||
<text class="fw-b">{{ accounts.network_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('recharge-list.recharge-list.epd531')}}</text>
|
||||
<text class="fw-b">{{ accounts.coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b">{{ accounts.platform_name }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('cash-list.cash-list.2w20g2')}}</text>
|
||||
<text class="fw-b">{{ accounts.add_time }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="flex-row align-e margin-bottom-main">
|
||||
<text class="fw-b">{{$t('recharge-pay.recharge-pay.lutmsv')}}</text>
|
||||
<text class="cr-grey-c text-size-xs">{{$t('recharge-pay.recharge-pay.1a5vqk')}}</text>
|
||||
</view>
|
||||
<component-upload :propData="image_list" :propMaxNum="10" :propPathType="editor_path_type" @call-back="return_image_event"></component-upload>
|
||||
</view>
|
||||
<view class="padding-main bg-white radius-md margin-bottom-xxxxl">
|
||||
<view class="flex-row align-e margin-bottom-main">
|
||||
<text class="fw-b">{{$t('recharge-pay.recharge-pay.wu49vk')}}</text>
|
||||
</view>
|
||||
<textarea :placeholder="$t('recharge-pay.recharge-pay.95pfkd')" name="pay_note" placeholder-class="cr-base" class="wh-auto bg-white" :value="pay_note" :maxlength="pay_note_length_max" @input="pay_note_event"></textarea>
|
||||
</view>
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<view class="flex-row align-c">
|
||||
<button type="default" class="item cancel-btn round margin-right-sm" @tap="cancel_event">{{$t('common.cancel')}}</button>
|
||||
<button type="default" class="item submit-btn round margin-left-sm" @tap="submit_event">{{$t('form.form.4yd066')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentUpload from '@/components/upload/upload';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
bottom_fixed_style: '',
|
||||
params: null,
|
||||
accounts: {},
|
||||
image_list: [],
|
||||
editor_path_type: '',
|
||||
// 备注
|
||||
pay_note: '',
|
||||
pay_note_length_max: '500',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentUpload,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
editor_path_type: data.editor_path_type || '',
|
||||
accounts: data.data || {},
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
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_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片回调
|
||||
return_image_event(data) {
|
||||
this.setData({
|
||||
image_list: data,
|
||||
});
|
||||
},
|
||||
|
||||
// 备注
|
||||
pay_note_event(e) {
|
||||
this.setData({
|
||||
pay_note: e.detail.value.trim(),
|
||||
});
|
||||
},
|
||||
|
||||
// 取消
|
||||
cancel_event() {
|
||||
app.globalData.page_back_prev_event();
|
||||
},
|
||||
|
||||
// 提交
|
||||
submit_event() {
|
||||
var new_data = {
|
||||
id: this.params.id,
|
||||
pay_voucher: this.image_list,
|
||||
pay_note: this.pay_note,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'pay_voucher', msg: this.$t('recharge-pay.recharge-pay.v5fok8') },
|
||||
{ fields: 'pay_note', msg: this.$t('recharge-pay.recharge-pay.95pfkd') },
|
||||
];
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('pay', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/recharge-list/recharge-list', true);
|
||||
}, 1000);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge-pay.css';
|
||||
</style>
|
||||
137
pages/plugins/coin/recharge/recharge.css
Normal file
137
pages/plugins/coin/recharge/recharge.css
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.recharge-title {
|
||||
background: radial-gradient(60% 70% at 90% 79%, rgba(33, 125, 239, 0.85) 0%, #A6C8F3 100%);
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.coin-dropdown {
|
||||
--height: 48rpx;
|
||||
display: inline-block;
|
||||
height: var(--height);
|
||||
line-height: var(--height);
|
||||
padding: 0 64rpx 0 32rpx;
|
||||
background: rgba(255, 255, 255, 0.23);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.coin-dropdown-icon {
|
||||
right: -36rpx;
|
||||
top: 2rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.recharge-qrcode {
|
||||
background-color: #fff;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.recharge-qrcode .img {
|
||||
width: 160rpx !important;
|
||||
height: 160rpx !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.recharge-content {
|
||||
margin-top: -32rpx;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
min-height: calc(100vh - 528rpx);
|
||||
/* #ifndef H5 */
|
||||
min-height: calc(100vh - 528rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.recharge-content-input-bg {
|
||||
background-color: #fafafc;
|
||||
}
|
||||
|
||||
.recharge-price-item {
|
||||
--size: -10rpx;
|
||||
margin-left: var(--size);
|
||||
margin-right: var(--size);
|
||||
width: calc(100% - var(--size));
|
||||
}
|
||||
|
||||
.recharge-price-list {
|
||||
background: #F5F7F9;
|
||||
border: 2rpx solid #F5F7F9;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 0;
|
||||
margin: 18rpx 10rpx;
|
||||
width: calc((100% / 3) - 24rpx);
|
||||
}
|
||||
|
||||
.recharge-price-badge {
|
||||
background: linear-gradient(107deg, #8A18DF 0%, #8D17DD 100%), #D8D8D8;
|
||||
border-radius: 16rpx 0px 16rpx 0px;
|
||||
padding: 2rpx 20rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -20rpx;
|
||||
max-width: calc(100% - 20px);
|
||||
}
|
||||
|
||||
.recharge-price-list.active {
|
||||
background: rgba(8, 140, 226, 0.06);
|
||||
border-radius: 8px;
|
||||
border: 1px solid #2FB0FB;
|
||||
}
|
||||
|
||||
.recharge-price-name {
|
||||
font-size: 44rpx;
|
||||
}
|
||||
|
||||
.recharge-price-img {
|
||||
--size: 36rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
.recharge-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.recharge-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.recharge-content-tips .item::before {
|
||||
content: '';
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #30B3FC;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 12rpx;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 28rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 虚拟币弹窗
|
||||
*/
|
||||
.popup_coin_status_container .scroll-y {
|
||||
height: 40vh;
|
||||
overflow-y: auto;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.coin-list-img {
|
||||
--size: 40rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
338
pages/plugins/coin/recharge/recharge.vue
Normal file
338
pages/plugins/coin/recharge/recharge.vue
Normal file
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back></component-nav-back>
|
||||
<block v-if="accounts_list.length > 0">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="recharge-title flex-col padding-lg">
|
||||
<view v-if="(accounts || mull) != null" class="margin-bottom-xxxl flex-row jc-sb margin-top-xl">
|
||||
<view class="cr-white flex-1 flex-width">
|
||||
<view class="coin-dropdown margin-bottom-main">
|
||||
<view class="flex-row align-c pr" @tap="popup_coin_status_open_event">
|
||||
<image v-if="(accounts.platform_icon || null) != null" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="margin-left-xs">{{ accounts.platform_name }}</text>
|
||||
<view class="coin-dropdown-icon pa padding-left-xxl">
|
||||
<iconfont name="icon-arrow-bottom" size="24rpx" color="#fff"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-size-xl fw-b single-text">{{ accounts.normal_coin }}</view>
|
||||
</view>
|
||||
<view class="recharge-qrcode">
|
||||
<block v-if="accounts.platform_data.recharge_qrcode">
|
||||
<image :src="accounts.platform_data.recharge_qrcode" mode="widthFix" class="img margin-right-xs radius dis-block" :data-value="accounts.platform_data.recharge_qrcode" @tap="recharge_qrcode_event" />
|
||||
</block>
|
||||
<block v-else>
|
||||
<iconfont name="icon-qrcode" size="160rpx" color="#f6f6f6"></iconfont>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recharge-content padding-xxl bg-white">
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('recharge.recharge.lh6k86')}}</view>
|
||||
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c">
|
||||
<view class="single-text padding-right-sm flex-1 flex-width">{{ accounts.platform_data.recharge_address }}</view>
|
||||
<view :data-value="accounts.platform_data.recharge_address" @tap.stop="text_copy_event">
|
||||
<iconfont name="icon-copy" size="24rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('recharge.recharge.e5rblc')}}</view>
|
||||
<block v-if="network_list.length > 0">
|
||||
<picker class="recharge-content-input-bg padding-main border-radius-sm" @change="recharge_event" :value="network_list_index" :range="network_list" range-key="name">
|
||||
<view class="picker arrow-bottom">
|
||||
{{ network_list[network_list_index]['name'] }}
|
||||
</view>
|
||||
</picker>
|
||||
</block>
|
||||
<view v-else class="cr-grey">{{$t('cash.cash.1g49wo')}}</view>
|
||||
</view>
|
||||
<view class="margin-bottom-xxxl">
|
||||
<view v-if="accounts.platform_data.preset_data.length > 0">
|
||||
<view class="margin-bottom-xs">{{$t('recharge.recharge.eb6722')}}</view>
|
||||
<view class="flex-row flex-wrap recharge-price-item margin-bottom-xs">
|
||||
<block v-for="(item, index) in accounts.platform_data.preset_data" :key="index">
|
||||
<view class="recharge-price-list flex-col align-c jc-c pr" :class="preset_data_index == index ? 'active' : ''" :data-index="index" :data-value="item.value" @tap="preset_data_change">
|
||||
<view class="flex-row align-c jc-c">
|
||||
<image :src="wallet_static_url + 'recharge-price.png'" mode="widthFix" class="recharge-price-img round" />
|
||||
<view class="margin-left-xs recharge-price-name">{{ item.value }}</view>
|
||||
</view>
|
||||
<view class="margin-top-sm cr-grey-9 text-size-xs">10000</view>
|
||||
<view v-if="item.tips" class="recharge-price-badge text-size-xss cr-white single-text">{{ item.tips }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c margin-bottom-xxl">
|
||||
<text>{{$t('recharge.recharge.k1e7hs')}}</text>
|
||||
<view class="padding-left-lg">
|
||||
<input type="digit" name="coin" :value="recharge_num" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('recharge.recharge.0i541i')" @input="recharge_num_change" />
|
||||
</view>
|
||||
</view>
|
||||
<button type="default" class="recharge-btn cr-white round" @tap="recharge_submit">{{$t('recharge.recharge.x27b25')}}</button>
|
||||
</view>
|
||||
<view v-if="accounts.platform_data.recharge_desc.length > 0" class="margin-bottom-xxxl">
|
||||
<view class="margin-bottom-main">{{$t('recharge.recharge.e8n7ul')}}</view>
|
||||
<view class="recharge-content-tips">
|
||||
<view v-for="(item, index) in accounts.platform_data.recharge_desc" :key="index" class="item pr padding-left-xl margin-bottom-sm cr-grey-9 text-size-xs">{{ item }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 虚拟币下拉框 -->
|
||||
<component-popup :propShow="popup_coin_status" propPosition="bottom" @onclose="popup_coin_status_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<view class="fr" @tap.stop="popup_coin_status_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_coin_status_container padding-vertical-main flex-col text-size">
|
||||
<view class="scroll-y">
|
||||
<view v-for="(item, index) in accounts_list" :key="index" class="flex-row jc-sb align-c padding-vertical-main" :class="accounts_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item" :data-index="index" @tap="coin_checked_event">
|
||||
<view class="flex-row align-c">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-list-img round" />
|
||||
<view class="margin-left-sm text-size-md single-text">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<iconfont :name="accounts.id == item.id ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="40rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: {},
|
||||
|
||||
// 账户
|
||||
accounts: {},
|
||||
// 虚拟币下拉框探弹窗状态
|
||||
popup_coin_status: false,
|
||||
// 虚拟币下拉框list
|
||||
accounts_list: [],
|
||||
// 充币网络
|
||||
network_list_index: 0,
|
||||
network_list: [],
|
||||
// 充值选中下标
|
||||
preset_data_index: null,
|
||||
// 充值数量
|
||||
recharge_num: '',
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: {accounts_id : this.accounts.id || this.params.id || null},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts: data.accounts || {},
|
||||
accounts_list: data.accounts_list || [],
|
||||
network_list: data.network_list || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
app.globalData.is_login_check(res.data, this, 'get_data');
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 虚拟币切换
|
||||
coin_checked_event(e) {
|
||||
this.setData({
|
||||
accounts: this.accounts_list[e.currentTarget.dataset.index],
|
||||
popup_coin_status: false,
|
||||
});
|
||||
this.get_data();
|
||||
},
|
||||
popup_coin_status_open_event() {
|
||||
this.setData({
|
||||
popup_coin_status: !this.popup_coin_status,
|
||||
});
|
||||
},
|
||||
popup_coin_status_close_event() {
|
||||
this.setData({
|
||||
popup_coin_status: false,
|
||||
});
|
||||
},
|
||||
// 充币网络切换
|
||||
recharge_event(e) {
|
||||
this.setData({
|
||||
network_list_index: parseInt(e.detail.value || 0),
|
||||
});
|
||||
},
|
||||
// 充值币选中
|
||||
recharge_num_change(e) {
|
||||
this.setData({
|
||||
recharge_num: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 其他充值数量
|
||||
preset_data_change(e) {
|
||||
this.setData({
|
||||
preset_data_index: parseInt(e.currentTarget.dataset.index || 0),
|
||||
recharge_num: parseInt(e.currentTarget.dataset.value || 0),
|
||||
});
|
||||
},
|
||||
// 立即充值
|
||||
recharge_submit() {
|
||||
if(this.network_list.length == 0) {
|
||||
app.globalData.showToast(this.$t('cash.cash.en6vsa'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 表单数据
|
||||
var new_data = {
|
||||
accounts_id: this.accounts.id,
|
||||
network_id: this.network_list[this.network_list_index].id,
|
||||
address: this.accounts.platform_data.recharge_address,
|
||||
coin: this.recharge_num,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [{ fields: 'coin', msg: this.$t('recharge.recharge.5q02ar') }];
|
||||
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'recharge', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/recharge-list/recharge-list', true);
|
||||
}, 1000);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// 复制文本
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
},
|
||||
|
||||
// 二维码预览
|
||||
recharge_qrcode_event(e) {
|
||||
app.globalData.image_show_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './recharge.css';
|
||||
</style>
|
||||
18
pages/plugins/coin/transaction-list/transaction-list.css
Normal file
18
pages/plugins/coin/transaction-list/transaction-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.transaction .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
537
pages/plugins/coin/transaction-list/transaction-list.vue
Normal file
537
pages/plugins/coin/transaction-list/transaction-list.vue
Normal file
@@ -0,0 +1,537 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="transaction">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_operate_type_open_event">
|
||||
<view>{{ operate_type_name !== null && operate_type_name !== $t('common.all') ? operate_type_name : $t('wallet-log-detail.wallet-log-detail.tdf3wo') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_operate_type_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c margin-right-xxxl padding-right-xl pr" @tap="popup_business_type_open_event">
|
||||
<view>{{ business_type_name !== null && business_type_name !== $t('common.all') ? business_type_name : $t('invoice.invoice.l3832z') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_business_type_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_coin_type_open_event">
|
||||
<view>{{ coin_type_name !== null && coin_type_name !== $t('common.all') ? coin_type_name : $t('transaction-list.transaction-list.cu39n5') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_coin_type_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{ item.business_type_name }}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.1mf6wj')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin_type_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('detail.detail.4w20tq')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_type_name }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.2w1o1l')}}</text>
|
||||
<text class="fw-b warp">{{ item.operate_coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.jgx0cf')}}</text>
|
||||
<text class="fw-b warp">{{ item.original_coin }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('convert-list.convert-list.6347mw')}}</text>
|
||||
<text class="fw-b warp">{{ item.latest_coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transaction-list.transaction-list.7cv11k')}}</text>
|
||||
<text class="fw-b warp">{{ item.msg }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 操作类型 -->
|
||||
<component-popup :propShow="popup_operate_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_operate_type_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('wallet-log-detail.wallet-log-detail.tdf3wo')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="operate_type_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="operate_type_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in operate_type_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="operate_type_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="operate_type_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_operate_type_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 业务类型 -->
|
||||
<component-popup :propShow="popup_business_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_business_type_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('invoice.invoice.l3832z')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="business_type_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="business_type_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in business_type_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="business_type_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="business_type_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_business_type_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
<!-- 币类型 -->
|
||||
<component-popup :propShow="popup_coin_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_coin_type_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('transaction-list.transaction-list.cu39n5')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="coin_type_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="coin_type_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in coin_type_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="coin_type_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.name" :data-value="item.value" :data-index="index" @tap="coin_type_list_event">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_coin_type_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
// 操作类型
|
||||
popup_operate_type_status: false,
|
||||
operate_type: null,
|
||||
operate_type_list_index: null,
|
||||
operate_type_name: null,
|
||||
operate_type_list: [],
|
||||
// 业务类型
|
||||
popup_business_type_status: false,
|
||||
business_type: null,
|
||||
business_type_list_index: null,
|
||||
business_type_name: null,
|
||||
business_type_list: [],
|
||||
// 币类型
|
||||
popup_coin_type_status: false,
|
||||
coin_type: null,
|
||||
coin_type_list_index: null,
|
||||
coin_type_name: null,
|
||||
coin_type_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始数据
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
operate_type_list: data.log_operate_type_list || [],
|
||||
business_type_list: data.log_business_type_list || [],
|
||||
coin_type_list: data.log_coin_type_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = this.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
// 加载loding
|
||||
if (this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
var new_data = {
|
||||
accounts_id: this.accounts_id,
|
||||
business_type: this.business_type,
|
||||
operate_type: this.operate_type,
|
||||
coin_type: this.coin_type,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'accountslog', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
popup_operate_type_status: false,
|
||||
popup_business_type_status: false,
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 操作类型打开
|
||||
popup_operate_type_open_event() {
|
||||
this.setData({
|
||||
popup_operate_type_status: !this.popup_operate_type_status,
|
||||
popup_accounts_status: false,
|
||||
popup_business_type_status: false,
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 操作类型关闭
|
||||
popup_operate_type_close_event() {
|
||||
this.setData({
|
||||
popup_operate_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 操作类型选择
|
||||
operate_type_list_event(e) {
|
||||
this.setData({
|
||||
operate_type_list_index: e.currentTarget.dataset.index,
|
||||
operate_type: e.currentTarget.dataset.value,
|
||||
operate_type_name: e.currentTarget.dataset.name,
|
||||
popup_operate_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 业务类型打开
|
||||
popup_business_type_open_event() {
|
||||
this.setData({
|
||||
popup_business_type_status: !this.popup_business_type_status,
|
||||
popup_accounts_status: false,
|
||||
popup_operate_type_status: false,
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 业务类型关闭
|
||||
popup_business_type_close_event() {
|
||||
this.setData({
|
||||
popup_business_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 业务类型选择
|
||||
business_type_list_event(e) {
|
||||
this.setData({
|
||||
business_type_list_index: e.currentTarget.dataset.index,
|
||||
business_type: e.currentTarget.dataset.value,
|
||||
business_type_name: e.currentTarget.dataset.name,
|
||||
popup_business_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 币类型打开
|
||||
popup_coin_type_open_event() {
|
||||
this.setData({
|
||||
popup_coin_type_status: !this.popup_coin_type_status,
|
||||
popup_accounts_status: false,
|
||||
popup_operate_type_status: false,
|
||||
popup_business_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 币类型关闭
|
||||
popup_coin_type_close_event() {
|
||||
this.setData({
|
||||
popup_coin_type_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 币类型选择
|
||||
coin_type_list_event(e) {
|
||||
this.setData({
|
||||
coin_type_list_index: e.currentTarget.dataset.index,
|
||||
coin_type: e.currentTarget.dataset.value,
|
||||
coin_type_name: e.currentTarget.dataset.name,
|
||||
popup_coin_type_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './transaction-list.css';
|
||||
</style>
|
||||
18
pages/plugins/coin/transfer-list/transfer-list.css
Normal file
18
pages/plugins/coin/transfer-list/transfer-list.css
Normal file
@@ -0,0 +1,18 @@
|
||||
.transfer-accounts .nav {
|
||||
z-index: 102;
|
||||
}
|
||||
.scroll-box {
|
||||
height: calc(100vh - 88rpx);
|
||||
}
|
||||
|
||||
.convert-group-row .title {
|
||||
min-width: 140rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 钱包弹窗
|
||||
*/
|
||||
.popup_accounts_container .item {
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
342
pages/plugins/coin/transfer-list/transfer-list.vue
Normal file
342
pages/plugins/coin/transfer-list/transfer-list.vue
Normal file
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="transfer-accounts">
|
||||
<view class="padding-main bg-white pr nav flex-row oa">
|
||||
<view class="flex-shrink flex-row align-c padding-right-xl pr" @tap="popup_accounts_open_event">
|
||||
<view>{{ accounts_name !== null && accounts_name !== $t('common.all') ? accounts_name : $t('cash-list.cash-list.n74r94') }}</view>
|
||||
<view class="pa right-0"><iconfont :name="popup_accounts_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event" @scrolltolower="scroll_lower">
|
||||
<view class="padding-main">
|
||||
<view v-if="data_list.length > 0">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main bg-white radius-md margin-bottom-main">
|
||||
<view class="br-b-dashed padding-bottom-main margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>{{$t('user-transfer-detail.user-transfer-detail.x17599')}}</view>
|
||||
<view class="cr-grey-9">{{ item.add_time }}</view>
|
||||
</view>
|
||||
<view class="convert-group-row">
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transfer-list.transfer-list.69rnx6')}}</text>
|
||||
<text class="fw-b warp">{{ item.transfer_no }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transfer-list.transfer-list.4aj248')}}</text>
|
||||
<text class="fw-b warp">{{ item.receive_user.username }}</text>
|
||||
</view>
|
||||
<view class="margin-bottom-sm flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transfer-list.transfer-list.m2r55k')}}</text>
|
||||
<text class="fw-b warp">{{ item.coin }}</text>
|
||||
</view>
|
||||
<view class="flex-row">
|
||||
<text class="cr-grey-9 title">{{$t('transfer-list.transfer-list.9g8lyb')}}</text>
|
||||
<text class="fw-b warp">{{ item.note }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 账户 -->
|
||||
<component-popup :propShow="popup_accounts_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_accounts_close_event">
|
||||
<view class="padding-vertical-lg">
|
||||
<view class="padding-horizontal-main text-size-xs">{{$t('cash-list.cash-list.s7l616')}}</view>
|
||||
<view class="popup_accounts_container padding-sm flex-row flex-wrap align-c tc text-size-md">
|
||||
<view class="flex-width-half-half">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == null ? 'cr-main bg-main-light' : ''" :data-name="$t('common.all')" :data-value="null" :data-index="null" @tap="accounts_list_event">{{$t('common.all')}}</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in accounts_list" class="flex-width-half-half" :key="index">
|
||||
<view class="item margin-sm padding-vertical-sm" :class="accounts_list_index == index ? 'cr-main bg-main-light' : ''" :data-name="item.platform_name" :data-value="item.id" :data-index="index" @tap="accounts_list_event">{{ item.platform_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tc padding-top-lg br-t" @tap="popup_accounts_close_event">
|
||||
<text class="padding-right-sm">{{ $t('nav-more.nav-more.h9g4b1') }}</text>
|
||||
<iconfont name="icon-arrow-top" color="#ccc"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
|
||||
// 弹窗距离顶部距离
|
||||
popup_top_height: 0,
|
||||
|
||||
// 账户
|
||||
popup_accounts_status: false,
|
||||
accounts_id: null,
|
||||
accounts_list_index: null,
|
||||
accounts_name: null,
|
||||
accounts_list: [],
|
||||
|
||||
data_list: [],
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_is_loading: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
accounts_id: params.id || null,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始数据
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
this.get_data_list();
|
||||
var self = this;
|
||||
var timer = setInterval(function () {
|
||||
if (self.popup_top_height == 0) {
|
||||
self.popup_top_height_computer();
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('init', 'user', 'coin'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts_list: data.accounts_list || [],
|
||||
});
|
||||
if (this.accounts_list.length > 0 && (this.accounts_id || null) != null) {
|
||||
var index = data.accounts_list.findIndex((item) => item.id == this.accounts_id);
|
||||
this.setData({
|
||||
accounts_list_index: index,
|
||||
accounts_id: this.accounts_list[index].id,
|
||||
accounts_name: this.accounts_list[index].platform_name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
// 加载loding
|
||||
if (this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
var new_data = {
|
||||
send_accounts_id: this.accounts_id,
|
||||
page: this.data_page,
|
||||
};
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'transfer', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 账户打开
|
||||
popup_accounts_open_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: !this.popup_accounts_status,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户关闭
|
||||
popup_accounts_close_event() {
|
||||
this.setData({
|
||||
popup_accounts_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 账户选择
|
||||
accounts_list_event(e) {
|
||||
this.setData({
|
||||
accounts_list_index: e.currentTarget.dataset.index,
|
||||
accounts_id: e.currentTarget.dataset.value,
|
||||
accounts_name: e.currentTarget.dataset.name,
|
||||
popup_accounts_status: false,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 计算搜索框的高度
|
||||
popup_top_height_computer() {
|
||||
const query = uni.createSelectorQuery();
|
||||
query
|
||||
.select('.nav')
|
||||
.boundingClientRect((res) => {
|
||||
if ((res || null) != null) {
|
||||
// 获取搜索框高度
|
||||
this.setData({
|
||||
popup_top_height: res.height,
|
||||
});
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './transfer-list.css';
|
||||
</style>
|
||||
19
pages/plugins/coin/transfer/transfer.css
Normal file
19
pages/plugins/coin/transfer/transfer.css
Normal file
@@ -0,0 +1,19 @@
|
||||
.note {
|
||||
background-color: #fafafc;
|
||||
}
|
||||
|
||||
.accounts-btn,
|
||||
.transfer-btn {
|
||||
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
|
||||
}
|
||||
|
||||
.accounts-btn,
|
||||
.transfer-btn:active {
|
||||
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 80rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
260
pages/plugins/coin/transfer/transfer.vue
Normal file
260
pages/plugins/coin/transfer/transfer.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="data_list_loding_status == 3" class="transfer">
|
||||
<view class="padding-main">
|
||||
<view class="bg-white padding-main radius-md margin-bottom-main">
|
||||
<view class="padding-vertical-sm border-radius-sm flex-row align-c">
|
||||
<view class="flex-row">
|
||||
<image v-if="accounts.platform_icon" :src="accounts.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<view class="padding-left-main">
|
||||
<view class="coin-dropdown text-size-md pr margin-bottom-xs flex-row">
|
||||
<text class="cr-666">{{ accounts.platform_name }}</text>
|
||||
</view>
|
||||
<view class="fw-b text-size">{{ accounts.platform_symbol }} {{ accounts.normal_coin }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white padding-main radius-md margin-bottom-main">
|
||||
<view class="padding-vertical-sm flex-row align-c">
|
||||
<iconfont name="icon-scan" size="40rpx" @tap="scancode_event"></iconfont>
|
||||
<view class="padding-left-lg flex-row jc-sb align-c flex-1 flex-width">
|
||||
<view class="flex-1 padding-right-main">
|
||||
<input type="text" name="receive_accounts_key" :value="receive_accounts_key" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('transfer.transfer.1aijp1')" @input="receive_accounts_key_change" />
|
||||
</view>
|
||||
<button type="default" class="accounts-btn text-size-xs cr-white round" @tap="receive_accounts_key_event">{{$t('common.confirm')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white padding-main radius-md margin-bottom-main">
|
||||
<view class="padding-vertical-sm">
|
||||
<text class="text-size fw-b">{{$t('transfer.transfer.b4m5p3')}}</text>
|
||||
<view class="margin-top-xxxxl">
|
||||
<input type="digit" name="coin" :value="coin" class="text-size-xl tc" placeholder-class="cr-grey-9" :placeholder="$t('transfer.transfer.d15853')" @input="coin_change" />
|
||||
<view class="cr-grey-9 tc margin-top-main">{{$t('transfer.transfer.9xe2bl')}}<text class="cr-black fw-b">{{ accounts.platform_symbol }} {{ accounts.default_coin }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="note padding-main radius margin-top-xxxl">
|
||||
<input type="text" name="note" :value="note" placeholder-class="text-size-md cr-grey-9" :placeholder="$t('transfer.transfer.2bwh7h')" @input="note_change" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="padding-main bg-white radius-md">
|
||||
<view class="padding-vertical-sm border-radius-sm flex-row align-c">
|
||||
<text class="text-size fw-b">转账密码</text>
|
||||
<view class="padding-left-lg">
|
||||
<input type="password" name="pay_pwd" :value="pay_pwd" placeholder-class="text-size-md cr-grey-9" placeholder="请输入支付密码" @input="pwd_num_change" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="padding-xxxl margin-top-sm">
|
||||
<button type="default" class="transfer-btn cr-white round" @tap="transfer_event">{{$t('transfer.transfer.3i4h4z')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
var accounts_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
accounts_static_url: accounts_static_url,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
||||
accounts_id: null,
|
||||
receive_accounts_key: null,
|
||||
receive_accounts_id: null,
|
||||
accounts: {},
|
||||
receive_accounts: {},
|
||||
coin: null,
|
||||
note: '',
|
||||
// pay_pwd: '',
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
// 设置参数
|
||||
this.setData({
|
||||
accounts_id: params.id,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
|
||||
// 初始数据
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('createinfo', 'transfer', 'coin'),
|
||||
method: 'POST',
|
||||
data: { accounts_id: this.accounts_id, accounts_key: this.receive_accounts_key },
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
accounts: data.accounts || {},
|
||||
receive_accounts: data.receive_accounts || {},
|
||||
receive_accounts_id: data.receive_accounts ? data.receive_accounts.id : null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
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_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
scancode_event() {
|
||||
// 调用扫码
|
||||
var self = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
receive_accounts_key: res.result,
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 收款账号
|
||||
receive_accounts_key_change(e) {
|
||||
this.setData({
|
||||
receive_accounts_key: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 确认收款账号
|
||||
receive_accounts_key_event() {
|
||||
this.get_data();
|
||||
},
|
||||
// 转账币
|
||||
coin_change(e) {
|
||||
this.setData({
|
||||
coin: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 备注
|
||||
note_change(e) {
|
||||
this.setData({
|
||||
note: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 转账密码
|
||||
pwd_num_change(e) {
|
||||
this.setData({
|
||||
pwd_num: e.detail.value,
|
||||
});
|
||||
},
|
||||
// 立即转账
|
||||
transfer_event(e) {
|
||||
var new_data = {
|
||||
receive_accounts_id: this.receive_accounts_id,
|
||||
coin: this.coin,
|
||||
note: this.note,
|
||||
// pwd_num: this.pwd_num,
|
||||
};
|
||||
// 数据校验
|
||||
var validation = [
|
||||
{ fields: 'receive_accounts_key', msg: this.$t('transfer.transfer.1aijp1') },
|
||||
{ fields: 'coin', msg: this.$t('transfer.transfer.d15853') },
|
||||
];
|
||||
// 验证提交表单
|
||||
if (app.globalData.fields_check(new_data, validation)) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('create', 'transfer', 'coin'),
|
||||
method: 'POST',
|
||||
data: new_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
setTimeout(function () {
|
||||
app.globalData.url_open('/pages/plugins/coin/transfer-list/transfer-list', true);
|
||||
}, 1000);
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './transfer.css';
|
||||
</style>
|
||||
43
pages/plugins/coin/user/user.css
Normal file
43
pages/plugins/coin/user/user.css
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 顶部
|
||||
*/
|
||||
.coin-title {
|
||||
background-size: 100% auto;
|
||||
padding-top: 130rpx;
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(var(--status-bar-height) + 5px + 130rpx);
|
||||
/* #endif */
|
||||
border-bottom-left-radius: 60rpx;
|
||||
border-bottom-right-radius: 60rpx;
|
||||
}
|
||||
|
||||
.coin-operate-list {
|
||||
--size: 96rpx;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 内容
|
||||
*/
|
||||
.coin-content .coin-item {
|
||||
max-height: calc(100vh - 688rpx);
|
||||
/* #ifndef H5 */
|
||||
max-height: calc(100vh - 688rpx - var(--status-bar-height) - 5px);
|
||||
/* #endif */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.coin-content-list-img {
|
||||
--size: 80rpx;
|
||||
width: var(--size);
|
||||
height: var(--size) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* 明细弹窗
|
||||
*/
|
||||
.popup_user_detail_container .item {
|
||||
background: #EFF0F1;
|
||||
}
|
||||
257
pages/plugins/coin/user/user.vue
Normal file
257
pages/plugins/coin/user/user.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-nav-back></component-nav-back>
|
||||
<view v-if="(data_base || null) != null">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
|
||||
<view class="coin-title flex-col padding-lg" :style="'background-image:url(' + wallet_static_url + 'user-head-bg.png)'">
|
||||
<view class="margin-bottom-main flex-row jc-sb align-c">
|
||||
<view>
|
||||
<view class="cr-base text-size-md">{{$t('user.user.67p34x')}}</view>
|
||||
<view class="text-size-40 fw-b">{{ is_price_show ? accounts_summary : '***' }}</view>
|
||||
</view>
|
||||
<view @tap="price_change">
|
||||
<iconfont :name="is_price_show ? 'icon-wodeqianbao-eye' : 'icon-eye-half'" size="44rpx"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row jc-sb padding-bottom-main">
|
||||
<view v-if="data_base.is_enable_recharge == 1" class="tc text-size-xs" data-value="/pages/plugins/coin/recharge/recharge" @tap="url_event">
|
||||
<view class="coin-operate-list bg-white flex-row align-c jc-c margin-bottom-main">
|
||||
<iconfont name="icon-recharge" size="44rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view>{{$t('recharge.recharge.otwkjn')}}</view>
|
||||
</view>
|
||||
<view v-if="data_base.is_enable_convert == 1" class="tc text-size-xs" data-value="/pages/plugins/coin/convert/convert" @tap="url_event">
|
||||
<view class="coin-operate-list bg-white flex-row align-c jc-c margin-bottom-main">
|
||||
<iconfont name="icon-convert-o" size="44rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view>{{$t('pages.plugins-coin-convert')}}</view>
|
||||
</view>
|
||||
<view v-if="data_base.is_enable_cash == 1" class="tc text-size-xs" data-value="/pages/plugins/coin/cash/cash" @tap="url_event">
|
||||
<view class="coin-operate-list bg-white flex-row align-c jc-c margin-bottom-main">
|
||||
<iconfont name="icon-cash" size="44rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view>{{$t('user.user.8752a4')}}</view>
|
||||
</view>
|
||||
<view class="tc text-size-xs" data-value="/pages/plugins/coin/detail/detail" data-method="true" @tap="url_event">
|
||||
<view class="coin-operate-list bg-white flex-row align-c jc-c margin-bottom-main">
|
||||
<iconfont name="icon-detail" size="44rpx" color="#635BFF"></iconfont>
|
||||
</view>
|
||||
<view>{{$t('pages.plugins-coin-detail')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="accounts_list.length > 0" class="coin-content padding-lg">
|
||||
<view class="bg-white radius-lg padding-sm">
|
||||
<view class="coin-item padding-main">
|
||||
<view v-for="(item, index) in accounts_list" :key="index" class="flex-row jc-sb align-c" :class="accounts_list.length == index + 1 ? '' : 'br-b-f5 margin-bottom-lg padding-bottom-lg'" :data-value="'/pages/plugins/coin/detail/detail?id=' + item.id" @tap="url_event">
|
||||
<view class="flex-1 flex-width flex-row align-c padding-right-main">
|
||||
<image v-if="item.platform_icon" :src="item.platform_icon" mode="widthFix" class="coin-content-list-img round" />
|
||||
<text class="fw-b single-text margin-left-main">{{ item.platform_name }}</text>
|
||||
</view>
|
||||
<view class="flex-col align-e">
|
||||
<view class="margin-bottom-xss text-size">{{ item.platform_symbol }} {{ item.normal_coin }}</view>
|
||||
<view class="cr-grey-9 text-size-xs">{{ item.default_symbol }} {{ item.default_coin }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0"></component-no-data>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 明细 -->
|
||||
<component-popup :propShow="popup_user_detail_status" propPosition="bottom" @onclose="popup_user_detail_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="oh">
|
||||
<text class="text-size">{{$t('pages.plugins-coin-detail')}}</text>
|
||||
<view class="fr" @tap.stop="popup_user_detail_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup_user_detail_container padding-vertical-main flex-row flex-wrap align-c tc text-size">
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/recharge-list/recharge-list" @tap="url_event">{{$t('pages.plugins-coin-recharge-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/transfer-list/transfer-list" @tap="url_event">{{$t('pages.plugins-coin-transfer-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/transaction-list/transaction-list" @tap="url_event">{{$t('pages.plugins-coin-transaction-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/cash-list/cash-list" @tap="url_event">{{$t('pages.plugins-coin-cash-list')}}</view>
|
||||
</view>
|
||||
<view class="flex-width-half">
|
||||
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/convert-list/convert-list" @tap="url_event">{{$t('pages.plugins-coin-convert-list')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNavBack from '@/components/nav-back/nav-back';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
var wallet_static_url = app.globalData.get_static_url('coin', true) + 'app/';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
// #ifdef MP-TOUTIAO
|
||||
bar_height = 0;
|
||||
// #endif
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
wallet_static_url: wallet_static_url,
|
||||
status_bar_height: bar_height,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
|
||||
// 是否显示虚拟币
|
||||
is_price_show: false,
|
||||
data_base: null,
|
||||
// 虚拟币数量
|
||||
accounts_summary: 0,
|
||||
accounts_list: [],
|
||||
// 明细弹窗
|
||||
popup_user_detail_status: false,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNavBack,
|
||||
componentNoData,
|
||||
componentPopup,
|
||||
componentBottomLine,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'user', 'coin'),
|
||||
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,
|
||||
accounts_list: data.accounts_list || [],
|
||||
accounts_summary: data.accounts_summary || 0,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 0,
|
||||
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: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 显示隐藏虚拟币
|
||||
price_change() {
|
||||
this.setData({
|
||||
is_price_show: !this.is_price_show,
|
||||
});
|
||||
},
|
||||
|
||||
// 明细弹窗打开
|
||||
popup_user_detail_open_event() {
|
||||
this.setData({
|
||||
popup_user_detail_status: true,
|
||||
});
|
||||
},
|
||||
// 明细弹窗关闭
|
||||
popup_user_detail_close_event(e) {
|
||||
this.setData({
|
||||
popup_user_detail_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 页面滚动监听
|
||||
scroll_event(e) {
|
||||
uni.$emit('onPageScroll', e.detail);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
if (e.currentTarget.dataset.method) {
|
||||
this.popup_user_detail_open_event();
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './user.css';
|
||||
</style>
|
||||
Reference in New Issue
Block a user