diff --git a/apis/orderApi.js b/apis/orderApi.js new file mode 100644 index 0000000..0b19b8d --- /dev/null +++ b/apis/orderApi.js @@ -0,0 +1,14 @@ +import http from '../utils/http/index.js' + +/** + * 获取客户订单列表 + * @param {object} data 获取验证码参数 + * @returns {Promise} + * swagger: http://api-ops-yyt-test.qniao.cn//base-paper-trading/swagger-ui/index.html?urls.primaryName=CustomerApi#/%E5%8E%9F%E7%BA%B8%E8%AE%A2%E5%8D%95/getCustomerOrderListPageUsingGET + */ +export const getOrderList = (data) => { + return http.get({ + url: '/base-paper-trading/get/customer/order/list/page', + data + }) +} diff --git a/components/scroll-list/scroll-list.vue b/components/scroll-list/scroll-list.vue index 40d82a4..261facc 100644 --- a/components/scroll-list/scroll-list.vue +++ b/components/scroll-list/scroll-list.vue @@ -580,7 +580,7 @@ export default { .scroll-content { height: 100%; display: flex; - will-change: transform; + // will-change: transform; flex-direction: column; .pull-down-wrap { left: 0; @@ -627,10 +627,11 @@ export default { margin: auto; display: flex; align-items: center; + margin-bottom: 400rpx; flex-direction: column; .empty-image { - width: 200rpx; - height: 200rpx; + width: 600rpx; + height: 600rpx; } .empty-text { color: #606266; diff --git a/enums/index.js b/enums/index.js index 790632f..1c06a7f 100644 --- a/enums/index.js +++ b/enums/index.js @@ -107,3 +107,87 @@ export const fsAuditStatus = { PASS: 2, REJECT: 3 } + +/** + * 客户订单状态 0: 全部 ; 30100: 待确认 ; 30204: 待供应商确认 ; 30101: 已下单 ; 30104: 已完成 ; 30105: 已取消 + */ +export const orderStatusEnum = { + ALL: 0, + WAIT_CONFIRM: 30100, + WAIT_SUPPLIER_CONFIRM: 30204, + ORDERED: 30101, + FINISHED: 30104, + CANCELED: 30105 +} + +/** + * 客户订单状态 0: 全部 ; 30100: 待确认 ; 30204: 待供应商确认 ; 30101: 已下单 ; 30104: 已完成 ; + */ +export const orderStatusArray = [ + { + value: orderStatusEnum.ALL, + label: '全部' + }, + { + value: orderStatusEnum.WAIT_CONFIRM, + label: '待确认' + }, + { + value: orderStatusEnum.WAIT_SUPPLIER_CONFIRM, + label: '待供应商确认' + }, + { + value: orderStatusEnum.ORDERED, + label: '已下单' + }, + { + value: orderStatusEnum.FINISHED, + label: '已完成' + }, + { + value: orderStatusEnum.CANCELED, + label: '已取消' + } +] + +export const orderStatusMap = { + [orderStatusEnum.ALL]: '全部', + [orderStatusEnum.WAIT_CONFIRM]: '待确认', + [orderStatusEnum.WAIT_SUPPLIER_CONFIRM]: '待供应商确认', + [orderStatusEnum.ORDERED]: '已下单', + [orderStatusEnum.FINISHED]: '已完成', + [orderStatusEnum.CANCELED]: '已取消' +} + +/** + * 供应商订单状态 待客户确认订单/30202,待供应商确认订单/30205,待发货/30106,已发货/30107 已发货在H5客户端显示 待收货/30107 ,待客户借款/30207,支付中/30208,待客户支付/30214,付款失败/30211,已完成/30213,待客户还款/30217,已取消/30212,还款中/30216 + */ +export const supplierOrderStatusEnum = { + WAIT_CLIENT_CONFIRM: 30202, + WAIT_SUPPLIER_CONFIRM: 30205, + WAIT_DELIVERY: 30106, + WAIT_RECEIVE: 30107, + WAIT_CLIENT_LOAN: 30207, + PAYING: 30208, + WAIT_CLIENT_PAY: 30214, + PAY_FAIL: 30211, + FINISHED: 30213, + WAIT_CLIENT_REPAY: 30217, + REPAYING: 30216, + CANCELED: 30212 +} + +export const supplierOrderStatusMap = { + [supplierOrderStatusEnum.WAIT_CLIENT_CONFIRM]: '待客户确认', + [supplierOrderStatusEnum.WAIT_SUPPLIER_CONFIRM]: '待供应商确认', + [supplierOrderStatusEnum.WAIT_DELIVERY]: '待发货', + [supplierOrderStatusEnum.WAIT_RECEIVE]: '待收货', + [supplierOrderStatusEnum.WAIT_CLIENT_LOAN]: '待客户借款', + [supplierOrderStatusEnum.PAYING]: '支付中', + [supplierOrderStatusEnum.WAIT_CLIENT_PAY]: '待客户支付', + [supplierOrderStatusEnum.PAY_FAIL]: '付款失败', + [supplierOrderStatusEnum.FINISHED]: '已完成', + [supplierOrderStatusEnum.WAIT_CLIENT_REPAY]: '待客户还款', + [supplierOrderStatusEnum.REPAYING]: '还款中', + [supplierOrderStatusEnum.CANCELED]: '已取消' +} diff --git a/manifest.json b/manifest.json index 9f55dcf..aabc002 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { - "name" : "uniapp-demo", - "appid" : "", + "name" : "纸掌柜", + "appid" : "__UNI__34A22DC", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", @@ -85,7 +85,7 @@ "vueVersion" : "2", "h5" : { "router" : { - "mode" : "history" + "mode" : "hash" } } } diff --git a/pages.json b/pages.json index 7ee5a3d..e518dc7 100644 --- a/pages.json +++ b/pages.json @@ -67,6 +67,14 @@ "navigationStyle": "custom" } }, + { + "path": "pages/order-list/index", + "style": { + "navigationBarTitleText": "订单列表", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }, { "path": "pages/test/index", "style": { diff --git a/pages/error/index.vue b/pages/error/index.vue index 4a36246..560f88a 100644 --- a/pages/error/index.vue +++ b/pages/error/index.vue @@ -1,5 +1,11 @@ - + diff --git a/pages/login/index.vue b/pages/login/index.vue index 34eb221..76a23db 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -139,12 +139,12 @@ export default { store.commit('setToken', token) // 登录成功先查看是否有下一个页面 const nextPage = store.state.nextPage + let page = null if (nextPage.name) { - go2(nextPage.name, nextPage.data, true) - } else { - // 初始登录没有下一个页面,进行账号信息处理 - this.setAccountInfo() + page = { url: nextPage.name, data: nextPage.data, isRedirect: true } } + // 初始登录没有下一个页面,进行账号信息处理 + this.setAccountInfo(page) store.commit('removeNextPage') }, 1000) } @@ -154,13 +154,13 @@ export default { } }) }, - setAccountInfo() { + setAccountInfo(page = { url: 'store', data: {}, isRedirect: true }) { getBaseInfo({}, true).then((res) => { if (res) { if (!res.enterpriseList || res.enterpriseList.length === 0) { go2('enterprise-info', { operation: 'add' }, true) } else { - go2('store') + go2(page.url, page.data, page.isRedirect) } } }) diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 88d2115..0e00aa5 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -36,26 +36,30 @@ - 其他工具 + 我的订单 + + 查看更多订单 + + - + 全部订单 - + 待确认 - + 待供应商确认 - + 已下单 - + 已完成 @@ -105,16 +109,15 @@ - test - enterprise-info + test + enterprise-info + + diff --git a/static/imgs/order/order-empty.png b/static/imgs/order/order-empty.png new file mode 100644 index 0000000..b47dbf9 Binary files /dev/null and b/static/imgs/order/order-empty.png differ diff --git a/static/imgs/order/paper-default-icon.png b/static/imgs/order/paper-default-icon.png new file mode 100644 index 0000000..4aece50 Binary files /dev/null and b/static/imgs/order/paper-default-icon.png differ diff --git a/store/index.js b/store/index.js index faf41cb..bd0a7c2 100644 --- a/store/index.js +++ b/store/index.js @@ -19,7 +19,7 @@ let qnToken = null, uecToken = null, searchHistory = null, /** - * @value supplierId 当前被分析的供应商id + * @value supplierId 当前被分享的供应商id */ supplierId = null const companyInfoParams = ['id', 'name', 'fddEnterpriseStatus'] @@ -51,7 +51,7 @@ const store = new Vuex.Store({ qnToken: qnToken || '', // token supplierId: supplierId || '', // 供应商id userInfo: userInfo || {}, // 用户信息 - companyInfo: companyInfo || {}, // 纸盘商信息 + companyInfo: companyInfo || {}, // 印包厂信息 nextPage: { name: '', data: {} diff --git a/utils/index.js b/utils/index.js index ad47f00..9b0d029 100644 --- a/utils/index.js +++ b/utils/index.js @@ -1,12 +1,16 @@ import env from '@/env/index.js' import store from '@/store/index.js' +import { isDate } from './is.js' /** * 日期格式化,样例 yyyy-mm-dd hh:MM:ss * @param date Date 需要转换的日期 * @param fmt string 转化的格式 yyyy-mm-dd hh:MM:ss */ export const dateTimeFormat = (date, fmt) => { - if (!date) { + if (!isDate(date)) { + date = new Date(date) + } + if (!date || isNaN(date.getTime())) { throw new Error('日期不正确') } let ret diff --git a/utils/is.js b/utils/is.js index fa7bb45..ac04e98 100644 --- a/utils/is.js +++ b/utils/is.js @@ -15,3 +15,7 @@ export function isObject(val) { export function isArray(val) { return is(val, 'Array') } + +export function isDate(val) { + return is(val, 'Date') +}