pc端修改我的优惠券bug,样式,管理端删除添加秒杀活动功能

master
mabo 2021-08-05 18:07:11 +08:00
parent ffeef640da
commit c6874acb1b
5 changed files with 13 additions and 233 deletions

View File

@ -55,9 +55,6 @@
color: #fff;
font-size: 16px;
padding: 20px;
&:hover{
font-weight: bold;
}
}
i{
position: absolute;

View File

@ -14,7 +14,7 @@
<p>有效期{{item.endTime}}</p>
</div>
<b></b>
<a class="c-right" @click="go(item)">使</a>
<a class="c-right" :class="{'canot-use':params.memberCouponStatus !== 'NEW'}" @click="go(item)">使</a>
<i class="circle-top"></i>
<i class="circle-bottom"></i>
</li>
@ -66,9 +66,12 @@ export default {
//
change (index) {
this.params.memberCouponStatus = this.statusList[index]
this.params.pageNumber = 1;
this.getList()
},
go (item) { // 使
if (this.params.memberCouponStatus !== 'NEW') return;
if (item.storeId !== 'platform') {
this.$router.push({path: '/merchant', query: {id: item.storeId}})
} else {
@ -127,10 +130,15 @@ export default {
width: 43px;
font-size: 14px;
}
.canot-use{
color: #999;
background-color: #eee;
}
i {
right: 34px;
}
}
.pageration {
text-align: right;
}

View File

@ -240,12 +240,6 @@ export const otherRouter = {
name: "seckill-goods",
component: () => import("@/views/promotion/seckill/seckillGoods.vue")
},
{
path: "promotion/seckill/manager-seckill-add",
title: "添加限时抢购",
name: "manager-seckill-add",
component: () => import("@/views/promotion/seckill/addSeckill.vue")
},
{
path: "/floorList/renovation",
title: "编辑模板",

View File

@ -1,219 +0,0 @@
<template>
<div>
<Card>
<Form ref="form" :model="form" :label-width="120" :rules="formRule">
<div class="base-info-item">
<h4>基本信息</h4>
<div class="form-item-view">
<FormItem label="活动名称" prop="promotionName">
<Input
type="text"
v-model="form.promotionName"
placeholder="请填写活动名称"
clearable
:disabled="form.promotionStatus != 'NEW'"
style="width: 260px"
/>
</FormItem>
<FormItem label="报名截止时间" prop="applyEndTime">
<DatePicker
type="datetime"
v-model="form.applyEndTime"
format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择"
clearable
:disabled="form.promotionStatus != 'NEW'"
style="width: 200px"
>
</DatePicker>
</FormItem>
<FormItem label="活动开始时间" prop="startTime">
<DatePicker
type="datetime"
v-model="form.startTime"
:disabled="form.promotionStatus != 'NEW'"
format="yyyy-MM-dd"
placeholder="请选择"
clearable
style="width: 200px"
>
</DatePicker>
</FormItem>
<FormItem label="抢购时间段" prop="seckillPeriod">
<Tag
v-for="item in form.seckillPeriod"
:key="item"
:name="item"
closable
style="marrgin-left: 10px"
@on-close="removePeriodTime"
>{{ item >= 10 ? item : "0" + item }}:00</Tag
>
<InputNumber
:max="23"
:min="0"
v-model="periodTime"
v-show="showAddPeriod"
@on-blur="addPeriodTime"
></InputNumber>
<Button
type="default"
@click="addPeriod"
v-if="form.promotionStatus == 'NEW'"
>添加时间段</Button
>
</FormItem>
<FormItem label="申请规则" prop="seckillRule">
<Input
type="text"
v-model="form.seckillRule"
placeholder="申请规则"
clearable
:disabled="form.promotionStatus != 'NEW'"
style="width: 260px"
/>
</FormItem>
</div>
<div class="foot-btn">
<Button @click="closeCurrentPage" style="margin-right: 5px">返回</Button>
<Button
type="primary"
:loading="submitLoading"
v-if="form.promotionStatus == 'NEW'"
@click="handleSubmit"
>提交</Button
>
</div>
</div>
</Form>
</Card>
</div>
</template>
<script>
import { saveSeckill, updateSeckill, seckillDetail } from "@/api/promotion";
export default {
name: "addSeckill",
data() {
return {
modalType: 0, //
form: {
/** 活动名称 */
promotionName: "",
/** 报名截止时间 */
applyEndTime: "",
/** 活动开始时间 */
startTime: "",
/** 抢购时间段 */
seckillPeriod: [],
/** 申请规则 */
seckillRule: "",
promotionStatus: "NEW",
},
id: this.$route.query.id, // id
periodTime: null, //
showAddPeriod: false, // input
submitLoading: false, //
formRule: {
promotionName: [{ required: true, message: "请填写活动名称" }],
applyEndTime: [{ required: true, message: "请选择报名截止时间" }],
seckillPeriod: [{ required: true, message: "请填写抢购时间段" }],
startTime: [{ required: true, message: "请选择活动开始时间" }],
seckillRule: [{ required: true, message: "请输入申请规则" }],
},
};
},
mounted() {
// id
if (this.id) {
this.getData();
this.modalType = 1;
}
},
methods: {
//
closeCurrentPage() {
this.$store.commit("removeTag", "manager-seckill-add");
localStorage.pageOpenedList = JSON.stringify(this.$store.state.app.pageOpenedList);
this.$router.go(-1);
},
//
getData() {
seckillDetail(this.id).then((res) => {
if (res.success) {
let data = res.result;
data.seckillPeriod = res.result.hours.split(",");
this.form = data;
}
});
},
addPeriod() { // input
this.addPeriodTime();
this.showAddPeriod = true;
},
addPeriodTime() { //
this.showAddPeriod = false;
if (
this.periodTime !== null &&
!this.form.seckillPeriod.includes(this.periodTime)
) {
this.form.seckillPeriod.push(this.periodTime);
}
},
removePeriodTime(event, name) { //
this.form.seckillPeriod = this.form.seckillPeriod.filter((i) => i !== name);
},
/** 添加秒杀活动 */
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true;
this.form.hours = this.form.seckillPeriod.toString();
if (this.modalType === 0) {
// id
delete this.form.id;
saveSeckill(this.form).then((res) => {
this.submitLoading = false;
if (res && res.success) {
this.$Message.success("限时抢购活动添加成功");
this.closeCurrentPage();
}
});
} else {
delete this.form.createTime;
delete this.form.updateTime;
delete this.form.endTime;
//
updateSeckill(this.form).then((res) => {
this.submitLoading = false;
if (res && res.success) {
this.$Message.success("限时抢购活动修改成功");
this.closeCurrentPage();
}
});
}
}
});
},
},
};
</script>
<style lang="scss" scoped>
h4 {
margin-bottom: 10px;
padding: 0 10px;
border: 1px solid #ddd;
background-color: #f8f8f8;
font-weight: bold;
color: #333;
font-size: 14px;
line-height: 40px;
text-align: left;
}
// .ivu-form-item{
// margin-bottom: 30px;
// }
</style>

View File

@ -21,10 +21,10 @@
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row class="operation padding-row">
<!-- <Row class="operation padding-row">
<Button type="primary" @click="add"></Button>
</Row>
<Tabs value="list" @on-click="clickTabPane">
</Row> -->
<Tabs value="list" class="mt_10" @on-click="clickTabPane">
<TabPane label="秒杀活动列表" name="list">
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10">
<template slot-scope="{ row }" slot="action">
@ -32,7 +32,7 @@
<Button type="info" size="small" class="mr_5" v-else @click="manage(row)"></Button>
<Button type="primary" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'" @click="manage(row)"></Button>
<Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'" @click="manage(row)"></Button>
<Button type="error" size="small" v-if="
row.promotionStatus == 'START' || row.promotionStatus == 'NEW'