diff --git a/src/api/blindBox/blindBoxOeder.ts b/src/api/blindBox/blindBoxOeder.ts new file mode 100644 index 0000000000000000000000000000000000000000..4bf93b305e464b92c5d6d393a6f8709726146012 --- /dev/null +++ b/src/api/blindBox/blindBoxOeder.ts @@ -0,0 +1,80 @@ +import { http } from '@/utils/http/axios'; + +export interface BasicResponseModel { + code: number; + message: string; + result: T; +} + +/** + * @description: 盲盒订单表列表 + */ +export function getBlindBoxOrderPage(params?) { + return http.request({ + url: '/blind-box/blind-box-order/page', + method: 'GET', + params, + }); +} +//isTransformResponse true不进行任何处理直接返回, false会进行处理后返回 例如权限不够都会处理 +/** + * 保存盲盒订单表 + * @param params + */ +export function saveBlindBoxOrder(params?) { + return http.request( + { + url: `/blind-box/blind-box-order`, + method: 'POST', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 编辑盲盒订单表 + * @param params + */ +export function updateBlindBoxOrder(params?) { + return http.request( + { + url: `/blind-box/blind-box-order/${params.id}`, + method: 'PUT', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 删除盲盒订单表 + * @param params + */ +export function deleteBlindBoxOrder(params?) { + return http.request( + { + url: `/blind-box/blind-box-order/${params.id}`, + method: 'DELETE', + params, + }, + { + isTransformResponse: false, + } + ); +} +/*** + * 获取盲盒订单项 + * @param params + */ +export const getBlindOrderItem = (params: number) => { + return http.request({ + url: `/blind-box/blind-box-order/item/list/${params}`, + method: 'GET', + // params, + }); +}; diff --git a/src/api/order/order.ts b/src/api/order/order.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a269ade0a863e787225d4e995678518dc966d88 --- /dev/null +++ b/src/api/order/order.ts @@ -0,0 +1,76 @@ +import { http } from '@/utils/http/axios'; + +export interface BasicResponseModel { + code: number; + message: string; + result: T; +} + +/** + * @description: 订单表列表 + */ +export function getOrderPage(params?) { + return http.request({ + url: '/order/order/page', + method: 'GET', + params, + }); +} +//isTransformResponse true不进行任何处理直接返回, false会进行处理后返回 例如权限不够都会处理 +/** + * 保存订单表 + * @param params + */ +export function saveOrder(params?) { + return http.request( + { + url: `/order/order`, + method: 'POST', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 编辑订单表 + * @param params + */ +export function updateOrder(params?) { + return http.request( + { + url: `/order/order/${params.id}`, + method: 'PUT', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 删除订单表 + * @param params + */ +export function deleteOrder(params?) { + return http.request( + { + url: `/order/order/${params.id}`, + method: 'DELETE', + params, + }, + { + isTransformResponse: false, + } + ); +} +export const getOrderItemPage = (orderId) => { + return http.request({ + url: `/order/order/item/list`, + method: 'GET', + params: { orderId }, + }); +}; diff --git a/src/api/order/orderItem.ts b/src/api/order/orderItem.ts new file mode 100644 index 0000000000000000000000000000000000000000..af2130fbbb4eafde8fbf69775af339aa67c0adfc --- /dev/null +++ b/src/api/order/orderItem.ts @@ -0,0 +1,69 @@ +import { http } from '@/utils/http/axios'; + +export interface BasicResponseModel { + code: number; + message: string; + result: T; +} + +/** + * @description: 订单子项表列表 + */ +export function getOrderItemPage(params?) { + return http.request({ + url: '/order/orderItem/page', + method: 'GET', + params, + }); +} +//isTransformResponse true不进行任何处理直接返回, false会进行处理后返回 例如权限不够都会处理 +/** + * 保存订单子项表 + * @param params + */ +export function saveOrderItem(params?) { + return http.request( + { + url: `/order/orderItem`, + method: 'POST', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 编辑订单子项表 + * @param params + */ +export function updateOrderItem(params?) { + return http.request( + { + url: `/order/orderItem/${params.id}`, + method: 'PUT', + params, + }, + { + isTransformResponse: false, + } + ); +} + +/** + * 删除订单子项表 + * @param params + */ +export function deleteOrderItem(params?) { + return http.request( + { + url: `/order/orderItem/${params.id}`, + method: 'DELETE', + params, + }, + { + isTransformResponse: false, + } + ); +} diff --git a/src/enums/orderEnum.ts b/src/enums/orderEnum.ts new file mode 100644 index 0000000000000000000000000000000000000000..b390c7fb2b724c75395244ba79d7299e6ec36a8d --- /dev/null +++ b/src/enums/orderEnum.ts @@ -0,0 +1,8 @@ +export enum OrderStatus { + PendingPay = 0, // 待付款 + AlreadyPay = 1, // 已付款 + AlreadyGo = 2, // 已发货 + AlreadyGet = 3, // 已收货 + AlreadyCancel = 4, // 已取消 + AlreadyFinish = 5, //已完成 +} diff --git a/src/router/modules/blindBox.ts b/src/router/modules/blindBox.ts index 38d53d2162734663e350c2bcc52c5e1d7f6129ea..f513d91cf141cfe713b77be6caa83d00a544a8fd 100755 --- a/src/router/modules/blindBox.ts +++ b/src/router/modules/blindBox.ts @@ -23,7 +23,7 @@ const routes: Array = [ meta: { title: '盲盒', icon: renderIcon(GiftOutlined), - permissions: ['blind_box_list'], + permissions: ['blind_box_list', 'blind_box_order'], sort: 4, }, children: [ @@ -49,6 +49,16 @@ const routes: Array = [ }, component: () => import('@/views/blindBox/blindBox/blindBoxCreate.vue'), }, + { + path: 'blind-box-order', + name: 'blindBoxOrder', + meta: { + title: '盲盒订单', + permissions: ['blind_box_order'], + //keepAlive: true, + }, + component: () => import('@/views/blindBox/bindBoxOrder/index.vue'), + }, ], }, ]; diff --git a/src/router/modules/order.ts b/src/router/modules/order.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6ce46cc958be13767bf24c3d336d63a2cb1d90e --- /dev/null +++ b/src/router/modules/order.ts @@ -0,0 +1,54 @@ +import { RouteRecordRaw } from 'vue-router'; +import { Layout } from '@/router/constant'; +import { GiftOutlined } from '@vicons/antd'; +import { renderIcon } from '@/utils/index'; +/** + * @param name 路由名称, 必须设置,且不能重名 + * @param meta 路由元信息(路由附带扩展信息) + * @param redirect 重定向地址, 访问这个路由时,自定进行重定向 + * @param meta.disabled 禁用整个菜单 + * @param meta.title 菜单名称 + * @param meta.icon 菜单图标 + * @param meta.keepAlive 缓存该路由 + * @param meta.sort 排序越小越排前 + * + * */ +const routes: Array = [ + { + path: '/order', + name: 'order', + redirect: '/order/order', + component: Layout, + meta: { + title: '订单', + icon: renderIcon(GiftOutlined), + permissions: ['order_list'], + sort: 4, + }, + children: [ + { + path: '/order', + name: 'order', + redirect: '/order/order', + meta: { + title: '订单', + permissions: ['order_list'], + //keepAlive: true, + }, + // component: () => import('@/views/order/order/index.vue'), + children: [ + { + path: '/order-list', + name: 'orderList', + meta: { + title: '订单列表', + permissions: ['order_list'], + }, + component: () => import('@/views/order/orderList/index.vue'), + }, + ], + }, + ], + }, +]; +export default routes; diff --git a/src/views/blindBox/bindBoxOrder/index.vue b/src/views/blindBox/bindBoxOrder/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..b505a539bad68617a270e8ec83e3eda979608668 --- /dev/null +++ b/src/views/blindBox/bindBoxOrder/index.vue @@ -0,0 +1,273 @@ + + + + + diff --git a/src/views/blindBox/bindBoxOrder/lib/columns.ts b/src/views/blindBox/bindBoxOrder/lib/columns.ts new file mode 100644 index 0000000000000000000000000000000000000000..aabc1e294fc2d6de77b9068b20e3a50a4564ca61 --- /dev/null +++ b/src/views/blindBox/bindBoxOrder/lib/columns.ts @@ -0,0 +1,105 @@ +import { formatToDateTime } from '@/utils/dateUtil'; + +export const columns = [ + { + title: 'ID', + key: 'id', + width: 50, + }, + { + title: '订单编号', + key: 'orderSn', + width: 150, + }, + { + title: '商品名称', + key: 'blindBoxName', + width: 100, + }, + // { + // title: '盲盒id', + // key: 'blindBoxId', + // width: 75, + // }, + { + title: '会员昵称', + key: 'nickname', + width: 100, + }, + // { + // title: '会员id', + // key: 'memberId', + // width: 100, + // }, + { + title: '会员手机号', + key: 'memberMobile', + width: 150, + }, + // { + // title: '抽奖次数', + // key: 'blindBoxNum', + // width: 100, + // }, + { + title: '价格', + key: 'price', + width: 100, + }, + { + title: '状态', + key: 'status', + width: 100, + render: (data) => { + try { + // if (data.status === 0) { + // return '待支付'; + // } else if (data.status === 1) { + // return '已支付'; + // } else if (data.status === 2) { + // return '已提货'; + // } else if (data.status === 3) { + // return '已完成'; + // } + switch (data.status) { + case 0: + return '待支付'; + case 1: + return '已支付'; + case 2: + return '已提货'; + case 3: + return '已完成'; + default: + break; + } + } catch (error) { + console.log(error); + } + }, + }, + // { + // title: '第三方支付单号', + // key: 'paymentOrderNo', + // width: 100, + // }, + // { + // title: '支付时间', + // key: 'payTime', + // width: 100, + // }, + { + title: '下单时间', + key: 'createTime', + width: 150, + render: (data) => { + try { + const createTime = data.createTime * 1000; + return formatToDateTime(createTime); + } catch (error) { + console.log(error); + return data.createTime; + } + }, + }, +]; diff --git a/src/views/blindBox/bindBoxOrder/lib/components/GoodsTable.vue b/src/views/blindBox/bindBoxOrder/lib/components/GoodsTable.vue new file mode 100644 index 0000000000000000000000000000000000000000..39ae38e46bdb01af4150f366480e710e3b2f08be --- /dev/null +++ b/src/views/blindBox/bindBoxOrder/lib/components/GoodsTable.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/views/blindBox/bindBoxOrder/lib/components/OrderTable.vue b/src/views/blindBox/bindBoxOrder/lib/components/OrderTable.vue new file mode 100644 index 0000000000000000000000000000000000000000..6cb8b68a56e65761ec6447e3ad7464f99d6b1a9a --- /dev/null +++ b/src/views/blindBox/bindBoxOrder/lib/components/OrderTable.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue index dd9a065a42fa69a857c94df525d6a49af0cc7d3d..18ba6a5beffc9f4ea44901128e92e00de80ae5f7 100755 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -4,7 +4,8 @@