From 8495761ef179cc8229081518bebd3e54050c5805 Mon Sep 17 00:00:00 2001 From: lxf Date: Thu, 11 Jul 2024 17:45:08 +0800 Subject: [PATCH] feat: 飞牛小程序初试版本 --- .gitignore | 3 ++- .prettierignore | 15 +++++++++++++++ .prettierrc.js | 25 +++++++++++++++++++++++++ App.vue | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------- common/api.js | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------- components/card/payee.vue | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ components/field/field-copy.vue | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ components/keyboard/keyboard-bill.vue | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ components/keyboard/keyboard-waybill.vue | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ components/list.vue | 2 +- components/popup/popup-platenumber.vue | 376 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ config/request.js | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------- main.js | 6 +----- package.json | 3 +++ pages.json | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------- pages/common/webview.vue | 59 +++++++++++++++++++++++++++++++++-------------------------- pages/global/search-common.vue | 30 +++++++++++++++--------------- pages/global/search-dict.vue | 46 ++++++++++++++++++++++++++++++++++++++++++++++ pages/global/search-payee.vue | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/index.vue | 16 ++++++---------- pages/login/code.vue | 59 ++++++++++++++++++++++++++++++++++------------------------- pages/login/login.vue | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------- pages/me/index.vue | 301 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/my/my.vue | 290 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/order/add.vue | 455 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/again-assign.vue | 268 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/arrival-car.vue | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/card.vue | 320 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/change-fee.vue | 341 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/change-goods.vue | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/detail.vue | 611 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/filter.vue | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/index.vue | 462 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/qr-painter.js | 288 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/start-car.vue | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/order/upload-receipt.vue | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/settlement/card.vue | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/settlement/filter.vue | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/settlement/index.vue | 424 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ static/addOrder.png | Bin 0 -> 8331 bytes static/copy-icon.png | Bin 0 -> 201 bytes static/logo.png | Bin 0 -> 20800 bytes static/qr.png | Bin 0 -> 188 bytes static/tabbar/inquiry-active-dingtalk.png | Bin 1685 -> 0 bytes static/tabbar/inquiry-active.png | Bin 1616 -> 0 bytes static/tabbar/inquiry.png | Bin 1818 -> 0 bytes static/tabbar/me-active.png | Bin 0 -> 2238 bytes static/tabbar/me.png | Bin 0 -> 2170 bytes static/tabbar/my-active-dingtalk.png | Bin 1522 -> 0 bytes static/tabbar/my-active.png | Bin 1669 -> 0 bytes static/tabbar/my.png | Bin 2092 -> 0 bytes static/tabbar/order-active.png | Bin 0 -> 3898 bytes static/tabbar/order.png | Bin 0 -> 3768 bytes static/tabbar/settlement-active.png | Bin 0 -> 2720 bytes static/tabbar/settlement.png | Bin 0 -> 2668 bytes store/index.js | 10 +++++----- uni.scss | 6 +++--- uni_modules/uview-ui/libs/config/props/input.js | 76 ++++++++++++++++++++++++++++++++++++++-------------------------------------- uni_modules/uview-ui/theme.scss | 2 +- uni_modules/zb-tooltip/changelog.md | 24 ++++++++++++++++++++++++ uni_modules/zb-tooltip/components/zb-tooltip/zb-tooltip.vue | 301 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ uni_modules/zb-tooltip/package.json | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ uni_modules/zb-tooltip/readme.md | 30 ++++++++++++++++++++++++++++++ yarn.lock | 5 +++++ 64 files changed, 6267 insertions(+), 645 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.js create mode 100644 components/card/payee.vue create mode 100644 components/field/field-copy.vue create mode 100644 components/keyboard/keyboard-bill.vue create mode 100644 components/keyboard/keyboard-waybill.vue create mode 100644 components/popup/popup-platenumber.vue create mode 100644 pages/global/search-dict.vue create mode 100644 pages/global/search-payee.vue create mode 100644 pages/me/index.vue delete mode 100644 pages/my/my.vue create mode 100644 pages/order/add.vue create mode 100644 pages/order/again-assign.vue create mode 100644 pages/order/arrival-car.vue create mode 100644 pages/order/card.vue create mode 100644 pages/order/change-fee.vue create mode 100644 pages/order/change-goods.vue create mode 100644 pages/order/detail.vue create mode 100644 pages/order/filter.vue create mode 100644 pages/order/index.vue create mode 100644 pages/order/qr-painter.js create mode 100644 pages/order/start-car.vue create mode 100644 pages/order/upload-receipt.vue create mode 100644 pages/settlement/card.vue create mode 100644 pages/settlement/filter.vue create mode 100644 pages/settlement/index.vue create mode 100644 static/addOrder.png create mode 100644 static/copy-icon.png create mode 100644 static/logo.png create mode 100644 static/qr.png delete mode 100644 static/tabbar/inquiry-active-dingtalk.png delete mode 100644 static/tabbar/inquiry-active.png delete mode 100644 static/tabbar/inquiry.png create mode 100644 static/tabbar/me-active.png create mode 100644 static/tabbar/me.png delete mode 100644 static/tabbar/my-active-dingtalk.png delete mode 100644 static/tabbar/my-active.png delete mode 100644 static/tabbar/my.png create mode 100644 static/tabbar/order-active.png create mode 100644 static/tabbar/order.png create mode 100644 static/tabbar/settlement-active.png create mode 100644 static/tabbar/settlement.png create mode 100644 uni_modules/zb-tooltip/changelog.md create mode 100644 uni_modules/zb-tooltip/components/zb-tooltip/zb-tooltip.vue create mode 100644 uni_modules/zb-tooltip/package.json create mode 100644 uni_modules/zb-tooltip/readme.md diff --git a/.gitignore b/.gitignore index ff9ea4d..a27dc14 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /unpackage /node_modules -.DS_Store \ No newline at end of file +.DS_Store +.idea diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..ea12408 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,15 @@ +/dist/* +.local +.hbuilderx +common +components +uni_modules +mixins +iconfont +/node_modules/** + +**/*.svg +**/*.sh + +/public/* +stats.html diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..2ec1a08 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,25 @@ +module.exports = { + // 行尾换行方式 + endOfLine: 'lf', + // Tab空格数 + tabWidth: 2, + // 使用Tab缩进 + useTabs: false, + // 换行字符数 + printWidth: 190, + // 开启 eslint 支持 + eslintIntegration: true, + // 字符串单引号 + singleQuote: true, + // 行尾分号 + semi: true, + // 尾逗号 none es5 all + trailingComma: 'all', + // 大括号空格 + bracketSpacing: true, + // 箭头函数参数只有一个时省略小括号 + arrowParens: 'avoid', + // 标签闭合位置对齐 + bracketSpacing: true, + ignorePath: '.prettierignore' +}; diff --git a/App.vue b/App.vue index f9d27e1..7e7d80e 100644 --- a/App.vue +++ b/App.vue @@ -8,7 +8,7 @@ import { onAuthAppBack, openAuthMiniApp } from 'dingtalk-design-libs/biz/openAut export default { computed: { - ...mapState(['authed','userInfo']), + ...mapState(['authed', 'userInfo']), }, onLaunch(options) { const systemInfo = uni.getSystemInfoSync(); @@ -19,21 +19,13 @@ export default { // 设置小程序来源,企业微信小程序或微信小程序 this.$store.commit('SET_ORIGIN', origin); this.$store.commit('SET_SCENE', options.scene); - this.$u.api.dict.all().then(response => { - cache.put('DICT', response.result); - this.$store.commit('SET_DICT', response.result); - }); - this.$u.api.district.all().then(response => { - cache.put('DISTRICT', response.result); - this.$store.commit('SET_DISTRICT', response.result); - }); if (!this.authed) { if (origin === 'QY_FREGHT_MA') { wx.qy.login({ suiteId: config.suiteId, - success: (res) => { + success: res => { if (res.code) { - uni.$u.api.login.loginByCode({ code: res.code }).then((response) => { + uni.$u.api.login.loginByCode({ code: res.code }).then(response => { if (!response.result) return this.handleLogin(); const result = response.result || {}; this.$store.commit('SET_AUTHED', result.hasBind); @@ -43,24 +35,28 @@ export default { uni.$u.api.user.detail().then(res => { this.$store.commit('SET_FREGHT_INFO', res.result); }); + this.loadCache(); } - }) + }); } }, fail: () => { this.handleLogin(); - } + }, }); } else { this.handleLogin(); } + } else { + this.loadCache(); } // 监听刷新权限 - uni.$on('refresh-permission', () =>{ + uni.$on('refresh-permission', () => { this.getPermission(); + this.loadCache(); }); // 监听检测更新 - uni.$on('refresh-version', (params) =>{ + uni.$on('refresh-version', params => { const { notifyType = 'toast' } = params || {}; this.handleRefreshVersion(notifyType); }); @@ -70,7 +66,7 @@ export default { onShow(options) { // #ifdef MP-DINGTALK // 监听钉钉统一授权小程序返回结果的方法 - onAuthAppBack(options, (data) => { + onAuthAppBack(options, data => { const { status, result } = data || {}; if (status === 'ok' && result && result.authCode) { uni.$u.api.login.dingtalk({ authCode: result.authCode, corpId: dd.corpId }).then(response => { @@ -90,9 +86,22 @@ export default { // #endif }, methods: { + loadCache() { + uni.$u.api.user.detail().then(res => { + this.$store.commit('SET_FREGHT_INFO', res.result); + }); + this.$u.api.dict.all().then(response => { + cache.put('DICT', response.result); + this.$store.commit('SET_DICT', response.result); + }); + this.$u.api.district.all().then(response => { + cache.put('DISTRICT', response.result); + this.$store.commit('SET_DISTRICT', response.result); + }); + }, // 检测更新 handleRefreshVersion(notifyType) { - const showToast = (options) => { + const showToast = options => { if (notifyType === 'silent') return; // 静默 wx.showToast(options); }; @@ -111,31 +120,34 @@ export default { if (res.confirm) { updateManager.applyUpdate(); } - } + }, }); }); updateManager.onUpdateFailed(() => { // 新版本下载失败 showToast({ title: '网络状况不佳,稍后再试', icon: 'none', duration: 2000 }); - }) + }); } else { showToast({ title: '当前已是最新版本', icon: 'none', duration: 2000 }); - } - }) + } + }); } else { showToast({ title: `当前${wx.getSystemInfoSync()?.environment === 'wxwork' ? '企业' : ''}微信版本过低,请升级到最新版本后重试`, icon: 'none', duration: 3000 }); } }, // 查询权限 getPermission() { - return new Promise((resolve) => { - uni.$u.api.user.getPermission({ systemCode: 'dispatch-helper-ma', userId: this.userInfo.userId }).then((response = {}) => { - const { result = [] } = response; - this.$store.commit('SET_PERMISSION', result); - resolve(result); - }).catch(() => { - resolve([]); - }); + return new Promise(resolve => { + uni.$u.api.user + .getPermission({ systemCode: 'freight-web', userId: this.userInfo.username }) + .then((response = {}) => { + const { result = [] } = response; + this.$store.commit('SET_PERMISSION', result); + resolve(result); + }) + .catch(() => { + resolve([]); + }); }); }, handleLogin() { @@ -149,40 +161,39 @@ export default { const result = response.result || {}; this.$store.commit('SET_AUTHED', result.hasBind); this.$store.commit('SET_USER_INFO', result); - this.getPermission(); - if (result.hasBind) { - uni.$u.api.user.detail().then(res => { - this.$store.commit('SET_FREGHT_INFO', res.result); - }); - } + uni.$emit('refresh-permission'); }); } - } + }, }); // #endif // #ifdef MP-DINGTALK // 打开钉钉统一授权小程序 openAuthMiniApp({ - path: 'pages/home/home', //不要改,这里是小程序dingwlanwvdmrtjjwdmd下的一个页面地址 + path: 'pages/home/home', //不要改,这里是小程序dingwlanwvdmrtjjwdmd下的一个页面地址 panelHeight: 'percent50', - extraData:{ + extraData: { clientId: config.clientId, // 应用ID(唯一标识) rpcScope: 'Contact.User.Read', fieldScope: 'Contact.User.mobile', - type:0, + type: 0, ext: JSON.stringify({}), - from:'' - } + from: '', + }, }); // #endif - } - } -} + }, + }, +}; diff --git a/common/api.js b/common/api.js index 437f95d..de29b28 100644 --- a/common/api.js +++ b/common/api.js @@ -1,11 +1,10 @@ import config from '@/config/index.js'; -const bossAPI = '/boss-service-api'; -const freightAPI = '/dispatch-helper-ma-api'; +const freightAPI = '/freight-web-api'; +const freightAdmin = '/freight-service-api'; const authAPI = '/auth-service-api'; -const dispatchMaApi = 'dispatch-ma-api'; -const tmsWebApi = 'tms-web-api'; -const driverAPI = '/driver-app-api'; +const dispatchMaApi = '/dispatch-ma-api'; +const tmsWebApi = '/tms-web-api'; const omsServiceApi = '/oms-service-api' const tmsServiceApi = '/tms-service-api'; const consignorAPI = '/consignor-app-api'; @@ -14,15 +13,15 @@ module.exports = (vm) => { vm.$u.api = { // 配置参数 config: { - getVehicleConfig: params => vm.$u.http.get(freightAPI + '/vehicle/getVehicleConfig', { params }), + getVehicleConfig: params => vm.$u.http.get(freightAPI + '/vehicle/getVehicleConfig', { params }), }, // 数据字典 dict: { - all: params => vm.$u.http.get(consignorAPI + '/dict/getAll', { params, custom: { auth: false } }), + all: params => vm.$u.http.get(tmsWebApi + '/dataDictionary/queryAll', { params, custom: { auth: true } }), }, // 行政区划 district: { - all: params => vm.$u.http.get(consignorAPI + '/district/commonOption', { params, custom: { auth: false } }), + all: params => vm.$u.http.get(tmsWebApi + '/district/commonOption', { params, custom: { auth: true } }), }, // 货主地址 addressHistory: { @@ -36,7 +35,7 @@ module.exports = (vm) => { // 发送手机验证码 send: (params) => vm.$u.http.get(freightAPI + '/maLogin/sendVc', { params, custom: { auth: false } }), // 绑定手机号 - bind: (data) => vm.$u.http.post(freightAPI + '/maLogin/wxbind', data, { custom: { auth: false } }), + bind: (data) => vm.$u.http.post(freightAPI + '/maLogin/vcWxbind', data, { custom: { auth: false } }), // 解除绑定 unbind: (data) => vm.$u.http.post(freightAPI + '/user/consignor/unbindWx', data), // 微信一键登录 @@ -58,24 +57,24 @@ module.exports = (vm) => { user: { // 根据企业名称获取企业详细信息 getCompanyDetail: (params) => vm.$u.http.get(freightAPI + '/user/getCompanyDetail', { params }), - detail: params => vm.$u.http.get(freightAPI + '/user/getDetail', { params }), - getPermission: params => vm.$u.http.get(authAPI + '/permission/getPermission', { params }), + detail: params => vm.$u.http.get(freightAPI + '/user/getDetail', { params }), + getPermission: params => vm.$u.http.get(authAPI + '/permission/getPermission', { params }), }, // 联系人 contact: { // 选择器数据源 - select: params => vm.$u.http.get(freightAPI + '/consignorContact/commonSelect', { params }), + select: params => vm.$u.http.get(freightAPI + '/consignorContact/commonSelect', { params }), + }, + // 常用地址 + address: { + page: params => vm.$u.http.get(freightAPI + '/address/page', { params }), + detail: params => vm.$u.http.get(freightAPI + '/address/getDetail', { params }), + add: (data) => vm.$u.http.post(freightAPI + '/address/add', data), + modify: (data) => vm.$u.http.post(freightAPI + '/address/modify', data), + delete: (data) => vm.$u.http.post(freightAPI + '/address/delete', data), }, - // 常用地址 - address: { - page: params => vm.$u.http.get(freightAPI + '/address/page', { params }), - detail: params => vm.$u.http.get(freightAPI + '/address/getDetail', { params }), - add: (data) => vm.$u.http.post(freightAPI + '/address/add', data), - modify: (data) => vm.$u.http.post(freightAPI + '/address/modify', data), - delete: (data) => vm.$u.http.post(freightAPI + '/address/delete', data), - }, // 查询筛选接口 - filter: { + filter: { org: params => vm.$u.http.get(dispatchMaApi + '/org/commonSelect', { params }), user: params => vm.$u.http.get(tmsWebApi + '/user/commonSelect', { params }), // 用户选择器 getCommonSelect: params => vm.$u.http.get(dispatchMaApi + '/customer/getCommonSelect', { params }), @@ -90,6 +89,67 @@ module.exports = (vm) => { getBelongCustomer: params => vm.$u.http.get(omsServiceApi + '/orderConfig/selectCustomer', { params }), // 获取专属客户 statisticsUser: params => vm.$u.http.get(freightAPI + '/pushcartEmployee/page', { params }), // 获取推车员工 tmsOrg: params => vm.$u.http.get(tmsWebApi + '/org/commonSelect', { params }), + projectCode: params => vm.$u.http.get(freightAPI + '/freightProject/commonSelect', { params }),// 项目 + payeeCommonSelect: params => vm.$u.http.get(freightAPI + '/freightEnterpriseCollectDriver/payeeCommonSelect', { params }), // 代收人 + driver: params => vm.$u.http.get(tmsServiceApi + '/driver/commonSelect', { params }), // 司机选择器 + vehicle: params => vm.$u.http.get(tmsWebApi + '/vehicle/commonSelect', { params }), // 车辆选择器 + goodsName: p => vm.$u.http.get(freightAPI + '/freightEnterpriseGoods/commonSelect', { params:{...p,goodsName:p.query }}).then(res=>{ + return { + ...res, + result:res.result.map(i => { + return { + name:i.goodsName, + code:i.id, + id:i.id + } + }) + } + }), // 货物选择器 + }, + // 申请支付 + freightPayApply: { + page: params => vm.$u.http.post(freightAPI + '/freightPayApply/page', params), + getApplyDetailByIds: params => vm.$u.http.post(freightAPI + '/freightPayApply/getApplyDetailByIds', params), // 明细 + apply: params => vm.$u.http.post(freightAPI + '/freightPayApply/apply', params,{custom: {toast:true}}), // 申请 + cancelApply: params => vm.$u.http.post(freightAPI + '/freightPayApply/cancelApply', params,{custom: {toast:true}}), // 取消申请 + audit: params => vm.$u.http.post(freightAPI + '/freightPayApply/audit', params,{custom: {toast:true}}), // 审核 + getCount: params => vm.$u.http.get(freightAPI + '/freightPayApply/getCount', {params}), // 总数 + }, + // 订单管理-网货货运-new + freightOrder: { + add: params => vm.$u.http.post(freightAPI + '/freightOrder/maAdd', params,{custom: {toast:true}}), // 下单 + getDistance: params => vm.$u.http.get(freightAPI + '/freightOrder/getDistance', {params}), // 获取距离 + page: params => vm.$u.http.post( freightAPI + '/freightOrder/page', params ), // 分页查询 + currentFreight: params => vm.$u.http.get( freightAdmin + '/freightEnterprise/getDetailByCurrentFreight', params ), // 获取企业配置相关详情 + getServiceAmount: params => vm.$u.http.get( freightAPI + '/freightOrder/getServiceAmount', {params}), // 订单服务费 + enterpriseCollectDriverPage: params => vm.$u.http.get( freightAPI + '/freightEnterpriseCollectDriver/page', params), // 网货企业代收用户分页查询 + download: params => vm.$u.http.get( freightAPI + '/freightOrder/download', params), // 模板下载 + downloadStartCar: params => vm.$u.http.get( freightAPI + '/freightOrder/orderDepartAndArriveDownload', params), // 模板下载 + importStartCar: params => vm.$u.http.get( freightAPI + '/freightOrder/importOrderDepartAndArrive', params), // 导入 + import: params => vm.$u.http.get( freightAPI + '/freightOrder/import', params), // 导入 + depart: params => vm.$u.http.post( freightAPI + '/freightOrder/depart', params), // 发车 + arrive: params => vm.$u.http.post( freightAPI + '/freightOrder/arrive', params), // 到达 + sign: params => vm.$u.http.get( freightAPI + '/freightOrder/sign', params), // 签收 + cancel: params => vm.$u.http.post( freightAPI + '/freightOrder/cancel', params), // 取消 + delete: params => vm.$u.http.post( freightAPI + '/freightOrder/delete', params), // 删除 + assignVehicle: params => vm.$u.http.post( freightAPI + '/freightOrder/assignVehicle', params), // 充值指派 + asyncPayee: params => vm.$u.http.get( freightAPI + '/freightOrder/syncPayee', params), // 同步收款人 + modifyPayee: params => vm.$u.http.post( freightAPI + '/freightOrder/modifyPayee', params), // 修改收款人 + getPayeeInfo: params => vm.$u.http.get( freightAPI + '/freightOrder/getPayeeInfo', params), // 获取收款人 + modifyCustomerOrderCode: params => vm.$u.http.post( freightAPI + '/freightOrder/modifyCustomerOrderCode', params), // 修改内部单号 + modifyAddress: params => vm.$u.http.get( freightAPI + '/freightOrder/modifyAddress', params), // 更改地址 + modifyGoods: params => vm.$u.http.post( freightAPI + '/freightOrder/modifyGoods', params), // 更改货物信息 + adjustAmount: params => vm.$u.http.post( freightAPI + '/freightOrder/adjustAmount', params), // 更改运费 + modifyReceiptAttachment: params => vm.$u.http.post( freightAdmin + '/woss/freightOrder/modifyReceiptAttachment', params), // 修改回单附件 + count: params => vm.$u.http.post( freightAPI + '/freightOrder/count', params), // 状态数量 + getDetail: params => vm.$u.http.get( freightAPI + '/freightOrder/getDetail', {params}), // 订单详情 + checkDepartureTime: params => vm.$u.http.get( freightAPI + '/freightOrder/checkDepartureTime', params), // 校验选择的运单发车时间是否一致 + getStartLatestAddress: params => vm.$u.http.get( freightAPI + '/freightOrder/getStartLatestAddress', params), // + getEndLatestAddress: params => vm.$u.http.get( freightAPI + '/freightOrder/getEndLatestAddress', params), // + payeeBindBankCardNo: params => vm.$u.http.get( freightAPI + '/freightOrder/payeeBindBankCardNo', params), // + getSensitiveByOrderCode:params => vm.$u.http.get( freightAdmin + '/freightOrder/getSensitiveByOrderCode', {params}), + buildMaQrcode:params => vm.$u.http.get( freightAdmin + '/woss/freightOrder/buildMaQrcode', {params}), + supplementTrailerVehicle: params => vm.$u.http.get( freightAPI + '/freightOrder/supplementTrailerVehicle', params), // 绑定车挂 }, }; -} \ No newline at end of file +} diff --git a/components/card/payee.vue b/components/card/payee.vue new file mode 100644 index 0000000..d829360 --- /dev/null +++ b/components/card/payee.vue @@ -0,0 +1,70 @@ + + + + diff --git a/components/field/field-copy.vue b/components/field/field-copy.vue new file mode 100644 index 0000000..4f250bc --- /dev/null +++ b/components/field/field-copy.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/components/keyboard/keyboard-bill.vue b/components/keyboard/keyboard-bill.vue new file mode 100644 index 0000000..1510aef --- /dev/null +++ b/components/keyboard/keyboard-bill.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/components/keyboard/keyboard-waybill.vue b/components/keyboard/keyboard-waybill.vue new file mode 100644 index 0000000..31dc3f5 --- /dev/null +++ b/components/keyboard/keyboard-waybill.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/components/list.vue b/components/list.vue index 3f92dc1..894fd2c 100644 --- a/components/list.vue +++ b/components/list.vue @@ -169,4 +169,4 @@ export default { }, } } - \ No newline at end of file + diff --git a/components/popup/popup-platenumber.vue b/components/popup/popup-platenumber.vue new file mode 100644 index 0000000..56963e4 --- /dev/null +++ b/components/popup/popup-platenumber.vue @@ -0,0 +1,376 @@ + + + + + diff --git a/config/request.js b/config/request.js index bf60536..a7e841a 100644 --- a/config/request.js +++ b/config/request.js @@ -4,9 +4,9 @@ const apiHost = config.apiHost; const systemInfo = wx.getSystemInfoSync(); // 此vm参数为页面的实例,可以通过它引用vuex中的变量 -module.exports = (vm) => { +module.exports = vm => { // 初始化请求配置 - uni.$u.http.setConfig((config) => { + uni.$u.http.setConfig(config => { /* config 为默认全局配置*/ config.baseURL = apiHost; /* 根域名 */ config.header = { @@ -20,63 +20,72 @@ module.exports = (vm) => { platform: 'mp', // 当前运行平台 }; return config; - }) + }); // 请求拦截 - uni.$u.http.interceptors.request.use((config) => { // 可使用async await 做异步操作 - if (config.custom.auth === false) { - delete config.header['Authorization']; - } else { - config.header['Authorization'] = `Bearer ${vm.$store.state?.userInfo?.accessToken}`; - } - return config; - }, config => { // 可使用async await 做异步操作 - return Promise.reject(config) - }) + uni.$u.http.interceptors.request.use( + config => { + // 可使用async await 做异步操作 + if (config.custom.auth === false) { + delete config.header['Authorization']; + } else { + config.header['Authorization'] = `Bearer ${vm.$store.state?.userInfo?.accessToken}`; + } + // config.header['Authorization'] = `Bearer 814aec36-60b1-4b47-a0fa-b909501f3e48`; + return config; + }, + config => { + // 可使用async await 做异步操作 + return Promise.reject(config); + }, + ); // 响应拦截 - uni.$u.http.interceptors.response.use((response) => { - const { data = {}, statusCode, config } = response; - const { success, message = '', businessException, errorCode } = data; - if (config && config.interceptors === false) { - // 请求配置不做返回拦截的情况 - return response; - } else { - if (success) { - return data; + uni.$u.http.interceptors.response.use( + response => { + const { data = {}, statusCode, config } = response; + const { success, message = '', businessException, errorCode } = data; + if (config && config.interceptors === false) { + // 请求配置不做返回拦截的情况 + return response; } else { - if (`${errorCode}` === '401') { - console.error(`【${errorCode}】登录过期`); - store.commit('SET_AUTHED', false); - setTimeout(() => { - uni.reLaunch({ url: '/pages/login/login' }); - }, 1200); - return Promise.reject(message); - } - if (businessException && !(config && config.custom && config.custom.toast)) { - uni.showToast({ icon: 'none', title: message || `[${errorCode}]系统异常`, duration: 3000 }); - } else if (!(config && config.custom && config.custom.toast)) { - if (config.toast !== false) { - if (`${errorCode}`.substr(0, 1) === '5') { - uni.showToast({ icon: 'none', title: `[${errorCode}]系统异常`, duration: 3000 }); - } else { - uni.showToast({ icon: 'none', title: message || `[${errorCode}]系统异常`, duration: 3000 }); + if (success) { + return data; + } else { + if (`${errorCode}` === '401') { + console.error(`【${errorCode}】登录过期`); + store.commit('SET_AUTHED', false); + setTimeout(() => { + uni.reLaunch({ url: '/pages/login/login' }); + }, 200); + return Promise.reject(message); + } + if (businessException && !(config && config.custom && config.custom.toast)) { + uni.showToast({ icon: 'none', title: message || `[${errorCode}]系统异常`, duration: 3000 }); + } else if (!(config && config.custom && config.custom.toast)) { + if (config.toast !== false) { + if (`${errorCode}`.substr(0, 1) === '5') { + uni.showToast({ icon: 'none', title: `[${errorCode}]系统异常`, duration: 3000 }); + } else { + uni.showToast({ icon: 'none', title: message || `[${errorCode}]系统异常`, duration: 3000 }); + } } } + return Promise.reject(message); } - return Promise.reject(message); } - } - }, (response) => { - // 对响应错误做点什么 (statusCode !== 200) - const { statusCode } = response; - if (statusCode === 401) { - console.error(`【${statusCode}】登录过期`); - store.commit('SET_AUTHED', false); - setTimeout(() => { - uni.reLaunch({ url: '/pages/login/login' }); - }, 1200); - } - return Promise.reject(response); - }); -} + }, + response => { + // 对响应错误做点什么 (statusCode !== 200) + const { statusCode } = response; + if (statusCode === 401) { + console.error(`【${statusCode}】登录过期`); + store.commit('SET_AUTHED', false); + setTimeout(() => { + uni.reLaunch({ url: '/pages/login/login' }); + }, 1200); + } + return Promise.reject(response); + }, + ); +}; diff --git a/main.js b/main.js index a126a3b..60aabd2 100644 --- a/main.js +++ b/main.js @@ -10,11 +10,7 @@ Vue.prototype.formatImagePath = formatImagePath; import uView from '@/uni_modules/uview-ui'; Vue.use(uView); -let colorPrimary = '#2673FB'; - -// #ifdef MP-DINGTALK -colorPrimary = '#3296FA'; -// #endif +let colorPrimary = '#1E7B6B'; uni.$u.setConfig({ config: { diff --git a/package.json b/package.json index b731c91..7caa009 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,8 @@ } } } + }, + "devDependencies": { + "prettier": "3.3.2" } } diff --git a/pages.json b/pages.json index 99d73ac..5f0be10 100644 --- a/pages.json +++ b/pages.json @@ -5,31 +5,97 @@ "style": { "navigationBarTitleText": "首页" } - }, - { + },{ "path": "pages/login/login", "style": { "navigationBarTitleText": "登录" } }, - { - "path": "pages/login/code", - "style": { - "navigationBarTitleText": "验证码" - } - }, { - "path": "pages/my/my", + "path": "pages/login/code", + "style": { + "navigationBarTitleText": "验证码" + } + },{ + "path": "pages/order/index", + "style": { + "navigationBarTitleText": "订单", + "enablePullDownRefresh": true + } + },{ + "path": "pages/order/detail", + "style": { + "navigationBarTitleText": "详情" + } + },{ + "path": "pages/order/filter", + "style": { + "navigationBarTitleText": "筛选器" + } + },{ + "path": "pages/order/add", + "style": { + "navigationBarTitleText": "创建订单" + } + },{ + "path": "pages/order/start-car", + "style": { + "navigationBarTitleText": "确认发车" + } + },{ + "path": "pages/order/arrival-car", + "style": { + "navigationBarTitleText": "确认到达" + } + }, + { + "path": "pages/order/change-fee", + "style": { + "navigationBarTitleText": "更改运费" + } + }, + { + "path": "pages/order/again-assign", "style": { - "navigationBarTitleText": "我的", - "navigationStyle": "custom" + "navigationBarTitleText": "重新指派" + } + }, + { + "path": "pages/order/upload-receipt", + "style": { + "navigationBarTitleText": "上传回单" + } + }, + { + "path": "pages/order/change-goods", + "style": { + "navigationBarTitleText": "货物信息" + } + }, + { + "path": "pages/settlement/index", + "style": { + "navigationBarTitleText": "支付申请", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/settlement/filter", + "style": { + "navigationBarTitleText": "筛选器" + } + }, + { + "path": "pages/me/index", + "style": { + "navigationBarTitleText": "我的" } } ], "subPackages": [ { - "root":"pages/common", - "pages":[ + "root":"pages/common", + "pages":[ { "path": "select-contact", "style": { @@ -45,12 +111,24 @@ { "path": "webview" } - ] - }, + ] + }, { "root":"pages/global", "pages": [ { + "path": "search-payee", + "style": { + "navigationBarTitleText": "代收人" + } + }, + { + "path": "search-dict", + "style": { + "navigationBarTitleText": "数据字典" + } + }, + { "path": "search-common", "style": { "navigationBarTitleText": "区域" @@ -97,54 +175,44 @@ ], "globalStyle": { "navigationBarTextStyle": "white", - "navigationBarTitleText": "则一请车助手", - "navigationBarBackgroundColor": "#2673FB", - "backgroundColor": "#2673FB" + "navigationBarTitleText": "则一飞牛货主", + "navigationBarBackgroundColor": "#1E7B6B", + "backgroundColor": "#1E7B6B" }, "condition": { "current": 0, "list": [ { - "name": "首页", - "path": "/pages/index" - }, - { - "name": "登录", - "path": "/pages/login/login" - } + "name": "首页", + "path": "/pages/index" + }, + { + "name": "登录", + "path": "/pages/login/login" + } ] }, "tabBar": { "color": "#8c8c8c", "fontSize": "100upx", - // #ifdef MP-DINGTALK - "selectedColor": "#3296FA", - // #endif - // #ifndef MP-DINGTALK - "selectedColor": "#2673FB", - // #endif + "selectedColor": "#1E7B6B", "backgroundColor": "#FFFFFF", "list": [ { - "pagePath": "pages/index", - "iconPath": "static/tabbar/inquiry.png", - // #ifdef MP-DINGTALK - "selectedIconPath": "static/tabbar/inquiry-active-dingtalk.png", - // #endif - // #ifndef MP-DINGTALK - "selectedIconPath": "static/tabbar/inquiry-active.png", - // #endif - "text": "首页" + "pagePath": "pages/order/index", + "iconPath": "static/tabbar/order.png", + "selectedIconPath": "static/tabbar/order-active.png", + "text": "订单" }, { - "pagePath": "pages/my/my", - "iconPath": "static/tabbar/my.png", - // #ifdef MP-DINGTALK - "selectedIconPath": "static/tabbar/my-active-dingtalk.png", - // #endif - // #ifndef MP-DINGTALK - "selectedIconPath": "static/tabbar/my-active.png", - // #endif + "pagePath": "pages/settlement/index", + "iconPath": "static/tabbar/settlement.png", + "selectedIconPath": "static/tabbar/settlement-active.png", + "text": "结算" + },{ + "pagePath": "pages/me/index", + "iconPath": "static/tabbar/me.png", + "selectedIconPath": "static/tabbar/me-active.png", "text": "我的" } ] @@ -156,15 +224,15 @@ "^List": "@/components/list.vue", "^Empty": "@/components/empty.vue", "^PullRefresh": "@/components/pull-refresh.vue", - "^Waypoints": "@/components/waypoints.vue", + "^Waypoints": "@/components/waypoints.vue", "^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue", "^action-(.*)": "@/components/action/action-$1.vue", "^card-(.*)": "@/components/card/card-$1.vue", "^keyboard-(.*)": "@/components/keyboard/keyboard-$1.vue", "^chart-(.*)": "@/components/chart/chart-$1.vue", - "^form-(.*)": "@/components/form/form-$1.vue", - "^popup-(.*)": "@/components/popup/popup-$1.vue", - "^picker-(.*)": "@/components/picker/picker-$1.vue", + "^form-(.*)": "@/components/form/form-$1.vue", + "^popup-(.*)": "@/components/popup/popup-$1.vue", + "^picker-(.*)": "@/components/picker/picker-$1.vue", "^render-(.*)": "@/components/render/render-$1.vue", "^select-(.*)": "@/components/select/select-$1.vue", "^upload-(.*)": "@/components/upload/upload-$1.vue", @@ -175,13 +243,13 @@ "^search-bar": "@/components/business/search-bar.vue", "^search-tabs": "@/components/business/search-tabs.vue", "^z-(.*)": "@/components/zee/z-$1.vue", - "^view-item": "@/components/business/view-item", + "^view-item": "@/components/business/view-item", "^count-down": "@/components/business/count-down", "^modal-input-line": "@/components/business/modal-input-line", "^view-image": "@/components/viewer/view-image", "^input-(.*)": "@/components/business/input/input-$1.vue", - "^f2": "@/components/f2/f2.vue", - "^l-(.*)": "@/uni_modules/lime-painter/components/l-$1/l-$1.vue" + "^f2": "@/components/f2/f2.vue", + "^l-(.*)": "@/uni_modules/lime-painter/components/l-$1/l-$1.vue" } } -} \ No newline at end of file +} diff --git a/pages/common/webview.vue b/pages/common/webview.vue index e222b72..0795d10 100644 --- a/pages/common/webview.vue +++ b/pages/common/webview.vue @@ -1,33 +1,40 @@ diff --git a/pages/global/search-common.vue b/pages/global/search-common.vue index 01d9c52..49f3544 100644 --- a/pages/global/search-common.vue +++ b/pages/global/search-common.vue @@ -4,7 +4,7 @@