Commit c4e3fbe5 authored by 李俊赕's avatar 李俊赕

v1.0.0bug修复

parent 24540e44
......@@ -116,10 +116,15 @@ const install = (Vue, vm) => {
if (res.header.__token__) {
vm.$u.vuex('vuex__token__', res.header.__token__);
}
console.log(res,'res')
const code = getCode(res)
switch (code) {
case 1:
case 0:
if(res.status ===401 || res.statusCode === 401){
vm.$u.route('/pages/login/wxlogin');
return
}
return result;
case 200:
if(!result.data){
......@@ -138,11 +143,12 @@ const install = (Vue, vm) => {
// });
// return;
// }
let pages = getCurrentPages();
if((pages[pages.length - 1]).route!=='pages/login/wxlogin'){
util.setToken('')
vm.$u.route('/pages/login/wxlogin');
return
return
}
return result;
case 403://没有权限访问
......
......@@ -9,21 +9,10 @@ export default {
uptokenURL: globalUrl.ucenterUrl.apiUrl + '/v1/tokens',
imgList: [],
imgs:[],
uploadToken: ''
uploadToken: '',
selectNum:999,
};
},
props: {
uploadVisible: {
//选择按钮是否显示
type: Boolean,
default: true,
},
selectNum: {
//选择图片的数量
type: Number,
default: 9999,
},
},
computed: {
uploadBtnShow() {
let flag = this.imgList.length < this.selectNum
......@@ -174,7 +163,6 @@ export default {
// },
async removeImg(index) {
this.imgList.splice(index, 1)
this.imgs.splice(index, 1)
// this.$emit('image-change', this.imgList) //将图片回传父页面
},
getUrlKey(file) {
......
......@@ -70,6 +70,9 @@
this.pageTitle = item.label || '图片上传'
}
})
if(this.uploadType!=='other_certificates'){
this.selectNum = 1
}
uni.setNavigationBarTitle({
title: this.pageTitle
});
......@@ -82,12 +85,6 @@
let selected = this.selected
let prevVue = pages[pages.length - 2].$vm
const uploadType = this.uploadType
// let imgUrl = this.imgs.length>0 && this.imgs[0]
// if(uploadType==='other_certificates'){
// imgUrl = this.imgs.join(',')
// prevVue.imgObj[uploadType] = imgUrl
// }
// prevVue.fileInfo[uploadType] = imgUrl
prevVue.imgObj[uploadType] = this.imgList
},
initworkingAgeList() {
......
......@@ -59,12 +59,12 @@
other_certificates: "",
id_card_back_check: false,
},
imgObj:{
id_card_front:[],
id_card_back:[],
electrician_certificate:[],
vehicle_photos:[],
other_certificates:[]
imgObj: {
id_card_front: [],
id_card_back: [],
electrician_certificate: [],
vehicle_photos: [],
other_certificates: []
},
formShowList: [{
filedName: "id_card_front",
......@@ -109,28 +109,27 @@
saving: false,
}
},
onLoad(e) {
if (e && e.activeService && e.activeService.length > 0) {
//console.log(e.activeService)
this.activeService = e.activeService
}
},
updated(){
Object.keys(this.imgObj).map(key=>{
onLoad(e) {},
updated() {
Object.keys(this.imgObj).map(key => {
const imgs = this.imgObj[key]
this.fileInfo[key] = imgs.length>0&&imgs[0].key || ''
this.fileInfo[key] = imgs.length > 0 && imgs[0].key || ''
})
},
watch: {
"fileInfo.id_card_front"() {
console.log('idcard-change')
if (this.fileInfo.id_card_front) {
this.checkIdCard("front");
} else {
this.fileInfo.id_card_name = "";
this.fileInfo.id_card_number ="";
}
},
"fileInfo.id_card_back"() {
if (this.fileInfo.id_card_front) {
this.checkIdCard("back");
} else {
this.fileInfo.id_card_back_check = true;
}
},
},
......@@ -169,14 +168,14 @@
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 (res.code !== 200) {
if (type === "front") {
this.fileInfo.id_card_name = "";
this.fileInfo.id_card_number = "";
......@@ -195,183 +194,100 @@
this.fileInfo.id_card_back_check = true;
}
},
//新身份证 正反面上传
// 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_number = "";
// } else {
// console.log('44444444444444444')
// 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() {
let formFlag = true;
const fileInfo = this.fileInfo;
let checkFunc = function (item) {
const value = fileInfo[item.filedName];
const tips = "请上传您的" + item.label;
if (!value) {
uni.showToast({
title:tips,
icon:'none'
})
return false;
}
return true;
};
const flagArr = this.formShowList.some((item) => {
// 返回验证失败的数组
let flag = true;
if (item.required) {
flag = checkFunc(item);
}
return !flag;
});
formFlag = !flagArr || flagArr.length > 1;
if(formFlag){
if (!fileInfo.id_card_name) {
uni.showToast({
title:'身份证识别不通过,请重新上传',
icon:'none'
})
formFlag = false;
}
if (!fileInfo.id_card_back_check) {
uni.showToast({
title:'身份证国徽面识别不通过,请重新上传',
icon:'none'
})
formFlag = false;
}
}
return formFlag;
},
async submitFileInfo() {
if (!this.checkFileInfo()) {
return;
}
const fileInfo = this.fileInfo;
let submitInfoData = {
...fileInfo,
}
uni.showLoading({
title:'加载中……'
let formFlag = true;
const fileInfo = this.fileInfo;
let checkFunc = function(item) {
const value = fileInfo[item.filedName];
const tips = "请上传您的" + item.label;
if (!value) {
uni.showToast({
title: tips,
icon: 'none'
})
return false;
}
return true;
};
const flagArr = this.formShowList.some((item) => {
// 返回验证失败的数组
let flag = true;
if (item.required) {
flag = checkFunc(item);
}
return !flag;
});
formFlag = !flagArr || flagArr.length > 1;
if (formFlag) {
if (!fileInfo.id_card_name) {
uni.showToast({
title: '身份证识别不通过,请重新上传',
icon: 'none'
})
const res = await this.$u.api.submitSettleFileInfo(submitInfoData)
uni.hideLoading()
if(res.code!==200){
uni.showToast({
title:res.message,
icon:'none'
})
return
}
formFlag = false;
}
if (!fileInfo.id_card_back_check) {
uni.showToast({
title:'资料提交成功',
title: '身份证国徽面识别不通过,请重新上传',
icon: 'none'
})
let timer = setTimeout(()=>{
clearTimeout(timer)
uni.navigateTo({
url:'/pages/settle/prompt'
})
},2000)
this.submitSuccess = true;
// this.$u.api.post("@u/v1/h5/settled/submit-info", submitInfoData)
// .then((res) => {
// uni.hideLoading()
// if (res.status != 200) {
// return;
// }
// if (res.data) {
// uni.showToast({
// title:'工作人员2个工作日内审核回复',
// icon:'none'
// })
// this.submitSuccess = true;
// }
// })
// .catch(() => {
// //Indicator.close();
// });
},
formFlag = false;
}
}
return formFlag;
},
async submitFileInfo() {
if (!this.checkFileInfo()) {
return;
}
const fileInfo = this.fileInfo;
let submitInfoData = {
...fileInfo,
}
uni.showLoading({
title: '加载中……'
})
const res = await this.$u.api.submitSettleFileInfo(submitInfoData)
uni.hideLoading()
if (res.code !== 200) {
uni.showToast({
title: res.message,
icon: 'none'
})
return
}
uni.showToast({
title: '资料提交成功',
})
let timer = setTimeout(() => {
clearTimeout(timer)
uni.navigateTo({
url: '/pages/settle/prompt'
})
}, 2000)
this.submitSuccess = true;
// this.$u.api.post("@u/v1/h5/settled/submit-info", submitInfoData)
// .then((res) => {
// uni.hideLoading()
// if (res.status != 200) {
// return;
// }
// if (res.data) {
// uni.showToast({
// title:'工作人员2个工作日内审核回复',
// icon:'none'
// })
// this.submitSuccess = true;
// }
// })
// .catch(() => {
// //Indicator.close();
// });
},
},
}
</script>
......
......@@ -25,7 +25,11 @@
},
onLoad(e) {
this.startCounting()
this.getBaseInfo()
},
onShow(){
if(!this.settledInfo){
this.getBaseInfo()
}
},
methods: {
async getBaseInfo(){
......
......@@ -61,10 +61,8 @@
},
methods: {
successCallback(){
const timer = setTimeout(()=>{
uni.navigateTo({
url:'/pages/settle/prompt'
})
uni.navigateTo({
url:'/pages/settle/prompt'
})
},
async getBaseInfo(){
......@@ -87,34 +85,16 @@
...this.payResult
}
const res = await this.$u.api.getSettleDepositResult(params);
console.log(res,'res')
if(res.code !== 200){
if(res.status!==true){
return
}
uni.showToast({
title:'支付成功'
title:'支付成功',
})
let timer = setTimeout(()=>{
clearTimeout(timer)
this.successCallback()
},3000)
// const payStatus = res.data.status
// switch (parseInt(payStatus)) {
// case 0:
// this.pending();
// break;
// case 1:
// this.paySuccess = true
// uni.showToast({
// title:'支付成功',
// icon:'none'
// })
// this.successCallback()
// break;
// default:
// this.paySuccess = false
// }
// },1000)
},
getCode: async function() {
let that = this
......@@ -162,7 +142,7 @@
}
// const codeApiUrl = globalUrl.codeUrl.apiUrl;
const response = await this.$u.api.paySettleDeposit(params)
if (response.status !==200) {
if (response.status!==true) {
uni.showToast({
title: response.message,
icon:'none'
......@@ -176,7 +156,7 @@
cancelText:'失败',
success: function (res) {
if (res.confirm) {
console.log(res.confirm,'res.confirm')
// console.log(res.confirm,'res.confirm')
self.pending()
} else if (res.cancel) {
console.log('用户点击取消');
......
......@@ -28,7 +28,7 @@
status:2,
statusName:'已通过',
txtArr:['你已通过','“充电桩安装入驻审核”'],
btnTxt:'去培训学习',
btnTxt:'去考试',
url:'/pages/exam/index'
},{
status:3,
......@@ -95,7 +95,6 @@
this.settledInfo = settledInfo
this.status = settledInfo.record.status
uni.hideLoading()
console.log(settledInfo,'settledInfo')
this.initInfo(settledInfo.record)
},
initInfo(record){
......
......@@ -8,7 +8,7 @@
</view>
<view class="item item-select u-row-between">
<view class="label">结算方式:</view>
<u-radio-group v-model="baseInfo.pay_type" >
<u-radio-group v-model="baseInfo.pay_type" @change="radioGroupChange">
<u-radio
v-for="(item, index) in radioList" :key="index"
:name="item.value"
......@@ -82,8 +82,11 @@
onLoad(e) {
},
onShow(){
uni.navigateTo({
// url:'/pages/settle/web?url='+url
url:'/pages/settle/web'
})
this.getBaseInfo()
// this.goSign()
// const url = 'https://m.test.ibanshou.cn/activity/settled_2021/mini'
// uni.navigateTo({
// url:'/pages/settle/web?url='+url
......@@ -214,11 +217,15 @@
// }
// return true
// },
radioGroupChange(val){
this.baseInfo.bank_name = ''
this.baseInfo.bank_no = ''
this.baseInfo.bank_site = ''
},
async getBaseInfo(){
const app = getApp()
const callBack = (vm,result)=>{
vm.settledInfo = result
console.log(result,'result--------')
const record = result.record
vm.baseInfo.name = record.id_card_name
vm.baseInfo.id = record.id
......@@ -229,8 +236,6 @@
return
}
await app.getBaseInfo(this,callBack)
},
async submitInfo(){
// checkSettleSignInfo
......@@ -332,7 +337,7 @@
uni.navigateTo({
// url:'/pages/settle/web?url='+url
url:'/pages/settle/web?url='+encodeURIComponent(url)
url:'/pages/settle/web'
})
}
},
......
......@@ -22,16 +22,7 @@
this.webUrl = e.url
return
}
webUrl = decodeURIComponent(e.url);
console.log('web-webUrl:')
console.log(webUrl)
webUrl = getApp().globalData.signUrl
console.log('getApp-web-webUrl:')
console.log(webUrl)
this.webUrl = webUrl
}
......
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