Commit 21c6237c authored by 李俊赕's avatar 李俊赕

Merge branch 'dev-photo-tools' of...

Merge branch 'dev-photo-tools' of https://git.banshouhui.com/heyinchen/take_order into dev-photo-tools
parents bbe47c40 ba5e49ea
...@@ -5,13 +5,13 @@ let settledApiFun = function(vm){ ...@@ -5,13 +5,13 @@ let settledApiFun = function(vm){
/* 查询用户基本信息 */ /* 查询用户基本信息 */
let getSettleBaseInfo = async (params = {}) => await vm.$u.get(codeApiUrl+'/v1/settled/get-settled-info', params); let getSettleBaseInfo = async (params = {}) => await vm.$u.get(codeApiUrl+'/v1/settled/get-settled-info', params);
/* 获取认证区域信息 */ /* 获取认证区域信息 */
let getSettleArea = async (params = {}) => await vm.$u.get('/v1/h5/settled/area', params); let getSettleArea = async (params = {}) => await vm.$u.get('/v1/settled/area', params);
/* 提交用户基本信息 */ /* 提交用户基本信息 */
let submitSettleBaseInfo = async (params = {}) => await vm.$u.get('/v1/h5/settled/save-info', params); let submitSettleBaseInfo = async (params = {}) => await vm.$u.get('/v1/settled/save-info', params);
/* 校验身份证正面 */ /* 校验身份证正面 */
let checkSettleIDCardFront = async (params = {}) => await vm.$u.post(codeApiUrl+'/v1/h5/settled/card-front', params); let checkSettleIDCardFront = async (params = {}) => await vm.$u.post(codeApiUrl+'/v1/settled/card-front', params);
/* 校验身份证反面 */ /* 校验身份证反面 */
let checkSettleIDCardBack = async (params = {}) => await vm.$u.post(codeApiUrl+'/v1/h5/settled/card-back', params); let checkSettleIDCardBack = async (params = {}) => await vm.$u.post(codeApiUrl+'/v1/settled/card-back', params);
/* 缴纳保证金 */ /* 缴纳保证金 */
const token = 'RTOKENe56f873b5823477fa2e15572f8fa7eb3a5fb6f7b' const token = 'RTOKENe56f873b5823477fa2e15572f8fa7eb3a5fb6f7b'
const url = codeApiUrl+'/v1/settled/pay-deposit?access-token='+token const url = codeApiUrl+'/v1/settled/pay-deposit?access-token='+token
......
...@@ -7,6 +7,23 @@ ...@@ -7,6 +7,23 @@
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/settle/file",
"style": {
"navigationBarTitleText": "入驻资料"
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "下单"
}
},
{ {
"path": "pages/settle/index", "path": "pages/settle/index",
"style": { "style": {
...@@ -40,12 +57,6 @@ ...@@ -40,12 +57,6 @@
}, },
{ {
"path": "pages/settle/file",
"style": {
"navigationBarTitleText": "入驻资料"
}
},{
"path": "pages/settle/file-upload", "path": "pages/settle/file-upload",
"style": { "style": {
"navigationBarTitleText": "图片上传" "navigationBarTitleText": "图片上传"
...@@ -78,13 +89,7 @@ ...@@ -78,13 +89,7 @@
} }
}, },
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "下单"
}
},
{ {
"path": "pages/sign/index", "path": "pages/sign/index",
......
...@@ -162,6 +162,12 @@ ...@@ -162,6 +162,12 @@
title: '加载中' title: '加载中'
}) })
this.newCheckSettleIDCard(type)
return
//*/
// checkSettleIDCardFront // checkSettleIDCardFront
// checkSettleIDCardBack // checkSettleIDCardBack
let request = { let request = {
...@@ -173,33 +179,139 @@ ...@@ -173,33 +179,139 @@
front: this.fileInfo.id_card_front, front: this.fileInfo.id_card_front,
back: this.fileInfo.id_card_back, back: this.fileInfo.id_card_back,
}; };
console.log('url111111:')
console.log(url)
const params = { const params = {
["id_card_" + type]: url[type], ["id_card_" + type]: url[type],
id: this.fileInfo.id || 0, id: this.fileInfo.id || 0,
} }
console.log('params111111:')
console.log(params)
const res = await request[type](params); const res = await request[type](params);
console.log('1111111111111111')
console.log('res:')
console.log(res)
uni.hideLoading() uni.hideLoading()
if (res.status === 200) { if (res.status === 200) {
if (type === "front") { if (type === "front") {
console.log('front11111111111111')
this.fileInfo.id_card_name = this.fileInfo.id_card_name =
res.data.id_card_name || ""; res.data.id_card_name || "";
this.fileInfo.id_card_number = this.fileInfo.id_card_number =
res.data.id_card_number || ""; res.data.id_card_number || "";
} else { } else {
console.log('22222222222222')
this.fileInfo.id_card_back_check = true; this.fileInfo.id_card_back_check = true;
} }
} else { } else {
if (type === "front") { if (type === "front") {
console.log('front333333333333')
this.fileInfo.id_card_name = "";
this.fileInfo.id_card_number = "";
} else {
console.log('44444444444444444')
this.fileInfo.id_card_back_check = false;
}
}
},
//新身份证 正反面上传
newCheckSettleIDCard: function (type) {
let url = {
front: this.fileInfo.id_card_front,
back: this.fileInfo.id_card_back,
};
let that = this
uni.request({
url: 'http://rest-u.yunya.com/v1/settled/card-' + type,
method: 'POST',
header:{
Authorization:'RTOKENe56f873b5823477fa2e15572f8fa7eb3a5fb6f7b',
token:getApp().globalData.token
},
data: {
["id_card_" + type]: url[type],
id: this.fileInfo.id || 0
},
success: (res) => {
uni.hideLoading()
console.log('上传 正面 成功')
console.log(res)
if(res.statusCode==401){
uni.navigateTo({
url:'/pages/login/wxlogin'
})
return
}
if(res.statusCode==200){
console.log('statusCode == 200')
if (type === "front") {
console.log('front11111111111111')
this.fileInfo.id_card_name =
res.data.id_card_name || "";
this.fileInfo.id_card_number =
res.data.id_card_number || "";
} else {
console.log('22222222222222')
this.fileInfo.id_card_back_check = true;
}
}else{
console.log('statusCode != 200')
if (type === "front") {
console.log('front333333333333')
this.fileInfo.id_card_name = ""; this.fileInfo.id_card_name = "";
this.fileInfo.id_card_number = ""; this.fileInfo.id_card_number = "";
} else { } else {
console.log('44444444444444444')
this.fileInfo.id_card_back_check = false; this.fileInfo.id_card_back_check = false;
} }
uni.showToast({
icon:'none',
title:res.data.message
})
}
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon:'none',
title:'上传正面失败'
})
// console.log('获取下单列表 失败')
// console.log(e)
} }
})
}, },
checkFileInfo() { checkFileInfo() {
let formFlag = true; let formFlag = true;
const fileInfo = this.fileInfo; const fileInfo = this.fileInfo;
console.log('fileInfo:')
console.log(fileInfo)
let checkFunc = function (item) { let checkFunc = function (item) {
const value = fileInfo[item.filedName]; const value = fileInfo[item.filedName];
const tips = "请上传您的" + item.label; const tips = "请上传您的" + item.label;
...@@ -241,6 +353,10 @@ ...@@ -241,6 +353,10 @@
return formFlag; return formFlag;
}, },
submitFileInfo() { submitFileInfo() {
this.newSubmitFileInfo()
return
if (!this.checkFileInfo()) { if (!this.checkFileInfo()) {
return; return;
} }
...@@ -250,7 +366,7 @@ ...@@ -250,7 +366,7 @@
} }
submitInfoData.other_certificates = fileInfo.other_certificates && submitInfoData.other_certificates = fileInfo.other_certificates &&
fileInfo.other_certificates.join(","), fileInfo.other_certificates.join(","),
Indicator.open(); //Indicator.open();
this.$u.api.post("@u/v1/h5/settled/submit-info", submitInfoData) this.$u.api.post("@u/v1/h5/settled/submit-info", submitInfoData)
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
...@@ -267,10 +383,99 @@ ...@@ -267,10 +383,99 @@
} }
}) })
.catch(() => { .catch(() => {
Indicator.close(); //Indicator.close();
}); });
}, },
//新 提交请求
newSubmitFileInfo: function (){
if (!this.checkFileInfo()) {
return;
}
const fileInfo = this.fileInfo;
let submitInfoData = {
...fileInfo,
}
submitInfoData.other_certificates = fileInfo.other_certificates &&
fileInfo.other_certificates.join(","),
//let that = this
uni.request({
url: 'http://rest-u.yunya.com/v1/settled/submit-info',
method: 'POST',
header:{
Authorization:'RTOKENe56f873b5823477fa2e15572f8fa7eb3a5fb6f7b',
token:getApp().globalData.token
},
data: {
id_card_name:submitInfoData.id_card_name,
id_card_number:submitInfoData.id_card_number,
id_card_front:submitInfoData.id_card_front,
id_card_back:submitInfoData.id_card_back,
electrician_certificate:submitInfoData.electrician_certificate,
vehicle_photos:submitInfoData.other_certificates,
other_certificates:submitInfoData.other_certificates
},
success: (res) => {
uni.hideLoading()
console.log('提交 证件信息 成功')
console.log(res)
if(res.statusCode==401){
uni.navigateTo({
url:'/pages/login/wxlogin'
})
return
}
if(res.statusCode==200){
console.log('statusCode=200')
if (res.data) {
uni.showToast({
title:'工作人员2个工作日内审核回复',
icon:'none'
})
this.submitSuccess = true;
}
let timer = setTimeout(() => {
clearTimeout(timer)
uni.navigateTo({
url: '/pages/settle/prompt'
+'?promptType=step1'
})
}, 2000)
}else{
uni.showToast({
icon:'none',
title:"提交失败"
})
}
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon:'none',
title:'提交证件信息失败'
})
// console.log('获取下单列表 失败')
// console.log(e)
}
})
},
submitBaseInfo() { submitBaseInfo() {
const baseInfo = this.baseInfo; const baseInfo = this.baseInfo;
if (!this.checkBaseInfo()) { if (!this.checkBaseInfo()) {
...@@ -301,7 +506,8 @@ ...@@ -301,7 +506,8 @@
let timer = setTimeout(() => { let timer = setTimeout(() => {
clearTimeout(timer) clearTimeout(timer)
uni.navigateTo({ uni.navigateTo({
url: '/pages/settle/file' url: '/pages/settle/prompt'
+'?promptType=step1'
}) })
}, 2000) }, 2000)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment