优化
This commit is contained in:
+43
-12
@@ -1,4 +1,5 @@
|
||||
import { API } from './../../../utils/network/api'
|
||||
import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
|
||||
|
||||
const api = new API()
|
||||
const app = getApp()
|
||||
@@ -17,8 +18,10 @@ Page({
|
||||
withdrawal_amount: "xxxx",
|
||||
income_tax: "xx",
|
||||
contactKeFu: false,
|
||||
sub_visible: false,
|
||||
skeleton_loading: true,
|
||||
order_inquiry_ids: []
|
||||
order_inquiry_ids: [],
|
||||
sub_btn_disabled: false
|
||||
},
|
||||
onLoad(option){
|
||||
let order_inquiry_ids = option.order_inquiry_ids;
|
||||
@@ -33,29 +36,50 @@ Page({
|
||||
this.postDoctorWithdrawalInfo(params);
|
||||
},
|
||||
onShow(){
|
||||
|
||||
this.setData({
|
||||
sub_btn_disabled: false
|
||||
})
|
||||
},
|
||||
go(e){
|
||||
let url = e.currentTarget.dataset.url;
|
||||
app.go(url);
|
||||
},
|
||||
contactKeFu(e){
|
||||
let _this = this;
|
||||
|
||||
console.log("concatKeFu");
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: ['JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc'],
|
||||
success (res) {
|
||||
console.log(res);
|
||||
_this.setData({
|
||||
contactKeFu: true
|
||||
let tmplIds = ['JMPmlYGh1HcUSuEfJCVQUIsZv4H5ar3QvXZfrNYNFuc']
|
||||
let sub_promise = requestSubscribeMessage(tmplIds)
|
||||
sub_promise.then(res => {
|
||||
console.log("订阅成功")
|
||||
this.setData({
|
||||
contactKeFu: true
|
||||
})
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
let errCode = err.errCode
|
||||
if(errCode == 20004){
|
||||
this.setData({
|
||||
sub_visible: true,
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
subcancelDialog(){
|
||||
this.setData({
|
||||
sub_visible: false
|
||||
})
|
||||
},
|
||||
subconfirmDialog(){
|
||||
this.setData({
|
||||
sub_visible: false
|
||||
})
|
||||
wx.openSetting({
|
||||
success (res) {
|
||||
console.log(res.authSetting)
|
||||
}
|
||||
})
|
||||
},
|
||||
postDoctorWithdrawalInfo(params){
|
||||
|
||||
//获取提现数据
|
||||
api.postDoctorWithdrawalInfo(params).then(response => {
|
||||
console.log(response);
|
||||
@@ -74,9 +98,13 @@ Page({
|
||||
}
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
|
||||
})
|
||||
},
|
||||
postDoctorWithdrawal(){
|
||||
this.setData({
|
||||
sub_btn_disabled: true
|
||||
})
|
||||
let params = {};
|
||||
params.order_inquiry_id = this.data.order_inquiry_ids.join(",");
|
||||
params.withdrawal_amount_total = this.data.withdrawal_amount;
|
||||
@@ -94,6 +122,9 @@ Page({
|
||||
})
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
this.setData({
|
||||
sub_btn_disabled: false
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -6,6 +6,7 @@
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"t-skeleton": "tdesign-miniprogram/skeleton/skeleton"
|
||||
"t-skeleton": "tdesign-miniprogram/skeleton/skeleton",
|
||||
"t-dialog": "tdesign-miniprogram/dialog/dialog"
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="container">
|
||||
<view class="top">
|
||||
<view class="txt_title">结算银行卡</view>
|
||||
<view class="rule" bindtap="go" data-url="/Pages/yishi/agreement_detail/index?agreement_id=12">提现规则<van-icon name="warning-o" color="#FF9800" /></view>
|
||||
<view class="rule" bindtap="go" data-url="/Pages/agreement_page/index?agreement_id=12">提现规则<van-icon name="warning-o" color="#FF9800" /></view>
|
||||
</view>
|
||||
<view class="bankcard" wx:if="{{!skeleton_loading}}">
|
||||
<view class="bankcard_icon">
|
||||
@@ -58,7 +58,7 @@
|
||||
</view> -->
|
||||
|
||||
<view class="bottom">
|
||||
<van-button bind:click="postDoctorWithdrawal" disabled="{{order_inquiry_ids.length == 0}}" custom-style="border-radius: 10rpx;font-size: 30rpx;" block color="#3CC7C0">提取</van-button>
|
||||
<van-button bind:click="postDoctorWithdrawal" disabled="{{order_inquiry_ids.length == 0 || sub_btn_disabled}}" custom-style="border-radius: 10rpx;font-size: 30rpx;" block color="#3CC7C0">提取</van-button>
|
||||
<view class="kefu" bindtap="contactKeFu">
|
||||
<text>联系客服</text>
|
||||
</view>
|
||||
@@ -71,4 +71,18 @@
|
||||
confirm-button-color="#3CC7C0"
|
||||
confirm-button-open-type="contact"
|
||||
/>
|
||||
|
||||
<t-dialog
|
||||
visible="{{ sub_visible }}"
|
||||
title="温馨提示"
|
||||
content="您已关闭订阅消息通知,请点击“确认”按钮在设置中打开订阅通知。"
|
||||
>
|
||||
<view slot="cancel-btn" class="dialog dialog_cancel_btn" bindtap="subcancelDialog">
|
||||
取消
|
||||
</view>
|
||||
<view slot="confirm-btn" class="dialog dialog_confirm_btn" bindtap="subconfirmDialog">
|
||||
确定
|
||||
</view>
|
||||
</t-dialog>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -139,5 +139,18 @@ page{
|
||||
color: #3CC7C0;
|
||||
margin: 30rpx;
|
||||
}
|
||||
|
||||
.dialog{
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
}
|
||||
.dialog_cancel_btn{
|
||||
border-top: 1px solid #E9E9E9;
|
||||
border-right: 1px solid #E9E9E9;
|
||||
}
|
||||
.dialog_confirm_btn{
|
||||
border-top: 1px solid #E9E9E9;
|
||||
color: #3CC7C0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user