/** * uni-ui 加载状态 * @type {{LOADING: string, NO_MORE: string, MORE: string}} */ export const LoadingStatus = { MORE: "more", // 还有更多 LOADING: "loading", // 加载中 NO_MORE: "noMore" // 没有更多了 } // 任务类型 export const TaskType = { EMERGENCY: '1', // 急修 TOWING: '2', // 拖车 parseName(type) { const map = { [this.EMERGENCY]: '急修', [this.TOWING]: '拖车' } return map[type] || '未知' } } /** * 任务状态枚举 * @type {{WAIT_RECEIVE: string, RECEIVED: string, CANCEL: string, AFTER_SALE: string, FINISHED: string}} */ export const TaskStatus = { WAIT_RECEIVE: '1', // 待接单 RECEIVED: '2', // 已接单 CANCEL: '3', // 已取消 AFTER_SALE: '4', // 售后 FINISHED: '5', // 已完成 /** * 获取状态名称 */ parseName(status) { const map = { [this.WAIT_RECEIVE]: '待接单', [this.RECEIVED]: '已接单', [this.CANCEL]: '已取消', [this.AFTER_SALE]: '售后', [this.FINISHED]: '已完成' } return map[status] || '未知' }, /** * 获取状态名称 */ parseNameForUser(status) { const map = { [this.WAIT_RECEIVE]: '已下单', [this.RECEIVED]: '已接单', [this.CANCEL]: '已取消', [this.AFTER_SALE]: '售后', [this.FINISHED]: '已完成' } return map[status] || '未知' }, /** * 获取允许接单的状态列表 */ canReceive() { return [this.WAIT_RECEIVE] }, /** * 获取允许完成的状态列表 */ canComplete() { return [this.RECEIVED] }, /** * 获取允许取消的状态列表 */ canCancel() { return [this.WAIT_RECEIVE, this.RECEIVED] }, /** * 获取允许申请售后的状态列表 */ canAfterSale() { return [this.FINISHED] }, /** * 获取允许修改的状态列表 * @returns {string[]} 可以修改的状态码列表 */ canUpdate() { return [this.WAIT_RECEIVE, this.RECEIVED] }, } /** * 商户状态枚举 * @type {{WAIT_VERIFY: string, REJECTED: string, ONLINE: string, OFFLINE: string}} */ export const MchStatus = { WAIT_VERIFY: '1', // 待审核 REJECTED: '2', // 驳回 ONLINE: '3', // 在线 OFFLINE: '4', // 下线 /** * 获取状态名称 * @param {string} status 状态码 * @returns {string} 状态名称 */ parseName(status) { const map = { [this.WAIT_VERIFY]: '待审核', [this.REJECTED]: '驳回', [this.ONLINE]: '在线', [this.OFFLINE]: '下线' } return map[status] || '未知' }, /** * 获取可以审核的商户状态列表 * @returns {string[]} 可以审核的状态码列表 */ canVerify() { return [this.WAIT_VERIFY] }, /** * 获取可以上下线的商户状态列表 * @returns {string[]} 可以上下线的状态码列表 */ canOnline() { return [this.ONLINE, this.OFFLINE] } } /** * 余额日志类型枚举 * @type {{USER_SCORE: string, MCH_BALANCE: string, MCH_SCORE: string}} */ export const BalanceLogType = { USER_SCORE: '1', // 用户积分 MCH_BALANCE: '2', // 商户余额 MCH_SCORE: '3', // 商户积分 /** * 获取类型名称 * @param {string} type 类型码 * @returns {string} 类型名称 */ parseName(type) { const map = { [this.USER_SCORE]: '用户积分', [this.MCH_BALANCE]: '商户余额', [this.MCH_SCORE]: '商户积分' } return map[type] || '未知' } } // VIPD等级 export const VipLevel = { VIP0: '0', VIP1: '1', VIP2: '2', getName(level) { const map = { [this.VIP0]: '未开通', [this.VIP1]: '普通会员', [this.VIP2]: '高级会员' } return map[level] || '未知' } } // VIP订单状态 export const VipOrderStatus = { WAIT_PAY: '1', // 待支付 SUCCESS: '2', // 成功 CANCEL: '3', // 取消 } // 员工角色 export const MchStaffType = { MANAGER: "1", // 店长 STAFF: "2", // 员工 parseName(type) { const map = { [this.MANAGER]: '店长', [this.STAFF]: '员工' } return map[type] || '未知' } } // 提现状态 export const WithdrawStatus = { PAYING: 'PAYING', // 打款中 SUCCESS: 'SUCCESS', // 已打款 FAILED: 'FAILED', // 打款失败 CANCELLED: 'CANCELLED', // 已撤销 parseName(status) { const map = { [this.PAYING]: '打款中', [this.SUCCESS]: '已打款', [this.FAILED]: '打款失败', [this.CANCELLED]: '已撤销' } return map[status] || '未知' }, parseColor(status) { const map = { [this.PAYING]: '#FFA500', [this.SUCCESS]: '#008000', [this.FAILED]: '#FF0000', [this.CANCELLED]: '#808080' } return map[status] || '#808080' } }