123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <template>
- <view style="padding-top: 50rpx;">
- <view class="bank">
- <view class="bank_name">
- {{ bankInfo.bank_name}}
- </view>
- <view class="bank_time">
- 绑定时间:{{ bankInfo.time}}
- </view>
- <view class="bank_btn" @click="UnBank">
- 解除绑定
- </view>
- </view>
- </view>
- </template>
- <script>
- import { _API_BankInfo, _API_UnbindBank } from '../../apis/zbs.js';
- export default {
- data() {
- return {
- type: '',
- bankInfo: {},
- }
- },
- onLoad(e) {
- this.type == e.type
- },
- onShow() {
- this.getBankInfo()
- },
- methods: {
- getBankInfo() {
- _API_BankInfo().then(res => {
- if (res.code == 200) {
- this.showBank = true
- this.bankInfo = res.data
- } else {
- uni.showModal({
- content: res.message || '获取失败',
- showCancel: false
- });
- return false;
- }
- })
- },
- // 解除绑定
- UnBank() {
- uni.showModal({
- title: '提示',
- content: '确定要解绑该银行卡吗?',
- success: (res) => {
- if (res.confirm) {
- uni.showLoading()
- _API_UnbindBank({ id: this.bankInfo.id }).then(res => {
- uni.hideLoading()
- if (res.code == 200) {
- if (this.type == 1) {
- uni.reLaunch({
- url: './detail'
- })
- } else {
- uni.navigateBack({
- delta: 2
- })
- }
- } else {
- uni.showModal({
- title: '失败',
- content: res.message || '操作失败',
- showCancel: false
- })
- return false;
- }
- })
- .catch(err => {
- uni.hideLoading()
- })
- }
- }
- })
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .bank {
- border-radius: 16rpx;
- margin: 0 30rpx 0 30rpx;
- background-color: #fff;
- // border: 2rpx dashed #FF232C;
- padding: 24rpx;
- font-size: 28rpx;
- &_name {
- // text-align: center;
- font-weight: bold;
- font-size: 32rpx;
- margin-bottom: 20rpx;
- }
- &_btn {
- margin: 50rpx auto 0;
- width: 600rpx;
- line-height: 88rpx;
- border-radius: 44rpx;
- text-align: center;
- color: #FF232C;
- font-size: 32rpx;
- border: 2rpx solid #FF232C;
- }
- }
- </style>
|