Merge branch 'main' of https://git.yuzhankeji.cn/TmOct5/BlockChainH5 into main
97
apis/interfaces/withdraws.js
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/**
|
||||||
|
* 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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
export {
|
||||||
|
accountsCreate,
|
||||||
|
withdrawsAccounts,
|
||||||
|
withdrawsAccountsList,
|
||||||
|
accountsCreateEdit,
|
||||||
|
withdrawsAccountsEdits,
|
||||||
|
withdrawsAccountsDelete,
|
||||||
|
withdrawsIndexCreate,
|
||||||
|
withdrawsIndex,
|
||||||
|
withdrawsIndexLists
|
||||||
|
}
|
||||||
21
pages.json
@@ -180,22 +180,13 @@
|
|||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/wallet/extract",
|
"path": "pages/wallet/extract",
|
||||||
|
"name": "Extract",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "提现能量",
|
"navigationBarTitleText": "提现能量",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
"navigationBarBackgroundColor": "#774ffd",
|
"navigationBarBackgroundColor": "#774ffd",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
},
|
}
|
||||||
"name": "Extract"
|
|
||||||
}, {
|
|
||||||
"path": "pages/wallet/resetPassword",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "重置密码",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"navigationBarBackgroundColor": "#774ffd",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
},
|
|
||||||
"name": "ResetPassword"
|
|
||||||
},{
|
},{
|
||||||
"path": "pages/verification/index",
|
"path": "pages/verification/index",
|
||||||
"name": "verificationIndex",
|
"name": "verificationIndex",
|
||||||
@@ -263,23 +254,23 @@
|
|||||||
"name": "Fragment"
|
"name": "Fragment"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/wallet/addCard",
|
"path": "pages/wallet/addBank",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "添加银行卡",
|
"navigationBarTitleText": "添加银行卡",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
"navigationBarBackgroundColor": "#774ffd",
|
"navigationBarBackgroundColor": "#774ffd",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
},
|
},
|
||||||
"name": "addCard"
|
"name": "addBank"
|
||||||
},{
|
},{
|
||||||
"path": "pages/wallet/selectCard",
|
"path": "pages/wallet/bankList",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "银行卡列表",
|
"navigationBarTitleText": "银行卡列表",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
"navigationBarBackgroundColor": "#774ffd",
|
"navigationBarBackgroundColor": "#774ffd",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
},
|
},
|
||||||
"name": "selectCard"
|
"name": "bankList"
|
||||||
},{
|
},{
|
||||||
"path": "pages/wallet/withdrawList",
|
"path": "pages/wallet/withdrawList",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
263
pages/login/guide.vue
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<!-- <view class="title">易品新境</view> -->
|
||||||
|
<view class="login-top">
|
||||||
|
<view class="top-logo-content">
|
||||||
|
<image class="top-logo" fit="contain" src="/static/imgs/top_logo.png" />
|
||||||
|
链商星球(中国)
|
||||||
|
</view>
|
||||||
|
<image class="top-bg" fit="contain" src="/static/imgs/top_bg.png" />
|
||||||
|
</view>
|
||||||
|
<!-- 输入手机号相关 -->
|
||||||
|
<view class="inputs phone">
|
||||||
|
<label class="label">+86</label>
|
||||||
|
<input type="number" placeholder="输入您的手机号码" v-model="phone" />
|
||||||
|
</view>
|
||||||
|
<view class="inputs sms">
|
||||||
|
<input type="number" placeholder="输入短信验证码" v-model="code" />
|
||||||
|
<button class="sms-btn" type="default" size="mini" :disabled="phone == '' || getSms"
|
||||||
|
@click="getPhoneCode">{{getSms ? '重新发送' + smsTime + 's': '发送验证码'}}</button>
|
||||||
|
</view>
|
||||||
|
<button class="btn" type="default" :disabled="phone == '' || code == ''" @click="login">登录</button>
|
||||||
|
<!-- 快捷登录 -->
|
||||||
|
<view class="quick">
|
||||||
|
<view class="quick-title">快捷登录</view>
|
||||||
|
<view class="quick-box">
|
||||||
|
<image class="quick-icon" src="@/static/icons/wechat.png" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 用户登录注册协议 -->
|
||||||
|
<view class="agreement">未注册的手机号验证后将自动创建账号,登录即表示同意接收<navigator url="">用户隐私规格</navigator>和<navigator url="">用户服务协议
|
||||||
|
</navigator>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getSms,
|
||||||
|
smsAuth
|
||||||
|
} from '@/apis/interfaces/auth'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
phone: "18245180131",
|
||||||
|
code: "",
|
||||||
|
smsTime: 60,
|
||||||
|
getSms: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 用户登录
|
||||||
|
login() {
|
||||||
|
smsAuth({
|
||||||
|
mobileNo: this.phone,
|
||||||
|
code: this.code
|
||||||
|
}).then(res => {
|
||||||
|
this.$store.commit('setToken', res.token_type + ' ' + res.access_token)
|
||||||
|
this.$Router.back()
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取验证码
|
||||||
|
getPhoneCode() {
|
||||||
|
let outTime
|
||||||
|
getSms({
|
||||||
|
mobileNo: this.phone
|
||||||
|
}).then(res => {
|
||||||
|
uni.showToast({
|
||||||
|
title: res,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
this.getSms = true
|
||||||
|
outTime = setInterval(() => {
|
||||||
|
if (this.smsTime <= 1) {
|
||||||
|
this.getSms = false
|
||||||
|
this.smsTime = 60
|
||||||
|
clearInterval('outTime')
|
||||||
|
}
|
||||||
|
this.smsTime -= 1
|
||||||
|
}, 1000)
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
height: 100vh;
|
||||||
|
width: 100vw;
|
||||||
|
padding: $padding * 3;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: white;
|
||||||
|
|
||||||
|
.login-top {
|
||||||
|
height: 36vh;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
padding-bottom: 160rpx;
|
||||||
|
|
||||||
|
.top-bg {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 30rpx;
|
||||||
|
// left: 2rpx;
|
||||||
|
z-index: 2;
|
||||||
|
width: 740rpx;
|
||||||
|
margin-left: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-logo-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: #7f56a4;
|
||||||
|
font-size: 18px;
|
||||||
|
|
||||||
|
.top-logo {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
width: 240rpx;
|
||||||
|
height: 240rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.inputs {
|
||||||
|
background:rgba($color: $mian-color, $alpha: 0.05);
|
||||||
|
border: solid 1rpx $border-color;
|
||||||
|
position: relative;
|
||||||
|
margin-top: $margin;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
padding: 0 $padding;
|
||||||
|
border: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: $title-size-lg;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.phone {
|
||||||
|
padding-left: 120rpx;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 120rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-right: solid 1rpx $border-color;
|
||||||
|
font-size: $title-size-lg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.sms {
|
||||||
|
padding-right: 200rpx;
|
||||||
|
|
||||||
|
.sms-btn[size='mini'] {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
border-left: solid 1rpx $border-color;
|
||||||
|
color: $text-price;
|
||||||
|
font-size: $title-size-lg;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
color: rgba($color: $text-price, $alpha: .6);
|
||||||
|
background: $border-color-lg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: $title-size + 6;
|
||||||
|
font-weight: bold;
|
||||||
|
color: $text-color;
|
||||||
|
margin-bottom: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
background: $mian-color;
|
||||||
|
color: white;
|
||||||
|
border-radius: 0;
|
||||||
|
margin-top: $margin;
|
||||||
|
font-size: $title-size;
|
||||||
|
line-height: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
background: rgba($color: $mian-color, $alpha: .6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick {
|
||||||
|
padding-top: $padding * 3;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.quick-title {
|
||||||
|
text-align: center;
|
||||||
|
color: $text-gray;
|
||||||
|
font-size: $title-size-sm;
|
||||||
|
padding-bottom: $padding;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-box {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.quick-icon {
|
||||||
|
width: 78rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.agreement {
|
||||||
|
padding-top: $padding * 2;
|
||||||
|
font-size: $title-size-sm;
|
||||||
|
color: $text-gray;
|
||||||
|
|
||||||
|
navigator {
|
||||||
|
color: $text-price;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -249,7 +249,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.agreement {
|
.agreement {
|
||||||
padding-top: $padding * 4;
|
padding-top: $padding * 2;
|
||||||
font-size: $title-size-sm;
|
font-size: $title-size-sm;
|
||||||
color: $text-gray;
|
color: $text-gray;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<view class="item" v-for="(item,index) in items" :key="index" v-if="items.length>0"
|
<view class="item" v-for="(item,index) in items" :key="index" v-if="items.length>0"
|
||||||
@click="item.read_at === ''?read(index,item):noread(item)">
|
@click="item.read_at === ''?read(index,item):noread(item)">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<image src="/static/images/news_2_1.png" mode="widthFix"></image>
|
<image src="/static/imgs/news_2_1.png" mode="widthFix" />
|
||||||
<!-- <image v-if="index===1" src="/static/img/news_1_1.png" mode="widthFix"></image>
|
<!-- <image v-if="index===1" src="/static/img/news_1_1.png" mode="widthFix"></image>
|
||||||
<image v-if="index===2" src="/static/img/news_3_1.png" mode="widthFix"></image> -->
|
<image v-if="index===2" src="/static/img/news_3_1.png" mode="widthFix"></image> -->
|
||||||
<view :style="item.read_at=== '' ?'flex:1;':'flex:1;color:#808080;'">{{item.title}}</view>
|
<view :style="item.read_at=== '' ?'flex:1;':'flex:1;color:#808080;'">{{item.title}}</view>
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="content webkit-box">
|
|
||||||
<!-- logo -->
|
|
||||||
<image class="logo" src="@/static/img/oc-logo.png" mode="widthFix"></image>
|
|
||||||
<!-- 副标题 -->
|
|
||||||
<view class="sub-title">激活您的OC Chain区块链钱包地址。</br>地址可以理解为您的个人银行卡卡号,与他人转账时是区块链上两个地址的交易行为</view>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<navigator class="wallet-btn" url="./mnemonic" open-type="redirect">激活钱包</navigator>
|
|
||||||
<!-- <navigator class="wallet-btn hollow" url="./guide">导入钱包</navigator> -->
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
page {
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.content{
|
|
||||||
position: relative;
|
|
||||||
height: 100vh;
|
|
||||||
padding: 0 15vw;
|
|
||||||
text-align: center;
|
|
||||||
.logo{
|
|
||||||
width: 138rpx;
|
|
||||||
vertical-align: top;
|
|
||||||
margin-bottom: 30vh;
|
|
||||||
}
|
|
||||||
.sub-title{
|
|
||||||
font-size: $title-size-m;
|
|
||||||
color: $text-gray;
|
|
||||||
}
|
|
||||||
.wallet-btn{
|
|
||||||
width: 100%;
|
|
||||||
background-color: $mian-color;
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
margin-top: $margin * 2;
|
|
||||||
border-radius: $radius-lg;
|
|
||||||
color: white;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size;
|
|
||||||
&.hollow{
|
|
||||||
background-color: white;
|
|
||||||
color: $mian-color;
|
|
||||||
border:solid 2rpx $mian-color;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
334
pages/wallet/addBank.vue
Normal file
@@ -0,0 +1,334 @@
|
|||||||
|
<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="16" 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" 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="30" 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.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: #976dff, $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, #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;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="WithdrawingCoin">
|
|
||||||
<view class="withdrawing-content">
|
|
||||||
<view class="item-name">添加提现银行</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="title">收款人姓名</view>
|
|
||||||
<input class="input_num" v-model="name" maxlength="16"
|
|
||||||
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;"
|
|
||||||
placeholder="请输入收款人姓名" />
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="title">收款人账号</view>
|
|
||||||
<input class="input_num" v-model="card" type="number"
|
|
||||||
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;"
|
|
||||||
placeholder="请输入收款人账号" />
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="title">开户行</view>
|
|
||||||
<input class="input_num" v-model="name" maxlength="30"
|
|
||||||
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;"
|
|
||||||
placeholder="请输入开户行" />
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="title">支行名称</view>
|
|
||||||
<input class="input_num" v-model="name" maxlength="30"
|
|
||||||
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;"
|
|
||||||
placeholder="省-市-区-支行名称" />
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="title">收款人手机号</view>
|
|
||||||
<input class="input_num" v-model="name" maxlength="11"
|
|
||||||
placeholder-style="color:#999;font-weight:normal; font-size:30rpx;"
|
|
||||||
placeholder="请输入手机号" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn" @click="sureAdd">确认添加银行</view>
|
|
||||||
<view class="history" @click="$Router.push({name:'withdrawList'})">提现记录<u-icon name="question-circle-fill" /></view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
card: '', // 银行卡号
|
|
||||||
name: '', // 姓名
|
|
||||||
withdraw_input: '' // 提现能量球数量
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad() {},
|
|
||||||
methods: {
|
|
||||||
sureAdd() {
|
|
||||||
uni.navigateBack({})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</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: #976dff, $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: $title-size*1;
|
|
||||||
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, #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;
|
|
||||||
letter-spacing: 2rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
221
pages/wallet/bankList.vue
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
<template>
|
||||||
|
<view class="selectCard">
|
||||||
|
<view class="bankInfo" 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='60' />
|
||||||
|
</view>
|
||||||
|
<!-- <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) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/wallet/addBank?id=' + id
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 删除银行
|
||||||
|
delBank(id, index) {
|
||||||
|
let that = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '是否确认删除该银行',
|
||||||
|
cancelColor: '#cacaca',
|
||||||
|
cancelText: '我再想想',
|
||||||
|
confirmColor: '#7C52FC',
|
||||||
|
confirmText: '确认删除',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
withdrawsAccountsDelete(id).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
that.lists.splice(index, 1)
|
||||||
|
}).catch(err => {
|
||||||
|
this.$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>
|
||||||
|
.selectCard {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
padding-bottom: 80rpx;
|
||||||
|
|
||||||
|
.bankInfo {
|
||||||
|
width: calc(100% - 60rpx);
|
||||||
|
background-image: linear-gradient(to right, #7c52fc, #976dff);
|
||||||
|
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #976dff, $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: 80rpx;
|
||||||
|
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: #7C52FC;
|
||||||
|
|
||||||
|
&::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>
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="webkit-box code">
|
|
||||||
<view class="webkit-box code-content">
|
|
||||||
<view class="sub-title">扫码转入OC COIN</view>
|
|
||||||
<view class="code-img">
|
|
||||||
<image :src="code" mode="widthFix" />
|
|
||||||
</view>
|
|
||||||
<view class="hr"></view>
|
|
||||||
<view class="sub-title">钱包地址</view>
|
|
||||||
<view class="hash">{{address || '-'}}</view>
|
|
||||||
<view class="buttons">
|
|
||||||
<button class="item red" type="default" @click="showShare()">分享</button>
|
|
||||||
<button class="item greed" type="default" @click="copyAddress">复制</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="footer">OC CHNIA</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { code } from '@/apis/interfaces/wallet'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
address: '',
|
|
||||||
code: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
code().then(res=>{
|
|
||||||
this.code = res.image
|
|
||||||
this.address = res.address
|
|
||||||
}).catch(err=>{
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: err.message
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
copyAddress(){
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: this.address
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showShare(){
|
|
||||||
uni.share({
|
|
||||||
provider: 'weixin',
|
|
||||||
title: '我正在使用ocChain钱包收款',
|
|
||||||
scene: 'WXSceneSession',
|
|
||||||
href: 'https://live.funnyzhibo.com/blockdownload',
|
|
||||||
imageUrl: 'https://live.funnyzhibo.com/oc-chain.png',
|
|
||||||
summary: '我的收款地址' + this.address
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.code{
|
|
||||||
height: 100vh;
|
|
||||||
background:linear-gradient(to bottom, $mian-color, $mian-color-deep);
|
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
|
||||||
box-sizing: border-box;
|
|
||||||
// 收款码
|
|
||||||
.code-content{
|
|
||||||
text-align: center;
|
|
||||||
background: white;
|
|
||||||
margin: 0 8vw;
|
|
||||||
border-radius: $radius;
|
|
||||||
padding: $padding * 2;
|
|
||||||
height: 70vh;
|
|
||||||
box-shadow: 0 0 6rpx 6rpx rgba($color: #000000, $alpha: .02);
|
|
||||||
box-sizing: border-box;
|
|
||||||
.sub-title{
|
|
||||||
font-size: $title-size + 8;
|
|
||||||
}
|
|
||||||
.code-img{
|
|
||||||
width: 20vh;
|
|
||||||
height: 20vh;
|
|
||||||
margin: $margin * 3 0 $margin * 2;
|
|
||||||
display: inline-block;
|
|
||||||
background-image: url(../../static/background/wallet-code-background.png);
|
|
||||||
padding: $padding;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-position: center;
|
|
||||||
background-size: cover;
|
|
||||||
image{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.hr{
|
|
||||||
height: 1rpx;
|
|
||||||
background: $border-color;
|
|
||||||
margin: $margin * 2 0;
|
|
||||||
}
|
|
||||||
.hash{
|
|
||||||
word-wrap: break-word;
|
|
||||||
font-size: $title-size;
|
|
||||||
padding: $padding 0;
|
|
||||||
}
|
|
||||||
.buttons{
|
|
||||||
display: flex;
|
|
||||||
padding-top: $padding * 2;
|
|
||||||
.item{
|
|
||||||
width: 40%;
|
|
||||||
height: 80rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
font-size: $title-size;
|
|
||||||
color: white;
|
|
||||||
&::after{
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
&.red{
|
|
||||||
background: $red-color;
|
|
||||||
}
|
|
||||||
&.greed{
|
|
||||||
background: $mian-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 底部
|
|
||||||
.footer{
|
|
||||||
height: 10vh;
|
|
||||||
line-height: 10vh;
|
|
||||||
text-align: center;
|
|
||||||
font-size: $title-size + 10;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #58876e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<!-- 设置钱包密码 -->
|
|
||||||
<view class="password">
|
|
||||||
<view class="prompt">请设置6位数字密码。建议不要使用连续的数字。</view>
|
|
||||||
<view class="group">
|
|
||||||
<view class="inputs">
|
|
||||||
<label>密码</label>
|
|
||||||
<input type="digit" v-model="password" maxlength="6" placeholder="请设置密码" />
|
|
||||||
</view>
|
|
||||||
<view class="inputs">
|
|
||||||
<label>确认密码</label>
|
|
||||||
<input type="digit" v-model="verify" maxlength="6" placeholder="请确认密码" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="buttons">
|
|
||||||
<button type="default" form-type="submit" @click="createWallet">确认</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
security
|
|
||||||
} from '@/apis/interfaces/wallet'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
password: '',
|
|
||||||
verify: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 激活钱包
|
|
||||||
createWallet() {
|
|
||||||
if (this.password === '' || this.verify === '') {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '请设置密码'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.password !== this.verify) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '两次输入密码不一致'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
security({
|
|
||||||
code: this.password
|
|
||||||
}).then(res => {
|
|
||||||
uni.navigateBack()
|
|
||||||
}).catch(err => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: err.message
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 副标题
|
|
||||||
.sub-title {
|
|
||||||
color: $text-gray;
|
|
||||||
text-align: center;
|
|
||||||
margin: $margin * 2 $margin;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置密码
|
|
||||||
.password {
|
|
||||||
padding: 0 $padding * 2;
|
|
||||||
|
|
||||||
.prompt {
|
|
||||||
margin-top: $margin * 2;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
color: $mian-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.group {
|
|
||||||
margin-top: $margin;
|
|
||||||
border-radius: $radius-m;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
|
||||||
background-color: white;
|
|
||||||
|
|
||||||
.inputs {
|
|
||||||
padding: $padding $padding + 10;
|
|
||||||
border-bottom: solid 1rpx $border-color;
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
label {
|
|
||||||
color: $text-gray;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
height: 70rpx;
|
|
||||||
line-height: 70rpx;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 按钮
|
|
||||||
.buttons {
|
|
||||||
padding: $padding * 2;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
text-align: center;
|
|
||||||
line-height: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-bottom: $margin * 2;
|
|
||||||
font-size: $title-size-lg;
|
|
||||||
color: $mian-color;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
background-color: $mian-color;
|
|
||||||
border-radius: $radius-lg;
|
|
||||||
color: white;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -4,9 +4,9 @@
|
|||||||
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
|
<image src="/static/imgs/account-bg.png" mode="aspectFill" class="record-bg" />
|
||||||
<view class="propery-content">
|
<view class="propery-content">
|
||||||
<view class="currency">能量球钱包
|
<view class="currency">能量球钱包
|
||||||
<!-- <span>(≈ {{ price || '0.00' }} CNY)</span> -->
|
<span>(≈ {{ cost || '0.00' }} CNY)</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="balance">{{ balance.balance || '0.00' }}</view>
|
<view class="balance">{{ balance || '0.00' }}</view>
|
||||||
<view class="frozen" @click="withdrawDetail">提现记录</view>
|
<view class="frozen" @click="withdrawDetail">提现记录</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -14,98 +14,59 @@
|
|||||||
<view class="item-name">
|
<view class="item-name">
|
||||||
提现至银行卡
|
提现至银行卡
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="cardName" @click="addCard">添加银行卡</view>
|
<view class="cardName" v-if="bank_accounts === 0" @click="addBanks">添加银行卡</view>
|
||||||
<uni-icons type="arrowright" size="12" color="#fff" />
|
<view class="cardName" v-if='bank_accounts>0' @click="bankLists">{{bankInfo.name?bankInfo.name:'选择银行卡'}}</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item-name">
|
|
||||||
选择银行卡
|
|
||||||
<view class="right">
|
|
||||||
<view class="cardName" @click="selectCard">选择银行卡</view>
|
|
||||||
<uni-icons type="arrowright" size="12" color="#fff" />
|
<uni-icons type="arrowright" size="12" color="#fff" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="withdrawing-content">
|
<view class="withdrawing-content">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view style="flex: 1;">
|
<view style="flex: 1;">
|
||||||
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number"
|
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number"
|
||||||
placeholder-style="color:#999;font-weight:normal; font-size:40rpx;"
|
placeholder-style="color:#999;font-weight:normal; font-size:34rpx;" placeholder="提现数量" />
|
||||||
placeholder="能量球数量" />
|
|
||||||
<view v-if="total">≈ ¥{{total}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="all" @click="all">全部提现</view>
|
<view class="all" @click="all">全部提现</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @click="open">提现至银行卡</view>
|
<view class="total" v-if="total">≈ ¥{{total}} </view>
|
||||||
<view class="des">预计5- 10个工作日到账</view>
|
<view class="btn" @click="actions">提现至银行卡</view>
|
||||||
|
<view class="des">预计5- 10个工作日到账 手续费: {{tax}}%</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
withdraw,
|
withdrawsIndexCreate,
|
||||||
withdrawLogs,
|
withdrawsIndex
|
||||||
withdrawDo
|
} from '@/apis/interfaces/withdraws';
|
||||||
} from '@/apis/interfaces/wallet.js';
|
|
||||||
import numberJpan from "@/components/numberJpan/numberJpan.vue";
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
balance: 0, // 钱包能量球数量
|
balance: 0, // 钱包能量球数量
|
||||||
price: 0, // 当前能量球价格
|
tax: 0, // 当前手续费
|
||||||
|
cost:1,// 每个能量球的价格
|
||||||
|
total:0,// 约合人民币
|
||||||
card: '', // 银行卡号
|
card: '', // 银行卡号
|
||||||
name: '', // 姓名
|
|
||||||
password: '', //
|
|
||||||
withdraw_input: '', // 提现能量球数量
|
withdraw_input: '', // 提现能量球数量
|
||||||
total: '', // 提现能量球转化成的钱数
|
bank_accounts: 0,
|
||||||
page: 1,
|
bankInfo:{}
|
||||||
has_more: true,
|
|
||||||
withdrawLists: [],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
|
||||||
'number-jpan': numberJpan
|
|
||||||
},
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.reset()
|
this.getInfo()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.withdrawLists.length > 0) {
|
|
||||||
if (this.has_more) {
|
|
||||||
this.withdrawLogs()
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '没有更多~',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 提现基本信息
|
// 提现基本信息
|
||||||
withdraw() {
|
getInfo() {
|
||||||
withdraw().then(res => {
|
withdrawsIndexCreate().then(res => {
|
||||||
this.balance = Number(res.balance)
|
this.balance = res.balance
|
||||||
this.price = Number(res.price)
|
this.tax = res.tax
|
||||||
}).catch(err => {
|
this.cost = res.cost
|
||||||
uni.showToast({
|
this.bank_accounts = res.bank_accounts.length
|
||||||
title: err.message,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 提现记录
|
|
||||||
withdrawLogs() {
|
|
||||||
withdrawLogs({
|
|
||||||
page: this.page
|
|
||||||
}).then(res => {
|
|
||||||
this.withdrawLists = this.withdrawLists.concat(res.data)
|
|
||||||
if (res.page.has_more) {
|
|
||||||
this.page = this.page + 1
|
|
||||||
this.has_more = true
|
|
||||||
} else {
|
|
||||||
this.has_more = false
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
@@ -117,7 +78,7 @@
|
|||||||
inputNum(e) {
|
inputNum(e) {
|
||||||
let number = Number(e.detail.value)
|
let number = Number(e.detail.value)
|
||||||
if (number <= this.balance) {
|
if (number <= this.balance) {
|
||||||
this.total = Number(e.detail.value) * this.price
|
this.total = Number(e.detail.value) * this.cost
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '最大值能超过' + this.balance + '',
|
title: '最大值能超过' + this.balance + '',
|
||||||
@@ -133,7 +94,7 @@
|
|||||||
all() {
|
all() {
|
||||||
if (this.balance > 0) {
|
if (this.balance > 0) {
|
||||||
this.withdraw_input = this.balance
|
this.withdraw_input = this.balance
|
||||||
this.total = this.balance * this.price
|
this.total = this.balance * this.cost
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '啥也没有,我也做不到~',
|
title: '啥也没有,我也做不到~',
|
||||||
@@ -142,84 +103,63 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 打开密码 出发提现功能
|
// 提现
|
||||||
open() {
|
actions(){
|
||||||
if (this.total > 0) {
|
let data = {
|
||||||
let params = {
|
bank_account_id:this.bankInfo.bank_account_id,
|
||||||
name: this.name,
|
amount:Number(this.withdraw_input)
|
||||||
card: this.card,
|
|
||||||
total: this.withdraw_input
|
|
||||||
}
|
|
||||||
if (params.name === '' || params.card === '' || params.total === 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '重新确认提现信息',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$refs.numberPad.open()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '啥也没有,我也做不到~',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
if(data.bank_account_id === undefined || data.bank_account_id === null || data.bank_account_id === ''){
|
||||||
// 输入密码成功后,,,
|
uni.showToast({
|
||||||
closeChange(e) {
|
title:this.bank_accounts>0?'请选择银行卡':'请添加银行卡',
|
||||||
uni.showLoading({
|
icon:'none'
|
||||||
title: '提现中~'
|
})
|
||||||
})
|
return;
|
||||||
let params = {
|
|
||||||
name: this.name,
|
|
||||||
card: this.card,
|
|
||||||
total: this.withdraw_input,
|
|
||||||
code: e
|
|
||||||
}
|
}
|
||||||
withdrawDo(params).then(res => {
|
uni.showModal({
|
||||||
uni.showToast({
|
title:'温馨提示',
|
||||||
title: '申请提现成功,耐心等待打款',
|
content:'您是否确认提现,将会扣除' +this.tax+'%手续费' ,
|
||||||
icon: 'none',
|
confirmColor:'#7c52fc',
|
||||||
duration: 2000
|
cancelColor:'#cacaca',
|
||||||
})
|
cancelText:'我再想想',
|
||||||
this.reset()
|
confirmText:'确认提现',
|
||||||
}).catch(err => {
|
success: (res) => {
|
||||||
uni.showToast({
|
if(res.confirm){
|
||||||
title: err.message,
|
withdrawsIndex(data).then(res=>{
|
||||||
icon: 'none',
|
uni.showToast({
|
||||||
duration: 2000
|
title:res.message,
|
||||||
})
|
icon:'none'
|
||||||
|
})
|
||||||
|
this.withdraw_input = ''
|
||||||
|
this.total = ''
|
||||||
|
this.getInfo()
|
||||||
|
}).catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.name = ''
|
|
||||||
this.card = ''
|
|
||||||
this.page = 1
|
|
||||||
this.has_more = true
|
|
||||||
this.withdraw_input = ''
|
|
||||||
this.total = 0
|
|
||||||
this.withdrawLists = []
|
|
||||||
this.withdrawLogs();
|
|
||||||
this.withdraw();
|
|
||||||
},
|
},
|
||||||
// 添加银行卡
|
// 添加银行卡
|
||||||
addCard() {
|
addBanks() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/wallet/addCard'
|
url: '/pages/wallet/addBank'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 选择银行卡
|
// 选择银行卡
|
||||||
selectCard(){
|
bankLists() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/wallet/selectCard'
|
url: '/pages/wallet/bankList'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 提现记录
|
// 提现记录
|
||||||
withdrawDetail(){
|
withdrawDetail() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/wallet/withdrawList'
|
url: '/pages/wallet/withdrawList'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -232,12 +172,14 @@
|
|||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.receiptCode {
|
.receiptCode {
|
||||||
color: #808080;
|
color: #808080;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
// margin: $margin 0;
|
// margin: $margin 0;
|
||||||
font-size: $title-size-m;
|
font-size: $title-size-m;
|
||||||
}
|
}
|
||||||
|
|
||||||
.WithdrawingCoin {
|
.WithdrawingCoin {
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -262,6 +204,7 @@
|
|||||||
opacity: .5;
|
opacity: .5;
|
||||||
transform: rotate(-7deg);
|
transform: rotate(-7deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.propery-content {
|
.propery-content {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@@ -292,11 +235,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.all {
|
.all {
|
||||||
color: $text-price;
|
color: $text-price;
|
||||||
width: 160rpx;
|
width: 160rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-name {
|
.item-name {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #303030;
|
color: #303030;
|
||||||
@@ -326,6 +271,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.withdrawing-content {
|
.withdrawing-content {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: $padding $padding $padding $padding * 2;
|
padding: $padding $padding $padding $padding * 2;
|
||||||
@@ -390,6 +336,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
background-image: linear-gradient(to right, #7c52fc, #976dff);
|
background-image: linear-gradient(to right, #7c52fc, #976dff);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@@ -400,9 +347,17 @@
|
|||||||
font-size: $title-size;
|
font-size: $title-size;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.des{
|
|
||||||
|
.des {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #cacaca;
|
color: #cacaca;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.total {
|
||||||
|
color: $mian-color;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
margin-left: 50rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,125 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<form>
|
|
||||||
<!-- 副标题 -->
|
|
||||||
<view class="sub-title">输入您的钱包助记词导入</view>
|
|
||||||
<!-- 助记词 -->
|
|
||||||
<view class="word">
|
|
||||||
<textarea placeholder="输入助记词"></textarea>
|
|
||||||
</view>
|
|
||||||
<!-- 设置钱包密码 -->
|
|
||||||
<view class="password">
|
|
||||||
<view class="group">
|
|
||||||
<view class="inputs">
|
|
||||||
<label>钱包名称</label>
|
|
||||||
<input type="text" placeholder="输入钱包名称" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="title">不少于8个字符。建议包含大小写,符号,特殊字符。</view>
|
|
||||||
<view class="group">
|
|
||||||
<view class="inputs">
|
|
||||||
<label>密码</label>
|
|
||||||
<input type="password" placeholder="请设置密码" />
|
|
||||||
</view>
|
|
||||||
<view class="inputs">
|
|
||||||
<label>确认密码</label>
|
|
||||||
<input type="password" placeholder="请确认密码" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="buttons">
|
|
||||||
<view class="text">什么是助记词?</view>
|
|
||||||
<button type="default" form-type="submit">开始导入</button>
|
|
||||||
</view>
|
|
||||||
</form>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 副标题
|
|
||||||
.sub-title{
|
|
||||||
line-height: 90rpx;
|
|
||||||
color: $text-gray;
|
|
||||||
text-align: center;
|
|
||||||
margin: $margin;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
// 助记词
|
|
||||||
.word{
|
|
||||||
background-color: white;
|
|
||||||
margin: $margin * 2;
|
|
||||||
padding: $padding + 10;
|
|
||||||
border-radius: $radius-m;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
|
||||||
& textarea{
|
|
||||||
height: 200rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 设置密码
|
|
||||||
.password{
|
|
||||||
padding: 0 $padding * 2;
|
|
||||||
.title{
|
|
||||||
margin-top: $margin * 2;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
color: $mian-color;
|
|
||||||
}
|
|
||||||
.group{
|
|
||||||
margin-top: $margin;
|
|
||||||
border-radius: $radius-m;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
|
||||||
background-color: white;
|
|
||||||
.inputs{
|
|
||||||
padding: $padding $padding + 10;
|
|
||||||
border-bottom: solid 1rpx $border-color;
|
|
||||||
&:last-child{
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
label{
|
|
||||||
color: $text-gray;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
input{
|
|
||||||
height: 70rpx;
|
|
||||||
line-height: 70rpx;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 按钮
|
|
||||||
.buttons{
|
|
||||||
padding: $padding * 2;
|
|
||||||
.text{
|
|
||||||
text-align: center;
|
|
||||||
line-height: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-bottom: $margin * 2;
|
|
||||||
font-size: $title-size-lg;
|
|
||||||
color: $mian-color;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
button{
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
background-color: $mian-color;
|
|
||||||
border-radius: $radius-lg;
|
|
||||||
color: white;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,144 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="animate__animated animate__fadeInRight">
|
|
||||||
<!-- 数字资产 -->
|
|
||||||
<view class="property">
|
|
||||||
<view class="title">总资产(元)</view>
|
|
||||||
<view class="number">0.00</view>
|
|
||||||
</view>
|
|
||||||
<!-- 资产列表 -->
|
|
||||||
<view class="lists">
|
|
||||||
<view class="lists-header">
|
|
||||||
资产列表
|
|
||||||
<uni-icons type="plus" size="24" color="#aa55ff"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<view class="item" v-for="(item, index) in 2" :key="index" @click="propertyInfo(item)">
|
|
||||||
<view class="cost">
|
|
||||||
<image class="logo" src="" mode="" />
|
|
||||||
<view class="title ellipsis">OC COIN</view>
|
|
||||||
<view class="text ellipsis">≈¥0.21</view>
|
|
||||||
</view>
|
|
||||||
<view class="balance">
|
|
||||||
<view class="title ellipsis">120,330.00</view>
|
|
||||||
<view class="text ellipsis">¥25269.3000</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
propertyInfo(e){
|
|
||||||
console.log(e)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: './property'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 数字资产
|
|
||||||
.property{
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
margin-top: $margin;
|
|
||||||
margin-left: $margin + ($margin / 2);
|
|
||||||
background-color: $mian-color;
|
|
||||||
border-radius: $radius 0 0 $radius;
|
|
||||||
padding: ($padding * 3) ($padding * 3) ($padding * 3) ($padding * 2);
|
|
||||||
color: white;
|
|
||||||
font-weight: bold;
|
|
||||||
&::before,&::after{
|
|
||||||
background-color: rgba($color: $red-color, $alpha: .03);
|
|
||||||
border-radius: 50%;
|
|
||||||
content: " ";
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
&::before{
|
|
||||||
top: -300rpx;
|
|
||||||
left: 40%;
|
|
||||||
height: 400rpx;
|
|
||||||
width: 400rpx;
|
|
||||||
}
|
|
||||||
&::after{
|
|
||||||
bottom: -200rpx;
|
|
||||||
left: -100rpx;
|
|
||||||
height: 300rpx;
|
|
||||||
width: 300rpx;
|
|
||||||
}
|
|
||||||
.title{
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
.number{
|
|
||||||
font-size: $title-size + 18;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 资产列表
|
|
||||||
.lists{
|
|
||||||
padding: $margin + ($margin / 2);
|
|
||||||
.lists-header{
|
|
||||||
display: flex;
|
|
||||||
font-size: $title-size + 2;
|
|
||||||
color: $text-color;
|
|
||||||
font-weight: bold;
|
|
||||||
padding: $padding 0 ($padding/2) 0;
|
|
||||||
justify-content: space-between;
|
|
||||||
justify-items: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.item{
|
|
||||||
background-color: white;
|
|
||||||
border-radius: $radius;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
|
|
||||||
margin-top: $margin;
|
|
||||||
padding: $padding * 2;
|
|
||||||
display: flex;
|
|
||||||
&:first-child{
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
.cost{
|
|
||||||
position: relative;
|
|
||||||
margin-right: $margin;
|
|
||||||
padding-left: 108rpx;
|
|
||||||
width: 50%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
.logo{
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 88rpx;
|
|
||||||
height: 88rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: $border-color;
|
|
||||||
margin-right: $margin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.balance{
|
|
||||||
padding-left: $padding;
|
|
||||||
width: 50%;
|
|
||||||
text-align: right;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.title{
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
.text{
|
|
||||||
font-size: $title-size-m;
|
|
||||||
color: $text-gray;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<!-- 提示信息 -->
|
|
||||||
<view class="prompt">
|
|
||||||
请按照顺序记录并确保正确备份助记词
|
|
||||||
</view>
|
|
||||||
<!-- 助记词 -->
|
|
||||||
<ul class="mnemonic">
|
|
||||||
<li v-for="(item, index) in mnemonic" :key="index">{{item}}</li>
|
|
||||||
</ul>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="buttons">
|
|
||||||
<view class="text">注:助记词是用户账户的唯一标识,不能分享给他人,掌握该助记词即可控制该账户与钱包</view>
|
|
||||||
<button type="default" @click="goto('/pages/wallet/validation')">验证助记词</button>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="skip">暂时不验证?<navigator url="/pages/index/index" open-type="switchTab">点此跳过</navigator></view> -->
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { seed } from "../../apis/interfaces/wallet"
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mnemonic: [], // 助记词
|
|
||||||
sign : '' // 校验签名
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
seed().then(res => {
|
|
||||||
this.mnemonic = res.seed.split(' ')
|
|
||||||
this.sign = res.sign
|
|
||||||
}).catch(err => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: err.message
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
goto(url){
|
|
||||||
uni.redirectTo({
|
|
||||||
url: url + '?seed=' + this.mnemonic + '&sign=' + this.sign
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 提示信息
|
|
||||||
.prompt{
|
|
||||||
color: $text-gray;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 90rpx;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
// 跳过
|
|
||||||
.skip{
|
|
||||||
padding: $padding * 2;
|
|
||||||
text-align: center;
|
|
||||||
color: $text-gray;
|
|
||||||
navigator{
|
|
||||||
color: $mian-color;
|
|
||||||
margin-left: $margin/2;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 助记词
|
|
||||||
.mnemonic{
|
|
||||||
margin: $margin $margin * 2;
|
|
||||||
border-radius: $radius-m;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
|
||||||
background-color: white;
|
|
||||||
padding: $padding;
|
|
||||||
list-style: none;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
li{
|
|
||||||
text-align: center;
|
|
||||||
height: 58rpx;
|
|
||||||
line-height: 58rpx;
|
|
||||||
width: 58rpx;
|
|
||||||
margin: $margin / 2;
|
|
||||||
color: $text-color;
|
|
||||||
background: rgba($color: $border-color, $alpha: .4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 按钮
|
|
||||||
.buttons{
|
|
||||||
padding: $padding $padding * 2;
|
|
||||||
.text{
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: $margin * 2;
|
|
||||||
font-size: $title-size-lg;
|
|
||||||
color: $red-color;
|
|
||||||
}
|
|
||||||
button{
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
background-color: $mian-color;
|
|
||||||
border-radius: $radius-lg;
|
|
||||||
color: white;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<!-- 私钥 -->
|
|
||||||
<view class="keys">
|
|
||||||
<view class="title">您已接收OC Chain托管</view>
|
|
||||||
<view class="key">{{key || '-'}}</view>
|
|
||||||
<view class="copykey" @click="copykey">复制我的私钥</view>
|
|
||||||
</view>
|
|
||||||
<!-- 疑问 -->
|
|
||||||
<view class="doubt" v-if="rules.length > 0">
|
|
||||||
<view class="doubt-item" v-for="(item, index) in rules" :key="index">
|
|
||||||
<view class="title">{{item.title || '-'}}</view>
|
|
||||||
<view class="content">{{item.description || '-'}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 免责说明 -->
|
|
||||||
<view class="liability">
|
|
||||||
<navigator url="/pages/wallet/cmsWithDraw">免责条款</navigator>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { privatekey, keyrules } from '@/apis/interfaces/wallet'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
key: "",
|
|
||||||
rules: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
Promise.all([privatekey(this.$Route.query.password), keyrules()]).then(res => {
|
|
||||||
let privatekey = res[0],
|
|
||||||
keyrules = res[1]
|
|
||||||
this.key = privatekey.private_key
|
|
||||||
this.rules = keyrules
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
copykey(){
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: this.key
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.keys{
|
|
||||||
margin: $margin * 2;
|
|
||||||
background: white;
|
|
||||||
padding: $padding * 2;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
|
|
||||||
border-radius: $radius;
|
|
||||||
.title{
|
|
||||||
text-align: center;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size + 4;
|
|
||||||
color: $text-color;
|
|
||||||
}
|
|
||||||
.key{
|
|
||||||
padding: $padding * 2 0;
|
|
||||||
text-align: center;
|
|
||||||
color: $mian-color;
|
|
||||||
word-wrap: break-word;
|
|
||||||
}
|
|
||||||
.copykey{
|
|
||||||
background-color: $mian-color;
|
|
||||||
color: white;
|
|
||||||
height: 95rpx;
|
|
||||||
line-height: 95rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-size: $title-size;
|
|
||||||
border-radius: $radius-m;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.doubt{
|
|
||||||
margin: $margin $margin * 2;
|
|
||||||
.doubt-item{
|
|
||||||
padding: $padding 0;
|
|
||||||
.title{
|
|
||||||
font-weight: bold;
|
|
||||||
color: $text-color;
|
|
||||||
line-height: 50rpx;
|
|
||||||
font-size: $title-size + 2;
|
|
||||||
}
|
|
||||||
.content{
|
|
||||||
color: $text-gray-lg;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
line-height: 40rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.liability{
|
|
||||||
text-align: center;
|
|
||||||
color: $text-gray;
|
|
||||||
@extend .ios-bottom;
|
|
||||||
navigator{
|
|
||||||
font-size: $title-size-sm;
|
|
||||||
display: inline-block;
|
|
||||||
line-height: 90rpx;
|
|
||||||
padding: 0 ($padding * 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<!-- 设置钱包密码 -->
|
|
||||||
<view class="password">
|
|
||||||
<view class="prompt">请设置6位数字密码。建议不要使用连续的数字。</view>
|
|
||||||
<view class="group">
|
|
||||||
<view class="inputs">
|
|
||||||
<label>密码</label>
|
|
||||||
<input type="digit" v-model="password" maxlength="6" password placeholder="请设置新密码" />
|
|
||||||
</view>
|
|
||||||
<view class="inputs">
|
|
||||||
<label>确认密码</label>
|
|
||||||
<input type="digit" v-model="verify" maxlength="6" password placeholder="请确认新密码" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="buttons">
|
|
||||||
<button type="default" form-type="submit" @click="createWallet">确认</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
securityReset
|
|
||||||
} from '@/apis/interfaces/wallet'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
password: '',
|
|
||||||
verify: '',
|
|
||||||
oldPassword: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.oldPassword = this.$Route.query.password
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 激活钱包
|
|
||||||
createWallet() {
|
|
||||||
if (this.password === '' || this.verify === '') {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '请设置密码'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.password !== this.verify) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '两次输入密码不一致'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
securityReset({
|
|
||||||
new_code: this.password,
|
|
||||||
old_code: this.oldPassword
|
|
||||||
}).then(res => {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '密码已重置',
|
|
||||||
showCancel:false,
|
|
||||||
success: res=> {
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}).catch(err => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: err.message
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 副标题
|
|
||||||
.sub-title {
|
|
||||||
color: $text-gray;
|
|
||||||
text-align: center;
|
|
||||||
margin: $margin * 2 $margin;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置密码
|
|
||||||
.password {
|
|
||||||
padding: 0 $padding * 2;
|
|
||||||
|
|
||||||
.prompt {
|
|
||||||
margin-top: $margin * 2;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
color: $mian-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.group {
|
|
||||||
margin-top: $margin;
|
|
||||||
border-radius: $radius-m;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
|
||||||
background-color: white;
|
|
||||||
|
|
||||||
.inputs {
|
|
||||||
padding: $padding $padding + 10;
|
|
||||||
border-bottom: solid 1rpx $border-color;
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
label {
|
|
||||||
color: $text-gray;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
height: 70rpx;
|
|
||||||
line-height: 70rpx;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 按钮
|
|
||||||
.buttons {
|
|
||||||
padding: $padding * 2;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
text-align: center;
|
|
||||||
line-height: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-bottom: $margin * 2;
|
|
||||||
font-size: $title-size-lg;
|
|
||||||
color: $mian-color;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
background-color: $mian-color;
|
|
||||||
border-radius: $radius-lg;
|
|
||||||
color: white;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<view class="webkit-box results">
|
|
||||||
<uni-icons type="checkbox-filled" size="88" color="#009b69"></uni-icons>
|
|
||||||
<view class="title">交易已提交</view>
|
|
||||||
<view class="sub-title">预计10秒内到账,可在交易记录中查询,以实际到账时间为准</view>
|
|
||||||
<view class="hash">
|
|
||||||
<view class="hash-title">交易哈希</view>
|
|
||||||
<view class="hash-text">{{hash}}</view>
|
|
||||||
</view>
|
|
||||||
<button class="results-button" type="default" @click="navBack">返回</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
hash: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad(e){
|
|
||||||
this.hash = e.hash
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
navBack(){
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.results{
|
|
||||||
height: 100vh;
|
|
||||||
box-sizing: border-box;
|
|
||||||
text-align: center;
|
|
||||||
padding-left: $padding * 3;
|
|
||||||
padding-right: $padding * 3;
|
|
||||||
padding-bottom: 20vh;
|
|
||||||
.title{
|
|
||||||
font-size: $title-size + 8;
|
|
||||||
color: $text-color;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 80rpx;
|
|
||||||
padding: $padding 0;
|
|
||||||
}
|
|
||||||
.sub-title{
|
|
||||||
color: $text-gray;
|
|
||||||
line-height: 40rpx;
|
|
||||||
}
|
|
||||||
.hash{
|
|
||||||
background-color: white;
|
|
||||||
padding: $padding * 2;
|
|
||||||
border-radius: $radius-lg;
|
|
||||||
margin-top: $margin * 2;
|
|
||||||
font-size: $title-size;
|
|
||||||
color: $text-color;
|
|
||||||
.hash-title{
|
|
||||||
padding-bottom: $padding;
|
|
||||||
}
|
|
||||||
.hash-text{
|
|
||||||
word-break:break-all;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.results-button{
|
|
||||||
margin-top: $margin * 3;
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
background-color: $mian-color;
|
|
||||||
color: white;
|
|
||||||
font-size: $title-size;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="selectCard">
|
|
||||||
<view class="bankInfo">
|
|
||||||
<image class="bankLogin" src="/static/imgs/bankLogo.png" mode="widthFix" />
|
|
||||||
<view class="right">
|
|
||||||
<view class="left">
|
|
||||||
<view class="title">浦发银行 <view class="tags">快捷支付</view>
|
|
||||||
</view>
|
|
||||||
<view class="des">储值卡</view>
|
|
||||||
<view class="no">622 8480530 382837819</view>
|
|
||||||
</view>
|
|
||||||
<u-icon name="calendar" color="rgba(255,255,255,0.6)" size='60' />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <u-toast ref="uToast" /> -->
|
|
||||||
<u-toast ref="uToast" />
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
chaineb
|
|
||||||
} from '@/apis/interfaces/mine';
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.selectCard {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 100vh;
|
|
||||||
padding-top: 30rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
.bankInfo {
|
|
||||||
width: calc(100% - 60rpx);
|
|
||||||
background-image: linear-gradient(to right, #7c52fc, #976dff);
|
|
||||||
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #976dff, $alpha: 0.6);
|
|
||||||
margin: 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: 80rpx;
|
|
||||||
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);
|
|
||||||
|
|
||||||
.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: #7C52FC;
|
|
||||||
|
|
||||||
&::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>
|
|
||||||
@@ -1,216 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<!-- 账户余额 -->
|
|
||||||
<view class="transfer-block">
|
|
||||||
<view class="unit">OCC</view>
|
|
||||||
<view class="transfer-flex">
|
|
||||||
<view class="item ellipsis">
|
|
||||||
<label>数量</label>{{balance.balance || '0.00'}}
|
|
||||||
</view>
|
|
||||||
<view class="item ellipsis">
|
|
||||||
<label>估值(CNY)</label>≈{{cny || '0.00'}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="sub-title">
|
|
||||||
<text>请认真确认地址及数量,地址错误无法找回</text>
|
|
||||||
</view>
|
|
||||||
<!-- 转账信息 -->
|
|
||||||
<view class="password">
|
|
||||||
<view class="group">
|
|
||||||
<view class="inputs input-scan">
|
|
||||||
<label>接收地址</label>
|
|
||||||
<input type="text" placeholder="请输入接收地址" v-model="address" />
|
|
||||||
<view class="input-scan-icon" @click="scanCode">
|
|
||||||
<uni-icons type="scan" size="22" color="#009b69"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="inputs">
|
|
||||||
<label>转账数量</label>
|
|
||||||
<input type="number" placeholder="请输入转账数量" v-model="number" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="group">
|
|
||||||
<view class="inputs">
|
|
||||||
<label>交易密码</label>
|
|
||||||
<input type="password" placeholder="请输入安全密码" v-model="password" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="buttons">
|
|
||||||
<button type="default" @click="submitTransfer">转账</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { sum, price, transfer } from '@/apis/interfaces/wallet'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
balance: {},
|
|
||||||
cny: '0.00',
|
|
||||||
address: '',
|
|
||||||
number: '',
|
|
||||||
password: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(e){
|
|
||||||
if(e.hashAddress) this.address = e.hashAddress
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
Promise.all([
|
|
||||||
sum(),
|
|
||||||
price()
|
|
||||||
]).then(res => {
|
|
||||||
this.balance = res[0]
|
|
||||||
if (res[0].balance > 0) this.cny = (res[1] * res[0].balance).toFixed(2)
|
|
||||||
}).catch(err => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: err.message
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 转账
|
|
||||||
submitTransfer(){
|
|
||||||
if(this.address === '' || this.number === '' || this.password === ''){
|
|
||||||
let messageText
|
|
||||||
if(this.address === '') messageText = '请输入接收地址'
|
|
||||||
else if(this.number === '') messageText = '请输入转账数量'
|
|
||||||
else if(this.password === '') messageText = '请输入安全密码'
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: messageText
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 提交转账信息
|
|
||||||
transfer({
|
|
||||||
to: this.address,
|
|
||||||
amount: this.number,
|
|
||||||
security_code: this.password
|
|
||||||
}).then(res => {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: './results?hash=' + res.txHash + '&number=' + this.number
|
|
||||||
})
|
|
||||||
}).catch(err => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: err.message
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 扫码
|
|
||||||
scanCode(){
|
|
||||||
uni.scanCode({
|
|
||||||
scanType: ['qrCode'],
|
|
||||||
success: res=> {
|
|
||||||
this.address = res.result
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 账户余额
|
|
||||||
.transfer-block{
|
|
||||||
background-color: white;
|
|
||||||
margin: $margin * 2;
|
|
||||||
border-radius: $radius-m;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
|
||||||
background-color: white;
|
|
||||||
padding: $padding $padding + 10;
|
|
||||||
.unit{
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size + 10;
|
|
||||||
line-height: 90rpx;
|
|
||||||
color: $text-color;
|
|
||||||
}
|
|
||||||
.transfer-flex{
|
|
||||||
display: flex;
|
|
||||||
padding: $padding 0;
|
|
||||||
border-top: solid 1rpx $border-color;
|
|
||||||
.item{
|
|
||||||
width: 50%;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
& > label{
|
|
||||||
color: $text-gray;
|
|
||||||
padding-right: $padding/2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 提示信息
|
|
||||||
.sub-title{
|
|
||||||
color: $text-gray;
|
|
||||||
text-align: center;
|
|
||||||
margin: $margin * 2 $margin;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
// 转账信息
|
|
||||||
.password{
|
|
||||||
padding: 0 $padding * 2;
|
|
||||||
.group{
|
|
||||||
margin-top: $margin;
|
|
||||||
border-radius: $radius-m;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
|
||||||
background-color: white;
|
|
||||||
.inputs{
|
|
||||||
padding: $padding $padding + 10;
|
|
||||||
border-bottom: solid 1rpx $border-color;
|
|
||||||
&:last-child{
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
label{
|
|
||||||
color: $text-gray;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
input{
|
|
||||||
height: 70rpx;
|
|
||||||
line-height: 70rpx;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.input-scan{
|
|
||||||
position: relative;
|
|
||||||
padding-right: ($padding*2) + 70;
|
|
||||||
.input-scan-icon{
|
|
||||||
position: absolute;
|
|
||||||
bottom: $padding;
|
|
||||||
right: $padding;
|
|
||||||
height: 70rpx;
|
|
||||||
width: 70rpx;
|
|
||||||
line-height: 70rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 按钮
|
|
||||||
.buttons{
|
|
||||||
padding: $padding * 2;
|
|
||||||
.text{
|
|
||||||
text-align: center;
|
|
||||||
line-height: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-bottom: $margin * 2;
|
|
||||||
font-size: $title-size-lg;
|
|
||||||
color: $mian-color;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
button{
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
background-color: $mian-color;
|
|
||||||
border-radius: $radius-lg;
|
|
||||||
color: white;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,169 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<!-- 提示信息 -->
|
|
||||||
<view class="prompt">
|
|
||||||
验证您的钱包助记词
|
|
||||||
</view>
|
|
||||||
<!-- 助记词 -->
|
|
||||||
<view class="mnemonic">
|
|
||||||
<view
|
|
||||||
class="item"
|
|
||||||
v-for="(item, index) in validation"
|
|
||||||
:key="index"
|
|
||||||
:class="item === null ? 'hide': ''"
|
|
||||||
@click="onKeys('removeKey', index)"
|
|
||||||
>{{ item }}</view>
|
|
||||||
</view>
|
|
||||||
<!-- 选择助记词 -->
|
|
||||||
<block v-if="mnemonic.length > 0">
|
|
||||||
<view class="mnemonic-title">
|
|
||||||
按顺序填写助记词
|
|
||||||
</view>
|
|
||||||
<view class="mnemonic-select">
|
|
||||||
<view class="item" v-for="(item, index) in mnemonic" :key="index" @click="onKeys('addKey', index)">{{ item }}</view>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
<!-- 按钮 -->
|
|
||||||
<view class="buttons">
|
|
||||||
<button type="default" @click="verifyMnemonic">验证</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { hash } from "../../apis/interfaces/wallet"
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
validation : new Array(15).fill(null), // 验证key
|
|
||||||
mnemonic : [], // 助记词key
|
|
||||||
sign : '', // 助记词校验签名
|
|
||||||
seedString : '', // 助记词原词
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(e) {
|
|
||||||
let seed = e.seed.split(',')
|
|
||||||
seed.sort(() => {
|
|
||||||
return Math.random() - .5
|
|
||||||
});
|
|
||||||
this.mnemonic = seed
|
|
||||||
this.sign = e.sign
|
|
||||||
this.seedString = e.seed
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 填写助记词
|
|
||||||
onKeys(type, index){
|
|
||||||
if(type === 'addKey') {
|
|
||||||
this.$set(this.validation, this.validation.findIndex(val => val === null), this.mnemonic[index])
|
|
||||||
this.$delete(this.mnemonic, index)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if(type === 'removeKey' && this.validation[index] !== null) {
|
|
||||||
this.mnemonic.push(this.validation[index])
|
|
||||||
this.$delete(this.validation, index)
|
|
||||||
this.validation.push(null)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 验证助记词
|
|
||||||
verifyMnemonic(){
|
|
||||||
if(this.validation.findIndex(val => val === null) > -1){
|
|
||||||
uni.showToast({
|
|
||||||
title: '请完整填写助记词',
|
|
||||||
icon : 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let seed = this.validation.toString().replace(/,/g, ',')
|
|
||||||
if (this.seedString !== seed) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '验证失败,请确认您的助记词',
|
|
||||||
icon : 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.redirectTo({
|
|
||||||
url: './create'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
// 提示信息
|
|
||||||
.prompt{
|
|
||||||
color: $text-gray;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 90rpx;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
}
|
|
||||||
// 选择助记词
|
|
||||||
.mnemonic-title{
|
|
||||||
padding-top: $padding * 2;
|
|
||||||
margin: 0 $margin * 2;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
color: $mian-color;
|
|
||||||
}
|
|
||||||
.mnemonic-select{
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
padding: $padding $padding + $padding / 2;
|
|
||||||
.item{
|
|
||||||
background-color: white;
|
|
||||||
line-height: 68rpx;
|
|
||||||
height: 68rpx;
|
|
||||||
width: 68rpx;
|
|
||||||
text-align: center;
|
|
||||||
margin: $margin / 2;
|
|
||||||
border-radius: $radius-m;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 助记词
|
|
||||||
.mnemonic{
|
|
||||||
margin: $margin ($margin * 2);
|
|
||||||
border-radius: $radius-m;
|
|
||||||
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
|
|
||||||
background-color: white;
|
|
||||||
padding: $padding;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: flex-start;
|
|
||||||
.item{
|
|
||||||
background: rgba($color: $border-color, $alpha: .4);
|
|
||||||
width: 58rpx;
|
|
||||||
height: 58rpx;
|
|
||||||
line-height: 58rpx;
|
|
||||||
text-align: center;
|
|
||||||
color: $text-color;
|
|
||||||
margin: $margin / 2;
|
|
||||||
&.hide{
|
|
||||||
border:dashed 1px $border-color;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 按钮
|
|
||||||
.buttons{
|
|
||||||
padding: $padding $padding * 2;
|
|
||||||
.text{
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: $margin * 2;
|
|
||||||
font-size: $title-size-lg;
|
|
||||||
color: $red-color;
|
|
||||||
}
|
|
||||||
button{
|
|
||||||
height: 90rpx;
|
|
||||||
line-height: 90rpx;
|
|
||||||
background-color: $mian-color;
|
|
||||||
border-radius: $radius-lg;
|
|
||||||
color: white;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: $title-size;
|
|
||||||
&[disabled]{
|
|
||||||
background: rgba($color: $mian-color, $alpha: .8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -30,16 +30,23 @@
|
|||||||
<!-- 列表。。。 -->
|
<!-- 列表。。。 -->
|
||||||
<view class="ew_lists" v-if="lists.length>0">
|
<view class="ew_lists" v-if="lists.length>0">
|
||||||
<view style="padding-top: 30rpx;" v-for="(item,index) in lists " :key="index">
|
<view style="padding-top: 30rpx;" v-for="(item,index) in lists " :key="index">
|
||||||
<!-- <view class="receiptCode">回执单号:hash392J3K,390-9DKDKDIOKLK</view> -->
|
<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="item">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<span>能量球:150</span>
|
<span>
|
||||||
<span>金额≈¥300</span>
|
能量球:{{item.quantity}}
|
||||||
</view>
|
<span class='left-des'>金额≈¥{{item.take}} 手续费:{{item.tax}}</span>
|
||||||
<view class="right">
|
</span>
|
||||||
<span> {{item.created_at}} 提现</span>
|
<span>{{item.create_at}}</span>
|
||||||
<span> {{item.paid_at || index === 0 ? '2021-11-11 11:11:11到账':'努力打款中'}}</span>
|
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <view class="right">
|
||||||
|
<span> {{item.create_at}}</span>
|
||||||
|
<span> -</span>
|
||||||
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -53,16 +60,15 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
chaineb
|
withdrawsIndexLists
|
||||||
} from '@/apis/interfaces/mine';
|
} from '@/apis/interfaces/withdraws';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lists: [1, 1.1, 1, 1],
|
lists: [],
|
||||||
has_next_page: true,
|
has_next_page: true,
|
||||||
page: 1,
|
page: 1,
|
||||||
type: 'year', // 统计类型day日,month月,year年
|
type: 'year', // 统计类型day日,month月,year年
|
||||||
cointype: 'in', // in 收入 out 支出
|
|
||||||
date: new Date().toISOString().slice(0, 4), // 日:Y-m-d,月Y-m,年Y
|
date: new Date().toISOString().slice(0, 4), // 日:Y-m-d,月Y-m,年Y
|
||||||
params: {
|
params: {
|
||||||
year: true,
|
year: true,
|
||||||
@@ -98,12 +104,12 @@
|
|||||||
page: this.page,
|
page: this.page,
|
||||||
type: this.type,
|
type: this.type,
|
||||||
date: this.date,
|
date: this.date,
|
||||||
cointype: this.cointype
|
|
||||||
}
|
}
|
||||||
chaineb(data).then(res => {
|
withdrawsIndexLists(data).then(res => {
|
||||||
this.account = res.account
|
console.log(res)
|
||||||
this.lists = this.lists.concat(res.lists)
|
this.account = res.all
|
||||||
this.has_next_page = res.has_next_page
|
this.lists = this.lists.concat(res.lists.data)
|
||||||
|
this.has_next_page = res.lists.page.has_more
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
@@ -153,8 +159,8 @@
|
|||||||
this.type = type
|
this.type = type
|
||||||
this.params = {
|
this.params = {
|
||||||
year: true,
|
year: true,
|
||||||
month: false,
|
month: true,
|
||||||
day: false
|
day: true
|
||||||
}
|
}
|
||||||
this.date = this.currentDay
|
this.date = this.currentDay
|
||||||
this.reset()
|
this.reset()
|
||||||
@@ -335,7 +341,7 @@
|
|||||||
|
|
||||||
.record-money {
|
.record-money {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 60rpx;
|
font-size: 70rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
@@ -359,7 +365,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-bottom: solid 1rpx #f8f8f8;
|
border-bottom: solid 1rpx #f8f8f8;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 0 0 $padding*0.8 0;
|
padding: 0 0 $padding*0.8 50rpx;
|
||||||
|
|
||||||
.left,
|
.left,
|
||||||
.right {
|
.right {
|
||||||
@@ -368,18 +374,22 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
font-size: $title-size-m;
|
font-size: 30rpx;
|
||||||
// font-weight: 600;
|
|
||||||
padding-top: 10rpx;
|
padding-top: 10rpx;
|
||||||
color: #808080;
|
color: $text-price;
|
||||||
|
.left-des{
|
||||||
|
color: #999;
|
||||||
|
font-size: 26rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
span:nth-child(2) {
|
span:nth-child(2) {
|
||||||
color: #824F9A;
|
color: #C0C0C0;
|
||||||
font-size: $title-size-m;
|
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
font-size: 26rpx;
|
||||||
padding-top: $padding *0.5;
|
padding-top: $padding *0.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -387,12 +397,34 @@
|
|||||||
.right {
|
.right {
|
||||||
font-size: $title-size-m;
|
font-size: $title-size-m;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
color: #666;
|
color: #999;
|
||||||
|
|
||||||
span:nth-child(1) {
|
span:nth-child(1) {
|
||||||
padding-bottom: $padding*0.5;
|
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>
|
</style>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 569 B After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.5 KiB |
22
uni_modules/uni-badge/changelog.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
## 1.1.6(2021-09-22)
|
||||||
|
- 修复 在字节小程序上样式不生效的 bug
|
||||||
|
## 1.1.5(2021-07-30)
|
||||||
|
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||||
|
## 1.1.4(2021-07-29)
|
||||||
|
- 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性
|
||||||
|
## 1.1.3(2021-06-24)
|
||||||
|
- 优化 示例项目
|
||||||
|
## 1.1.1(2021-05-12)
|
||||||
|
- 新增 组件示例地址
|
||||||
|
## 1.1.0(2021-05-12)
|
||||||
|
- 新增 uni-badge 的 absolute 属性,支持定位
|
||||||
|
- 新增 uni-badge 的 offset 属性,支持定位偏移
|
||||||
|
- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点
|
||||||
|
- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+
|
||||||
|
- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式
|
||||||
|
## 1.0.7(2021-05-07)
|
||||||
|
- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug
|
||||||
|
- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug
|
||||||
|
- 新增 uni-badge 属性 custom-style, 支持自定义样式
|
||||||
|
## 1.0.6(2021-02-04)
|
||||||
|
- 调整为uni_modules目录规范
|
||||||
253
uni_modules/uni-badge/components/uni-badge/uni-badge.vue
Normal file
@@ -0,0 +1,253 @@
|
|||||||
|
<template>
|
||||||
|
<view class="uni-badge--x">
|
||||||
|
<slot />
|
||||||
|
<text v-if="text" :class="classNames" :style="[badgeWidth, positionStyle, customStyle, dotStyle]"
|
||||||
|
class="uni-badge"
|
||||||
|
@click="onClick()">{{displayValue}}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* Badge 数字角标
|
||||||
|
* @description 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景
|
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=21
|
||||||
|
* @property {String} text 角标内容
|
||||||
|
* @property {String} type = [default|primary|success|warning|error] 颜色类型
|
||||||
|
* @value default 灰色
|
||||||
|
* @value primary 蓝色
|
||||||
|
* @value success 绿色
|
||||||
|
* @value warning 黄色
|
||||||
|
* @value error 红色
|
||||||
|
* @property {String} size = [normal|small] Badge 大小
|
||||||
|
* @value normal 一般尺寸
|
||||||
|
* @value small 小尺寸
|
||||||
|
* @property {String} inverted = [true|false] 是否无需背景颜色
|
||||||
|
* @event {Function} click 点击 Badge 触发事件
|
||||||
|
* @example <uni-badge text="1"></uni-badge>
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: 'UniBadge',
|
||||||
|
emits:['click'],
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: 'default'
|
||||||
|
},
|
||||||
|
inverted: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
isDot: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
maxNum: {
|
||||||
|
type: Number,
|
||||||
|
default: 99
|
||||||
|
},
|
||||||
|
absolute: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
offset: {
|
||||||
|
type: Array,
|
||||||
|
default () {
|
||||||
|
return [0, 0]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: String,
|
||||||
|
default: 'normal'
|
||||||
|
},
|
||||||
|
customStyle: {
|
||||||
|
type: Object,
|
||||||
|
default () {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
width() {
|
||||||
|
return String(this.text).length * 8 + 12
|
||||||
|
},
|
||||||
|
classNames() {
|
||||||
|
const {
|
||||||
|
inverted,
|
||||||
|
type,
|
||||||
|
size,
|
||||||
|
absolute
|
||||||
|
} = this
|
||||||
|
return [
|
||||||
|
inverted ? 'uni-badge--' + type + '-inverted' : '',
|
||||||
|
'uni-badge--' + type,
|
||||||
|
'uni-badge--' + size,
|
||||||
|
absolute ? 'uni-badge--absolute' : ''
|
||||||
|
].join(' ')
|
||||||
|
},
|
||||||
|
positionStyle() {
|
||||||
|
if (!this.absolute) return {}
|
||||||
|
let w = this.width / 2,
|
||||||
|
h = 10
|
||||||
|
if (this.isDot) {
|
||||||
|
w = 5
|
||||||
|
h = 5
|
||||||
|
}
|
||||||
|
const x = `${- w + this.offset[0]}px`
|
||||||
|
const y = `${- h + this.offset[1]}px`
|
||||||
|
|
||||||
|
const whiteList = {
|
||||||
|
rightTop: {
|
||||||
|
right: x,
|
||||||
|
top: y
|
||||||
|
},
|
||||||
|
rightBottom: {
|
||||||
|
right: x,
|
||||||
|
bottom: y
|
||||||
|
},
|
||||||
|
leftBottom: {
|
||||||
|
left: x,
|
||||||
|
bottom: y
|
||||||
|
},
|
||||||
|
leftTop: {
|
||||||
|
left: x,
|
||||||
|
top: y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const match = whiteList[this.absolute]
|
||||||
|
return match ? match : whiteList['rightTop']
|
||||||
|
},
|
||||||
|
badgeWidth() {
|
||||||
|
return {
|
||||||
|
width: `${this.width}px`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dotStyle() {
|
||||||
|
if (!this.isDot) return {}
|
||||||
|
return {
|
||||||
|
width: '10px',
|
||||||
|
height: '10px',
|
||||||
|
borderRadius: '10px'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
displayValue() {
|
||||||
|
const { isDot, text, maxNum } = this
|
||||||
|
return isDot ? '' : (Number(text) > maxNum ? `${maxNum}+` : text)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onClick() {
|
||||||
|
this.$emit('click');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$bage-size: 12px;
|
||||||
|
$bage-small: scale(0.8);
|
||||||
|
$bage-height: 20px;
|
||||||
|
|
||||||
|
.uni-badge--x {
|
||||||
|
/* #ifdef APP-NVUE */
|
||||||
|
// align-self: flex-start;
|
||||||
|
/* #endif */
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: inline-block;
|
||||||
|
/* #endif */
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--absolute {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
overflow: hidden;
|
||||||
|
box-sizing: border-box;
|
||||||
|
/* #endif */
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: row;
|
||||||
|
height: $bage-height;
|
||||||
|
line-height: $bage-height;
|
||||||
|
color: $uni-text-color;
|
||||||
|
border-radius: 100px;
|
||||||
|
background-color: $uni-bg-color-hover;
|
||||||
|
background-color: transparent;
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Helvetica Neue', Helvetica, sans-serif;
|
||||||
|
font-size: $bage-size;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
cursor: pointer;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--inverted {
|
||||||
|
padding: 0 5px 0 0;
|
||||||
|
color: $uni-bg-color-hover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--default {
|
||||||
|
color: $uni-text-color;
|
||||||
|
background-color: $uni-bg-color-hover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--default-inverted {
|
||||||
|
color: $uni-text-color-grey;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--primary {
|
||||||
|
color: $uni-text-color-inverse;
|
||||||
|
background-color: $uni-color-primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--primary-inverted {
|
||||||
|
color: $uni-color-primary;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--success {
|
||||||
|
color: $uni-text-color-inverse;
|
||||||
|
background-color: $uni-color-success;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--success-inverted {
|
||||||
|
color: $uni-color-success;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--warning {
|
||||||
|
color: $uni-text-color-inverse;
|
||||||
|
background-color: $uni-color-warning;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--warning-inverted {
|
||||||
|
color: $uni-color-warning;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--error {
|
||||||
|
color: $uni-text-color-inverse;
|
||||||
|
background-color: $uni-color-error;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--error-inverted {
|
||||||
|
color: $uni-color-error;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-badge--small {
|
||||||
|
transform: $bage-small;
|
||||||
|
transform-origin: center center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
88
uni_modules/uni-badge/package.json
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-badge",
|
||||||
|
"displayName": "uni-badge 数字角标",
|
||||||
|
"version": "1.1.6",
|
||||||
|
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
|
||||||
|
"keywords": [
|
||||||
|
"",
|
||||||
|
"badge",
|
||||||
|
"uni-ui",
|
||||||
|
"uniui",
|
||||||
|
"数字角标",
|
||||||
|
"徽章"
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": ""
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"example": "../../temps/example_temps"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"category": [
|
||||||
|
"前端组件",
|
||||||
|
"通用组件"
|
||||||
|
],
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"App": {
|
||||||
|
"app-vue": "y",
|
||||||
|
"app-nvue": "y"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "y",
|
||||||
|
"Android Browser": "y",
|
||||||
|
"微信浏览器(Android)": "y",
|
||||||
|
"QQ浏览器(Android)": "y"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "y",
|
||||||
|
"IE": "y",
|
||||||
|
"Edge": "y",
|
||||||
|
"Firefox": "y",
|
||||||
|
"Safari": "y"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "y",
|
||||||
|
"阿里": "y",
|
||||||
|
"百度": "y",
|
||||||
|
"字节跳动": "y",
|
||||||
|
"QQ": "y"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "y",
|
||||||
|
"联盟": "y"
|
||||||
|
},
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
58
uni_modules/uni-badge/readme.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
|
||||||
|
## Badge 数字角标
|
||||||
|
> **组件名:uni-badge**
|
||||||
|
> 代码块: `uBadge`
|
||||||
|
|
||||||
|
|
||||||
|
数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景,
|
||||||
|
|
||||||
|
### 安装方式
|
||||||
|
|
||||||
|
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
|
||||||
|
|
||||||
|
如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
|
||||||
|
|
||||||
|
### 基本用法
|
||||||
|
|
||||||
|
在 ``template`` 中使用组件
|
||||||
|
|
||||||
|
```html
|
||||||
|
<uni-badge size="small" :text="100" absolute="rightBottom" type="primary">
|
||||||
|
<button type="default">右上</button>
|
||||||
|
</uni-badge>
|
||||||
|
<uni-badge text="1"></uni-badge>
|
||||||
|
<uni-badge text="2" type="purple" @click="bindClick"></uni-badge>
|
||||||
|
<uni-badge text="3" type="primary" :inverted="true"></uni-badge>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### Badge Props
|
||||||
|
|
||||||
|
|属性名 |类型 |默认值 |说明 |
|
||||||
|
|:-: |:-: |:-: |:-: |
|
||||||
|
|text |String |- |角标内容 |
|
||||||
|
|type |String |default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)|
|
||||||
|
|size |String |normal |Badge 大小,可取值:normal、small |
|
||||||
|
|is-dot |Boolean|false |不展示数字,只有一个小点 |
|
||||||
|
|max-num |String/Numbuer|99 |展示封顶的数字值,超过 99 显示99+ |
|
||||||
|
|custom-style |Object | {} |自定义 Badge 样式, 样式对象语法 |
|
||||||
|
|inverted |Boolean|false |是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 |
|
||||||
|
|absolute (不支持 nvue) |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) |
|
||||||
|
|offset |Array[number]| [0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top])|
|
||||||
|
|
||||||
|
### Badge Events
|
||||||
|
|
||||||
|
|事件名 |事件说明 |返回参数 |
|
||||||
|
|:-: |:-: |:-: |
|
||||||
|
|@click |点击 Badge 触发事件| - |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 组件示例
|
||||||
|
|
||||||
|
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge)
|
||||||