我的零钱提现银行卡添加银行卡]

This commit is contained in:
2021-10-18 16:26:24 +08:00
parent a9e877c850
commit f53fcec0a9
21 changed files with 9263 additions and 13 deletions

167
apis/interfaces/wallet.js Normal file
View File

@@ -0,0 +1,167 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 钱包
*/
import {request} from '../index.js'
// 导出助记词
const seed = () => {
return request({
url: 'chain/safe/seed'
})
}
const hash = (data) => {
return request({
url: 'chain/wallet/hash',
method: 'POST',
data: data
})
}
// 收款码
const code = () => {
return request({
url: 'chain/account/code'
})
}
// 原石余额
const sum = () => {
return request({
url: 'chain/account/balance'
})
}
// 原石价格
const price = () => {
return request({
url: 'nodes/price'
})
}
// 账户记录
const logs = (data) => {
return request({
url: 'chain/account/logs',
data: data
})
}
// 设置安全密码
const security = (data) => {
return request({
url: 'chain/safe/security',
method: 'POST',
data
})
}
// 转账
const transfer = (data) => {
return request({
url: 'chain/account/transfer',
method: 'POST',
data
})
}
// 钱包私钥
const privatekey = (code) => {
return request({
url : "chain/safe/private_key",
data: {
code
}
})
}
// 获取可提现信息
const withdraw = () => {
return request({
url : "withdraw"
})
}
// 提现记录
const withdrawLogs = (data) => {
return request({
url : "withdraw/logs",
data:data
})
}
// 提现
const withdrawDo = (data) => {
return request({
url : "withdraw",
method: 'POST',
data:data
})
}
// 验证支付密码是否正确
const securityCheck = (password) => {
return request({
url : "chain/safe/security/check",
method: 'POST',
data:{
code : password,
}
})
}
// 修改密码
const securityReset = (data) => {
return request({
url : "chain/safe/security",
method: 'PUT',
data:data
})
}
// 提现服务条款
const cmsWithdraw = () => {
return request({
url : "cms/withdraw"
})
}
// 私钥规则
const keyrules = () => {
return request({
url: 'cms/keyrules'
})
}
// 能量球转红包前置,获取能量球的基本信息
const accountCashs = (data) => {
return request({
url: 'user/account/cashs',
data:data
})
}
export {
seed,
hash,
code,
sum,
price,
logs,
security,
transfer,
privatekey,
withdraw,
withdrawLogs,
withdrawDo,
securityCheck,
securityReset,
cmsWithdraw,
keyrules,
accountCashs
}

View File

@@ -0,0 +1,123 @@
/**
* zdx
* moduleName: 提现模块
*/
import {
request
} from '../index.js'
// 添加前置条件
const accountsCreate = () => {
return request({
url: 'withdraws/accounts/create'
})
}
// 添加银行卡
const withdrawsAccounts = (data) => {
return request({
url: 'withdraws/accounts',
method: 'POST',
data: data
})
}
// 银行卡列表
const withdrawsAccountsList = (data) => {
return request({
url: 'withdraws/accounts',
method: 'get',
data: data
})
}
// 编辑银行卡前置
const accountsCreateEdit = (id) => {
return request({
url: 'withdraws/accounts/'+id+'/edit'
})
}
// 编辑银行卡
const withdrawsAccountsEdits = (data) => {
return request({
url: 'withdraws/accounts/'+data.bank_account_id,
method: 'PUT',
data: data
})
}
// 删除银行卡
const withdrawsAccountsDelete = (id) => {
return request({
url: 'withdraws/accounts/'+id,
method: 'DELETE'
})
}
// 提现前置记录
const withdrawsIndexCreate = () => {
return request({
url: 'withdraws/index/create'
})
}
// 提现接口
const withdrawsIndex = (data) => {
return request({
url: 'withdraws/index',
method: 'POST',
data: data
})
}
// 提现记录
const withdrawsIndexLists = (data) => {
return request({
url: 'withdraws/index',
method: 'get',
data: data
})
}
// 能量碎片记录
const userAccoutScores = (data) => {
return request({
url: 'user/account/scores',
method: 'get',
data: data
})
}
// 能量球转红包前置
const cashsCreate = () => {
return request({
url: 'user/account/cashs/create',
method: 'get'
})
}
// 能量球转红包
const accountCashs = (data) => {
return request({
url: 'user/account/cashs',
method: 'POST',
data: data
})
}
export {
accountsCreate,
withdrawsAccounts,
withdrawsAccountsList,
accountsCreateEdit,
withdrawsAccountsEdits,
withdrawsAccountsDelete,
withdrawsIndexCreate,
withdrawsIndex,
withdrawsIndexLists,
userAccoutScores,
accountCashs,
cashsCreate
}

View File

@@ -0,0 +1,129 @@
<template>
<view>
<block v-if="list.length > 0">
<view class="record--item" v-for="(item, index) in list" :key="index" v-if="item && !hash">
<view class="title ellipsis-1">{{item.rule.title}} <span> {{item.coin?' ('+item.coin+'个能量球) ':''}} </span></view>
<view class="time ellipsis-1">{{item.created_at || '-'}}</view>
<view class="webkit-box variation">
<view class="ellipsis" :class="item.amount<0 ? 'add': 'remove'">{{item.amount}}</view>
<view class="symbol">{{item.amount>0?'现金红包收入':'现金红包支出'}}</view>
</view>
</view>
<view class="record--item record--item1" v-for="(item, index) in list" :key="index" v-if="item && hash">
<view class="title ellipsis-1">{{item.hash}}</view>
<view class="time ellipsis-1">{{item.block_time || '-'}}</view>
<view class="webkit-box variation">
<view class="ellipsis" :class="item.is_in ? 'add': 'remove'">
{{item.is_in ? '+': '-'}}{{item.amount}}</view>
<view class="symbol">{{item.assets.symbol}}</view>
</view>
</view>
</block>
<block v-else>
<no-list v-if='logsType === ""' name='no-record' txt="没有任何记录~" />
<no-list v-if='logsType === "in"' name='no-in' txt="没有任何收入记录~" />
<no-list v-if='logsType === "out"' name='no-out' txt="没有任何支出记录~" />
</block>
</view>
</template>
<script>
export default {
name: "property",
props: {
list: {
type: Array,
default: () => {
return []
}
},
logsType: {
type: String
},
hash: {
type: Boolean
}
},
data() {
return {
};
}
}
</script>
<style lang="scss" scoped>
.record--item1 {
padding: $padding 330rpx $padding 0 !important;
}
.record--item {
padding: $padding 220rpx $padding 0;
border-bottom: solid 1rpx #f7f7f7;
position: relative;
min-height: 50rpx;
.variation {
position: absolute;
right: 0;
top: $margin;
bottom: $margin;
width: 300rpx;
text-align: right;
font-weight: bold;
&>label {
font-size: 80%;
}
.symbol {
color: #666;
font-weight: normal;
font-size: $title-size-m;
}
.add {
color: $mian-color;
font-size: 36rpx;
}
.remove {
font-size: 36rpx;
color: $mian-color;
}
}
.title {
line-height: 50rpx;
font-size: 30rpx;
word-break: break-word;
span{
font-size: 24rpx;
color: #999;
}
}
.time {
font-size: 26rpx;
color: #999;
padding-top: 6rpx;
}
}
// 数据空
.record--null {
padding-top: $padding * 3;
text-align: center;
color: $mian-color;
font-size: $title-size;
height: 50vh;
box-sizing: border-box;
line-height: 60rpx;
image {
width: 168rpx;
}
}
</style>

View File

@@ -64,7 +64,7 @@
<view class="text">转让权证</view>
</view> -->
<view class="general-item">
<view class="number">{{wordData.top.barter_total.toFixed(2) || 0}}</view>
<view class="number">{{wordData.top.order_total.toFixed(2) || 0}}</view>
<view class="text">总交易额</view>
</view>
<view class="general-item" @click="$Router.push({name: 'GoodsMag'})">

