|
@@ -54,6 +54,9 @@
|
|
|
</view>
|
|
|
<uni-load-more :status="loadingType"></uni-load-more>
|
|
|
</view>
|
|
|
+ <u-action-sheet :show="showBank" :actions="bankList" title="请选择银行卡"
|
|
|
+ @close="showBank = false" @select="bankSelect">
|
|
|
+ </u-action-sheet>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -72,10 +75,13 @@
|
|
|
import {
|
|
|
qianBao
|
|
|
} from '@/api/wallet.js';
|
|
|
+ import {
|
|
|
+ getBank
|
|
|
+ } from '@/api/set.js';
|
|
|
import dayjs from '@/libs/dayjs/dayjs.min.js';
|
|
|
export default {
|
|
|
computed: {
|
|
|
- ...mapState('user', ['hasLogin'])
|
|
|
+ ...mapState('user', ['hasLogin','userInfo'])
|
|
|
},
|
|
|
filters: {
|
|
|
dateFormat: function(value) {
|
|
@@ -84,9 +90,10 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- tabCurrentIndex: 1,
|
|
|
+ tabCurrentIndex: 0,
|
|
|
navList: ['卖出', '买入'],
|
|
|
number: '',
|
|
|
+ money:'',
|
|
|
price: '',
|
|
|
page: 1,
|
|
|
limit: 10,
|
|
@@ -97,6 +104,9 @@
|
|
|
max_sell:''
|
|
|
},
|
|
|
loaded:false,
|
|
|
+ showBank:false,
|
|
|
+ bankList:[],
|
|
|
+ bank_id:'',
|
|
|
}
|
|
|
},
|
|
|
onNavigationBarButtonTap(res) {
|
|
@@ -117,6 +127,55 @@
|
|
|
that.money = +res.data.like_usdt;
|
|
|
})
|
|
|
},
|
|
|
+ getBank() {
|
|
|
+ const obj = this;
|
|
|
+ getBank().then((res) => {
|
|
|
+ let data = res.data.list
|
|
|
+ let reg = /^(.{4})(?:\d+)(.{4})$/
|
|
|
+ data.forEach(item => {
|
|
|
+ item.bank_code1 = item.bank_code.replace(reg, "**** $2")
|
|
|
+ item.name = item.bank+' '+item.bank_code1
|
|
|
+ })
|
|
|
+ obj.bankList = data
|
|
|
+ console.log(obj.bankList,'obj.bankList')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bankSelect(e){
|
|
|
+ const obj = this;
|
|
|
+ this.bank_id = e.id
|
|
|
+ if(this.bank_id){
|
|
|
+ uni.showModal({
|
|
|
+ title: '请输入支付密码',
|
|
|
+ editable:true,
|
|
|
+ success: res => {
|
|
|
+ if(res.confirm){
|
|
|
+ sellPush({
|
|
|
+ type: 'USDT',
|
|
|
+ num: obj.number,
|
|
|
+ price: obj.price,
|
|
|
+ phone: obj.userInfo.phone || '',
|
|
|
+ trade_psw: res.content,
|
|
|
+ sell_type: 'money',
|
|
|
+ bank_id:obj.bank_id
|
|
|
+ }).then((
|
|
|
+ data
|
|
|
+ ) => {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: data.msg,
|
|
|
+ icon:'none'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {},
|
|
|
+ complete: () => {}
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
getIndex(){
|
|
|
getIndex({})
|
|
|
.then(({
|
|
@@ -127,6 +186,7 @@
|
|
|
})
|
|
|
.catch(e => {});
|
|
|
},
|
|
|
+
|
|
|
// 购买订单
|
|
|
commitorder(item) {
|
|
|
uni.showModal({
|
|
@@ -164,31 +224,15 @@
|
|
|
// 挂出
|
|
|
submission() {
|
|
|
let obj = this;
|
|
|
- uni.showModal({
|
|
|
- title: '请输入支付密码',
|
|
|
- editable:true,
|
|
|
- success: res => {
|
|
|
- if(res.confirm){
|
|
|
- sellPush({
|
|
|
- type: 'USDT',
|
|
|
- num: obj.number,
|
|
|
- price: obj.price,
|
|
|
- phone: '',
|
|
|
- trade_psw: res.content,
|
|
|
- sell_type: 'money',
|
|
|
- }).then(({
|
|
|
- data
|
|
|
- }) => {
|
|
|
-
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- console.log(e);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- fail: () => {},
|
|
|
- complete: () => {}
|
|
|
- });
|
|
|
+ if(obj.bankList.length > 0){
|
|
|
+ obj.showBank = true
|
|
|
+ }else{
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '请先去添加银行卡',
|
|
|
+ icon:'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
init() {
|
|
|
this.page = 1;
|
|
@@ -196,6 +240,7 @@
|
|
|
this.loadingType = 'more';
|
|
|
this.loadData();
|
|
|
this.qianBao();
|
|
|
+ this.getBank()
|
|
|
},
|
|
|
tabClick(index) {
|
|
|
this.tabCurrentIndex = index;
|