Commit d3d0f3c0 authored by 刘用法's avatar 刘用法

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

parents 0b7191b6 c9f79e1b
......@@ -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;
......@@ -12,11 +12,8 @@
}
} else if (process.env.NODE_ENV === "production") {
if (NODE_ENV === 'test') {
ENV_VAR = require('./.env.test.js');
} else if (NODE_ENV === 'prod') {
ENV_VAR = require('./.env.prod.js');
}
// ENV_VAR = require('./.env.prod.js');
ENV_VAR = require('./.env.test.js');
}
if (ENV_VAR) {
process.uniEnv = {};
......
......@@ -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;
......@@ -120,6 +120,9 @@
height: 38px;
.txt {
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
</style>
......@@ -185,6 +185,9 @@
height: 38px;
.txt {
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.text-view {
......
......@@ -5,20 +5,20 @@
<u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" title="完工信息" title-bold></u-navbar>
<u-tabs class="order-tabs" ref="tabs" :current="tabIndex" name="panelName" :list="list" @change="tabsChange" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="80" font-size="32"></u-tabs>
<view class="u-menu-wrap">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" :scroll-into-view="itemId" v-if="list[tabIndex].items.length > 1">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" v-if="list[tabIndex].items.length > 1">
<view v-for="(item,index) in list[tabIndex].items" :key="index" class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
<text class="u-line-1">{{item.name}}</text>
</view>
</scroll-view>
<scroll-view :scroll-top="scrollRightTop" :enhanced="true" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll">
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll" :scroll-into-view="itemId">
<u-form :model="form" ref="uForm">
<template v-for="(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])">
<view class="class-item" :key="groupIndex">
<view class="title" v-if="groupItem.name !== '基本信息'">{{groupItem.name}}</view>
<view class="class-bd">
<u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top"
:prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200">
:prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200" :id="`item${item.fieldsId}`">
<view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}}
......@@ -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">
......@@ -147,6 +147,7 @@
menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id
oldItemId: '',
menuItemPos: [],
arr: [],
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
......@@ -369,6 +370,7 @@
self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex
self.oldItemId = `item${ele.fieldsId}`
}
})
})
......@@ -433,6 +435,7 @@
self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex
self.oldItemId = `item${ele.fieldsId}`
}
}
})
......@@ -460,8 +463,8 @@
locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项
this.tabIndex = panelIndex
this.arr = []
this.scrollRightTop = 0
this.current = groupIndex
this.scrollRightTop = 0;
this.current = 0;
this.$nextTick(function() {
this.swichMenu(groupIndex)
})
......@@ -497,16 +500,6 @@
})
}
},
tabsChange(index){
this.tabIndex = index
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.leftMenuStatus(0)
this.$nextTick(function() {
this.getMenuItemTop()
})
},
calMaterialCraftListAmount(arr){
let amount = 0
if(arr){
......@@ -563,13 +556,26 @@
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
this.leftMenuStatus(0)
this.$nextTick(function() {
this.getMenuItemTop()
this.current = 0
this.leftMenuStatus(0)
const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
this.oldItemId = `item${itemId}`
this.$nextTick(async () => {
if (this.oldItemId) this.itemId = this.oldItemId
})
}
},
tabsChange(index){
this.tabIndex = index
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.leftMenuStatus(0)
this.$nextTick(function() {
if (this.oldItemId)this.itemId = this.oldItemId
this.getMenuItemTop()
})
},
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
selectUpload(item, groupIndex, itemIndex){
......@@ -624,7 +630,7 @@
this.getWatermark()
},
// 获取拍照规范
photograph(){
photograph(){
let self = this
let param = {"partnerCompanyId":this.partnerCompanyId,
"categoryId":this.categoryId,
......@@ -640,7 +646,7 @@
})
},
// 获取水印
getWatermark(){
getWatermark(){
if(getApp().globalData.photo.waterSetting){
return
}
......@@ -654,17 +660,20 @@
});
},
// ------------------------- 以上方法为上传组件相关 -------------------------
// ------------------------- 以下方法为展示滚动切换 -------------------------
// 点击左边的栏目切换
async swichMenu(index) {
if (this.arr.length == 0) {
await this.getMenuItemTop();
}
console.log("index, this.current", index, this.current)
if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() {
this.scrollRightTop = this.arr[index];
this.itemId = this.oldItemId
if(!this.oldItemId) this.scrollRightTop = this.arr[index];
this.oldItemId = ''
this.current = index;
this.leftMenuStatus(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;
......
......@@ -184,7 +184,7 @@ uploader.requestError = function(e) {
throw e;
} else {
uni.showToast({
title: "网络错误,请检查一下网络",
title: "当前网络信号较差,请耐心等待;或者尝试切换网络环境",
icon: "none"
});
}
......
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