|
|
@@ -9,7 +9,7 @@
|
|
|
</view>
|
|
|
</navigator>
|
|
|
|
|
|
- <navigator url="select-bank" class="bank" v-else hover-class="none">
|
|
|
+ <navigator :url="'select-bank?id='+bank.id" class="bank" v-else hover-class="none">
|
|
|
<view class="left center">
|
|
|
<image :src="bank.bankType?'/static/bank/'+bank.bankType+'.png':''" mode=""></image>
|
|
|
<view class="content">
|
|
|
@@ -106,14 +106,15 @@
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.fetchCardList()
|
|
|
this.fetchShopDetail()
|
|
|
},
|
|
|
onShow() {
|
|
|
- if (this.canReset) {
|
|
|
- this.bank = this.$util.getBackParams('bank')
|
|
|
+ let bank=this.$util.getBackParams('bank')
|
|
|
+ if (!this.$isEmpty(bank)) {
|
|
|
+ this.bank=bank
|
|
|
+ }else{
|
|
|
+ this.fetchCardList()
|
|
|
}
|
|
|
- this.canReset = true
|
|
|
},
|
|
|
methods: {
|
|
|
async fetchShopDetail() {
|
|
|
@@ -148,8 +149,37 @@
|
|
|
this.withdrawAmount=this.canWithDraw
|
|
|
this.$refs.amountInput.initialMoney(this.withdrawAmount)
|
|
|
},
|
|
|
- withdrawConfirm(){
|
|
|
-
|
|
|
+ async withdrawConfirm(){
|
|
|
+ if (this.$isEmpty(this.bank)) {
|
|
|
+ this.$u.toast('请选择银行')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let params={
|
|
|
+ shopId:this.vuex_shopId,
|
|
|
+ amount:parseFloat(this.withdrawAmount),
|
|
|
+ bankId:this.bank.id
|
|
|
+ }
|
|
|
+ let orderId=(await this.$api.withdraw.submit(params)).data
|
|
|
+ if (this.$isEmpty(orderId)) {
|
|
|
+ this.$u.toast('提现失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let data={
|
|
|
+ orderId,
|
|
|
+ orderType:"USER_WITHDRAW"
|
|
|
+ }
|
|
|
+ let res=await this.$api.withdraw.yeeWithdraw(data)
|
|
|
+ if (res.data.status=="SUCCESS") {
|
|
|
+ this.$dialog.showModal('银行处理中').then(()=>{
|
|
|
+ this.$back()
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (res.data.returnMsg=='账户余额不足') {
|
|
|
+ this.$dialog.showModalAndBack('提现失败,平台账户余额不足')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$dialog.showModalAndBack(res.data.returnMsg)
|
|
|
}
|
|
|
}
|
|
|
};
|