diff --git a/apis/clientCreditApi.js b/apis/clientCreditApi.js new file mode 100644 index 0000000..c1c30d4 --- /dev/null +++ b/apis/clientCreditApi.js @@ -0,0 +1,9 @@ +import http from '../utils/http/index.js' + +// 根据名称模糊查询企业列表 +export function getCompanyList(data) { + return http.get({ + url: '/base-paper-trading/get/customers/enterprise/basic/list', + data + }) +} diff --git a/apis/commonApi.js b/apis/commonApi.js index b6f2bf2..1a07f27 100644 --- a/apis/commonApi.js +++ b/apis/commonApi.js @@ -1,6 +1,9 @@ import http from '../utils/http/index.js' let areaCache = null -// 获取省市区 +/** + * 获取省市区街道 + * @returns array + */ export function getArea(data = {}) { return new Promise((resolve, reject) => { if (areaCache) { @@ -17,3 +20,27 @@ export function getArea(data = {}) { } }) } + +let baseInfo = null +/** + * 获取当前账号的基础信息 + * @param {object} data 参数,暂时不需要,可以传{} + * @param {boolean} refresh 是否强制刷新,默认false拿缓存数据 + * @returns object + */ +export function getBaseInfo(data = {}, refresh = false) { + return new Promise((resolve, reject) => { + if (!refresh && baseInfo) { + resolve(baseInfo) + } else { + http.get({ url: '/yyt-uec/get/base-info', data }, { hideLoading: true }).then((res) => { + if (res) { + baseInfo = res + resolve(res) + } else { + resolve(null) + } + }) + } + }) +} diff --git a/common/css/reset.scss b/common/css/reset.scss index ca1fcb7..6204afe 100644 --- a/common/css/reset.scss +++ b/common/css/reset.scss @@ -1,7 +1,7 @@ page { font-size: $uni-font-size-base; line-height: 1; - background-color: #fff; + background-color: #f7f8fa; -webkit-overflow-scrolling: touch; /* 使ios列表滑动流畅*/ } diff --git a/components/qn-data-picker/components/qn-data-picker/keypress.js b/components/qn-data-picker/keypress.js similarity index 100% rename from components/qn-data-picker/components/qn-data-picker/keypress.js rename to components/qn-data-picker/keypress.js diff --git a/components/qn-data-picker/components/qn-data-picker/qn-data-picker.vue b/components/qn-data-picker/qn-data-picker.vue similarity index 99% rename from components/qn-data-picker/components/qn-data-picker/qn-data-picker.vue rename to components/qn-data-picker/qn-data-picker.vue index de01cc3..56a5b22 100644 --- a/components/qn-data-picker/components/qn-data-picker/qn-data-picker.vue +++ b/components/qn-data-picker/qn-data-picker.vue @@ -94,7 +94,7 @@ const styleEnum = { right: 'flex-end' } export default { - name: 'UniDataPicker', + name: 'qnDataPicker', emits: ['popupopened', 'popupclosed', 'nodeclick', 'input', 'change', 'update:modelValue'], mixins: [dataPicker], components: { diff --git a/components/qn-data-picker/components/qn-data-pickerview/qn-data-picker.js b/components/qn-data-pickerview/qn-data-picker.js similarity index 100% rename from components/qn-data-picker/components/qn-data-pickerview/qn-data-picker.js rename to components/qn-data-pickerview/qn-data-picker.js diff --git a/components/qn-data-picker/components/qn-data-pickerview/qn-data-pickerview.vue b/components/qn-data-pickerview/qn-data-pickerview.vue similarity index 100% rename from components/qn-data-picker/components/qn-data-pickerview/qn-data-pickerview.vue rename to components/qn-data-pickerview/qn-data-pickerview.vue diff --git a/components/qn-form/qn-form.vue b/components/qn-form/qn-form.vue new file mode 100644 index 0000000..4b75a5e --- /dev/null +++ b/components/qn-form/qn-form.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/pages.json b/pages.json index a911a82..3ea8906 100644 --- a/pages.json +++ b/pages.json @@ -1,157 +1,182 @@ { - "pages": [ - //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - - { - "path": "pages/client/index", - "style": { - "navigationBarTitleText": "客户", - "navigationStyle": "custom" - } - }, - { - "path": "pages/client-list/index", - "style": { - "navigationBarTitleText": "客户列表", - "navigationStyle": "custom" - } - }, - { - "path": "pages/search/index", - "style": { - "navigationBarTitleText": "客户搜索", - "navigationStyle": "custom" - } - }, - { - "path": "pages/add-user/index", - "style": { - "navigationBarTitleText": "添加客户", - "navigationStyle": "custom" - } - }, - { - "path": "pages/trade/index", - "style": { - "navigationBarTitleText": "交易", - "navigationStyle": "custom" - } - }, - { - "path": "pages/mall/index", - "style": { - "navigationBarTitleText": "商城" - } - }, - { - "path": "pages/mine/index", - "style": { - "navigationBarTitleText": "我的" - } - }, - { - "path": "pages/login/index", - "style": { - "navigationBarTitleText": "登录", - "enablePullDownRefresh": false, - "navigationStyle": "custom" - } - }, - { - "path": "pages/agreement/index", - "style": { - "navigationBarTitleText": "用户与隐私协议" - } - }, - { - "path": "pages/client-detail/index", - "style": { - "navigationBarTitleText": "客户详情", - "navigationStyle": "custom" - } - } - ,{ - "path" : "components/not-logged/not-logged", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/trade/quotationList", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/trade/orderList", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/trade/my-offer", - "style" : - { - "navigationBarTitleText": "我的报价", - "enablePullDownRefresh": false - } - - } - ], - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "uni-app", - "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8", - "backgroundColorTop": "#FFFFFF" - }, - "tabBar": { - "color": "#888", - "selectedColor": "#007AFF", - "borderStyle": "white", - "backgroundColor": "#f9f9f9", - "list": [{ - "pagePath": "pages/client/index", - "iconPath": "static/imgs/tabbar/client-gray.png", - "selectedIconPath": "static/imgs/tabbar/client-blue.png", - "text": "客户" - }, - { - "pagePath": "pages/trade/index", - "iconPath": "static/imgs/tabbar/trade-gray.png", - "selectedIconPath": "static/imgs/tabbar/trade-blue.png", - "text": "交易" - }, - { - "pagePath": "pages/mall/index", - "iconPath": "static/imgs/tabbar/mall-gray.png", - "selectedIconPath": "static/imgs/tabbar/mall-blue.png", - "text": "纸商城" - }, - { - "pagePath": "pages/mine/index", - "iconPath": "static/imgs/tabbar/mine-gray.png", - "selectedIconPath": "static/imgs/tabbar/mine-blue.png", - "text": "我的" - } - ] - }, - "condition": { - //模式配置,仅开发期间生效 - "current": 0, //当前激活的模式(list 的索引项) - "list": [{ - "name": "", //模式名称 - "path": "", //启动页面,必选 - "query": "" //启动参数,在页面的onLoad函数里面得到 - }] - } + "pages": [ + { + "path": "pages/client/index", + "style": { + "navigationBarTitleText": "客户", + "navigationStyle": "custom" + } + }, + { + "path": "pages/client-list/index", + "style": { + "navigationBarTitleText": "客户列表", + "navigationStyle": "custom" + } + }, + { + "path": "pages/search/index", + "style": { + "navigationBarTitleText": "客户搜索", + "navigationStyle": "custom" + } + }, + { + "path": "pages/add-user/index", + "style": { + "navigationBarTitleText": "添加客户", + "navigationStyle": "custom" + } + }, + { + "path": "pages/trade/index", + "style": { + "navigationBarTitleText": "交易", + "navigationStyle": "custom" + } + }, + { + "path": "pages/mall/index", + "style": { + "navigationBarTitleText": "商城" + } + }, + { + "path": "pages/mine/index", + "style": { + "navigationBarTitleText": "我的" + } + }, + { + "path": "pages/login/index", + "style": { + "navigationBarTitleText": "登录", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }, + { + "path": "pages/agreement/index", + "style": { + "navigationBarTitleText": "用户与隐私协议" + } + }, + { + "path": "pages/client-detail/index", + "style": { + "navigationBarTitleText": "客户详情", + "navigationStyle": "custom" + } + }, + { + "path": "pages/client-credit/index", + "style": { + "navigationBarTitleText": "客户授信", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/client-signing/index", + "style": { + "navigationBarTitleText": "客户签约", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/client-credit-limit/index", + "style": { + "navigationBarTitleText": "授信额度", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/client-credit-list/index", + "style": { + "navigationBarTitleText": "客户授信列表", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } + }, + { + "path": "components/not-logged/not-logged", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/trade/quotationList", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/trade/orderList", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/trade/my-offer", + "style": { + "navigationBarTitleText": "我的报价", + "enablePullDownRefresh": false + } + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "uni-app", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8", + "backgroundColorTop": "#FFFFFF" + }, + "tabBar": { + "color": "#888", + "selectedColor": "#007AFF", + "borderStyle": "white", + "backgroundColor": "#f9f9f9", + "list": [ + { + "pagePath": "pages/client/index", + "iconPath": "static/imgs/tabbar/client-gray.png", + "selectedIconPath": "static/imgs/tabbar/client-blue.png", + "text": "客户" + }, + { + "pagePath": "pages/trade/index", + "iconPath": "static/imgs/tabbar/trade-gray.png", + "selectedIconPath": "static/imgs/tabbar/trade-blue.png", + "text": "交易" + }, + { + "pagePath": "pages/mall/index", + "iconPath": "static/imgs/tabbar/mall-gray.png", + "selectedIconPath": "static/imgs/tabbar/mall-blue.png", + "text": "纸商城" + }, + { + "pagePath": "pages/mine/index", + "iconPath": "static/imgs/tabbar/mine-gray.png", + "selectedIconPath": "static/imgs/tabbar/mine-blue.png", + "text": "我的" + } + ] + }, + "condition": { + //模式配置,仅开发期间生效 + "current": 0, //当前激活的模式(list 的索引项) + "list": [ + { + "name": "", //模式名称 + "path": "", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + } + ] + } } diff --git a/pages/add-user/index.vue b/pages/add-user/index.vue index c77a674..7bde349 100644 --- a/pages/add-user/index.vue +++ b/pages/add-user/index.vue @@ -257,7 +257,7 @@ import { back, uploadImage } from '@/utils/hook.js' import { getArea } from '@/apis/commonApi.js' import { getCompanyList, getCompanyInfoById, addCustomer } from '@/apis/addUserApi.js' import qnEasyinput from '@/components/qn-easyinput/qn-easyinput.vue' -import qnDataPicker from '@/components/qn-data-picker/components/qn-data-picker/qn-data-picker.vue' +import qnDataPicker from '@/components/qn-data-picker/qn-data-picker.vue' import qnDatetimePicker from '@/components/qn-datetime-picker/qn-datetime-picker.vue' import qnFooter from '@/components/qn-footer/qn-footer.vue' const validateFields = [ diff --git a/pages/client-credit-limit/index.vue b/pages/client-credit-limit/index.vue new file mode 100644 index 0000000..e69de29 diff --git a/pages/client-credit-list/index.vue b/pages/client-credit-list/index.vue new file mode 100644 index 0000000..e69de29 diff --git a/pages/client-credit/index.vue b/pages/client-credit/index.vue new file mode 100644 index 0000000..e9ffbcf --- /dev/null +++ b/pages/client-credit/index.vue @@ -0,0 +1,267 @@ + + + + + diff --git a/pages/client-signing/index.vue b/pages/client-signing/index.vue new file mode 100644 index 0000000..e69de29 diff --git a/pages/login/index.vue b/pages/login/index.vue index 2642882..fa4315a 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -44,6 +44,7 @@ diff --git a/static/imgs/client-credit/fs-credit-icon.png b/static/imgs/client-credit/fs-credit-icon.png new file mode 100644 index 0000000..f9caf9b Binary files /dev/null and b/static/imgs/client-credit/fs-credit-icon.png differ diff --git a/static/imgs/client-credit/month-credit-icon.png b/static/imgs/client-credit/month-credit-icon.png new file mode 100644 index 0000000..f9df5e3 Binary files /dev/null and b/static/imgs/client-credit/month-credit-icon.png differ diff --git a/static/imgs/client-credit/selected-icon.png b/static/imgs/client-credit/selected-icon.png new file mode 100644 index 0000000..6e54dc4 Binary files /dev/null and b/static/imgs/client-credit/selected-icon.png differ diff --git a/store/index.js b/store/index.js index acad6c7..a2c03df 100644 --- a/store/index.js +++ b/store/index.js @@ -3,10 +3,20 @@ import Vuex from 'vuex' import { isObject, isArray } from '@/utils/is' let qnToken = null, + /** + * @value name 职员名称 + */ userInfo = null, + /** + * @value id 企业id + * @value name 企业名称 + * @value fddEnterpriseStatus 法大大认证状态 。1未认证,2认证进行中,3认证成功,4认证失败 + */ supplierInfo = null, uecToken = null, searchHistory = null +const supplierInfoParams = ['id', 'name', 'fddEnterpriseStatus'] +const userInfoParams = ['name'] try { uecToken = uni.getStorageSync('uecToken') qnToken = uni.getStorageSync('qnToken') @@ -77,6 +87,37 @@ const store = new Vuex.Store({ console.error('userInfo必须是对象') return } + for (let i = 0; i < userInfoParams.length; i++) { + if (userInfo[userInfoParams[i]] === undefined) { + console.error('userInfo必须包含' + userInfoParams[i] + '属性') + return + } + } + try { + uni.setStorageSync('userInfo', JSON.stringify(userInfo)) + state.userInfo = userInfo + } catch (e) { + console.error('设置userInfo失败:', e) + } + }, + /** + * 更改当前用户信息 + * @param {*} state 状态 + * @param {arr} map 以key-value形式存储的数组 + * @value key 需要更改的key + * @value value 更改后的值 + */ + changeUserInfo(state, map) { + if (!isArray(map)) { + console.error('map必须是数组') + return + } + let userInfo = state.userInfo + map.forEach((item) => { + if (userInfoParams.includes(item.key)) { + userInfo[item.key] = item.value + } + }) try { uni.setStorageSync('userInfo', JSON.stringify(userInfo)) state.userInfo = userInfo @@ -97,6 +138,37 @@ const store = new Vuex.Store({ console.error('supplierInfo必须是对象') return } + for (let i = 0; i < supplierInfoParams.length; i++) { + if (supplierInfo[supplierInfoParams[i]] === undefined) { + console.error(`supplierInfo必须包含${supplierInfoParams[i]}`) + return + } + } + try { + uni.setStorageSync('supplierInfo', JSON.stringify(supplierInfo)) + state.supplierInfo = supplierInfo + } catch (e) { + console.error('设置supplierInfo失败:', e) + } + }, + /** + * 更改当前供应商信息 + * @param {*} state 状态 + * @param {arr} map 以key-value形式存储的数组 + * @value key 需要更改的key + * @value value 更改后的值 + */ + changeSupplierInfo(state, map) { + if (!isArray(map)) { + console.error('map必须是数组') + return + } + let supplierInfo = state.supplierInfo + map.forEach((item) => { + if (supplierInfoParams.includes(item.key)) { + supplierInfo[item.key] = item.value + } + }) try { uni.setStorageSync('supplierInfo', JSON.stringify(supplierInfo)) state.supplierInfo = supplierInfo