diff --git a/src/layout/components/Aside.vue b/src/layout/components/Aside.vue
index 202d370..33c5164 100644
--- a/src/layout/components/Aside.vue
+++ b/src/layout/components/Aside.vue
@@ -54,7 +54,7 @@
类别管理
-
+
优惠券管理
@@ -63,6 +63,10 @@
添加优惠券
+
+
+ 优惠券中心
+
diff --git a/src/router/routes.ts b/src/router/routes.ts
index 25ffd85..c435562 100644
--- a/src/router/routes.ts
+++ b/src/router/routes.ts
@@ -42,6 +42,16 @@ export const routes = [
path: '/OrderList',
name: '订单列表',
component: ()=> import("../views/Orders/OrderList.vue")
+ },
+ {
+ path: '/AddCoupons',
+ name:'添加优惠券',
+ component: ()=> import("../views/Coupons/AddCoupons.vue")
+ },
+ {
+ path: '/CouponCenter',
+ name:'优惠券中心',
+ component: ()=> import("../views/Coupons/CouponCenter.vue")
}
]
},
diff --git a/src/views/Coupons/AddCoupons.vue b/src/views/Coupons/AddCoupons.vue
index 96c0baf..c439428 100644
--- a/src/views/Coupons/AddCoupons.vue
+++ b/src/views/Coupons/AddCoupons.vue
@@ -1,11 +1,135 @@
-
-
-
+
+
+ handleChange(event, 0)"
+ limit="1" >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 提交
+
+
-
\ No newline at end of file
+
+const fileSimple = ref()
+const form = ref({
+ name: '',
+ conditionAmount:0,//满减金额
+ totalNum:0,
+ requirePoints:0,//兑换积分
+ residueNum:0,//剩余数量
+ limitNum:0,//限量领取
+ useScope:'',//使用范围
+ startTime: '',
+ endTime: '',
+ description:'',//使用说明
+ image:''
+})
+onMounted(() => {
+
+})
+const AddCoupon = async () => {
+ console.log(form)
+ const values = Object.values(form.value);
+ if (values.some(value => value === null || value === undefined || value === '')) {
+ ElMessage({
+ type: 'warning',
+ message: '请检查表单数据是否完整填写'
+ });
+ return;
+ }
+ const res = await myAxios.post('/coupon/add', {...form.value });
+ if (res.data.code === 1) {
+ ElMessage({
+ type: 'success',
+ message: "提交成功"
+ });
+ } else {
+ ElMessage.error("服务错误");
+ }
+ console.log(form.value.startTime)
+}
+
+const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
+ console.log(uploadFile, uploadFiles)
+}
+//上传图片
+const handleChange = async (file: any, flag: number) => {
+ fileSimple.value = file
+ let formData = new FormData()
+ formData.append("file", fileSimple.value.raw)
+ const res = await myAxios({
+ url: '/file/upload/server/not_login',
+ method: 'post',
+ headers: {
+ 'content-Type': 'multipart/form-data'
+ },
+ data: {
+ biz: "test",
+ file: formData.get("file")
+ }
+ })
+ // console.log(res.data,123213213213)
+ if (res.data.code === 1) {
+ form.value.image = res.data.data
+ }
+
+}
+
diff --git a/src/views/Coupons/CouponCenter.vue b/src/views/Coupons/CouponCenter.vue
new file mode 100644
index 0000000..21e09ae
--- /dev/null
+++ b/src/views/Coupons/CouponCenter.vue
@@ -0,0 +1,252 @@
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 批量删除
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 详情
+
+
+ 编辑
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![优惠券图片]()
+
+ handleChange(event, 0)"
+ limit="1" >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 1f3dc1e..3e0ecfe 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -1,126 +1,252 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- --------
-
-
-
-
-
-
-
-
-
-
- --------
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 批量删除
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 详情
+
+
+ 编辑
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![优惠券图片]()
+
+ handleChange(event, 0)"
+ limit="1" >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file