1.虚拟币借口连调

2024.3.26 sws
master
sws 2024-03-27 11:50:45 +08:00
parent b501d6bbac
commit dc11555f6f
12 changed files with 1447 additions and 529 deletions

View File

@ -8,5 +8,5 @@ module.exports = {
filename: 'zh', // 输出的文件名,默认为 zh_cn
extname: 'json', // 输出的文件后缀名默认为 js ,支持json和jsjs格式为 module.exports = {} 或 export default {}
// langList: ['en', 'spa', 'cht'] // 翻译目标语言列表,默认是 ['en'] 具体语种请自行查看。注意使用不同的翻译接口需要更换对应的语言编码腾讯翻译、火山翻译、谷歌翻译语言编码大致相同百度要特别注意与上述3种翻译有不同的语言编码
langList: ['en', 'spa', 'cht'] // 翻译目标语言列表,默认是 ['en'] 具体语种请自行查看。注意使用不同的翻译接口需要更换对应的语言编码腾讯翻译、火山翻译、谷歌翻译语言编码大致相同百度要特别注意与上述3种翻译有不同的语言编码
langList: ['en'] // 翻译目标语言列表,默认是 ['en'] 具体语种请自行查看。注意使用不同的翻译接口需要更换对应的语言编码腾讯翻译、火山翻译、谷歌翻译语言编码大致相同百度要特别注意与上述3种翻译有不同的语言编码
}

View File

