diff --git a/pages/home/certificate/index.js b/pages/home/certificate/index.js index ce069c3..cb3125e 100644 --- a/pages/home/certificate/index.js +++ b/pages/home/certificate/index.js @@ -1,5 +1,5 @@ // pages/home/authory/index.js -import { ocrLicense } from "../../api/user" +import { ocrLicense, checkLicense } from "../../api/user" import { zconfig } from'../../api/ztb' import { updateUserInfo, identifyEnterprise } from '../../api/ztb' const util = require('../../../utils/util') @@ -15,6 +15,7 @@ Page({ form: { }, flag: false, // 是否不可以编辑, false:可编辑;true:不可编辑 disabled: true, + editable: true, imgList: [null] }, onLoad: function (options) { @@ -128,7 +129,18 @@ Page({ ['form.legalPersonName']: result.data.legalPersonName, ['form.locDetail']: result.data.locDetail, }) - wx.hideLoading() + result.data.enterpriseName = result.data.name + checkLicense(result.data).then(res => { + if(res.data.checkStatus != 0){ + this.setData({ editable : false }) + } + wx.hideLoading() + util.showToast(res.data.checkStatusExplain) + }).catch(error => { + wx.hideLoading() + this.setData({ editable : false }) + util.showToast(error) + }) }).catch(error => { wx.hideLoading() util.showToast(error) @@ -187,6 +199,14 @@ Page({ deleteImg: function(e) { var index = e.currentTarget.dataset.index this.data.imgList[index] = null; - this.setData({ imgList: this.data.imgList }) + this.data.form.businessLicenseImg = null + this.data.form.locDetail = null + this.setData({ + imgList: this.data.imgList, + ['form.name']: '', + ['form.uniformSocialCreditCode']: null, + ['form.legalPersonName']: null, + editable: true + }) } }) \ No newline at end of file diff --git a/pages/home/certificate/index.wxml b/pages/home/certificate/index.wxml index f266f87..13f059c 100644 --- a/pages/home/certificate/index.wxml +++ b/pages/home/certificate/index.wxml @@ -30,19 +30,19 @@ *公司名称: - + *信用代码: - + - + *法人姓名: - + diff --git a/pages/home/certificate/index.wxss b/pages/home/certificate/index.wxss index 9d6e457..5b1e087 100644 --- a/pages/home/certificate/index.wxss +++ b/pages/home/certificate/index.wxss @@ -59,7 +59,7 @@ .inputs{ width: 65%; height: 36px; - padding: 10px 0px; + padding: 14rpx 0px; } .must{