Commit be460f14 authored by Damon's avatar Damon

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

parents a0ac102a f0919a31
......@@ -10,6 +10,7 @@ const UNI_APP = {
},
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'http://deudn.c.pp.cc/',
uc_img_url_pre: 'http://deudn.c.pp.cc/',
argoDebugMode: 1
}
module.exports = UNI_APP;
......@@ -9,6 +9,7 @@ const UNI_APP = {
},
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com',
uc_img_url_pre: 'https://img2.banshouhui.com/',
argoDebugMode: 0
}
......
......@@ -9,6 +9,7 @@ const UNI_APP = {
},
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com',
uc_img_url_pre: 'https://img2.banshouhui.com/',
argoDebugMode: 1
}
module.exports = UNI_APP;
......@@ -44,7 +44,7 @@
@value-change="fieldValueChange">
</xh-select>
<view v-else-if="item.formType==='file'">
<xh-files
<xh-files
:ref="`fileChild${itemIndex}`"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :partnerCompanyId="partnerCompanyId" :categoryId="categoryId" :value='form[item.fieldsName] || []'
@value-change="fieldValueChange">
......@@ -53,9 +53,9 @@
<u-image class="pic" width="160rpx" height="160rpx" :border-radius="10" @click="selectUpload(JSON.stringify(item), groupIndex, itemIndex)" :src="uploadImage"></u-image>
</view>
</template>
</xh-files>
</view>
</xh-files>
</view>
<xh-location v-else-if="item.formType==='location'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
......@@ -533,7 +533,7 @@
// 更新预计超出金额
let amount = this.calMaterialCraftListAmount(this.form.materialList)
amount += this.calMaterialCraftListAmount(this.form.craftList)
this.$set(this.form,'overAmount',amount)
this.$set(this.form,'allExtraAmt',amount)
},
// 字段的值更新
fieldValueChange(data) {
......@@ -628,7 +628,7 @@
this.getWatermark()
},
// 获取拍照规范
photograph(){
photograph(){
let self = this
let param = {"partnerCompanyId":this.partnerCompanyId,
"categoryId":this.categoryId,
......@@ -644,7 +644,7 @@
})
},
// 获取水印
getWatermark(){
getWatermark(){
if(getApp().globalData.photo.waterSetting){
return
}
......@@ -658,7 +658,7 @@
});
},
// ------------------------- 以上方法为上传组件相关 -------------------------
// ------------------------- 以下方法为展示滚动切换 -------------------------
// 点击左边的栏目切换
async swichMenu(index) {
......
......@@ -89,6 +89,9 @@
import Settle from '@/components/settle/index.vue'
import base from '@/components/upload/index';
const app = getApp()
const globalUrl = process.uniEnv || {};
const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl;
const uc_img_url_pre = globalUrl.uc_img_url_pre;
export default {
mixins:[base],
components: {
......@@ -184,11 +187,13 @@ export default {
],
submitSuccess: false,
saving: false,
wxToken: "",
}
},
onLoad(e) {
getApp().trackPage('入驻证件信息上传页')
this.initSettledInfo()
this.getWxToken()
},
updated() {
// 该方法性能消耗大目前不使用
......@@ -259,6 +264,20 @@ export default {
},
methods: {
async getWxToken() {
let that = this;
wx.request({
url: ucenterApiUrl + "/v1/settled/wx-token",
method: 'GET',
header: {
'Authorization': that.vuex_token
},
success(res) {
that.wxToken = res.data.access_token;
console.log(that.wxToken);
}
})
},
// 初始化入驻信息
async initSettledInfo() {
let self = this
......@@ -380,44 +399,53 @@ export default {
uni.showLoading({
title: '识别中'
})
let request = {
front: this.$u.api.checkSettleIDCardFront,
back: this.$u.api.checkSettleIDCardBack,
};
let url = {
front: this.fileInfo.id_card_front,
back: this.fileInfo.id_card_back,
};
const params = {
["id_card_" + type]: url[type],
id: this.fileInfo.id || 0,
}
const res = await request[type](params);
if (res.code !== 200) {
if (type === "front") {
this.fileInfo.id_card_name = "";
this.fileInfo.id_card_number = "";
this.frontErrorMsg = res.message || "识别失败,请重新上传"
} else {
this.fileInfo.id_card_back_check = false;
this.backErrorMsg = res.message || "识别失败,请重新上传"
}
return
}
uni.hideLoading()
if (type === "front") {
this.fileInfo.id_card_name =
res.data.id_card_name || "";
this.fileInfo.id_card_number =
res.data.id_card_number || "";
this.frontErrorMsg = (!this.fileInfo.id_card_name || !this.fileInfo.id_card_number) ? "识别失败,请重新上传" : ''
} else {
this.fileInfo.id_card_expire = res.data.id_card_expire || "";
this.fileInfo.id_card_back_check = true;
this.backErrorMsg = !this.fileInfo.id_card_expire ? "识别失败,请重新上传" : ''
}
let url = {
front: this.fileInfo.id_card_front,
back: this.fileInfo.id_card_back,
};
let that = this;
// 文字识别
let access_token = this.wxToken;
let img_pre = uc_img_url_pre;
let img_url = img_pre + url[type] //"tmp/X8XIAJvSt7jp29a97371a466eecab48e7a7c35d92861.jpg";
console.log(access_token);
console.log(img_url);
img_url = encodeURI(img_url);
let post_url = 'https://api.weixin.qq.com/cv/ocr/idcard?type=MODE&img_url='+img_url+'&access_token=' + access_token;
//url识别图片
wx.request({
url: post_url,
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
method: 'POST',
success(res) {
uni.hideLoading()
let info = res.data;
if(info.errcode != 0){
if (type === "front") {
that.fileInfo.id_card_name = "";
that.fileInfo.id_card_number = "";
that.frontErrorMsg = res.message || "识别失败,请重新上传"
} else {
that.fileInfo.id_card_back_check = false;
that.backErrorMsg = res.message || "识别失败,请重新上传"
}
return
} else if (type === "front") {
that.fileInfo.id_card_name =
info.name || "";
that.fileInfo.id_card_number =
info.id || "";
that.frontErrorMsg = (!that.fileInfo.id_card_name || !that.fileInfo.id_card_number) ? "识别失败,请重新上传" : ''
} else {
that.fileInfo.id_card_expire = info.valid_date || "";
that.fileInfo.id_card_back_check = true;
that.backErrorMsg = !that.fileInfo.id_card_expire ? "识别失败,请重新上传" : ''
}
}
})
},
checkFileInfo() {
let formFlag = true;
......
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