能量碎片接口页面处理
This commit is contained in:
@@ -82,7 +82,14 @@ const withdrawsIndexLists = (data) => {
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
// 能量碎片记录
|
||||
const userAccoutScores = (data) => {
|
||||
return request({
|
||||
url: 'user/account/scores',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
accountsCreate,
|
||||
@@ -93,5 +100,6 @@ export {
|
||||
withdrawsAccountsDelete,
|
||||
withdrawsIndexCreate,
|
||||
withdrawsIndex,
|
||||
withdrawsIndexLists
|
||||
withdrawsIndexLists,
|
||||
userAccoutScores
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<block v-if="list.length > 0">
|
||||
<view class="record--item" v-for="(item, index) in list" :key="index">
|
||||
<view class="record--item" v-for="(item, index) in list" :key="index" v-if="item">
|
||||
<view class="title ellipsis">{{item.hash || '-'}}</view>
|
||||
<view class="time ellipsis">{{item.block_time || '-'}}</view>
|
||||
<view class="webkit-box variation">
|
||||
|
||||
@@ -173,6 +173,7 @@
|
||||
duration: 3000
|
||||
})
|
||||
setTimeout(res => {
|
||||
uni.setStorageSync('refresh',true)
|
||||
uni.navigateBack({})
|
||||
}, 3000)
|
||||
}).catch(err => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="selectCard">
|
||||
<view class="bankInfo" v-for="(item,index) in lists" :key='index'
|
||||
<view class="bankInfo" v-if="lists.length>0" v-for="(item,index) in lists" :key='index'
|
||||
@longpress='delBank(item.bank_account_id,index)'>
|
||||
<image class="bankLogin" @click="selectBank(item)" :src="item.bank.cover" mode="widthFix" />
|
||||
<view class="right" @click="selectBank(item)">
|
||||
@@ -13,8 +13,10 @@
|
||||
</view>
|
||||
</view>
|
||||
<u-icon name="edit-pen-fill" @click='editBank(item.bank_account_id)' color="rgba(255,255,255,0.6)"
|
||||
size='60' />
|
||||
size='50' />
|
||||
</view>
|
||||
<!-- 无列表 -->
|
||||
<no-list v-if="lists.length === 0" name='no-shop' txt="没有任何提现银行 ~ " />
|
||||
<!-- <u-toast ref="uToast" /> -->
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
@@ -96,6 +98,10 @@
|
||||
withdrawsAccountsDelete(id).then(res => {
|
||||
console.log(res)
|
||||
that.lists.splice(index, 1)
|
||||
if(that.lists.length === 0){
|
||||
uni.navigateBack({})
|
||||
uni.setStorageSync('refresh',true)
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
title: err.message,
|
||||
@@ -147,7 +153,8 @@
|
||||
z-index: 1;
|
||||
|
||||
.bankLogin {
|
||||
width: 80rpx;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
opacity: .9;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
提现至银行卡
|
||||
<view class="right">
|
||||
<view class="cardName" v-if="bank_accounts === 0" @click="addBanks">添加银行卡</view>
|
||||
<view class="cardName" v-if='bank_accounts>0' @click="bankLists">{{bankInfo.name?bankInfo.name:'选择银行卡'}}</view>
|
||||
<view class="cardName" v-if='bank_accounts>0' @click="bankLists">{{bankInfo.name?bankInfo.name:'选择银行卡'}}
|
||||
</view>
|
||||
<uni-icons type="arrowright" size="12" color="#fff" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -29,9 +30,9 @@
|
||||
<view class="all" @click="all">全部提现</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total" v-if="total">≈ ¥{{total}} </view>
|
||||
<view class="total" v-if="total">≈ ¥{{total.toFixed(2)}} </view>
|
||||
<view class="btn" @click="actions">提现至银行卡</view>
|
||||
<view class="des">预计5- 10个工作日到账 手续费: {{tax}}%</view>
|
||||
<view class="des">预计5- 10个工作日到账 手续费: {{tax}}%</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -45,19 +46,22 @@
|
||||
return {
|
||||
balance: 0, // 钱包能量球数量
|
||||
tax: 0, // 当前手续费
|
||||
cost:1,// 每个能量球的价格
|
||||
total:0,// 约合人民币
|
||||
cost: 1, // 每个能量球的价格
|
||||
total: 0, // 约合人民币
|
||||
card: '', // 银行卡号
|
||||
withdraw_input: '', // 提现能量球数量
|
||||
bank_accounts: 0,
|
||||
bankInfo:{}
|
||||
bankInfo: {}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getInfo()
|
||||
},
|
||||
onReachBottom() {
|
||||
|
||||
onShow() {
|
||||
if (uni.getStorageSync('refresh')) {
|
||||
this.bankInfo = {}
|
||||
this.getInfo()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 提现基本信息
|
||||
@@ -67,6 +71,7 @@
|
||||
this.tax = res.tax
|
||||
this.cost = res.cost
|
||||
this.bank_accounts = res.bank_accounts.length
|
||||
uni.setStorageSync('refresh', false)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
@@ -104,35 +109,49 @@
|
||||
}
|
||||
},
|
||||
// 提现
|
||||
actions(){
|
||||
actions() {
|
||||
let data = {
|
||||
bank_account_id:this.bankInfo.bank_account_id,
|
||||
amount:Number(this.withdraw_input)
|
||||
bank_account_id: this.bankInfo.bank_account_id,
|
||||
amount: Number(this.withdraw_input)
|
||||
}
|
||||
if(data.bank_account_id === undefined || data.bank_account_id === null || data.bank_account_id === ''){
|
||||
if (data.bank_account_id === undefined || data.bank_account_id === null || data.bank_account_id === '') {
|
||||
uni.showToast({
|
||||
title:this.bank_accounts>0?'请选择银行卡':'请添加银行卡',
|
||||
icon:'none'
|
||||
title: this.bank_accounts > 0 ? '请选择银行卡' : '请添加银行卡',
|
||||
icon: 'none'
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (data.amount === 0) {
|
||||
uni.showToast({
|
||||
title: '请输入能量球数量',
|
||||
icon: 'none'
|
||||
})
|
||||
return;
|
||||
}
|
||||
uni.showModal({
|
||||
title:'温馨提示',
|
||||
content:'您是否确认提现,将会扣除' +this.tax+'%手续费' ,
|
||||
confirmColor:'#7c52fc',
|
||||
cancelColor:'#cacaca',
|
||||
cancelText:'我再想想',
|
||||
confirmText:'确认提现',
|
||||
title: '温馨提示',
|
||||
content: '您是否确认提现,将会扣除' + this.tax + '%手续费',
|
||||
confirmColor: '#7c52fc',
|
||||
cancelColor: '#cacaca',
|
||||
cancelText: '我再想想',
|
||||
confirmText: '确认提现',
|
||||
success: (res) => {
|
||||
if(res.confirm){
|
||||
withdrawsIndex(data).then(res=>{
|
||||
if (res.confirm) {
|
||||
uni.showLoading({
|
||||
title:'提交中'
|
||||
})
|
||||
withdrawsIndex(data).then(res => {
|
||||
uni.showToast({
|
||||
title:res.message,
|
||||
icon:'none'
|
||||
title: res,
|
||||
icon: 'none',
|
||||
duration:3000
|
||||
})
|
||||
this.withdraw_input = ''
|
||||
this.total = ''
|
||||
this.getInfo()
|
||||
setTimeout(res => {
|
||||
this.getInfo()
|
||||
uni.hideLoading()
|
||||
}, 3000)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
|
||||
@@ -10,11 +10,8 @@
|
||||
<view :class="['record-top-item',type==='day'?'selectTopItem':'']"
|
||||
@click="selectType('day')">日账单</view>
|
||||
</view>
|
||||
<view class="record-mouth-year">
|
||||
<view class="record-type-right">
|
||||
<view class="record-title">碎片个数</view>
|
||||
<view class="record-money">{{account || '0.00'}} <span>个</span> </view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="record-mouth-year">
|
||||
<view class="record-type-left">
|
||||
<u-picker mode="time" v-model="show" :params="params"
|
||||
@confirm ='confirm' title ='筛选日期' start-year='2021' :end-year='currentYear'/>
|
||||
@@ -23,9 +20,23 @@
|
||||
<uni-icons type="arrowdown" color="#fff" size="12" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="record-mouth-year">
|
||||
<view class="record-type-left">
|
||||
<u-picker mode="time" v-model="show" :params="params" @confirm ='confirm' title ='筛选日期' start-year='2021' :end-year='currentYear'/>
|
||||
<view @click="show = true">
|
||||
{{date?date:'选择日期'}}
|
||||
<uni-icons type="arrowdown" color="#fff" size="12" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="record-type-right">
|
||||
<view :class="['pay_type_item',cointype==='all'?'pay_type_item_select':'']" @click="selectCoinType('all')">全部</view>
|
||||
<view :class="['pay_type_item',cointype==='1'?'pay_type_item_select':'']" @click="selectCoinType('1')">待发放</view>
|
||||
<view :class="['pay_type_item',cointype==='0'?'pay_type_item_select':'']" @click="selectCoinType('0')">已发放</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="record-title">碎片个数</view>
|
||||
<view class="record-money"><span>¥</span>{{account || '0.00'}}</view> -->
|
||||
<view class="record-title">当前碎片个数</view>
|
||||
<view class="record-money">{{score || '0.00'}} <span>个</span></view>
|
||||
</view>
|
||||
|
||||
<!-- 列表。。。 -->
|
||||
@@ -34,10 +45,10 @@
|
||||
<image src="/static/imgs/record-icon.png" mode="widthFix" class="record-icon" />
|
||||
<view class="">
|
||||
<view class="record-list-item-top">
|
||||
<view class="title ellipsis-2">完成任务获得碎片</view>
|
||||
<view class="money" >{{cointype==='in'?'+':'-'}}5</view>
|
||||
<view class="title ellipsis-2">{{item.remark}}</view>
|
||||
<view class="money" >{{item.amount}}</view>
|
||||
</view>
|
||||
<view class="record-list-item-date">2021-12-22 12:12:12</view>
|
||||
<view class="record-list-item-date">{{item.created_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -50,15 +61,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {chaineb} from '@/apis/interfaces/mine';
|
||||
import {userAccoutScores} from '@/apis/interfaces/withdraws';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lists:[1,1.1,1,1],
|
||||
lists:[],
|
||||
has_next_page:true,
|
||||
page:1,
|
||||
type:'year', // 统计类型day日,month月,year年
|
||||
cointype:'in',// in 收入 out 支出
|
||||
date:new Date().toISOString().slice(0,4), // 日:Y-m-d,月Y-m,年Y
|
||||
params: {
|
||||
year: true,
|
||||
@@ -69,10 +79,11 @@
|
||||
currentDay:new Date().toISOString().slice(0,10),
|
||||
currentMonth:new Date().toISOString().slice(0,7),
|
||||
currentYear:new Date().toISOString().slice(0,4),
|
||||
account:''
|
||||
score:'',
|
||||
cointype:'all'
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
onShow(){
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom(){
|
||||
@@ -94,12 +105,13 @@
|
||||
page:this.page,
|
||||
type:this.type,
|
||||
date:this.date,
|
||||
cointype:this.cointype
|
||||
frozen:this.cointype
|
||||
}
|
||||
chaineb(data).then(res => {
|
||||
this.account = res.account
|
||||
this.lists = this.lists.concat(res.lists)
|
||||
this.has_next_page = res.has_next_page
|
||||
userAccoutScores(data).then(res => {
|
||||
console.log(res)
|
||||
this.score = res.score
|
||||
this.lists = this.lists.concat(res.lists.data)
|
||||
this.has_next_page = res.lists.page.has_more
|
||||
}).catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
title: err.message,
|
||||
@@ -149,8 +161,8 @@
|
||||
this.type = type
|
||||
this.params= {
|
||||
year: true,
|
||||
month: false,
|
||||
day: false
|
||||
month: true,
|
||||
day: true
|
||||
}
|
||||
this.date = this.currentDay
|
||||
this.reset()
|
||||
@@ -183,7 +195,7 @@
|
||||
<style lang="scss" scoped>
|
||||
.Record {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
padding-top: 30rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
@@ -224,6 +236,11 @@
|
||||
// padding-top: 20rpx;
|
||||
position: relative;
|
||||
top: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,14 +253,14 @@
|
||||
}
|
||||
.record-top {
|
||||
width: calc(100% - 60rpx);
|
||||
height: 360rpx;
|
||||
// height: 360rpx;
|
||||
background-image: linear-gradient(to right, #7c52fc, #976dff);
|
||||
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #976dff, $alpha: 0.4);
|
||||
margin: 0 30rpx;
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
padding: 10rpx 50rpx 20rpx 50rpx;
|
||||
padding: 30rpx 30rpx 50rpx 50rpx;
|
||||
z-index: 1;
|
||||
|
||||
.record-bg {
|
||||
@@ -283,7 +300,7 @@
|
||||
z-index: 2;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
// margin-top: 20rpx;
|
||||
|
||||
.record-type-left {
|
||||
display: flex;
|
||||
@@ -299,15 +316,14 @@
|
||||
|
||||
.record-type-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
font-size: 24rpx;
|
||||
flex: 1;
|
||||
|
||||
.pay_type_item {
|
||||
margin: 0 10rpx;
|
||||
// margin: 0 10rpx;
|
||||
padding: 2rpx 20rpx;
|
||||
border-radius: 30rpx;
|
||||
border: solid 1rpx rgba($color: #000000, $alpha: 0);
|
||||
@@ -322,6 +338,7 @@
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
padding:0 0 20rpx 0;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.record-money {
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
|
||||
<view class="propery-content">
|
||||
<view class="currency">能量球钱包
|
||||
<!-- <span>(≈ {{ price || '0.00' }} CNY)</span> -->
|
||||
<span>(≈ {{ price || '0.00' }} CNY)</span>
|
||||
</view>
|
||||
<view class="balance">{{ balance.balance || '0.00' }}</view>
|
||||
<view class="frozen">{{ balance.frozen || '0.00' }} 冻结中</view>
|
||||
<!-- <view class="frozen">{{ balance.frozen || '0.00' }} 冻结中</view> -->
|
||||
<view class="balance-flex">
|
||||
<view class="balance-flex-item" @click="showAddress">区块链地址</view>
|
||||
<!-- <view class="balance-flex-item" @click="showPrivatekey('privatekey')">我的私钥</view> -->
|
||||
@@ -71,23 +71,12 @@
|
||||
onShow() {
|
||||
this.getsum()
|
||||
this.getlog()
|
||||
this.getprice()
|
||||
},
|
||||
methods: {
|
||||
getsum() {
|
||||
sum().then(res => {
|
||||
this.balance = res
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err.message
|
||||
})
|
||||
})
|
||||
},
|
||||
getprice() {
|
||||
price().then(res => {
|
||||
console.log(res,'87..........')
|
||||
this.price = res
|
||||
this.price = res.price
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
@@ -97,7 +86,6 @@
|
||||
},
|
||||
getlog() {
|
||||
logs().then(res => {
|
||||
console.log(res,'98 ...........')
|
||||
this.logs = res
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
|
||||
Reference in New Issue
Block a user