优化
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { API } from './../../../utils/network/api'
|
||||
import { FileUtil } from './../../../utils/fileutil'
|
||||
import { requestSubscribeMessage } from './../../../utils/requestSubscribeUtil';
|
||||
const api = new API()
|
||||
const app = getApp()
|
||||
Page({
|
||||
@@ -15,7 +16,8 @@ Page({
|
||||
btn_txt: "提交",
|
||||
multi_point_status: "",
|
||||
btn_disabled: true,
|
||||
sfz_show: false
|
||||
sfz_show: false,
|
||||
sub_visible: false,
|
||||
},
|
||||
|
||||
onLoad(){
|
||||
@@ -99,66 +101,88 @@ Page({
|
||||
})
|
||||
}
|
||||
},
|
||||
add(){
|
||||
let _this = this;
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: ['XWfEQYtb8_ubz8pCs3GoCG6TFxpDz9jn52895yvDm3s','bGGoKtDZC23GZtrrxuy6i5V7OhHgRgwXWx4yoDO1tlA'],
|
||||
success (res) {
|
||||
console.log(res);
|
||||
console.log(_this.data.id_card_front);
|
||||
console.log(_this.data.id_card_back);
|
||||
|
||||
if(_this.data.id_card_front.length == 0){
|
||||
wx.showToast({
|
||||
title: '身份证正面为空',
|
||||
icon: "error"
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
if(_this.data.id_card_back.length == 0){
|
||||
wx.showToast({
|
||||
title: '身份证反面为空',
|
||||
icon: "error"
|
||||
})
|
||||
return;
|
||||
}
|
||||
let id_card_front = _this.data.id_card_front[0].url;
|
||||
let id_card_back = _this.data.id_card_back[0].url;
|
||||
let sign_image = _this.data.sign_image[0].url;
|
||||
console.log("id_card_front: ", id_card_front);
|
||||
console.log("id_card_back: ", id_card_back);
|
||||
console.log("sign_image: ", sign_image);
|
||||
if(sign_image == ""){
|
||||
wx.showToast({
|
||||
title: '手写签名为空',
|
||||
icon: "error"
|
||||
})
|
||||
return;
|
||||
}
|
||||
let params = {};
|
||||
params.id_card_front = id_card_front;
|
||||
params.id_card_back = id_card_back;
|
||||
params.sign_image = sign_image;
|
||||
api.postDoctorAuthMulti(params).then(response => {
|
||||
console.log("postDoctorAuthMulti: ",response);
|
||||
wx.showToast({
|
||||
title: '提交成功',
|
||||
icon: "success"
|
||||
})
|
||||
_this.setData({
|
||||
btn_txt: "审核中",
|
||||
btn_disabled: true
|
||||
})
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
})
|
||||
},
|
||||
fail (res) { console.log(res) },
|
||||
complete (res) { console.log(res) },
|
||||
subcancelDialog(){
|
||||
this.setData({
|
||||
sub_visible: false
|
||||
})
|
||||
|
||||
this.goadd()
|
||||
},
|
||||
subconfirmDialog(){
|
||||
this.setData({
|
||||
sub_visible: false
|
||||
})
|
||||
wx.openSetting({
|
||||
success (res) {
|
||||
console.log(res.authSetting)
|
||||
}
|
||||
})
|
||||
},
|
||||
add(){
|
||||
let tmplIds = ['XWfEQYtb8_ubz8pCs3GoCG6TFxpDz9jn52895yvDm3s','bGGoKtDZC23GZtrrxuy6i5V7OhHgRgwXWx4yoDO1tlA']
|
||||
let sub_promise = requestSubscribeMessage(tmplIds)
|
||||
sub_promise.then(res => {
|
||||
console.log("订阅成功")
|
||||
this.goadd()
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
let errCode = err.errCode
|
||||
if(errCode == 20004){
|
||||
this.setData({
|
||||
sub_visible: true,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
goadd(){
|
||||
let _this = this;
|
||||
console.log(_this.data.id_card_front);
|
||||
console.log(_this.data.id_card_back);
|
||||
|
||||
if(_this.data.id_card_front.length == 0){
|
||||
wx.showToast({
|
||||
title: '身份证正面为空',
|
||||
icon: "error"
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
if(_this.data.id_card_back.length == 0){
|
||||
wx.showToast({
|
||||
title: '身份证反面为空',
|
||||
icon: "error"
|
||||
})
|
||||
return;
|
||||
}
|
||||
let id_card_front = _this.data.id_card_front[0].url;
|
||||
let id_card_back = _this.data.id_card_back[0].url;
|
||||
let sign_image = _this.data.sign_image[0].url;
|
||||
console.log("id_card_front: ", id_card_front);
|
||||
console.log("id_card_back: ", id_card_back);
|
||||
console.log("sign_image: ", sign_image);
|
||||
if(sign_image == ""){
|
||||
wx.showToast({
|
||||
title: '手写签名为空',
|
||||
icon: "error"
|
||||
})
|
||||
return;
|
||||
}
|
||||
let params = {};
|
||||
params.id_card_front = id_card_front;
|
||||
params.id_card_back = id_card_back;
|
||||
params.sign_image = sign_image;
|
||||
api.postDoctorAuthMulti(params).then(response => {
|
||||
console.log("postDoctorAuthMulti: ",response);
|
||||
wx.showToast({
|
||||
title: '提交成功',
|
||||
icon: "success"
|
||||
})
|
||||
_this.setData({
|
||||
btn_txt: "审核中",
|
||||
btn_disabled: true
|
||||
})
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
})
|
||||
},
|
||||
doUploadFile(event) {
|
||||
console.log("index douploadFIle: ", event);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"van-divider": "@vant/weapp/divider/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-image": "@vant/weapp/image/index"
|
||||
"van-image": "@vant/weapp/image/index",
|
||||
"t-dialog": "tdesign-miniprogram/dialog/dialog"
|
||||
}
|
||||
}
|
||||
@@ -97,4 +97,17 @@
|
||||
</view>
|
||||
</van-popup>
|
||||
|
||||
<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>
|
||||
@@ -54,4 +54,18 @@
|
||||
}
|
||||
.zhiye_popup_img{
|
||||
margin-top: 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