添加注释,删除无用代码,bug修改

This commit is contained in:
mabo
2021-07-26 18:12:13 +08:00
parent df9ea021b3
commit 87980277bf
38 changed files with 418 additions and 3550 deletions

View File

@@ -5,19 +5,17 @@
<Button @click="add" type="primary">添加活动</Button>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom">
<template slot-scope="{ row,index }" slot="action">
<Button type="info"
size="small" style="margin-right: 10px" @click="info(row)">查看
<template slot-scope="{ row }" slot="action">
<Button type="info" size="small" style="margin-right: 10px" @click="info(row)">
查看
</Button>
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error"
size="small" style="margin-right: 10px" @click="remove(row)">停止
size="small" style="margin-right: 10px" @click="remove(row)">停止
</Button>
</template>
</Table>
<Row type="flex" justify="end" class="mt_10">
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize"
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>
@@ -42,7 +40,7 @@ export default {
modalTitle: "", // 添加或编辑标题
searchForm: {
// 搜索框初始化对象
pageNumber: 0, // 当前页数
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
@@ -170,19 +168,20 @@ export default {
info(v) {
this.$router.push({name: "coupon-activity-info", query: {id: v.id}});
},
//跳转页面
// 分页 修改页码
changePage(v) {
this.searchForm.pageNumber = v - 1;
this.searchForm.pageNumber = v;
this.getDataList();
},
//修改分页
// 分页 修改页数
changePageSize(v) {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = v;
this.getDataList();
},
//搜索活动
handleSearch() {
this.searchForm.pageNumber = 0;
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
@@ -196,7 +195,6 @@ export default {
this.searchForm.startTime = null;
this.searchForm.endTime = null;
}
// 带多条件搜索参数获取表单数据 请自行修改接口
getCouponActivityList(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
@@ -210,23 +208,21 @@ export default {
edit(v) {
this.$router.push({name: "edit-platform-coupon", query: {id: v.id}});
},
//下架活动
//停止活动
remove(v) {
this.$Modal.confirm({
title: "确认下架",
title: "确认停止",
// 记得确认修改此处
content: "确认要下架此优惠券活动么?下架活动只能重新创建",
content: "确认要停止此优惠券活动么?停止活动只能重新创建",
loading: true,
onOk: () => {
// 删除
closeActivity(v.id).then((res) => {
if (res.success) {
this.$Message.success("优惠券活动已作废");
this.$Message.success("优惠券活动已停止");
this.getDataList();
}
}).catch(() => {
this.$Modal;
});
}).catch(() => {});
},
});
},

View File

@@ -1,7 +1,7 @@
<template>
<div>
<div class="content-goods-publish">
<Form ref="form" :model="form" :label-width="130">
<Form ref="form" :model="form" :label-width="70">
<div class="base-info-item">
<h4>优惠券活动详情</h4>
<div class="form-item-view">
@@ -30,10 +30,10 @@
<h4>优惠券列表</h4>
<Table :columns="couponColumn" :data="couponData" ref="table">
</Table>
<h4 v-if="couponActivity.activityScopeInfo && memberData.length>0">会员列表列表</h4>
<Table :columns="memberColumn" :data="memberData">
</Table>
<template v-if="couponActivity.activityScopeInfo && memberData.length>0">
<h4 class="mt_10">会员列表列表</h4>
<Table :columns="memberColumn" :data="memberData"></Table>
</template>
</div>
</Form>
</div>
@@ -52,7 +52,9 @@ export default {
data() {
return {
id: this.$route.query.id,//表单id
couponActivity: "",//券活动
couponActivity: {
},//券活动
couponColumn: [
{
title: "优惠券名称",
@@ -124,6 +126,52 @@ export default {
</script>
<style lang="scss" scoped>
@import "couponPublish.scss";
/*选择商品品类*/
.content-goods-publish {
padding: 15px;
margin: 0 auto;
text-align: center;
border: 1px solid #ddd;
background: none repeat 0 0 #fff;
height: 100%;
margin-bottom: 20px;
}
div.base-info-item {
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;
}
.form-item-view {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
padding-left: 40px;
.shop-category-text {
font-size: 12px;
}
}
}
/** 底部步骤 */
.footer {
width: 88.7%;
padding: 10px;
background-color: #ffc;
position: fixed;
bottom: 0px;
left: 10%;
text-align: center;
z-index: 9999;
}
</style>

View File

@@ -1,253 +0,0 @@
/*选择商品品类*/
.content-goods-publish {
padding: 15px;
margin: 0 auto;
text-align: center;
border: 1px solid #ddd;
background: none repeat 0 0 #fff;
height: 100%;
margin-bottom: 20px;
/*商品品类*/
.goods-category {
text-align: left;
padding: 10px;
background: #fafafa;
border: 1px solid #e6e6e6;
ul {
padding: 8px 4px 8px 8px;
list-style: none;
width: 300px;
background: none repeat 0 0 #fff;
border: 1px solid #e6e6e6;
display: inline-block;
letter-spacing: normal;
margin-right: 15px;
vertical-align: top;
word-spacing: normal;
li {
line-height: 20px;
padding: 5px;
cursor: pointer;
color: #333;
font-size: 12px;
display: flex;
flex-wrap: nowrap;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
}
}
/** 当前品类被选中的样式 */
.activeClass {
background-color: #d9edf7;
border: 1px solid #bce8f1;
color: #3a87ad;
}
/*!*当前选择的商品品类文字*!*/
.current-goods-category {
text-align: left;
padding: 10px;
width: 100%;
border: 1px solid #fbeed5;
color: #c09853;
background-color: #fcf8e3;
margin: 10px auto;
padding: 8px 35px 8px 14px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
font-size: 12px;
font-weight: bold;
}
}
/*编辑基本信息*/
.el-form {
padding-bottom: 80px;
.el-form-item {
width: 100%;
color: gray;
text-align: left;
}
}
div.base-info-item {
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;
}
.form-item-view {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
padding-left: 80px;
.shop-category-text {
font-size: 12px;
}
}
.item-goods-properts-row {
display: flex;
flex-direction: row;
word-break: break-all;
white-space: normal;
width: 300px;
height: 100px;
}
.item-goods-properts {
display: flex;
flex-direction: row;
margin-bottom: 10px;
}
.form-item {
display: flex;
align-items: center;
}
.el-form-item {
width: 30%;
min-width: 300px;
}
.goods-name-width {
width: 50%;
min-width: 300px;
}
.el-form-item__content {
margin-left: 120px;
text-align: left;
}
p.goods-group-manager {
padding-left: 7.5%;
text-align: left;
color: #999;
font-size: 13px;
}
/*teatarea*/
/deep/ .el-textarea {
width: 150%;
}
.seo-text {
width: 150%;
}
}
/*折叠面板*/
.el-collapse-item {
/deep/ .el-collapse-item__header {
text-align: left;
background-color: #f8f8f8;
padding: 0 10px;
font-weight: bold;
color: #333;
font-size: 14px;
}
.el-form-item {
margin-left: 5%;
width: 25%;
}
/deep/ .el-form-item__content {
margin-left: 120px;
text-align: left;
}
p.goods-group-manager {
padding-left: 12%;
text-align: left;
color: #999;
}
/deep/ .el-collapse-item__content {
padding: 10px 0;
text-align: left;
}
}
/*商品描述*/
.goods-intro {
line-height: 40;
}
/** 底部步骤 */
.footer {
width: 88.7%;
padding: 10px;
background-color: #ffc;
position: fixed;
bottom: 0px;
left: 10%;
text-align: center;
z-index: 9999;
}
/*图片上传组件第一张图设置封面*/
.goods-images {
/deep/ li.el-upload-list__item:first-child {
position: relative;
}
/deep/ li.el-upload-list__item:first-child:after {
content: "";
color: #fff;
font-weight: bold;
font-size: 12px;
position: absolute;
left: -15px;
top: -6px;
width: 40px;
height: 24px;
padding-top: 6px;
background: #13ce66;
text-align: center;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
}
}
.el-form-item__label {
word-break: break-all;
}
.step-view {
width: 33%;
height: 40px;
font-size: 19px;
text-align: center;
display: flex;
background-color: #fff;
justify-content: center;
align-items: center;
}
.page {
margin-top: 2vh;
margin-bottom: 5vh;
}

View File

@@ -6,12 +6,11 @@
<h4>活动信息</h4>
<div class="form-item-view">
<FormItem label="活动名称" prop="promotionName">
<Input type="text" v-model="form.promotionName" placeholder="活动名称" clearable style="width: 260px"/>
<Input type="text" v-model="form.promotionName" placeholder="请填写活动名称" clearable style="width: 260px"/>
</FormItem>
<FormItem label="活动时间">
<DatePicker type="datetimerange" :options="options" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择" style="width: 260px">
placeholder="请选择活动时间" style="width: 260px">
</DatePicker>
</FormItem>
@@ -72,18 +71,16 @@
<script>
import couponTemplate from "@/views/promotion/coupon/coupon";
import userList from "@/views/member/list/index";
import {saveActivityCoupon, updateCouponActivity} from "@/api/promotion";
import {saveActivityCoupon} from "@/api/promotion";
export default {
name: "addCouponActivity",
components: {
couponTemplate,
userList,
userList
},
data() {
data () {
return {
options: {
disabledDate(date) {
@@ -228,7 +225,6 @@ export default {
};
},
methods: {
// 返回已选择的用户
callbackSelectUser(val) {
// 每次将返回的数据回调判断
@@ -283,7 +279,6 @@ export default {
}
});
},
// 添加指定用户
addVip() {
this.checkUserList = true;