1.虚拟币优化

2024.4.1 sws
master
sws 2024-04-01 17:59:11 +08:00
parent 585101c636
commit eacd1f8d1d
6 changed files with 236 additions and 3 deletions

View File

@ -191,6 +191,7 @@
"plugins-coin-convert": "转换",
"plugins-coin-cash": "提现",
"plugins-coin-detail": "明细",
"plugins-coin-transfer": "转账",
"plugins-coin-transfer-list": "转账明细",
"plugins-coin-transaction-list": "交易明细",
"plugins-coin-cash-list": "提现明细",

View File

@ -1502,6 +1502,13 @@
"navigationBarTitleText": ""
}
},
{
"path": "transfer/transfer",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": ""
}
},
{
"path": "transfer-list/transfer-list",
"style": {

View File

@ -39,7 +39,7 @@
code: '',
size: 280,
},
accounts_key: '3453sdfsdf3254233453sdfsdf325423',
accounts_key: '',
};
},

View File

@ -151,9 +151,9 @@
//
coin_oprate_list: [
{
name: '充值',
name: '转账',
icon: 'icon-transfer-count',
url: '/pages/plugins/coin/recharge/recharge',
url: '/pages/plugins/coin/transfer/transfer',
},
{
name: '收款',

View File

@ -0,0 +1,11 @@
.note {
background-color: #fafafc;
}
.transfer-btn {
background: linear-gradient(107deg, #31B4FC 0%, #0842E2 100%);
}
.transfer-btn:active {
background: linear-gradient(107deg, #168ACA 0%, #022A97 100%);
}

View File

@ -0,0 +1,214 @@
<template>
<view :class="theme_view">
<view class="transfer">
<view class="padding-main">
<view class="bg-white padding-main radius-md margin-bottom-main">
<view class="padding-vertical-sm flex-row align-c">
<text class="text-size fw-b">收款账号</text>
<view class="padding-left-lg flex-row jc-sb align-c flex-1 flex-width">
<view class="flex-1 padding-right-main">
<input type="digit" name="receive_accounts_key" :value="receive_accounts_key" placeholder-class="text-size-md cr-grey-9" placeholder="请输入收款账号" @input="receive_accounts_key_change" />
</view>
<iconfont name="icon-scan" size="40rpx" @tap="scancode_event"></iconfont>
</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">转账币</text>
<view class="margin-top-xxxxl">
<input type="digit" name="coin" :value="coin" class="text-size-xl tc" placeholder-class="cr-grey-9" placeholder="请输入转账币" @input="coin_change" />
<view class="cr-grey-9 tc margin-top-main">
我的余额
<span class="cr-black fw-b">{{ accounts.platform_symbol }}{{ accounts.default_coin }}</span>
</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="请输入转账备注信息" @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"></button>
</view>
</view>
</view>
</view>
</template>
<script>
const app = getApp();
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,
accounts_id: null,
accounts_key: null,
receive_accounts_id: null,
accounts: {},
receive_accounts: {},
receive_accounts_key: null,
coin: null,
note: '',
// pay_pwd: '',
};
},
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();
}
},
//
get_data() {
uni.request({
url: app.globalData.get_request_url('createinfo', 'transfer', 'coin'),
method: 'POST',
data: { accounts_id: this.accounts_id, accounts_key: this.accounts_key },
dataType: 'json',
success: (res) => {
uni.stopPullDownRefresh();
console.log(res.data.data);
if (res.data.code == 0) {
var data = res.data.data;
this.setData({
accounts: data.accounts || {},
receive_accounts: data.receive_accounts || {},
});
} 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'));
},
});
},
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,
});
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_key: this.receive_accounts_key,
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: '请输入收款账号' },
{ 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', '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>