From 9538dfdce5186fbee67a0895926e102a136dac68 Mon Sep 17 00:00:00 2001 From: DanyangZhao <1909085973@qq.com> Date: Mon, 26 Jun 2023 09:14:01 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E7=9B=B2=E7=9B=92=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/blindBox/blindBoxOeder.ts | 69 ++++ src/router/modules/blindBox.ts | 12 +- src/views/blindBox/bindBoxOrder/index.vue | 349 ++++++++++++++++++ .../blindBox/bindBoxOrder/lib/columns.ts | 90 +++++ src/views/login/index.vue | 11 +- 5 files changed, 528 insertions(+), 3 deletions(-) create mode 100644 src/api/blindBox/blindBoxOeder.ts create mode 100644 src/views/blindBox/bindBoxOrder/index.vue create mode 100644 src/views/blindBox/bindBoxOrder/lib/columns.ts diff --git a/src/api/blindBox/blindBoxOeder.ts b/src/api/blindBox/blindBoxOeder.ts new file mode 100644 index 0000000..3b68ed0 --- /dev/null +++ b/src/api/blindBox/blindBoxOeder.ts @@ -0,0 +1,69 @@ +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, + } + ); +} diff --git a/src/router/modules/blindBox.ts b/src/router/modules/blindBox.ts index 38d53d2..f513d91 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/views/blindBox/bindBoxOrder/index.vue b/src/views/blindBox/bindBoxOrder/index.vue new file mode 100644 index 0000000..db31f45 --- /dev/null +++ b/src/views/blindBox/bindBoxOrder/index.vue @@ -0,0 +1,349 @@ + + + + + diff --git a/src/views/blindBox/bindBoxOrder/lib/columns.ts b/src/views/blindBox/bindBoxOrder/lib/columns.ts new file mode 100644 index 0000000..6ebd928 --- /dev/null +++ b/src/views/blindBox/bindBoxOrder/lib/columns.ts @@ -0,0 +1,90 @@ +import { formatToDateTime } from '@/utils/dateUtil'; + +export const columns = [ + { + title: 'ID', + key: 'id', + width: 100, + }, + { + title: '订单编号', + key: 'orderSn', + width: 100, + }, + { + title: '盲盒id', + key: 'blindBoxId', + width: 100, + }, + { + title: '会员id', + key: 'memberId', + width: 100, + }, + { + 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: 100, + render: (data) => { + try { + const createTime = data.createTime * 1000; + return formatToDateTime(createTime); + } catch (error) { + console.log(error); + return data.createTime; + } + }, + }, +]; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index dd9a065..f9006c6 100755 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -5,6 +5,7 @@ @@ -92,7 +93,7 @@ import { ResultEnum } from '@/enums/httpEnum'; import { PersonOutline, LockClosedOutline, LogoGithub, LogoFacebook } from '@vicons/ionicons5'; import { PageEnum } from '@/enums/pageEnum'; - + import { getTitle } from '@/api/login'; interface FormState { userName: string; password: string; @@ -103,7 +104,7 @@ const loading = ref(false); const autoLogin = ref(true); const LOGIN_NAME = PageEnum.BASE_LOGIN_NAME; - + const title = ref('雅尚轩后台管理页面'); const formInline = reactive({ // userName: 'admin', // password: '123456', @@ -155,6 +156,12 @@ } }); }; + // 获取登录标题 + const getTitles = async () => { + const res = await getTitle(); + console.log(res); + }; + getTitles(); -- Gitee From 2fac1f658b5e16e4ad7ab689987afd1b3527ef2d Mon Sep 17 00:00:00 2001 From: DanyangZhao <1909085973@qq.com> Date: Mon, 26 Jun 2023 16:16:47 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/blindBox/bindBoxOrder/index.vue | 192 ++++++++++++---------- 1 file changed, 103 insertions(+), 89 deletions(-) diff --git a/src/views/blindBox/bindBoxOrder/index.vue b/src/views/blindBox/bindBoxOrder/index.vue index db31f45..ad767e1 100644 --- a/src/views/blindBox/bindBoxOrder/index.vue +++ b/src/views/blindBox/bindBoxOrder/index.vue @@ -31,44 +31,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + 商品信息 + 退款单 + 发货单 + 订单记录 + 订单备注 + +