|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
- <view class="logo"><image :src="logo"></image></view>
|
|
|
+ <view class="logo"><image :src="moneyData.logo"></image></view>
|
|
|
<view class="select-box flex_item">
|
|
|
<view @tap="handleTap('picker')">{{ title }}</view>
|
|
|
<lb-picker
|
|
@@ -31,10 +31,10 @@
|
|
|
<view class="empty-box" v-show="list.length == 0"><u-empty></u-empty></view>
|
|
|
<view class="flex submit-box">
|
|
|
<view class="submit" @click="recharge">充币</view>
|
|
|
- <view class="tip"></view>
|
|
|
- <view class="submit" @click="withdraw">提币</view>
|
|
|
+ <view class="tip" v-if="moneyData.type==1"></view>
|
|
|
+ <view class="submit" @click="withdraw" v-if="moneyData.type==1">提币</view>
|
|
|
</view>
|
|
|
- <uni-popup ref="popup" type="center">
|
|
|
+ <!-- <uni-popup ref="popup" type="center">
|
|
|
<view class="popup">
|
|
|
<view class="cancel flex" @click="close">
|
|
|
<view></view>
|
|
@@ -44,28 +44,30 @@
|
|
|
<view class="popup-text">购买数量:</view>
|
|
|
<view class="password"><input type="number" v-model="num" placeholder="请输入算力数量" /></view>
|
|
|
<view class="popup-text">币种选择:</view>
|
|
|
- <view class="content" @click="useOutClickSide"><easy-select ref="easySelect" :options="moneyTypeList" :value="name" @selectOne="selectOne"></easy-select></view>
|
|
|
+ <view class="content" @click="useOutClickSide">
|
|
|
+ <easy-select ref="easySelect" :options="moneyTypeList" :value="moneyData.name" @selectOne="selectOne"></easy-select>
|
|
|
+ </view>
|
|
|
<view class="confirm-btn" @click="pay"><text>确认充币</text></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </uni-popup>
|
|
|
+ </uni-popup> -->
|
|
|
<uni-popup ref="mation" type="center">
|
|
|
<view class="popup">
|
|
|
<view class="cancel flex" @click="close2"><view class="tip">x</view></view>
|
|
|
<view class="list-boxs">
|
|
|
<view class="textBox flex">
|
|
|
<view class="font">交易前:</view>
|
|
|
- <view class="number">{{ before * 1 }} {{ code }}</view>
|
|
|
+ <view class="number">{{ before * 1 }} {{ moneyData.code }}</view>
|
|
|
</view>
|
|
|
<view class="xian"></view>
|
|
|
<view class="textBox flex">
|
|
|
<view class="font">交易额:</view>
|
|
|
- <view class="number">{{ pm }}{{ number * 1 }} {{ code }}</view>
|
|
|
+ <view class="number">{{ pm }}{{ number * 1 }} {{ moneyData.code }}</view>
|
|
|
</view>
|
|
|
<view class="xian"></view>
|
|
|
<view class="textBox flex">
|
|
|
<view class="font">交易后:</view>
|
|
|
- <view class="number">{{ balance * 1 }} {{ code }}</view>
|
|
|
+ <view class="number">{{ balance * 1 }} {{ moneyData.code }}</view>
|
|
|
</view>
|
|
|
<view class="xian"></view>
|
|
|
<scroll-view scroll-y="true" class="textBox">
|
|
@@ -78,66 +80,42 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { moneyLog, recharge,wallet } from '@/api/finance.js';
|
|
|
+import { moneyLog, recharge, wallet } from '@/api/finance.js';
|
|
|
import LbPicker from '@/components/lb-picker';
|
|
|
export default {
|
|
|
components: {
|
|
|
- LbPicker,
|
|
|
+ LbPicker
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- code: '',
|
|
|
title: '筛选',
|
|
|
- type: '',
|
|
|
- value: '',
|
|
|
- index: 0,
|
|
|
- typeList: [],
|
|
|
- list: '',
|
|
|
- num: '',
|
|
|
+ type: '',//当前筛选的类型查询用
|
|
|
+ value: '',//当前选中的类型名称
|
|
|
+ typeList: [],//记录列表
|
|
|
+ list: [],//历史记录列表
|
|
|
+ // num: '',//充值金额
|
|
|
moneyTypeList: [],
|
|
|
- money: '',
|
|
|
- name: '',
|
|
|
- logo: '',
|
|
|
- price: '',
|
|
|
- mark: '',
|
|
|
- charge: 0,
|
|
|
-
|
|
|
- _address_qr: '',
|
|
|
- __money_address: '',
|
|
|
- ids: '',
|
|
|
- keysAddr: '',
|
|
|
- text: '',
|
|
|
- balance: '',
|
|
|
- before: '',
|
|
|
- number: '',
|
|
|
+ text: '',//当前选中的流水详情
|
|
|
+ balance: '',//当前选中的流水金额
|
|
|
+ before: '',//交易前金额
|
|
|
+ number: '',//当前选中的弹窗交易金额
|
|
|
pm: '',
|
|
|
- way: [],
|
|
|
- address: '',
|
|
|
- waypath: '',
|
|
|
less: '',
|
|
|
page: 1,
|
|
|
limit: 5,
|
|
|
- isLast: true
|
|
|
+ isLast: true,
|
|
|
+ name: '', //币名称
|
|
|
+ moneyData: {
|
|
|
+ code: '',
|
|
|
+ money: '',
|
|
|
+ name: '',
|
|
|
+ logo: '',
|
|
|
+ type:'',
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- console.log(option, 'detail-option');
|
|
|
- this.waypath = option.waypath;
|
|
|
- console.log(this.waypath, '+++++++++++++++++++++');
|
|
|
- this.way = option.way;
|
|
|
- console.log('detail', this.way);
|
|
|
- this.code = option.code;
|
|
|
- this.logo = option.logo;
|
|
|
this.name = option.name;
|
|
|
- this.price = option.price;
|
|
|
- this.charge = option.charge;
|
|
|
- this.address = option.address;
|
|
|
- console.log(this.address, 'detail');
|
|
|
- this._address_qr = option._address_qr;
|
|
|
- this.__money_address = option.__money_address;
|
|
|
- this.mark = option.mark;
|
|
|
- this.ids = option.ids;
|
|
|
- this.keysAddr = option.keysAddr;
|
|
|
this.moneyType();
|
|
|
this.loadData();
|
|
|
},
|
|
@@ -151,9 +129,13 @@ export default {
|
|
|
limit: 10000,
|
|
|
type: obj.type
|
|
|
},
|
|
|
- obj.code
|
|
|
+ obj.name
|
|
|
).then(({ data }) => {
|
|
|
obj.typeList = data.type_list;
|
|
|
+ obj.typeList.unshift({
|
|
|
+ title:'全部',
|
|
|
+ type:''
|
|
|
+ })
|
|
|
obj.list = data.list;
|
|
|
console.log(obj.list);
|
|
|
});
|
|
@@ -162,56 +144,36 @@ export default {
|
|
|
async moneyType() {
|
|
|
let obj = this;
|
|
|
wallet({}).then(({ data }) => {
|
|
|
- const arr = Object.keys(data.back);
|
|
|
- console.log(arr);
|
|
|
- let ar = [];
|
|
|
- arr.forEach(e => {
|
|
|
- ar.push(data.back[e]);
|
|
|
- });
|
|
|
-
|
|
|
- obj.moneyTypeList = ar.filter(e => {
|
|
|
- console.log(e);
|
|
|
- if(e.can_trade == 1){
|
|
|
- return e;
|
|
|
- }
|
|
|
- else{
|
|
|
- return ;
|
|
|
- }
|
|
|
- });
|
|
|
- console.log(obj.moneyTypeList);
|
|
|
- if (obj.logo == '') {
|
|
|
- obj.logo = obj.moneyTypeList[0].LOGO;
|
|
|
- obj.name = obj.moneyTypeList[0].name;
|
|
|
- obj.code = obj.moneyTypeList[0].code;
|
|
|
- obj.money = obj.moneyTypeList[0].money.money;
|
|
|
- }
|
|
|
+ const dat = data.back[this.name];
|
|
|
+ obj.moneyData.logo = dat.LOGO;
|
|
|
+ obj.moneyData.name = dat.name;
|
|
|
+ obj.moneyData.code = dat.code;
|
|
|
+ obj.moneyData.money = dat.money.money;
|
|
|
+ obj.moneyData.type = +dat.can_cash
|
|
|
});
|
|
|
},
|
|
|
- pay() {
|
|
|
- let obj = this;
|
|
|
- recharge(
|
|
|
- {
|
|
|
- num: obj.num,
|
|
|
- money_type: obj.code
|
|
|
- },
|
|
|
- obj.buyId
|
|
|
- )
|
|
|
- .then(({ data }) => {
|
|
|
- obj.$api.msg(data.msg);
|
|
|
- obj.$refs.popup.close();
|
|
|
- obj.num = '';
|
|
|
- obj.code = '';
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/finance/recharge?LOGO=' + data._address_qr + '&order_id=' + data.order_id + '&ddress=' + data.__money_address + '&id=' + data.id
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- obj.$refs.popup.close();
|
|
|
- });
|
|
|
- },
|
|
|
+ // pay() {
|
|
|
+ // let obj = this;
|
|
|
+ // recharge(
|
|
|
+ // {
|
|
|
+ // num: obj.num,
|
|
|
+ // money_type: obj.moneyData.code
|
|
|
+ // },
|
|
|
+ // obj.name
|
|
|
+ // )
|
|
|
+ // .then(({ data }) => {
|
|
|
+ // obj.$api.msg(data.msg);
|
|
|
+ // obj.$refs.popup.close();
|
|
|
+ // obj.num = '';
|
|
|
+ // obj.moneyData.code = '';
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // obj.$refs.popup.close();
|
|
|
+ // });
|
|
|
+ // },
|
|
|
selectOne(options) {
|
|
|
this.name = options.name;
|
|
|
- this.code = options.code;
|
|
|
+ this.moneyData.code = options.code;
|
|
|
},
|
|
|
useOutClickSide() {
|
|
|
this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions();
|
|
@@ -229,72 +191,13 @@ export default {
|
|
|
this.loadData();
|
|
|
},
|
|
|
handleCancel(e) {},
|
|
|
+ // 充币按钮跳转页面
|
|
|
recharge() {
|
|
|
- let url = '/pages/finance/recharge?logo=' +
|
|
|
- this.logo +
|
|
|
- '&name=' +
|
|
|
- this.name +
|
|
|
- '&code=' +
|
|
|
- this.code +
|
|
|
- '&_address_qr=' +
|
|
|
- this._address_qr +
|
|
|
- '&__money_address=' +
|
|
|
- this.__money_address +
|
|
|
- '&mark=' +
|
|
|
- this.mark +
|
|
|
- '&ids=' +
|
|
|
- this.ids +
|
|
|
- '&keysAddr=' +
|
|
|
- this.keysAddr +
|
|
|
- '&charge=' +
|
|
|
- this.charge +
|
|
|
- '&address=' +
|
|
|
- this.address +
|
|
|
- '&way=' +
|
|
|
- this.way +
|
|
|
- '&waypath=' +
|
|
|
- this.waypath
|
|
|
- if(this.code === 'FIL') {
|
|
|
- console.log("555555555")
|
|
|
- url='/pages/finance/recharge'
|
|
|
- }
|
|
|
- uni.navigateTo({
|
|
|
- url:url
|
|
|
- // '/pages/finance/recharge?logo=' +
|
|
|
- // this.logo +
|
|
|
- // '&name=' +
|
|
|
- // this.name +
|
|
|
- // '&code=' +
|
|
|
- // this.code +
|
|
|
- // '&_address_qr=' +
|
|
|
- // this._address_qr +
|
|
|
- // '&__money_address=' +
|
|
|
- // this.__money_address +
|
|
|
- // '&mark=' +
|
|
|
- // this.mark +
|
|
|
- // '&ids=' +
|
|
|
- // this.ids +
|
|
|
- // '&keysAddr=' +
|
|
|
- // this.keysAddr +
|
|
|
- // '&charge=' +
|
|
|
- // this.charge +
|
|
|
- // '&address=' +
|
|
|
- // this.address +
|
|
|
- // '&way=' +
|
|
|
- // this.way +
|
|
|
- // '&waypath=' +
|
|
|
- // this.waypath
|
|
|
- });
|
|
|
- // this.$refs.popup.open();
|
|
|
+
|
|
|
},
|
|
|
close() {
|
|
|
this.$refs.popup.close();
|
|
|
},
|
|
|
- withdraw() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/finance/withdraw?logo=' + this.logo + '&name=' + this.name + '&code=' + this.code + '&money=' + this.price
|
|
|
- });
|
|
|
- },
|
|
|
navTo(url) {
|
|
|
uni.navigateTo({
|
|
|
url
|
|
@@ -437,9 +340,10 @@ page {
|
|
|
width: 100%;
|
|
|
background-color: #5771df;
|
|
|
color: #ffffff;
|
|
|
-
|
|
|
+ text-align: center;
|
|
|
.submit {
|
|
|
padding: 20rpx 20%;
|
|
|
+ flex-grow: 1;
|
|
|
}
|
|
|
|
|
|
.tip {
|