From b70f31ff5f7c4012a4e871891c41046ad1a1e6e9 Mon Sep 17 00:00:00 2001 From: dengxiongfei Date: Sat, 8 Jan 2022 18:24:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/clientCreditApi.js | 12 + apis/enterpriseInfoApi.js | 9 + enums/index.js | 9 + manifest.json | 4 +- pages.json | 12 +- pages/add-user/index.vue | 26 +- pages/client-credit/index.vue | 85 ++- pages/enterprise-info/index.vue | 491 ++++++++++++++++++ pages/login/index.vue | 26 +- pages/mine/index.vue | 205 +++++++- .../imgs/client-credit/has-selected-icon.png | Bin 0 -> 2945 bytes static/imgs/mine/certified-icon.png | Bin 0 -> 4969 bytes static/imgs/mine/mine-top-bg.png | Bin 0 -> 141488 bytes static/imgs/mine/non-certified-icon.png | Bin 0 -> 4582 bytes static/imgs/mine/user-avatar.png | Bin 0 -> 1522 bytes static/imgs/mine/vip-icon.png | Bin 0 -> 1368 bytes static/logo.png | Bin 4023 -> 6805 bytes store/index.js | 10 +- 18 files changed, 826 insertions(+), 63 deletions(-) create mode 100644 apis/enterpriseInfoApi.js create mode 100644 pages/enterprise-info/index.vue create mode 100644 static/imgs/client-credit/has-selected-icon.png create mode 100644 static/imgs/mine/certified-icon.png create mode 100644 static/imgs/mine/mine-top-bg.png create mode 100644 static/imgs/mine/non-certified-icon.png create mode 100644 static/imgs/mine/user-avatar.png create mode 100644 static/imgs/mine/vip-icon.png diff --git a/apis/clientCreditApi.js b/apis/clientCreditApi.js index c1c30d4..625c189 100644 --- a/apis/clientCreditApi.js +++ b/apis/clientCreditApi.js @@ -7,3 +7,15 @@ export function getCompanyList(data) { data }) } + +/** + * 获取客户授信方式 + * @param {*} data {customerEnterpriseId: '客户id',mallSupplierId:'供应商id'} + * @returns + */ +export function getCustomerCreditInfo(data) { + return http.get({ + url: '/yyt-uec/supplier/get/customer/credit-status', + data + }) +} diff --git a/apis/enterpriseInfoApi.js b/apis/enterpriseInfoApi.js new file mode 100644 index 0000000..d12c838 --- /dev/null +++ b/apis/enterpriseInfoApi.js @@ -0,0 +1,9 @@ +import http from '../utils/http/index.js' + +// 完善企业信息 +export function completeInfo(data) { + return http.post({ + url: '/yyt-uec/save/my/enterprise', + data + }) +} diff --git a/enums/index.js b/enums/index.js index be2dcd2..0f0b3ec 100644 --- a/enums/index.js +++ b/enums/index.js @@ -30,6 +30,15 @@ export const verificationType = { PHONE: 1, EMAIL: 2 } +/** + * 法大大企业认证状态 1:未认证 2:认证中 3:已认证 4:认证失败 + */ +export const fddEnterpriseStatus = { + UNCERTIFIED: 1, + CERTIFIED_ING: 2, + CERTIFIED_SUCCESS: 3, + CERTIFIED_FAIL: 4 +} /** * 上传地址 */ diff --git a/manifest.json b/manifest.json index f7ce734..8fa2378 100644 --- a/manifest.json +++ b/manifest.json @@ -54,7 +54,7 @@ "sdkConfigs" : { "maps" : { "amap" : { - "appkey_ios" : "5e4da36f4c1649ca28a1f8f795bcf5d2", + "appkey_ios" : "0182ee2a9fdd5fd3ef6a8bd5a2f98325", "appkey_android" : "877848546f7f3717101a17c33e1d4df3" } }, @@ -69,7 +69,7 @@ "geolocation" : { "amap" : { "__platform__" : [ "ios", "android" ], - "appkey_ios" : "5e4da36f4c1649ca28a1f8f795bcf5d2", + "appkey_ios" : "0182ee2a9fdd5fd3ef6a8bd5a2f98325", "appkey_android" : "877848546f7f3717101a17c33e1d4df3" } } diff --git a/pages.json b/pages.json index 3ea8906..bfb6f97 100644 --- a/pages.json +++ b/pages.json @@ -44,7 +44,9 @@ { "path": "pages/mine/index", "style": { - "navigationBarTitleText": "我的" + "navigationBarTitleText": "我的", + "enablePullDownRefresh": false, + "navigationStyle": "custom" } }, { @@ -55,6 +57,14 @@ "navigationStyle": "custom" } }, + { + "path": "pages/enterprise-info/index", + "style": { + "navigationBarTitleText": "完善企业信息", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }, { "path": "pages/agreement/index", "style": { diff --git a/pages/add-user/index.vue b/pages/add-user/index.vue index 7bde349..3d25f14 100644 --- a/pages/add-user/index.vue +++ b/pages/add-user/index.vue @@ -146,7 +146,7 @@ v-model="form.legalPersonMobile" :inputBorder="false" text="right" - placeholder="请输入法人/实控人" + placeholder="请输入法人/实控人手机" > @@ -192,10 +192,14 @@ > 点击上传 - - 已上传(点击查看) + + 重新上传 - + 预览 @@ -424,13 +428,13 @@ export default { }) return } - if (!/^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/.test(this.form['legalPersonIdCardNo'])) { - uni.showToast({ - title: '请输入正确法人身份证号', - icon: 'none' - }) - return - } + // if (!/^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/.test(this.form['legalPersonIdCardNo'])) { + // uni.showToast({ + // title: '请输入正确法人身份证号', + // icon: 'none' + // }) + // return + // } } if (this.form.contactMobile && !/^1[3456789]\d{9}$/.test(this.form['contactMobile'])) { uni.showToast({ diff --git a/pages/client-credit/index.vue b/pages/client-credit/index.vue index e9ffbcf..528807a 100644 --- a/pages/client-credit/index.vue +++ b/pages/client-credit/index.vue @@ -13,20 +13,25 @@ placeholder="请选择账号下的盘商" popup-title="请选择盘商" :map="{ text: 'name', value: 'id' }" - @change="onSupplierChange" :clear-icon="false" :localdata="supplierList" > - - + + + 月结授信 - - + + + 飞算授信 @@ -62,7 +67,7 @@ import { back, go2 } from '@/utils/hook.js' import qnForm from '@/components/qn-form/qn-form.vue' import qnDataPicker from '@/components/qn-data-picker/qn-data-picker.vue' -import { getCompanyList } from '@/apis/clientCreditApi.js' +import { getCompanyList, getCustomerCreditInfo } from '@/apis/clientCreditApi.js' import { getBaseInfo } from '@/apis/commonApi.js' const columns = [ { @@ -97,12 +102,14 @@ export default { return { columns: Object.freeze(columns), form: { + enterpriseId: null, name: null, - creditType: null, - supplierId: this.$store.state.supplierInfo.id + supplierId: this.$store.state.supplierInfo.supplierId }, + creditType: null, searchList: [], - supplierList: [] + supplierList: [], + hasCreditList: [] } }, methods: { @@ -123,7 +130,7 @@ export default { selectCompany(enterpriseId, enterpriseName) { this.$refs.popup.close() this.form.name = enterpriseName - this.form.id = enterpriseId + this.form.enterpriseId = enterpriseId }, next() { go2('client-signing', { @@ -131,18 +138,41 @@ export default { }) }, selectCreditType(creditType) { - console.log(creditType) - this.form.creditType = creditType + if (this.hasCreditList.includes(creditType)) { + return + } + if (!this.form.supplierId) { + uni.showToast({ + title: '请选择账号下的盘商', + icon: 'none' + }) + return + } + if (!this.form.enterpriseId) { + uni.showToast({ + icon: 'none', + title: '请先选择客户' + }) + return + } + this.creditType = creditType }, - onSupplierChange(e) { - console.log('e', e) + getCreditList(data) { + getCustomerCreditInfo(data).then((res) => { + if (res) { + res.hasCredit && this.hasCreditList.push('month') + res.hasFeisuanCredit && this.hasCreditList.push('fs') + } else { + this.hasCreditList = [] + } + }) } }, created() { getBaseInfo().then((res) => { if (res) { - this.supplierList = res.supplierList.map((item) => ({ - id: item.id, + this.supplierList = res.enterpriseList.map((item) => ({ + id: item.supplier?.id, // 暂时使用企业id name: item.name })) } @@ -150,7 +180,7 @@ export default { }, computed: { canSubmit() { - return this.form.id != null && this.form.creditType != null + return this.form.enterpriseId != null && this.form.supplierId != null && this.creditType != null } }, watch: { @@ -158,6 +188,17 @@ export default { if (this.form.id) { this.form.id = null } + }, + ['form.enterpriseId']() { + console.log('form.enterpriseId', this.form) + if (this.form.enterpriseId && this.form.supplierId) { + this.getCreditList({ mallSupplierId: this.form.supplierId, customerEnterpriseId: this.form.enterpriseId }) + } + }, + ['form.supplierId']() { + if (this.form.enterpriseId && this.form.supplierId) { + this.getCreditList({ mallSupplierId: this.form.supplierId, customerEnterpriseId: this.form.enterpriseId }) + } } } } @@ -246,6 +287,13 @@ export default { top: 0; right: 0; } + .hasSelected-icon { + width: 159rpx; + height: 50rpx; + position: absolute; + top: 0; + right: 0; + } .card_area-item-icon { width: 48rpx; height: 48rpx; @@ -263,5 +311,8 @@ export default { .selected { border: 3rpx solid #007aff; } + .hasSelected { + border: 3rpx solid #86e2df; + } } diff --git a/pages/enterprise-info/index.vue b/pages/enterprise-info/index.vue new file mode 100644 index 0000000..7f221b1 --- /dev/null +++ b/pages/enterprise-info/index.vue @@ -0,0 +1,491 @@ + + + + + diff --git a/pages/login/index.vue b/pages/login/index.vue index fa4315a..560bc09 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -140,16 +140,15 @@ export default { // 登录成功先查看是否有下一个页面 const nextPage = store.state.nextPage if (nextPage.name) { - go2(nextPage.name, nextPage.data) + go2(nextPage.name, nextPage.data, true) } else { - go2('mine') + // 初始登录没有下一个页面,进行账号信息处理 + this.setAccountInfo() } store.commit('removeNextPage') }, 1000) } }) - // 记录账号信息 - this.setAccountInfo() } }) } @@ -158,12 +157,19 @@ export default { setAccountInfo() { getBaseInfo({}, true).then((res) => { if (res) { - let supplierInfo = res.enterpriseList[0] - store.commit('setSupplierInfo', { id: supplierInfo.id, name: supplierInfo.name, fddEnterpriseStatus: supplierInfo.fddEnterpriseStatus }) - let userInfo = supplierInfo.employeeName - store.commit('setUserInfo', { name: userInfo.name }) - } else { - // 刚注册用户 + if (!res.enterpriseList || res.enterpriseList.length === 0) { + go2('enterprise-info', { operation: 'add' }, true) + } else { + let supplierInfo = res.enterpriseList[0] + store.commit('setSupplierInfo', { + id: supplierInfo.id, + name: supplierInfo.name, + fddEnterpriseStatus: supplierInfo.fddEnterpriseStatus, + supplierId: supplierInfo.supplier.id + }) + store.commit('setUserInfo', { name: supplierInfo.employeeName, userId: res.userId, mobile: res.mobile }) + go2('client') + } } }) } diff --git a/pages/mine/index.vue b/pages/mine/index.vue index f4afcf4..f2e48bf 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -1,5 +1,46 @@