@ -74,7 +74,7 @@
"article-category": "All articles",
"article-detail": "Article details",
"setup": "set up",
"password": "password modify",
"password": "password modify",
"personal": "personal data",
"logout": "Account cancellation",
"plugins-seckill-index": "Limited time flash sale",
@ -190,7 +190,9 @@
"plugins-coin-transaction-detail": "Transaction details",
"plugins-coin-withdrawal-detail": "Withdrawal details",
"plugins-coin-convert-detail": "Conversion details",
"plugins-coin-collection": "Collection"
"plugins-coin-collection": "Collection",
"plugins-coin-recharge-pay": "Recharge payment",
"plugins-coin-recharge-detail": "Recharge details"
},
"login": {
"login": {
@ -237,9 +239,9 @@
"s665h5": "Obtain verification code",
"jw378f": "Authorized User Information",
"np9177": "Bind phone",
"tgsa4d": "Bind email",
"876tdf": "Bind account",
"87yui2": "Bind successful",
"tgsa4d": "Bind email",
"876tdf": "Bind account",
"87yui2": "Bind successful",
"158yg2": "Login with mobile verification code",
"r329eu": "Email verification code login",
"39hn6v": "Account password registration",
@ -323,7 +325,7 @@
"setup": {
"x81v6d": "Replace phone",
"j6skqh": "Click to replace",
"dfg4wf": "Click to bind",
"dfg4wf": "Click to bind",
"r7jz13": "update language",
"42mba7": "Address",
"5eltza": "Click to manage",
@ -339,7 +341,7 @@
"07o10b": "Please bind your phone first",
"nwt4o1": "Please log in first",
"utnr7g": "Service phone",
"87ytgh": "Unbind"
"87ytgh": "Unbind"
}
},
"article-category": {
@ -1705,7 +1707,7 @@
"3eqv71": "Please go to the mini program to use the complete service",
"08cg8y": "The customer service address is incorrect",
"0gwt7z": "Clear successful",
"87yghj": "Logout successful",
"87yghj": "Logout successful",
"di6v5t": "Please obtain authorization first",
"nu5058": "Geographic location selection is not supported!",
"4v6q86": "No location selected"

View File

@ -78,7 +78,7 @@
"article-detail": "文章详情",
"setup": "设置",
"personal": "个人资料",
"password": "密码修改",
"password": "密码修改",
"logout": "账号注销",
"plugins-seckill-index": "限时秒杀",
"plugins-coupon-index": "领券中心",
@ -187,6 +187,7 @@
"plugins-ordergoodsform-order": "商品表单",
"plugins-coin-user": "虚拟币",
"plugins-coin-recharge": "充值",
"plugins-coin-recharge-pay": "充值支付",
"plugins-coin-convert": "转换",
"plugins-coin-withdrawal": "提现",
"plugins-coin-detail": "明细",
@ -194,6 +195,7 @@
"plugins-coin-transaction-detail": "交易明细",
"plugins-coin-withdrawal-detail": "提现明细",
"plugins-coin-convert-detail": "转换明细",
"plugins-coin-recharge-detail": "充值明细",
"plugins-coin-collection": "收款"
},
"login": {
@ -240,9 +242,9 @@
"s665h5": "获取验证码",
"jw378f": "授权用户信息",
"np9177": "绑定手机",
"tgsa4d": "绑定邮箱",
"876tdf": "绑定账户",
"87yui2": "绑定成功",
"tgsa4d": "绑定邮箱",
"876tdf": "绑定账户",
"87yui2": "绑定成功",
"158yg2": "手机验证码登录",
"r329eu": "邮箱验证码登录",
"39hn6v": "账号密码注册",
@ -319,7 +321,7 @@
"setup": {
"x81v6d": "更换手机",
"j6skqh": "点击更换",
"dfg4wf": "点击绑定",
"dfg4wf": "点击绑定",
"r7jz13": "修改语言",
"42mba7": "地址管理",
"5eltza": "点击管理",
@ -335,7 +337,7 @@
"07o10b": "请先绑定手机",
"nwt4o1": "请先登录",
"utnr7g": "客服电话有误",
"87ytgh": "解绑"
"87ytgh": "解绑"
}
},
"article-category": {
@ -1695,7 +1697,7 @@
"3eqv71": "请前往小程序使用完整服务",
"08cg8y": "客服地址有误",
"0gwt7z": "清除成功",
"87yghj": "退出成功",
"87yghj": "退出成功",
"di6v5t": "请先获取授权",
"nu5058": "不支持地理位置选择!",
"4v6q86": "未选择位置"

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<template>
<view :class="theme_view">
<component-nav-back propName="BTC详情"></component-nav-back>
<component-nav-back propName="账户详情"></component-nav-back>
<view>
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
<view class="coin-title flex-col padding-lg">
@ -35,25 +35,25 @@
<view class="coin-content padding-lg">
<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.type }}</view>
<view class="cr-grey-9">{{ item.date }}</view>
<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">金额类型</text>
<text class="fw-b">{{ item.price_type }}</text>
<text class="cr-grey-9">操作类型</text>
<text class="fw-b">{{ item.operate_type_name }}</text>
</view>
<view class="margin-bottom-sm flex-row">
<text class="cr-grey-9">操作金额</text>
<text class="fw-b">{{ item.price }}</text>
<text class="cr-grey-9">操作数量</text>
<text class="fw-b">{{ item.operate_coin }}</text>
</view>
<view class="margin-bottom-sm flex-row">
<text class="cr-grey-9">原始金额</text>
<text class="fw-b">{{ item.init_price }}</text>
<text class="cr-grey-9">原始数量</text>
<text class="fw-b">{{ item.original_coin }}</text>
</view>
<view class="flex-row">
<text class="cr-grey-9">最新金额</text>
<text class="fw-b">{{ item.new_price }}</text>
<text class="cr-grey-9">最新数量</text>
<text class="fw-b">{{ item.latest_coin }}</text>
</view>
</view>
</view>
@ -211,7 +211,7 @@
dataType: 'json',
success: (res) => {
uni.stopPullDownRefresh();
console.log(res);
console.log( res.data.data);
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
@ -222,6 +222,13 @@
data_list_loding_msg: '',
data_list_loding_status: 0,
});
for (var i = 0; i < data.accounts_list.length; i++) {
if (data.accounts_list[i].id === this.params.id) {
this.setData({
accounts_list_index: i,
});
}
}
} else {
this.setData({
data_list_loding_status: 2,

View File

@ -0,0 +1,14 @@
.convert .nav {
z-index: 102;
}
.scroll-box {
height: calc(100vh - 88rpx);
}
/*
*
*/
.popup_wallet_container .item {
background-color: #f4f4f4;
border-radius: 30rpx;
}

View File

@ -0,0 +1,395 @@
<template>
<view :class="theme_view">
<view class="convert">
<view class="padding-main bg-white pr nav flex-row">
<view class="flex-row align-c margin-right-main" @tap="popup_wallet_open_event">
<view>钱包</view>
<view class="padding-left-sm"><iconfont :name="popup_wallet_status ? 'icon-arrow-top' : 'icon-arrow-bottom'" size="24rpx"></iconfont></view>
</view>
<view class="flex-row align-c margin-left-sm" @tap="popup_type_open_event">
<view>类型</view>
<view class="padding-left-sm"><iconfont :name="popup_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-for="(item, index) in data" :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 }}</view>
<view class="cr-grey-9">{{ item.date }}</view>
</view>
<view>
<view class="margin-bottom-sm flex-row">
<text class="cr-grey-9">转出余额</text>
<text class="fw-b">{{ item.tob }}</text>
</view>
<view class="margin-bottom-sm flex-row">
<text class="cr-grey-9">转换汇率</text>
<text class="fw-b">{{ item.convert_rate }}</text>
</view>
<view class="flex-row">
<text class="cr-grey-9">最新金额</text>
<text class="fw-b">{{ item.new_price }}</text>
</view>
</view>
</view>
</view>
</scroll-view>
<!-- 钱包 -->
<component-popup :propShow="popup_wallet_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_wallet_close_event">
<view class="padding-vertical-lg">
<view class="padding-horizontal-main text-size-xs">钱包种类</view>
<view class="popup_wallet_container padding-sm flex-row flex-warp align-c tc text-size-md">
<view v-for="(item, index) in wallet_list" class="flex-width-half-half" :key="index">
<view class="item margin-sm padding-vertical-sm" :class="wallet_list_index === index ? 'cr-main bg-main-light' : ''" :data-index="index" @tap="wallet_event">{{ item.name }}</view>
</view>
</view>
<view class="tc padding-top-lg br-t" @tap="popup_wallet_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_type_status" propPosition="top" :propTop="popup_top_height + 'px'" @onclose="popup_type_close_event">
<view class="padding-vertical-lg">
<view class="padding-horizontal-main text-size-xs">提现类型</view>
<view class="popup_wallet_container padding-sm flex-row flex-warp align-c tc text-size-md">
<view v-for="(item, index) in type_list" class="flex-width-half-half" :key="index">
<view class="item margin-sm padding-vertical-sm" :class="type_list_index === index ? 'cr-main bg-main-light' : ''" :data-index="index" @tap="type_event">{{ item.name }}</view>
</view>
</view>
<view class="tc padding-top-lg br-t" @tap="popup_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>
</view>
</template>
<script>
const app = getApp();
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,
//
popup_top_height: 0,
//
popup_wallet_status: false,
wallet_list_index: 0,
wallet_list: [
{
name: '全部',
},
{
name: 'BTC',
},
{
name: 'ETH',
},
{
name: 'XRP',
},
{
name: 'DASH',
},
],
//
popup_type_status: false,
type_list_index: 0,
type_list: [
{
name: '全部',
},
{
name: '未打款',
},
{
name: '已打款',
},
{
name: '打款失败',
},
],
data: [
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
{
date: '2023-12-12',
status: '转入',
tob: '20000.00',
convert_rate: '0.33',
new_price: '2198.00',
},
],
};
},
components: {
componentNoData,
componentPopup,
},
props: {},
onLoad(params) {
//
app.globalData.page_event_onload_handle(params);
},
onShow() {
//
app.globalData.page_event_onshow_handle();
//
app.globalData.page_share_handle();
this.init();
},
//
onPullDownRefresh() {
this.get_data();
},
methods: {
init(e) {
var user = app.globalData.get_user_info(this, 'init');
if (user != false) {
this.get_data();
var self = this;
var timer = setInterval(function () {
if (self.popup_top_height == 0) {
self.popup_top_height_computer();
} else {
clearInterval(timer);
}
}, 500);
}
},
//
get_data() {},
//
popup_wallet_open_event() {
if (!this.popup_type_status) {
this.setData({
popup_wallet_status: !this.popup_wallet_status,
});
}
},
//
popup_wallet_close_event() {
this.setData({
popup_wallet_status: false,
});
},
//
wallet_event(e) {
this.setData({
wallet_list_index: e.currentTarget.dataset.index,
});
},
//
popup_type_open_event() {
if (!this.popup_wallet_status) {
this.setData({
popup_type_status: !this.popup_type_status,
});
}
},
//
popup_type_close_event() {
this.setData({
popup_type_status: false,
});
},
//
type_event(e) {
this.setData({
type_list_index: e.currentTarget.dataset.index,
});
},
//
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-detail.css';
</style>

View 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: 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, #FC6F31 0%, #E22C08 100%);
}
.coin-content-list-img {
--size: 36rpx;
width: var(--size);
height: var(--size) !important;
}

View File

@ -0,0 +1,320 @@
<template>
<view :class="theme_view">
<view v-if="coin_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 :src="coin_list[send_accounts_id_index]['platform_icon']" mode="widthFix" class="coin-content-list-img round" />
<text class="margin-left-sm fw-b single-text">{{ coin_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">余额:</text><text class="cr-blue">{{ coin_list[send_accounts_id_index]['platform_symbol'] }}{{ coin_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="金额" @input="default_value_change" />
<view class="margin-top-main tr text-size-xs">{{ coin_list[send_accounts_id_index]['platform_symbol'] }}{{ coin_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-convert2" 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 :src="coin_list[receive_accounts_id_index]['platform_icon']" mode="widthFix" class="coin-content-list-img round" />
<text class="margin-left-sm fw-b single-text">{{ coin_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">余额:</text><text class="cr-blue">{{ coin_list[receive_accounts_id_index]['platform_symbol'] }}{{ coin_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 placeholder="金额" />
<view class="margin-top-main tr text-size-xs">{{ coin_list[receive_accounts_id_index]['platform_symbol'] }}{{ coin_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">1XRP = 2.45546 <text class="cr-grey-9">($21.00)</text></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="number" :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"></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 coin_list" :key="index" class="flex-row jc-sb align-c padding-vertical-main" :class="coin_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 :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="36rpx"></iconfont>
</view>
</view>
</view>
</view>
</view>
</component-popup>
</view>
</view>
</template>
<script>
const app = getApp();
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,
//
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,
coin_list: [
// {
// name: 'BTC',
// img: wallet_static_url + 'user-head-bg.png',
// },
// {
// name: 'USDT-polygon',
// img: wallet_static_url + 'user-head-bg.png',
// },
],
//
convert_bool: false,
//
default_value: '',
//
convert_value: '0.00',
//
pay_pwd: '',
};
},
components: {
componentNoData,
componentPopup,
},
props: {},
onLoad(params) {
//
app.globalData.page_event_onload_handle(params);
this.init();
},
onShow() {
//
app.globalData.page_event_onshow_handle();
//
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;
this.setData({
data_base: data.base || null,
coin_list: data.accounts_list || [],
convert_value: data.convert_value || '0',
send_accounts_id: data.send_accounts.id,
receive_accounts_id: data.receive_accounts.id,
data_list_loding_msg: '',
data_list_loding_status: 0,
});
} else {
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_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,
coin_index: type == 1 ? this.send_accounts_id_index : this.receive_accounts_id_index,
popup_coin_status: true,
});
},
coin_checked_event(e) {
if (this.coin_type == 1) {
this.setData({
send_accounts_id_index: parseInt(e.currentTarget.dataset.index || 0),
send_accounts_id: e.currentTarget.dataset.value,
});
} else {
this.setData({
receive_accounts_id_index: parseInt(e.currentTarget.dataset.index || 0),
receive_accounts_id: e.currentTarget.dataset.value,
});
}
this.setData({
coin_index: parseInt(e.currentTarget.dataset.index || 0),
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_value_change(e) {
this.setData({
default_value: e.detail.value,
});
},
//
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: '请输入转换金额' }];
//
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-detail/convert-detail', 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 './recharge-pay.css';
</style>

View File

@ -31,6 +31,7 @@
text-align: center;
padding: 30rpx 38rpx;
}
.recharge-qrcode .img {
width: 160rpx !important;
height: 160rpx !important;
@ -68,6 +69,22 @@
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;
}

View File

@ -1,109 +1,105 @@
<template>
<view :class="theme_view">
<component-nav-back></component-nav-back>
<view>
<scroll-view :scroll-y="true" class="scroll-box" lower-threshold="60" @scroll="scroll_event">
<view class="recharge-title flex-col padding-lg">
<view class="margin-bottom-xxxl flex-row jc-sb margin-top-xl">
<view class="cr-white">
<view class="coin-dropdown">
<view class="flex-row align-c pr" @tap="popup_coin_status_open_event">
<image :src="coin_list[coin_index]['img']" mode="widthFix" class="coin-content-list-img round" />
<text class="margin-left-xs">{{ coin_list[coin_index]['name'] }}</text>
<view class="coin-dropdown-icon pa padding-left-xxl">
<iconfont name="icon-arrow-bottom" size="24rpx" color="#fff"></iconfont>
</view>
<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_list.length > 0" 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 :src="accounts_list[accounts_list_index]['platform_icon']" mode="widthFix" class="coin-content-list-img round" />
<text class="margin-left-xs">{{ accounts_list[accounts_list_index]['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-40 fw-b">38000</view>
</view>
<view class="recharge-qrcode">
<block v-if="recharge_qrcode">
<image :src="recharge_qrcode" mode="widthFix" class="img margin-right-xs circle" />
</block>
<block v-else>
<iconfont name="icon-qrcode" size="160rpx" color="#f6f6f6"></iconfont>
</block>
<view class="text-size-xl fw-b single-text">{{ accounts_list[accounts_list_index]['normal_coin'] }}</view>
</view>
<view class="recharge-qrcode">
<block v-if="recharge_qrcode">
<image :src="recharge_qrcode" mode="widthFix" class="img margin-right-xs circle" />
</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">充币地址</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">{{ recharge_address }}</view>
<view @tap.stop="text_copy_event" :data-value="recharge_address">
<iconfont name="icon-copy" size="24rpx" color="#999"></iconfont>
</view>
</view>
</view>
<view class="recharge-content padding-xxl bg-white">
<view class="margin-bottom-xxxl">
<view class="margin-bottom-main">充币地址</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">4gfgefg33445fghfghh4bfbfghebdfb34fgdfg44gfgefg33445fghfghh4bfbfghebdfb34fgdfg4</view>
<view @tap.stop="text_copy_event" data-value="123">
<iconfont name="icon-copy" size="24rpx" color="#999"></iconfont>
<view v-if="network_list.length > 0" class="margin-bottom-xxxl">
<view class="margin-bottom-main">充币网络</view>
<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>
</view>
<view class="margin-bottom-xxxl">
<view class="margin-bottom-xs">选择充值金额</view>
<view class="flex-row flex-warp recharge-price-item margin-bottom-xs">
<view v-for="(item, index) in preset_data" :key="index" 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>
</view>
<view class="margin-bottom-xxxl">
<view class="margin-bottom-main">充币网络</view>
<picker class="recharge-content-input-bg padding-main border-radius-sm" @change="recharge_event" :value="recharge_web_index" :range="recharge_web_list" range-key="name">
<view class="picker arrow-bottom">
{{ recharge_web_list[recharge_web_index]['name'] }}
</view>
</picker>
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c margin-bottom-xxl">
<text>其他数量</text>
<view class="padding-left-lg">
<input type="digit" name="coin" :value="recharge_num" placeholder-class="text-size-md cr-grey-9" placeholder="请输入充值数量" @input="recharge_num_change" />
</view>
</view>
<view class="margin-bottom-xxxl">
<view class="margin-bottom-xs">选择充值金额</view>
<view class="flex-row flex-warp recharge-price-item margin-bottom-xs">
<view v-for="(item, index) in recharge_price_list" :key="index" class="recharge-price-list flex-col align-c jc-c">
<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.name }}</view>
</view>
<view class="margin-top-sm cr-grey-9 text-size-xs">{{ item.price }}</view>
</view>
</view>
<view class="recharge-content-input-bg padding-main border-radius-sm flex-row align-c margin-bottom-xxl">
<text>其他数量</text>
<view class="padding-left-lg">
<input type="digit" class="" placeholder-class="text-size-md cr-grey-9" placeholder="请输入充值数量" />
</view>
</view>
<button type="default" class="recharge-btn cr-white round" @tap="popup_goods_search_event"></button>
</view>
<view class="margin-bottom-xxxl">
<view class="margin-bottom-main">充值说明</view>
<view class="recharge-content-tips">
<view class="item pr padding-left-xl margin-bottom-sm cr-grey-9 text-size-xs">充值只可选择以上固定档位金额</view>
<view class="item pr padding-left-xl margin-bottom-sm cr-grey-9 text-size-xs">充值只可选择以上固定档位金额</view>
<view class="item pr padding-left-xl margin-bottom-sm cr-grey-9 text-size-xs">充值只可选择以上固定档位金额</view>
</view>
<button type="default" class="recharge-btn cr-white round" @tap="recharge_submit"></button>
</view>
<view v-if="recharge_desc.length > 0" class="margin-bottom-xxxl">
<view class="margin-bottom-main">充值说明</view>
<view class="recharge-content-tips">
<view v-for="(item, index) in recharge_desc" :key="index" class="item pr padding-left-xl margin-bottom-sm cr-grey-9 text-size-xs">{{ item }}</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>
</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 class="popup_coin_status_container padding-vertical-main flex-col text-size">
<view class="scroll-y">
<view v-for="(item, index) in coin_list" :key="index" class="flex-row jc-sb align-c padding-vertical-main" :class="coin_list.length == index + 1 ? '' : 'br-b-f9'" :data-value="item" :data-index="index" @tap="coin_checked_event">
<view class="flex-row align-c">
<image :src="item.img" mode="widthFix" class="coin-list-img round" />
<view class="margin-left-sm text-size-md single-text">{{ item.name }}</view>
</view>
<view>
<iconfont :name="coin_index === index ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="36rpx"></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 :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_list_index === index ? 'icon-zhifu-yixuan cr-red' : 'icon-zhifu-weixuan'" size="36rpx"></iconfont>
</view>
</view>
</view>
</view>
</component-popup>
</view>
</view>
</component-popup>
</view>
</template>
<script>
const app = getApp();
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/';
//
@ -117,62 +113,33 @@
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: '',
//
recharge_qrcode: '',
//
popup_coin_status: false,
//
coin_index: 0,
accounts_list_index: 0,
// list
coin_list: [
{
name: 'BTC',
img: wallet_static_url + 'recharge-price.png',
},
],
accounts_list: [],
//
recharge_address: '',
//
recharge_web_index: 0,
recharge_web_list: [
{
name: 'BTC',
},
{
name: 'USDT-polygon',
},
],
network_list_index: 0,
network_list: [],
//
preset_data_index: null,
//
recharge_price_list: [
{
name: '100',
price: '100',
},
{
name: '400',
price: '400',
},
{
name: '400',
price: '400',
},
{
name: '400',
price: '400',
},
{
name: '400',
price: '400',
},
],
preset_data: [],
//
recharge_num: '',
//
recharge_desc: [],
};
},
components: {
componentNavBack,
componentNoData,
componentPopup,
},
props: {},
@ -181,10 +148,6 @@
//
app.globalData.page_event_onload_handle(params);
//
this.setData({
params: params,
});
this.init();
},
@ -204,74 +167,31 @@
init(e) {
var user = app.globalData.get_user_info(this, 'init');
if (user != false) {
this.init_data();
this.get_data();
}
},
init_data(){
uni.request({
url: app.globalData.get_request_url('createinfo', 'recharge', 'coin'),
method: 'POST',
data: { accounts_id: this.params.id },
dataType: 'json',
success: (res) => {
uni.stopPullDownRefresh();
console.log('1');
console.log(res);
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: 0,
});
} else {
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: this.$t('common.internet_error_tips'),
});
app.globalData.showToast(this.$t('common.internet_error_tips'));
},
});
},
//
get_data() {
uni.request({
url: app.globalData.get_request_url('index', 'recharge', 'coin'),
url: app.globalData.get_request_url('createinfo', 'recharge', 'coin'),
method: 'POST',
data: { accounts_id: this.params.id },
data: {},
dataType: 'json',
success: (res) => {
uni.stopPullDownRefresh();
console.log(res);
console.log(res.data.data);
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: 0,
network_list: data.network_list || [],
recharge_qrcode: data.recharge_qrcode || '',
recharge_address: data.recharge_address || '',
recharge_desc: data.recharge_desc || [],
preset_data: data.preset_data || [],
});
} else {
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
if (app.globalData.is_login_check(res.data, this, 'get_data')) {
app.globalData.showToast(res.data.msg);
}
@ -279,23 +199,15 @@
},
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({
coin_index: parseInt(e.currentTarget.dataset.index || 0),
accounts_list_index: parseInt(e.currentTarget.dataset.index || 0),
popup_coin_status: false,
});
},
@ -312,9 +224,65 @@
//
recharge_event(e) {
this.setData({
recharge_web_index: parseInt(e.detail.value || 0),
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() {
var new_data = {
accounts_id: this.accounts_list[this.accounts_list_index].id,
network_id: this.network_list[this.network_list_index].id,
address: this.recharge_address,
coin: this.recharge_num,
};
//
var validation = [{ fields: 'coin', msg: '请选择或输入充值数量' }];
//
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-detail/recharge-detail', 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);

View File

@ -69,6 +69,9 @@
</view>
</view>
<view class="popup_user_detail_container padding-vertical-main flex-row flex-warp 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-detail/recharge-detail" @tap="url_event"></view>
</view>
<view class="flex-width-half">
<view class="item padding-vertical-lg radius margin-sm" data-value="/pages/plugins/coin/transfer-accounts-detail/transfer-accounts-detail" @tap="url_event"></view>
</view>