View File

@@ -0,0 +1,18 @@
export default function h5Copy(content) {
if (!document.queryCommandSupported('copy')) {
// 不支持
return false
}
let textarea = document.createElement("textarea")
textarea.value = content
textarea.readOnly = "readOnly"
document.body.appendChild(textarea)
textarea.select() // 选择对象
textarea.setSelectionRange(0, content.length) //核心
let result = document.execCommand("copy") // 执行浏览器复制命令
textarea.remove()
return result
}

View File

@@ -657,6 +657,83 @@
}]
}
}
},
{
"path": "pages/wallet/property",
"name": "walletProperty",
"style": {
"navigationBarTitleText": "能量钱包",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor":"#e93340"
}
}, {
"path": "pages/wallet/redProperty",
"name": "walletRedProperty",
"style": {
"navigationBarTitleText": "现金红包",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor":"#e93340"
}
},
{
"path": "pages/wallet/extract",
"name": "Extract",
"style": {
"navigationBarTitleText": "原石转零钱",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#e93340",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/wallet/extractRed",
"name": "ExtractRed",
"style": {
"navigationBarTitleText": "我的零钱",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#e93340",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/wallet/fragment",
"name": "Fragment",
"style": {
"navigationBarTitleText": "贡献值记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#e93340",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/wallet/addBank",
"style": {
"navigationBarTitleText": "添加银行卡",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#e93340",
"navigationBarTextStyle": "white"
},
"name": "addBank"
}, {
"path": "pages/wallet/bankList",
"style": {
"navigationBarTitleText": "银行卡列表",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#e93340",
"navigationBarTextStyle": "white"
},
"name": "bankList"
}, {
"path": "pages/wallet/withdrawList",
"style": {
"navigationBarTitleText": "零钱提现记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#e93340",
"navigationBarTextStyle": "white"
},
"name": "withdrawList"
}
],
"tabBar": {
@@ -688,7 +765,7 @@
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "易货",
"navigationBarTitleText": "易货-易你所想",
"navigationBarBackgroundColor": "#f5f5f5",
"backgroundColor": "#f5f5f5"
},

View File

@@ -48,7 +48,7 @@
<view class="item-num">{{base.account.eb}}</view>
<view class="item-title">当前易币</view>
</view>
<view class="item" @click="showToast">
<view class="item" @click="$Router.push({name:'ExtractRed'})">
<view class="item-num">{{base.account.money}}</view>
<view class="item-title">零钱</view>
</view>

335
pages/wallet/addBank.vue Normal file
View File

@@ -0,0 +1,335 @@
<template>
<view class="WithdrawingCoin">
<view class="withdrawing-content">
<view class="item-name">{{bank_account_id===''?'添加':'编辑'}}提现银行</view>
<view class="item">
<view class="title">收款人姓名</view>
<input class="input_num" v-model="name" maxlength="13" placeholder="请输入收款人姓名"
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" />
</view>
<view class="item">
<view class="title">收款人手机号</view>
<input class="input_num" v-model="mobile" maxlength="11" placeholder="请输入手机号"
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" />
</view>
<view class="item">
<view class="title">开户行</view>
<u-select v-model="bankShow" value-name='id' :default-value='[0]' label-name='name'
@confirm='selectBank' :list="banks" />
<view class="input_num" @click="bankShow = true">
{{selectBankObj.label?selectBankObj.label:'请选择开户行'}}
</view>
</view>
<view class="item">
<view class="title">收款人账号</view>
<input class="input_num" v-model="no" maxlength="20" type="number" placeholder="请输入收款人账号"
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" />
</view>
<view class="item">
<view class="title">支行名称</view>
<input class="input_num" v-model="branch_name" maxlength="20" placeholder="省-市-区-支行名称"
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;" />
</view>
</view>
<view class="btn" @click="sureAdd">确认{{bank_account_id===''?'添加':'编辑'}}银行</view>
<view class="history" @click="$Router.push({name:'withdrawList'})">提现记录
<u-icon name="question-circle-fill" />
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
accountsCreate,
withdrawsAccounts,
accountsCreateEdit,
withdrawsAccountsEdits
} from '@/apis/interfaces/withdraws'
export default {
data() {
return {
no: '', // 银行卡号
name: '', // 用户姓名
branch_name: '', // 支行名称
mobile: '', // 手机号
bank_id: '', // 银行卡id
banks: [], // 开户行列表
bankShow: false, // 显示开户行列表
selectBankObj: {}, // 选择银行
bank_account_id:''
};
},
onLoad(e) {
// 有id 是编辑
if (e.id) {
this.bank_account_id = e.id
this.getAccountsCreateEdit()
} else {
this.getAccountsCreate()
}
},
methods: {
// 获取添加银行前置条件
getAccountsCreate() {
accountsCreate().then(res => {
console.log(res)
this.banks = res.banks
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
// 编辑前置
getAccountsCreateEdit() {
accountsCreateEdit(this.bank_account_id).then(res => {
console.log(res)
this.banks = res.banks
this.no = res.info.no
this.name = res.info.name
this.mobile = res.info.mobile
this.branch_name = res.info.branch_name
this.selectBankObj.label = res.info.bank.name
this.bank_id = res.info.bank.id
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
// 选择银行
selectBank(e) {
console.log(e[0])
this.selectBankObj = e[0]
this.bank_id = e[0].value
},
sureAdd() {
let data = {
no: this.no, // 银行卡号
name: this.name, // 用户姓名
branch_name: this.branch_name, // 支行名称
mobile: this.mobile, // 手机号
bank_id: this.bank_id, // 银行卡id
}
if (data.name === '') {
this.$refs.uToast.show({
title: '请核对收款人姓名',
type: 'primary',
duration: 3000
})
return;
}
if (data.mobile.length !== 11) {
this.$refs.uToast.show({
title: '请核对收款人手机号',
type: 'primary',
duration: 3000
})
return;
}
if (data.bank_id === '') {
this.$refs.uToast.show({
title: '请勾选开户行',
type: 'primary',
duration: 3000
})
return;
}
if (data.no === '') {
this.$refs.uToast.show({
title: '请核对收款账号',
type: 'primary',
duration: 3000
})
return;
}
if (data.branch_name === '') {
this.$refs.uToast.show({
title: '请核对省-市-区-支行名称',
type: 'primary',
duration: 3000
})
return;
}
if (this.bank_account_id) {
data.bank_account_id = this.bank_account_id
console.log(data)
this.withdrawsAccountsEdits(data)
} else {
this.withdrawsAccounts(data)
}
},
// 添加银行
withdrawsAccounts(data) {
withdrawsAccounts(data).then(res => {
this.$refs.uToast.show({
title: res,
type: 'primary',
duration: 3000
})
setTimeout(res => {
uni.setStorageSync('refresh',true)
uni.navigateBack({})
}, 3000)
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
// 编辑银行卡银行
withdrawsAccountsEdits(data) {
withdrawsAccountsEdits(data).then(res => {
this.$refs.uToast.show({
title: res,
type: 'primary',
duration: 3000
})
uni.setStorageSync('refresh',true)
setTimeout(res => {
uni.navigateBack({})
}, 3000)
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
}
}
}
</script>
<style lang="scss">
page {
width: 100%;
min-height: 100vh;
background-color: #fff;
}
.history {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
color: #cacaca;
.u-icon {
margin-left: 10rpx;
}
}
.withdrawing-content {
min-height: 300rpx;
background-color: #fff;
box-shadow: 0 0 30rpx 1rpx rgba($color: #000000, $alpha: 0.2);
margin: $margin;
border-radius: 20rpx;
padding: $padding;
font-size: $title-size-m;
.item-name {
text-align: center;
padding: $padding * .6;
color: #303030;
font-weight: bold;
margin-bottom: $margin;
font-size: $title-size *1.2;
position: relative;
&::after {
content: '';
position: absolute;
background-color: rgba($color: $text-price, $alpha: .4);
width: 200rpx;
height: 10rpx;
left: 50%;
margin-left: -100rpx;
bottom: 16rpx;
z-index: 1;
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #e93340, $alpha: 0.6);
}
}
.item {
border-bottom: solid 1rpx #f8f8f8;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
padding: $padding 0;
span:nth-child(1) {
color: #666;
margin-right: 20rpx;
}
.title {
width: 200rpx;
font-size: 28rpx;
&::before {
content: '*';
color: red;
padding-right: 4rpx;
}
}
.input_num {
font-size: 30rpx;
color: #3a3a3a;
// font-weight: bolder;
flex: 1;
margin-left: 20rpx;
}
}
.item-total {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: $padding*1 0 0 0;
color: #3a3a3a;
.total {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
.money {
padding-top: $padding *0.5;
}
}
.lists {
color: $text-price;
}
}
}
.btn {
background-image: linear-gradient(to right, #e93340, #e93340);
color: #fff;
border-radius: 10rpx;
text-align: center;
padding: $padding * .9;
margin: $margin*3 $margin * 2 $margin $margin*2;
font-size: $title-size;
font-weight: bold;
letter-spacing: 2rpx;
}
</style>

258
pages/wallet/bankList.vue Normal file
View File

@@ -0,0 +1,258 @@
<template>
<view class="selectCard">
<view class="demo" v-if="lists.length>0"><u-icon name="info-circle-fill" label-color='#cacaca' color='#cacaca' label='长按删除添加银行卡'/></view>
<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)">
<view class="left">
<view class="title">{{item.bank.name}}
<view class="tags">快捷支付</view>
</view>
<view class="des">储值卡</view>
<view class="no">{{item.no}}</view>
</view>
</view>
<u-icon name="edit-pen-fill" @click='editBank(item.bank_account_id)' color="rgba(255,255,255,0.6)"
size='50' />
</view>
<!-- 底部新增按钮 -->
<view class="addBtn" @click="$Router.push({ name: 'addBank'})">
<u-icon name="plus" label-pos='bottom' color='#fff' label-color='#fff' label='新增' />
</view>
<!-- 无列表 -->
<no-list v-if="lists.length === 0" name='no-shop' txt="没有任何提现银行 ~ " />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
withdrawsAccountsList,
withdrawsAccountsDelete
} from '@/apis/interfaces/withdraws'
export default {
data() {
return {
lists: [],
page: 1,
has_more: true
}
},
onLoad() {
this.withdrawsAccountsList()
},
onShow() {
if (uni.getStorageSync('refresh')) {
this.lists = []
this.page = 1
this.has_more = true
this.withdrawsAccountsList()
}
},
onReachBottom() {
if (this.has_more) {
this.page = this.page + 1
this.withdrawsAccountsList()
} else {
this.$refs.uToast.show({
title: '哎呦,没有更多了~',
type: 'primary',
duration: 3000
})
}
},
methods: {
// 添加银行
withdrawsAccountsList() {
let data = {
page: this.page
}
withdrawsAccountsList(data).then(res => {
console.log(res)
this.lists = this.lists.concat(res.data)
this.has_more = res.page.has_more
uni.setStorageSync('refresh', false)
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
},
// 跳转到编辑银行卡的页面
editBank(id) {
this.$Router.push({
name: 'addBank',
params: {
id: id
}
})
},
// 删除银行
delBank(id, index) {
let that = this
uni.showModal({
title: '温馨提示',
content: '是否确认删除该银行',
cancelColor: '#cacaca',
cancelText: '我再想想',
confirmColor: '#e93340',
confirmText: '确认删除',
success(res) {
if (res.confirm) {
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 => {
that.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
}
}
})
},
// 选择银行返回上一页携带参数
selectBank(item) {
let bankInfo = {
name: item.bank.name + '-' + item.no.substring(item.no.length - 4),
bank_account_id: item.bank_account_id
}
let pages = getCurrentPages()
let prevPage = pages[pages.length - 2]
console.log(bankInfo)
prevPage._data.bankInfo = bankInfo
uni.navigateBack() //返回上一页面
}
}
}
</script>
<style lang="scss" scoped>
.addBtn{
position: fixed;
bottom: 0;
margin: 40rpx;
text-align: center;
width: 130rpx;
height: 130rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
border-radius: 50%;
z-index: 100;
right: 0;
box-shadow: 0 0 20rpx 20rpx rgba($color: #fff, $alpha: .5);
background-image: linear-gradient(to right, #e93340, #e93340);
}
.selectCard {
width: 100%;
min-height: 100vh;
padding-top: 30rpx;
background-color: #fff;
padding-bottom: 80rpx;
.demo{
color: #cacaca;
font-size: 26rpx;
text-align: center;
}
.bankInfo {
width: calc(100% - 60rpx);
background-image: linear-gradient(to right, #e93340, #e93340);
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #e93340, $alpha: 0.6);
margin: 20rpx 30rpx 0 30rpx;
border-radius: 20rpx;
box-sizing: border-box;
position: relative;
padding: 40rpx 30rpx;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
z-index: 1;
.bankLogin {
width: 70rpx;
height: 70rpx;
opacity: .9;
}
.right {
flex: 1;
margin-left: 20rpx;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
box-sizing: border-box;
color: rgba($color: #fff, $alpha: .9);
position: relative;
z-index: 1;
.u-icon {
position: absolute;
background-color: pink;
z-index: 100;
right: 0;
}
.left {
flex: 1;
.title {
font-size: 38rpx;
font-weight: bold;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
.tags {
color: $text-price;
font-size: 24rpx;
margin-left: 20rpx;
padding: 4rpx 14rpx;
position: relative;
display: inline-block;
color: #e93340;
&::before {
background: rgba($color: #fff, $alpha: .8);
z-index: -1;
position: absolute;
content: '';
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: skewX(-10deg);
}
}
}
.des {
font-size: 28rpx;
margin-top: 14rpx;
}
.no {
font-size: 36rpx;
font-weight: bold;
margin-top: 20rpx;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,50 @@
<template>
<view>
<view class="clauseCont">
<rich-text :nodes="clauseData"></rich-text>
</view>
</view>
</template>
<script>
import {
cmsWithdraw
} from '@/apis/interfaces/wallet.js'
export default {
data() {
return {
clauseData: [] //服务条款
};
},
onLoad() {
// 获取服务条款
this.clauseInfo()
},
methods: {
// 服务条款
clauseInfo() {
cmsWithdraw().then(res => {
this.clauseData = res.content.replace(/\<img/gi,
'<img style="max-width:100%; height:auto; vertical-align: top;"')
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
}
}
</script>
<style lang="scss">
page {
background-color: $uni-bg-color;
}
.clauseCont {
padding: $padding + 10 $padding * 2;
width: 100%;
box-sizing: border-box;
}
</style>

371
pages/wallet/extract.vue Normal file
View File

@@ -0,0 +1,371 @@
<template>
<view class="WithdrawingCoin ">
<view class="propery">
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
<view class="propery-content">
<view class="currency">能量球钱包
<span>( {{ cost || '0.00' }} CNY)</span>
</view>
<view class="balance">{{ balance || '0.00' }}</view>
<!-- <view class="frozen" @click="withdrawDetail">提现记录</view> -->
</view>
</view>
<view class="withdrawing-content">
<view class="item">
<view style="flex: 1;">
<view class="inputTxt">提现数量</view>
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number"
placeholder-style="color:#999;font-weight:normal; font-size:34rpx;"
placeholder="请输入提现数量" :disabled="balance===0" />
</view>
<view class="all" @click="all">全部提现</view>
</view>
</view>
<view class="total" v-if="total"> {{total.toFixed(2)}} </view>
<view class="btn" @click="actions">提现至现金红包</view>
<view class="des">提现至红包可在红包中提现到银行卡 手续费: </view>
</view>
</template>
<script>
import {
cashsCreate,
accountCashs,
withdrawsIndexCreate,
withdrawsIndex
} from '@/apis/interfaces/withdraws';
export default {
data() {
return {
balance: 0, // 钱包能量球数量
tax: 0, // 当前手续费
cost: 1, // 每个能量球的价格
total: 0, // 约合人民币
card: '', // 银行卡号
withdraw_input: '', // 提现能量球数量
bank_accounts: 0,
bankInfo: {}
};
},
onLoad() {
this.getInfo()
},
onShow() {
if (uni.getStorageSync('refresh')) {
this.bankInfo = {}
this.getInfo()
}
},
methods: {
// 提现基本信息
getInfo() {
cashsCreate().then(res => {
this.withdraw_input = Number(res.balance)
this.balance = res.balance
this.cost = res.cost
this.total = Number(res.balance) * Number(res.cost)
uni.setStorageSync('refresh', false)
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
// 输入提现能量球数量
inputNum(e) {
let number = Number(e.detail.value)
if (number <= Number(this.balance)) {
this.total = Number(e.detail.value) * this.cost
} else {
this.total = 0
if (Number(this.balance) === 0) {
uni.showToast({
title: '当前不能提现',
icon: 'none',
duration: 2000
});
this.withdraw_input = 0
this.total = 0
} else {
uni.showToast({
title: '最大值能超过' + this.balance + '',
icon: 'none',
duration: 2000
});
this.withdraw_input = this.balance
this.total = this.balance * this.cost
}
}
},
// 点击全部
all() {
if (this.balance > 0) {
this.withdraw_input = this.balance
this.total = this.balance * this.cost
} else {
uni.showToast({
title: '啥也没有,我也做不到~',
icon: 'none',
duration: 2000
})
this.withdraw_input = 0
}
},
// 提现
actions() {
let data = {
amount: Number(this.withdraw_input)
}
if (data.amount === 0) {
uni.showToast({
title: '请输入能量球数量',
icon: 'none'
})
return;
}
uni.showModal({
title: '温馨提示',
content:'您是否确认提现到现金红包账户,交易将免手续费',
confirmColor: '#7c52fc',
cancelColor: '#cacaca',
cancelText: '我再想想',
confirmText: '确认提现',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '提交中'
})
accountCashs(data).then(res => {
uni.showToast({
title: res,
icon: 'none',
duration: 3000
})
this.withdraw_input = ''
this.total = ''
setTimeout(res => {
this.getInfo()
uni.hideLoading()
}, 3000)
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}
}
})
},
// 提现记录
withdrawDetail() {
this.$Router.push({
name: 'withdrawList'
})
}
}
}
</script>
<style lang="scss">
page {
width: 100%;
min-height: 100vh;
background-color: #f7f7f7;
}
.receiptCode {
color: #808080;
text-align: left;
// margin: $margin 0;
font-size: $title-size-m;
}
.WithdrawingCoin {
background-color: #f7f7f7;
width: 100%;
min-height: 100vh;
padding-bottom: 100rpx;
// 账户
.propery {
position: relative;
padding-top: var(--status-bar-height);
background-image: linear-gradient(to top, #7c52fc, #976dff);
position: relative;
overflow: hidden;
.record-bg {
position: absolute;
width: 120%;
height: 300rpx;
bottom: -50rpx;
right: -20rpx;
z-index: 1;
opacity: .5;
transform: rotate(-7deg);
}
.propery-content {
position: relative;
z-index: 1;
padding: $padding/2 $padding $padding*3;
text-align: center;
.currency {
font-size: $title-size-m;
color: rgba($color: white, $alpha: .8);
}
.balance {
font-size: $title-size * 2.5;
padding: $padding 0;
color: white;
}
.frozen {
background: rgba($color: #000000, $alpha: .1);
color: rgba($color: white, $alpha: .7);
display: inline-block;
font-size: 24rpx;
padding: 6rpx $padding;
border-radius: 20rpx;
border: solid 1rpx rgba($color: white, $alpha: .4)
}
}
}
}
.all {
color: $text-price;
width: 160rpx;
text-align: center;
}
.item-name {
text-align: center;
color: #303030;
font-weight: bold;
margin-bottom: $margin;
font-size: 30rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
background-image: linear-gradient(to right, #aaaaff, #aaaaff);
color: #fff;
margin: 30rpx;
padding: 30rpx;
.right {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
font-size: 34rpx;
.cardName {
flex: 1;
}
}
}
.withdrawing-content {
background-color: #fff;
padding: $padding $padding $padding $padding * 2;
font-size: $title-size-m;
/* 绑定银行卡 */
.bank-card {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 45rpx 0 35rpx;
}
.item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
padding: 20rpx 0;
span:nth-child(1) {
color: #666;
margin-right: 20rpx;
}
.inputTxt {
color: #999;
padding-bottom: 20rpx;
}
.input_num {
font-size: 60rpx;
color: #3a3a3a;
font-weight: bolder;
flex: 1;
}
}
.item-total {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: $padding*1 0 0 0;
color: #3a3a3a;
.total {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
.money {
padding-top: $padding *0.5;
}
}
.lists {
color: $text-price;
}
}
}
.btn {
background-image: linear-gradient(to right, #7c52fc, #976dff);
color: #fff;
border-radius: 10rpx;
text-align: center;
padding: $padding * .9;
margin: $margin * 3 $margin *2 $margin $margin*2;
font-size: $title-size;
font-weight: bold;
}
.des {
text-align: center;
color: #cacaca;
font-size: 26rpx;
}
.total {
color: $mian-color;
margin-top: 20rpx;
margin-left: 50rpx;
font-size: 36rpx;
}
</style>

404
pages/wallet/extractRed.vue Normal file
View File

@@ -0,0 +1,404 @@
<template>
<view class="WithdrawingCoin ">
<view class="propery">
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
<view class="propery-content">
<view class="currency">可提现额度</view>
<view class="balance">{{ balance || '0.00' }}</view>
<view class="frozen" @click="withdrawDetail">提现记录</view>
</view>
</view>
<view class="item-name">
提现至银行卡
<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>
<uni-icons type="arrowright" size="12" color="#fff" />
</view>
</view>
<view class="withdrawing-content">
<view class="item">
<view style="flex: 1;">
<view class="inputTxt">提现金额</view>
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number"
placeholder-style="color:#999;font-weight:normal; font-size:34rpx;"
placeholder="请输入提现金额" :disabled="balance===0" />
</view>
<view class="all" @click="all">全部提现</view>
</view>
</view>
<view class="total" v-if="total">≈ ¥{{total.toFixed(2)}} </view>
<view class="btn" @click="actions">提现至银行卡</view>
<view class="des">预计5- 10个工作日到账 手续费: {{tax === '0'?'免手续费':tax+'%'}}</view>
</view>
</template>
<script>
import {
withdrawsIndexCreate,
withdrawsIndex
} from '@/apis/interfaces/withdraws';
export default {
data() {
return {
balance: 0, // 钱包能量球金额
tax: 0, // 当前手续费
cost: 1, // 每个能量球的价格
total: 0, // 约合人民币
card: '', // 银行卡号
withdraw_input: '', // 提现能量球金额
bank_accounts: 0,
bankInfo: {}
};
},
onLoad() {
this.getInfo()
},
onShow() {
if (uni.getStorageSync('refresh')) {
this.bankInfo = {}
this.getInfo()
}
},
methods: {
// 提现基本信息
getInfo() {
withdrawsIndexCreate().then(res => {
this.balance = res.balance
this.tax = res.tax
this.cost = res.cost
this.bank_accounts = res.bank_accounts.length
this.withdraw_input = Number(res.balance)
this.total = Number(res.balance) * Number(res.cost)
uni.setStorageSync('refresh', false)
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
// 输入提现能量球金额
inputNum(e) {
let number = Number(e.detail.value)
console.log(number, this.balance)
if (number <= Number(this.balance)) {
this.total = Number(e.detail.value) * this.cost
} else {
this.total = 0
if (Number(this.balance) === 0) {
uni.showToast({
title: '当前不能提现',
icon: 'none',
duration: 2000
});
this.withdraw_input = 0
this.total = 0
} else {
uni.showToast({
title: '最大值能超过' + this.balance + '',
icon: 'none',
duration: 2000
});
this.withdraw_input = this.balance
this.total = this.balance * this.cost
}
}
},
// 点击全部
all() {
if (this.balance > 0) {
this.withdraw_input = this.balance
this.total = this.balance * this.cost
} else {
uni.showToast({
title: '啥也没有我也做不到~',
icon: 'none',
duration: 2000
})
this.withdraw_input = 0
}
},
// 提现
actions() {
let data = {
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 === '') {
uni.showToast({
title: this.bank_accounts > 0 ? '请选择银行卡' : '请添加银行卡',
icon: 'none'
})
return;
}
if (data.amount === 0) {
uni.showToast({
title: '请输入能量球金额',
icon: 'none'
})
return;
}
uni.showModal({
title: '温馨提示',
content:this.tax === '0'?'您是否确认提现交易将免手续费':'您是否确认提现将会扣除' + this.tax + '%手续费',
confirmColor: '#e93340',
cancelColor: '#cacaca',
cancelText: '我再想想',
confirmText: '确认提现',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '提交中'
})
withdrawsIndex(data).then(res => {
uni.showToast({
title: res,
icon: 'none',
duration: 3000
})
this.withdraw_input = ''
this.total = ''
setTimeout(res => {
this.getInfo()
uni.hideLoading()
uni.setStorageSync('refresh',true)
}, 3000)
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}
}
})
},
// 添加银行卡
addBanks() {
this.$Router.push({
name: 'addBank'
})
},
// 选择银行卡
bankLists() {
this.$Router.push({
name: 'bankList'
})
},
// 提现记录
withdrawDetail() {
this.$Router.push({
name: 'withdrawList'
})
}
}
}
</script>
<style lang="scss">
page {
width: 100%;
// min-height: 100vh;
background-color: #f7f7f7;
}
.receiptCode {
color: #808080;
text-align: left;
// margin: $margin 0;
font-size: $title-size-m;
}
.WithdrawingCoin {
background-color: #f7f7f7;
width: 100%;
// min-height: 100vh;
padding-bottom: 100rpx;
// 账户
.propery {
position: relative;
padding-top: var(--status-bar-height);
background-image: linear-gradient(to bottom, #e93340, #e93340);
position: relative;
overflow: hidden;
.record-bg {
position: absolute;
width: 120%;
height: 300rpx;
bottom: -50rpx;
right: -20rpx;
z-index: 1;
opacity: .5;
transform: rotate(-7deg);
}
.propery-content {
position: relative;
z-index: 1;
padding: $padding/2 $padding $padding*3;
text-align: center;
.currency {
font-size: $title-size-m;
color: rgba($color: white, $alpha: .8);
}
.balance {
font-size: $title-size * 2.5;
padding: $padding 0;
color: white;
}
.frozen {
background: rgba($color: #000000, $alpha: .1);
color: rgba($color: white, $alpha: .7);
display: inline-block;
font-size: 24rpx;
padding: 6rpx $padding;
border-radius: 20rpx;
border: solid 1rpx rgba($color: white, $alpha: .4)
}
}
}
}
.all {
color: $text-price;
width: 160rpx;
text-align: center;
}
.item-name {
text-align: center;
color: #303030;
font-weight: bold;
margin-bottom: $margin;
font-size: 30rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
background-image: linear-gradient(to right, #e97a76, #e97a76);
color: #fff;
margin: 30rpx;
padding: 30rpx;
.right {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
font-size: 34rpx;
.cardName {
flex: 1;
}
}
}
.withdrawing-content {
background-color: #fff;
padding: $padding $padding $padding $padding * 2;
font-size: $title-size-m;
/* 绑定银行卡 */
.bank-card {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 45rpx 0 35rpx;
}
.item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
padding: 20rpx 0;
span:nth-child(1) {
color: #666;
margin-right: 20rpx;
}
.inputTxt {
color: #999;
padding-bottom: 20rpx;
}
.input_num {
font-size: 60rpx;
color: #3a3a3a;
font-weight: bolder;
flex: 1;
}
}
.item-total {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: $padding*1 0 0 0;
color: #3a3a3a;
.total {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
.money {
padding-top: $padding *0.5;
}
}
.lists {
color: $text-price;
}
}
}
.btn {
background-image: linear-gradient(to bottom, #e93340, #d73c36);
color: #fff;
border-radius: 10rpx;
text-align: center;
padding: $padding * .9;
margin: $margin * 3 $margin *2 $margin $margin*2;
font-size: $title-size;
font-weight: bold;
}
.des {
text-align: center;
color: #cacaca;
font-size: 26rpx;
}
.total {
color: $mian-color;
margin-top: 20rpx;
margin-left: 50rpx;
font-size: 36rpx;
}
</style>

363
pages/wallet/fragment.vue Normal file
View File

@@ -0,0 +1,363 @@
<template>
<view class="Record">
<view class="record-top">
<image src="/static/imgs/account-bg.png" mode="widthFix" class="record-bg" />
<view class="record-top-nav">
<view :class="['record-top-item',type==='year'?'selectTopItem':'']"
@click="selectType('year')">年账单</view>
<view :class="['record-top-item',type==='month'?'selectTopItem':'']"
@click="selectType('month')">月账单</view>
<view :class="['record-top-item',type==='day'?'selectTopItem':'']"
@click="selectType('day')">日账单</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> -->
<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">{{score || '0.00'}} <span></span></view>
</view>
<!-- 列表 -->
<view class="record-list" v-if="lists.length>0">
<view class="record-list-item" v-for="(item,index) in lists" :key='index'>
<image src="/static/imgs/record-icon.png" mode="widthFix" class="record-icon" />
<view class="">
<view class="record-list-item-top">
<view class="title ellipsis-1">{{item.remark}} <span class='tags'>{{item.frozen.text}}</span></view>
<view class="money" >{{item.amount}}</view>
</view>
<view class="record-list-item-date">{{item.created_at}}</view>
</view>
</view>
</view>
<!-- 无列表 -->
<no-list v-if="lists.length === 0" name='no-record' txt="没有任何碎片记录 ~ " />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {userAccoutScores} from '@/apis/interfaces/withdraws';
export default {
data() {
return {
lists:[],
has_next_page:true,
page:1,
type:'year', // 统计类型day日month月year年
date:new Date().toISOString().slice(0,4), // 日Y-m-d月Y-m年Y
params: {
year: true,
month: false,
day: false
},
show: false, // 显示
currentDay:new Date().toISOString().slice(0,10),
currentMonth:new Date().toISOString().slice(0,7),
currentYear:new Date().toISOString().slice(0,4),
score:'',
cointype:'all'
}
},
onShow(){
this.getList()
},
onReachBottom(){
if (this.has_next_page) {
this.page = this.page + 1
this.getList()
} else {
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
type: 'primary',
duration: 3000
})
}
},
methods: {
// 获取列表
getList(){
let data = {
page:this.page,
type:this.type,
date:this.date,
frozen:this.cointype
}
userAccoutScores(data).then(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,
type: 'primary',
duration: 3000
})
})
},
selectCoinType(type){
if(this.cointype !== type){
this.cointype = type
this.reset()
}
},
// 重置
reset(){
this.page = 1
this.lists = []
this.has_next_page = true
this.getList()
},
// 选择 年 月 日 切换要重置数据
selectType(type){
if(this.type !== type){
switch(type){
case 'year':
this.type = type
this.params= {
year: true,
month: false,
day: false
}
this.date = this.currentYear
this.reset()
break;
case 'month':
this.type = type
this.params= {
year: true,
month: true,
day: false
}
this.date = this.currentMonth
this.reset()
break;
case 'day':
this.type = type
this.params= {
year: true,
month: true,
day: true
}
this.date = this.currentDay
this.reset()
break;
}
}
},
// 点击确认按钮
confirm(e){
let type = this.type
switch(type){
case 'year':
this.date = e.year
this.reset()
break;
case 'month':
this.date = e.year + '-' + e.month
this.reset()
break;
case 'day':
this.date = e.year + '-' + e.month + '-' + e.day
this.reset()
break;
}
}
}
}
</script>
<style lang="scss" scoped>
.Record {
width: 100%;
min-height: 100vh;
padding-top: 30rpx;
background-color: #fff;
}
.record-list {
padding: 20rpx 30rpx;
.record-list-item {
padding: 30rpx 0;
border-bottom: solid 1rpx #f7f7f7;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.record-icon{
width: 60rpx;
margin-right: 20rpx;
}
.record-list-item-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 600rpx;
.tags{
padding-left: 20rpx;
color: #ff5500;
font-size: 24rpx;
}
.title {
font-size: 28rpx;
width: 600rpx;
color: #444;
}
.money {
color: #ee4c47;
font-size: 40rpx;
font-weight: bold;
// padding-top: 20rpx;
position: relative;
top: 20rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
}
}
.record-list-item-date {
font-size: 26rpx;
color: #a6a6a6;
margin-top: 10rpx;
}
}
}
.record-top {
width: calc(100% - 60rpx);
// 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: 30rpx 30rpx 50rpx 50rpx;
z-index: 1;
.record-bg {
position: absolute;
width: 100%;
bottom: 0;
right: 0;
z-index: 1;
opacity: .5;
}
.record-top-nav {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.record-top-item {
margin: 40rpx 20rpx;
font-size: 30rpx;
font-weight: 500;
color: #fff;
}
.selectTopItem{
border-bottom: solid 4rpx #fff;
}
}
.record-mouth-year {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
box-sizing: border-box;
position: relative;
z-index: 2;
color: #fff;
font-size: 30rpx;
// margin-top: 20rpx;
.record-type-left {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
uni-icons {
margin-left: 4rpx;
}
}
.record-type-right {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
font-size: 24rpx;
.pay_type_item {
// margin: 0 10rpx;
padding: 2rpx 20rpx;
border-radius: 30rpx;
border: solid 1rpx rgba($color: #000000, $alpha: 0);
}
.pay_type_item_select{
border: solid 1rpx #f7f7f7;
}
}
}
.record-title {
font-size: 28rpx;
color: #fff;
padding:0 0 20rpx 0;
margin-top: 30rpx;
}
.record-money {
color: #fff;
font-size: 60rpx;
font-weight: bold;
span {
font-size: 24rpx;
font-weight: 400;
padding-left: 20rpx;
margin-right: 4rpx;
}
}
}
</style>

347
pages/wallet/property.vue Normal file
View File

@@ -0,0 +1,347 @@
<template>
<view class="propertyIndex">
<view class="propery">
<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>
</view>
<view class="balance">{{ balance.balance || '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> -->
<view class="balance-flex-item" @click="$Router.push({name: 'Extract'})">能量球转红包</view>
</view>
</view>
</view>
<!-- 账户记录 -->
<view class="record">
<view class="record-tabs">
<view class="tabs-item" :class="logsType === '' ? 'show': ''" @click="onLogsType('')">全部</view>
<view class="tabs-item" :class="logsType === 'in' ? 'show': ''" @click="onLogsType('in')">收入</view>
<view class="tabs-item" :class="logsType === 'out' ? 'show': ''" @click="onLogsType('out')">支出</view>
</view>
<record :list="logs" :logsType="logsType" :hash='true' />
<!-- ios安全距离 -->
<view class="ios-bottom"></view>
</view>
</view>
</template>
<script>
import record from '@/components/property/record'
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy'
import {
sum,
price,
logs,
code
} from '@/apis/interfaces/wallet'
export default {
components: {
record
},
data() {
return {
balance: {},
price: '0.00',
logs: [],
logsType: '', // ''全部in入out出
password: '',
passwordPages: ''
};
},
onShow() {
this.getsum()
this.getlog()
},
methods: {
getsum() {
sum().then(res => {
this.balance = res
this.price = res.price
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
getlog() {
logs().then(res => {
this.logs = res
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
// 弹出私钥
showPrivatekey(pages) {
this.passwordPages = pages
this.$refs.showPassword.open('center')
},
// 交易记录
onLogsType(index) {
if (this.logsType === index) return
this.logsType = index
let flag
switch(index){
case '':
flag = 0
break;
case 'in':
flag = 2
break;
case 'out':
flag = 1
break;
}
this.logs = []
logs({
flag: flag
}).then(res => {
this.logs = res
})
},
// 区块地址
showAddress() {
uni.showModal({
title: '我的区块链地址',
content: '\n地址可以理解为银行卡卡号与他人转账时是区块链上的两个地址间的交易行为\n\n' + this.balance.address,
confirmText: '复制',
confirmColor: '#b11eff',
showCancel: false,
success: (res) => {
if (res.confirm) {
uni.setClipboardData({
data: this.balance.address,
success() {
uni.showToast({
title: '区块链地址已复制',
icon: 'none'
})
}
})
}
}
})
}
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
uni.showActionSheet({
// itemList: ['转账', '收款', '提币', '修改密码'],
itemList: ['提现', '修改密码'],
success: (res) => {
switch (res.tapIndex) {
case 0:
console.log('提现了,')
this.$Router.push({
name: 'Extract'
})
break;
case 1:
this.showPrivatekey('resetPassword')
break;
}
uni.hideLoading()
}
})
}
}
}
</script>
<style lang="scss" scoped>
.propertyIndex {
width: 100%;
min-height: 100vh;
background-color: #FFFFFF;
}
// 验证密码弹出层
.validationPassword {
background-color: white;
border-radius: 20rpx;width: 70vw;
.from {
padding: $padding*2;
.title {
text-align: center;
font-size: $title-size;
padding-bottom: $padding*2;
font-weight: bold;
color: $text-price;
}
.input {
text-align: center;
height: 90rpx;
font-size: $title-size;
border-radius: 20rpx; background: $border-color-lg;
padding: 0 ($padding*2);
}
}
.buttons {
display: flex;
border-top: solid 1rpx $border-color;
.button {
width: 50%;
font-size: $title-size;
line-height: 90rpx;
height: 90rpx;
text-align: center;
box-sizing: border-box;
&.cancel {
border-right: solid 1rpx $border-color;
color: $text-gray;
}
&.confirm {
color: $text-price;
}
}
}
// .button{
// background-color: $text-price;
// color: white;
// border-radius: 20rpx// border: none;
// margin-top: $margin*2;
// font-size: $title-size;
// height: 90rpx;
// line-height: 90rpx;
// }
// .close{
// @extend .button;
// text-align: center;
// color: $text-gray;
// margin-top: $margin;
// background-color: transparent;
// }
}
// 账户
.propery {
position: relative;
padding-top: var(--status-bar-height);
background-image: linear-gradient(to top, #7c52fc, #976dff);
position: relative;
overflow: hidden;
.record-bg {
position: absolute;
width: 100%;
height: 300rpx;
bottom: 0;
right: 0;
z-index: 1;
opacity: .5;
transform: rotate(0);
}
// &::before {
// position: absolute;
// left: 0;
// top: 0;
// width: 100%;
// height: 100%;
// content: " ";
// background-image: url(@/static/imgs/account-bg.png);
// background-size: 100%;
// background-repeat: no-repeat;
// opacity: .5;
// transform:rotate(0deg);
// }
.propery-content {
position: relative;
z-index: 1;
padding: $padding/2 $padding $padding*3;
text-align: center;
.currency {
font-size: $title-size-m;
color: rgba($color: white, $alpha: .8);
}
.balance {
font-size: $title-size * 2.5;
padding: $padding 0;
color: white;
}
.frozen {
background: rgba($color: #000000, $alpha: .1);
color: rgba($color: white, $alpha: .7);
display: inline-block;
font-size: 24rpx;
padding: 6rpx $padding;
border-radius: 20rpx; border: solid 1rpx rgba($color: white, $alpha: .4)
}
.balance-flex {
display: flex;
justify-content: center;
margin-top: $margin * 2;
.balance-flex-item {
background-color: white;
width: 200rpx;
height: 75rpx;
line-height: 75rpx;
color: $text-price;
margin: 0 $margin;
border-radius: 20rpx; font-size: 28rpx;
}
}
}
}
// 记录
.record {
background-color: white;
border-radius: $radius $radius 0 0;
padding: $padding ($padding * 2);
margin-top: -$margin;
position: relative;
z-index: 2;
.record-tabs {
display: flex;
justify-content: space-around;
font-weight: bold;
font-size: $title-size;
color: $text-gray;
line-height: 70rpx;
margin-bottom: $margin;
.tabs-item {
position: relative;
padding: 0 $padding;
&.show {
color: $text-price;
&::before {
position: absolute;
bottom: 0;
left: $padding;
right: $padding;
height: 4rpx;
content: " ";
background-color: $text-price;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,325 @@
<template>
<view class="propertyIndex">
<view class="propery">
<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> -->
</view>
<view class="balance">{{ cash || '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> -->
<view class="balance-flex-item" @click="$Router.push({name: 'ExtractRed'})">提现至银行卡</view>
</view>
</view>
</view>
<!-- 账户记录 -->
<view class="record">
<view class="record-tabs">
<view class="tabs-item" :class="logsType === '' ? 'show': ''" @click="onLogsType('')">全部</view>
<view class="tabs-item" :class="logsType === 'in' ? 'show': ''" @click="onLogsType('in')">收入</view>
<view class="tabs-item" :class="logsType === 'out' ? 'show': ''" @click="onLogsType('out')">支出</view>
</view>
<record :list="logs" :logsType="logsType" />
<!-- ios安全距离 -->
<view class="ios-bottom"></view>
</view>
</view>
</template>
<script>
import record from '@/components/property/record'
import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy'
import {
logs,
accountCashs,// 现金红包新增
} from '@/apis/interfaces/wallet'
export default {
components: {
record
},
data() {
return {
logs: [],
logsType: '', // ''全部in入out出
cash:'0.00',
has_more:true,
page:1
};
},
onLoad() {
this.getlog()
},
onShow() {
if(uni.getStorageSync('refresh')){
this.logsType = ''
this.reset()
uni.setStorageSync('refresh',false)
}else{
console.log('没有更多更新')
}
},
onReachBottom() {
console.log('chudi.....')
if(this.has_more){
this.page = this.page+1
this.getlog()
}else{
uni.showToast({
title:'我是有底线的~',
icon:'none'
})
}
},
methods: {
getlog() {
let data = {
type:this.logsType,//''全部in入out出
page:this.page
}
accountCashs(data).then(res => {
console.log(res)
this.logs = this.logs.concat(res.lists.data)
this.cash = res.cash
this.has_more = res.lists.page.has_more
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
// 交易记录
onLogsType(index) {
if (this.logsType === index) return
this.logsType = index
this.reset()
},
reset(){
this.logs = []
this.has_more = true
this.page =1
this.getlog()
},
// 区块地址
showAddress() {
uni.showModal({
title: '我的区块链地址',
content: '\n地址可以理解为银行卡卡号与他人转账时是区块链上的两个地址间的交易行为\n\n' + this.balance.address,
confirmText: '复制',
confirmColor: '#b11eff',
showCancel:false,
success: (res) => {
if (res.confirm) {
uni.setClipboardData({
data: this.balance.address,
success() {
uni.showToast({
title: '区块链地址已复制',
icon : 'none'
})
}
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.propertyIndex {
width: 100%;
min-height: 100vh;
background-color: #FFFFFF;
}
// 验证密码弹出层
.validationPassword {
background-color: white;
border-radius: 20rpx;
width: 70vw;
.from {
padding: $padding*2;
.title {
text-align: center;
font-size: $title-size;
padding-bottom: $padding*2;
font-weight: bold;
color: $text-price;
}
.input {
text-align: center;
height: 90rpx;
font-size: $title-size;
border-radius: 20rpx;
background: $border-color-lg;
padding: 0 ($padding*2);
}
}
.buttons {
display: flex;
border-top: solid 1rpx $border-color;
.button {
width: 50%;
font-size: $title-size;
line-height: 90rpx;
height: 90rpx;
text-align: center;
box-sizing: border-box;
&.cancel {
border-right: solid 1rpx $border-color;
color: $text-gray;
}
&.confirm {
color: $text-price;
}
}
}
// .button{
// background-color: $text-price;
// color: white;
// border-radius: 20rpx;
// border: none;
// margin-top: $margin*2;
// font-size: $title-size;
// height: 90rpx;
// line-height: 90rpx;
// }
// .close{
// @extend .button;
// text-align: center;
// color: $text-gray;
// margin-top: $margin;
// background-color: transparent;
// }
}
// 账户
.propery {
position: relative;
padding-top: var(--status-bar-height);
background-image: linear-gradient(to top, #7c52fc, #976dff);
position: relative;
overflow: hidden;
.record-bg {
position: absolute;
width: 100%;
height: 300rpx;
bottom: 0;
right: 0;
z-index: 1;
opacity: .5;
transform: rotate(0);
}
// &::before {
// position: absolute;
// left: 0;
// top: 0;
// width: 100%;
// height: 100%;
// content: " ";
// background-image: url(@/static/imgs/account-bg.png);
// background-size: 100%;
// background-repeat: no-repeat;
// opacity: .5;
// transform:rotate(0deg);
// }
.propery-content {
position: relative;
z-index: 1;
padding: $padding/2 $padding $padding*3;
text-align: center;
.currency {
font-size: $title-size-m;
color: rgba($color: white, $alpha: .8);
}
.balance {
font-size: $title-size * 2.5;
padding: $padding 0;
color: white;
}
.frozen {
background: rgba($color: #000000, $alpha: .1);
color: rgba($color: white, $alpha: .7);
display: inline-block;
font-size: 24rpx;
padding: 6rpx $padding;
border-radius: 20rpx;
border: solid 1rpx rgba($color: white, $alpha: .4)
}
.balance-flex {
display: flex;
justify-content: center;
margin-top: $margin * 2;
.balance-flex-item {
background-color: white;
width: 300rpx;
height: 75rpx;
line-height: 75rpx;
color: $text-price;
margin: 0 $margin;
border-radius: 20rpx;
font-size: 28rpx;
}
}
}
}
// 记录
.record {
background-color: white;
border-radius: $radius $radius 0 0;
padding: $padding ($padding * 2);
margin-top: -$margin;
position: relative;
z-index: 2;
.record-tabs {
display: flex;
justify-content: space-around;
font-weight: bold;
font-size: $title-size;
color: $text-gray;
line-height: 70rpx;
margin-bottom: $margin;
.tabs-item {
position: relative;
padding: 0 $padding;
&.show {
color: $text-price;
&::before {
position: absolute;
bottom: 0;
left: $padding;
right: $padding;
height: 4rpx;
content: " ";
background-color: $text-price;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,440 @@
<template>
<view class="Record">
<view class="record-top">
<image src="/static/imgs/account-bg.png" mode="widthFix" class="record-bg" />
<view class="record-top-nav">
<view :class="['record-top-item',type==='year'?'selectTopItem':'']" @click="selectType('year')">年账单
</view>
<view :class="['record-top-item',type==='month'?'selectTopItem':'']" @click="selectType('month')">月账单
</view>
<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 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>
<view class="record-money">{{account || '0.00'}} </view>
</view>
</view>
<!-- <view class="record-title">碎片个数</view>
<view class="record-money"><span></span>{{account || '0.00'}}</view> -->
</view>
<!-- 列表 -->
<view class="ew_lists" v-if="lists.length>0">
<view style="padding-top: 30rpx;" v-for="(item,index) in lists " :key="index">
<view class="receiptCode">
<image class="logo" src="/static/imgs/record-icon.png" mode="widthFix" />
<view class="title">{{item.way}}</view>
<span class='status'> {{item.status.status_text}}</span>
</view>
<view class="item">
<view class="left">
<span>
提现:{{item.quantity}}
<span class='left-des'>实际到账:{{item.take}} 手续费{{item.tax}}</span>
</span>
<span>{{item.create_at}}</span>
</view>
<!-- <view class="right">
<span> {{item.create_at}}</span>
<span> -</span>
</view> -->
</view>
</view>
</view>
<!-- 无列表 -->
<no-list v-if="lists.length === 0" name='no-record' txt="没有任何提现记录 ~ " />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
withdrawsIndexLists
} from '@/apis/interfaces/withdraws';
export default {
data() {
return {
lists: [],
has_next_page: true,
page: 1,
type: 'year', // 统计类型day日month月year年
date: new Date().toISOString().slice(0, 4), // 日Y-m-d月Y-m年Y
params: {
year: true,
month: false,
day: false
},
show: false, // 显示
currentDay: new Date().toISOString().slice(0, 10),
currentMonth: new Date().toISOString().slice(0, 7),
currentYear: new Date().toISOString().slice(0, 4),
account: ''
}
},
onLoad() {
this.getList()
},
onReachBottom() {
if (this.has_next_page) {
this.page = this.page + 1
this.getList()
} else {
this.$refs.uToast.show({
title: '吼吼吼~我是有底的~',
type: 'primary',
duration: 3000
})
}
},
methods: {
// 获取列表
getList() {
let data = {
page: this.page,
type: this.type,
date: this.date,
}
withdrawsIndexLists(data).then(res => {
console.log(res)
this.account = res.all
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,
type: 'primary',
duration: 3000
})
})
},
selectCoinType(type) {
if (this.cointype !== type) {
this.cointype = type
this.reset()
}
},
// 重置
reset() {
this.page = 1
this.lists = []
this.has_next_page = true
this.getList()
},
// 选择 年 月 日 切换要重置数据
selectType(type) {
if (this.type !== type) {
switch (type) {
case 'year':
this.type = type
this.params = {
year: true,
month: false,
day: false
}
this.date = this.currentYear
this.reset()
break;
case 'month':
this.type = type
this.params = {
year: true,
month: true,
day: false
}
this.date = this.currentMonth
this.reset()
break;
case 'day':
this.type = type
this.params = {
year: true,
month: true,
day: true
}
this.date = this.currentDay
this.reset()
break;
}
}
},
// 点击确认按钮
confirm(e) {
let type = this.type
switch (type) {
case 'year':
this.date = e.year
this.reset()
break;
case 'month':
this.date = e.year + '-' + e.month
this.reset()
break;
case 'day':
this.date = e.year + '-' + e.month + '-' + e.day
this.reset()
break;
}
}
}
}
</script>
<style lang="scss" scoped>
.Record {
width: 100%;
min-height: 100vh;
padding-top: 30rpx;
background-color: #fff;
}
.record-list {
padding: 20rpx 30rpx;
.record-list-item {
padding: 30rpx 0;
border-bottom: solid 1rpx #f7f7f7;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.record-icon {
width: 60rpx;
margin-right: 20rpx;
}
.record-list-item-top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 600rpx;
.title {
font-size: 28rpx;
width: 600rpx;
color: #444;
}
.money {
color: #ee4c47;
font-size: 40rpx;
font-weight: bold;
// padding-top: 20rpx;
position: relative;
top: 20rpx;
}
}
.record-list-item-date {
font-size: 26rpx;
color: #a6a6a6;
margin-top: 10rpx;
}
}
}
.record-top {
width: calc(100% - 60rpx);
height: 360rpx;
background-image: linear-gradient(to right, #e93340, #e93340);
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #e93340, $alpha: 0.4);
margin: 0 30rpx;
border-radius: 20rpx;
box-sizing: border-box;
position: relative;
padding: 10rpx 50rpx 20rpx 50rpx;
z-index: 1;
.record-bg {
position: absolute;
width: 100%;
bottom: 0;
right: 0;
z-index: 1;
opacity: .5;
}
.record-top-nav {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.record-top-item {
margin: 40rpx 20rpx;
font-size: 30rpx;
font-weight: 500;
color: #fff;
}
.selectTopItem {
border-bottom: solid 4rpx #fff;
}
}
.record-mouth-year {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
box-sizing: border-box;
position: relative;
z-index: 2;
color: #fff;
font-size: 30rpx;
margin-top: 20rpx;
.record-type-left {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
uni-icons {
margin-left: 4rpx;
}
}
.record-type-right {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
font-size: 24rpx;
flex: 1;
.pay_type_item {
margin: 0 10rpx;
padding: 2rpx 20rpx;
border-radius: 30rpx;
border: solid 1rpx rgba($color: #000000, $alpha: 0);
}
.pay_type_item_select {
border: solid 1rpx #f7f7f7;
}
}
}
.record-title {
font-size: 28rpx;
color: #fff;
padding: 0 0 20rpx 0;
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
justify-content: space-between;
box-sizing: border-box;
}
.record-money {
color: #fff;
font-size: 70rpx;
font-weight: bold;
span {
font-size: 24rpx;
font-weight: 400;
padding-left: 20rpx;
margin-right: 4rpx;
}
}
}
.ew_lists {
padding: $padding;
border-top: solid 4rpx #f8f8f8;
.item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
border-bottom: solid 1rpx #f8f8f8;
background-color: #fff;
padding: 0 0 $padding*0.8 50rpx;
.left,
.right {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
margin-top: 10rpx;
}
.left {
font-size: 30rpx;
padding-top: 10rpx;
color: $text-price;
.left-des {
color: #999;
font-size: 26rpx;
margin-left: 20rpx;
}
span:nth-child(2) {
color: #C0C0C0;
font-weight: normal;
font-size: 26rpx;
padding-top: $padding *0.5;
}
}
.right {
font-size: $title-size-m;
align-items: flex-end;
color: #999;
span:nth-child(1) {
padding-bottom: $padding*0.5;
}
}
}
.receiptCode {
font-size: 32rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
.title {
flex: 1;
}
.logo {
width: 40rpx;
margin-right: 10rpx;
}
.status {
color: #999;
font-size: 26rpx;
}
}
}
</style>

View File

@@ -11,6 +11,7 @@ $text-gray: #555;
$text-gray-m: #999;
$text-price: #e93340;
$main-color: #e93340;
$mian-color: #e93340;
$main-color-light: #e93340;
// 边框颜色

BIN
static/imgs/record-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long