From 66958f57ec724f3b2cafc7361bbd380b0c2dbe08 Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Tue, 26 Mar 2024 19:01:19 +0800
Subject: [PATCH] =?UTF-8?q?1.=E8=99=9A=E6=8B=9F=E5=B8=81=E5=80=9F=E5=8F=A3?=
=?UTF-8?q?=E8=BF=9E=E8=B0=83=202024.3.26=20sws?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 4 +-
pages/plugins/coin/convert/convert.vue | 182 +++++++--
pages/plugins/coin/detail/detail.vue | 313 +++++----------
pages/plugins/coin/recharge/recharge.css | 5 +
pages/plugins/coin/recharge/recharge.vue | 152 ++++---
.../transfer-accounts-detail.vue | 378 +++++++-----------
pages/plugins/coin/user/user.css | 2 +-
pages/plugins/coin/user/user.vue | 317 ++++-----------
8 files changed, 580 insertions(+), 773 deletions(-)
diff --git a/App.vue b/App.vue
index 444fe3c6..d8f79bc9 100644
--- a/App.vue
+++ b/App.vue
@@ -7,11 +7,11 @@
data: {
// 基础配置
// 数据接口请求地址
- request_url: 'https://d1.shopxo.vip/',
+ request_url: 'http://shopxo.com/',
// request_url: 'https://new.shopxo.vip/',
// 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/)
- static_url: 'https://d1.shopxo.vip/',
+ static_url: 'http://shopxo.com/',
// static_url: 'https://new.shopxo.vip/',
// 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立)
diff --git a/pages/plugins/coin/convert/convert.vue b/pages/plugins/coin/convert/convert.vue
index b480263a..554c66ad 100644
--- a/pages/plugins/coin/convert/convert.vue
+++ b/pages/plugins/coin/convert/convert.vue
@@ -1,23 +1,25 @@
-
+
-
- {{ coin_list[coin_index_old]['name'] }}
+
+ {{ coin_list[send_accounts_id_index]['platform_name'] }}
- 余额:23.234
+
+ 余额:{{ coin_list[send_accounts_id_index]['platform_symbol'] }}{{ coin_list[send_accounts_id_index]['normal_coin'] }}
+
-
- $21.00
+
+ {{ coin_list[send_accounts_id_index]['platform_symbol'] }}{{ coin_list[send_accounts_id_index]['default_coin'] }}
@@ -26,17 +28,19 @@
-
- {{ coin_list[coin_index_new]['name'] }}
+
+ {{ coin_list[receive_accounts_id_index]['platform_name'] }}
- 余额:23.234
+
+ 余额:{{ coin_list[receive_accounts_id_index]['platform_symbol'] }}{{ coin_list[receive_accounts_id_index]['normal_coin'] }}
+
-
- $21.00
+
+ {{ coin_list[receive_accounts_id_index]['platform_symbol'] }}{{ coin_list[receive_accounts_id_index]['default_coin'] }}
@@ -46,7 +50,7 @@
支付密码
-
+
@@ -63,10 +67,10 @@
-
+
-
- {{ item.name }}
+
+ {{ item.platform_name }}
@@ -98,21 +102,31 @@
// 虚拟币状态
coin_type: 1,
coin_index: 0,
- coin_index_old: 0,
- coin_index_new: 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',
- },
+ // {
+ // 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: '',
};
},
@@ -149,24 +163,64 @@
},
// 获取数据
- 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.coin_index_old : this.coin_index_new,
+ 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({
- coin_index_old: parseInt(e.currentTarget.dataset.index || 0),
+ send_accounts_id_index: parseInt(e.currentTarget.dataset.index || 0),
+ send_accounts_id: e.currentTarget.dataset.value,
});
} else {
this.setData({
- coin_index_new: parseInt(e.currentTarget.dataset.index || 0),
+ receive_accounts_id_index: parseInt(e.currentTarget.dataset.index || 0),
+ receive_accounts_id: e.currentTarget.dataset.value,
});
}
this.setData({
@@ -182,17 +236,77 @@
// 虚拟货币调换
coin_center_convert_event() {
- var old_index = this.coin_index_old;
- var new_index = this.coin_index_new;
+ 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({
- coin_index_new: old_index,
- coin_index_old: new_index,
+ 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() {},
+ 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) {
diff --git a/pages/plugins/coin/detail/detail.vue b/pages/plugins/coin/detail/detail.vue
index c0f018dd..fe4f7ee9 100644
--- a/pages/plugins/coin/detail/detail.vue
+++ b/pages/plugins/coin/detail/detail.vue
@@ -4,17 +4,17 @@
-
+
-
+
- {{ coin_list[coin_index]['name'] }}
+ {{ accounts_list[accounts_list_index]['platform_name'] }}
- {{ is_price_show ? '5410.00' : '***' }}
+ {{ is_price_show ? accounts_list[accounts_list_index]['normal_coin'] : '***' }}
@@ -33,7 +33,7 @@
-
+
{{ item.type }}
{{ item.date }}
@@ -59,55 +59,55 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
- {{ item.name }}
-
-
-
-
+
+
+
+
+
+
+ {{ item.platform_name }}
+
+
+
-
-
-
-
-
- 明细
-
-
-
-
-
-
- 转账明细
-
-
- 交易明细
-
-
- 提现明细
-
-
- 转换明细
-
+
+
+
+
+
+
+ 明细
+
+
-
-
+
+
+ 转账明细
+
+
+ 交易明细
+
+
+ 提现明细
+
+
+ 转换明细
+
+
+
+