bug修改
parent
e5449213c2
commit
48c0dcb69b
|
@ -40,7 +40,7 @@
|
|||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="copyright">
|
||||
<p>Copyright © LILI</p>
|
||||
<p>Copyright © {{year}} LILI</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
@ -58,7 +58,8 @@ export default {
|
|||
[ '支付方式', '货到付款', '在线支付', '分期付款', '邮局汇款', '公司转账' ],
|
||||
[ '售后服务', '售后政策', '价格保护', '退款说明', '返修/退换货', '取消订单' ]
|
||||
],
|
||||
moreLink: ['关于我们', '联系我们', '联系客服', '商家帮助', '隐私政策'] // 更多链接
|
||||
moreLink: ['关于我们', '联系我们', '联系客服', '商家帮助', '隐私政策'], // 更多链接
|
||||
year: new Date().getFullYear() // 当前年份
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="imgBox" :style="{width:data.originalWidth+'px',height:data.originalHeight + 'px'}">
|
||||
<img :src="data.backImage" style="width:100%;height:100%" alt="">
|
||||
<img class="slider" :src="data.slidingImage" :style="{left:distance+'px',top:data.randomY+'px'}" :width="data.sliderWidth" :height="data.sliderHeight" alt="">
|
||||
<Icon type="md-refresh" class="refresh" @click="refresh" />
|
||||
<Icon type="md-refresh" class="refresh" @click="init" />
|
||||
</div>
|
||||
<div class="handle" :style="{width:data.originalWidth+'px'}">
|
||||
<span class="bgcolor" :style="{width:distance + 'px',background:bgColor}"></span>
|
||||
|
@ -82,26 +82,24 @@ export default {
|
|||
this.verifyText = '解锁失败';
|
||||
let that = this;
|
||||
setTimeout(() => {
|
||||
that.refresh();
|
||||
that.init();
|
||||
}, 1000);
|
||||
this.$emit('change', { status: false, distance: this.distance });
|
||||
}
|
||||
} else {
|
||||
this.refresh()
|
||||
this.init()
|
||||
}
|
||||
|
||||
}).catch(()=>{
|
||||
this.refresh()
|
||||
this.init()
|
||||
});
|
||||
},
|
||||
refresh () { // 刷新滑块
|
||||
init () { // 初始化数据
|
||||
this.flag = false;
|
||||
this.downX = 0;
|
||||
this.distance = 0;
|
||||
this.bgColor = '#04ad11';
|
||||
this.verifyText = '拖动滑块解锁';
|
||||
this.init();
|
||||
},
|
||||
init () { // 初始化数据
|
||||
getVerifyImg(this.type).then(res => {
|
||||
if (res.result) {
|
||||
this.data = res.result;
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
<a class="item" href="https://pickmall.cn/" target="_blank">条款</a>
|
||||
</Row>
|
||||
<Row type="flex" justify="center" class="copyright">
|
||||
Copyright © 2020 - Present
|
||||
Copyright © {{year}} - Present
|
||||
<a href="https://pickmall.cn/" target="_blank" style="margin: 0 5px"
|
||||
>lili-shop</a
|
||||
>
|
||||
|
@ -130,6 +130,7 @@ export default {
|
|||
password: '',
|
||||
oncePasd: ''
|
||||
},
|
||||
year: new Date().getFullYear(), // 当前年份
|
||||
step: 0, // 步骤
|
||||
ruleInline: {
|
||||
// 验证规则
|
||||
|
|
|
@ -84,7 +84,9 @@ export default {
|
|||
params: { // 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
keywords: ''
|
||||
keywords: '',
|
||||
sort: 'createTime',
|
||||
order: 'desc'
|
||||
},
|
||||
// 状态数组
|
||||
afterSaleStatusList,
|
||||
|
|
|
@ -230,13 +230,6 @@ export const otherRouter = {
|
|||
name: "edit-platform-coupon",
|
||||
component: () => import("@/views/promotion/coupon/couponPublish.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/member-receive-coupon",
|
||||
title: "领取详情",
|
||||
name: "member-receive-coupon",
|
||||
component: () =>
|
||||
import("@/views/promotion/coupon/memberReceiveCoupon.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/platform-coupon-info",
|
||||
title: "详情",
|
||||
|
@ -261,25 +254,12 @@ export const otherRouter = {
|
|||
name: "coupon-activity-info",
|
||||
component: () => import("@/views/promotion/couponActivity/couponInfo.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/member-receive-coupon",
|
||||
title: "领取详情",
|
||||
name: "member-coupon-activity",
|
||||
component: () =>
|
||||
import("@/views/promotion/coupon/memberReceiveCoupon.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/platform-coupon-info",
|
||||
title: "详情",
|
||||
name: "platform-coupon-activity",
|
||||
component: () => import("@/views/promotion/coupon/couponInfo.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/add-coupon-specify",
|
||||
title: "精准发劵",
|
||||
name: "add-coupon-specify",
|
||||
component: () => import("@/views/promotion/coupon/couponSpecify.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/manager-pintuan",
|
||||
title: "平台拼团",
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<a class="item" href="https://pickmall.com" target="_blank">{{ $t('terms') }}</a>
|
||||
</Row>
|
||||
<Row type="flex" justify="center" class="copyright">
|
||||
Copyright © 2020 - Present
|
||||
Copyright © {{year}} - Present
|
||||
<a
|
||||
href="https://pickmall.cn/"
|
||||
target="_blank"
|
||||
|
@ -18,7 +18,12 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: "footer"
|
||||
name: "footer",
|
||||
data() {
|
||||
return {
|
||||
year: new Date().getFullYear()
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="imgBox" :style="{width:data.originalWidth+'px',height:data.originalHeight + 'px'}">
|
||||
<img :src="data.backImage" style="width:100%;height:100%" alt="">
|
||||
<img class="slider" :src="data.slidingImage" :style="{left:distance+'px',top:data.randomY+'px'}" :width="data.sliderWidth" :height="data.sliderHeight" alt="">
|
||||
<Icon type="md-refresh" class="refresh" @click="refresh" />
|
||||
<Icon type="md-refresh" class="refresh" @click="init" />
|
||||
</div>
|
||||
<div class="handle" :style="{width:data.originalWidth+'px'}">
|
||||
<span class="bgcolor" :style="{width:distance + 'px',background:bgColor}"></span>
|
||||
|
@ -82,27 +82,24 @@ export default {
|
|||
this.verifyText = '解锁失败';
|
||||
let that = this;
|
||||
setTimeout(() => {
|
||||
that.refresh();
|
||||
that.init();
|
||||
}, 1000);
|
||||
this.$emit('change', { status: false, distance: this.distance });
|
||||
}
|
||||
} else {
|
||||
this.refresh()
|
||||
this.init()
|
||||
}
|
||||
|
||||
}).catch(()=>{
|
||||
this.refresh()
|
||||
this.init()
|
||||
});
|
||||
},
|
||||
refresh () { // 刷新滑块
|
||||
init () { // 初始化数据
|
||||
this.flag = false;
|
||||
this.downX = 0;
|
||||
this.distance = 0;
|
||||
this.bgColor = '#04ad11';
|
||||
this.verifyText = '拖动滑块解锁';
|
||||
this.init();
|
||||
},
|
||||
init () { // 初始化数据
|
||||
getVerifyImg(this.type).then(res => {
|
||||
if (res.result) {
|
||||
this.data = res.result;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form mb_10">
|
||||
<Form-item label="活动名称" prop="couponName">
|
||||
<Input type="text" v-model="searchForm.couponName" placeholder="请输入活动名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
|
@ -19,17 +18,15 @@
|
|||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation padding-row">
|
||||
<Row class="operation padding-row" v-if="getType !== 'ACTIVITY'">
|
||||
<Button @click="add" type="primary">添加优惠券</Button>
|
||||
<Button @click="delAll">批量下架</Button>
|
||||
<!-- <Button @click="upAll" >批量上架</Button> -->
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-select-cancel="cancelSelect" @on-selection-change="changeSelect">
|
||||
<Table v-if="refreshTable" :loading="loading" border :columns="columns" :data="data" ref="table" @on-selection-change="changeSelect">
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="success" :class="{'mr_10' : !checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'}" size="small" @click="edit(row)">编辑
|
||||
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="success" :class="{'mr_10' : row.promotionStatus === 'START' || row.promotionStatus === 'NEW'}" size="small" @click="edit(row)">编辑
|
||||
</Button>
|
||||
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" @click="remove(row)">下架
|
||||
<Button v-if="row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" @click="remove(row)">下架
|
||||
</Button>
|
||||
</template>
|
||||
</Table>
|
||||
|
@ -220,15 +217,10 @@ export default {
|
|||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
selectCoupon: [], //本级选中的优惠券
|
||||
refreshTable: true, // 修改选中状态后刷新表格
|
||||
};
|
||||
},
|
||||
props: {
|
||||
// 是否为选中模式
|
||||
checked: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
//优惠券类型 查询参数
|
||||
getType: {
|
||||
type: String,
|
||||
|
@ -246,94 +238,73 @@ export default {
|
|||
this.init();
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 选中优惠券 父级传值
|
||||
selectedList: {
|
||||
handler(val) {
|
||||
// 判断是否是父级回调给自己已选择优惠券
|
||||
if (val.length != 0) {
|
||||
this.selectCoupon = val;
|
||||
if (val.length) {
|
||||
this.selectList = val;
|
||||
this.data.forEach((item) => {
|
||||
item._checked = false;
|
||||
if (this.selectList.length) {
|
||||
this.selectList.forEach((child) => {
|
||||
if (item.id == child.id) {
|
||||
item._checked = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.data.forEach((item) => {
|
||||
item._checked = false;
|
||||
});
|
||||
}
|
||||
this.refreshTable = false;
|
||||
this.$nextTick(() =>{
|
||||
this.refreshTable = true;
|
||||
})
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
check() {
|
||||
// this.selectCoupon.push(this.selectList)
|
||||
this.$emit("selected", this.selectCoupon);
|
||||
},
|
||||
methods: {
|
||||
check() { // 选中的优惠券
|
||||
this.$emit("selected", this.selectList);
|
||||
},
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
add() {
|
||||
add() { // 跳转添加页面
|
||||
this.$router.push({ name: "add-platform-coupon" });
|
||||
},
|
||||
/** 跳转至领取详情页面 */
|
||||
receiveInfo(v) {
|
||||
this.$router.push({ name: "member-receive-coupon", query: { id: v.id } });
|
||||
},
|
||||
info(v) {
|
||||
info(v) { // 查看优惠券
|
||||
this.$router.push({ name: "platform-coupon-info", query: { id: v.id } });
|
||||
},
|
||||
changePage(v) {
|
||||
changePage(v) { // 改变页码
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
// this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
changePageSize(v) { // 改变页数
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
handleSearch() { // 搜索
|
||||
this.searchForm.pageNumber = 0;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
clearSelectAll() { // 清除选中状态
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
|
||||
/**
|
||||
* 取消已选择的数据
|
||||
*/
|
||||
cancelSelect(selection, row) {
|
||||
console.log(row)
|
||||
let findCoupon = this.selectCoupon.find((item) => {
|
||||
return item.id == row.id;
|
||||
});
|
||||
// 如果没有则添加
|
||||
if (!findCoupon) {
|
||||
this.selectCoupon.push(row);
|
||||
} else {
|
||||
// 有重复数据就删除
|
||||
this.selectCoupon.map((item, index) => {
|
||||
if (item.id == findCoupon.id) {
|
||||
this.selectCoupon.splice(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 选择优惠券
|
||||
*/
|
||||
changeSelect(e) {
|
||||
if (this.checked && e.length != 0) {
|
||||
this.selectCoupon.push(...e);
|
||||
this.check();
|
||||
}
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
if (this.getType === 'ACTIVITY') this.check()
|
||||
},
|
||||
getDataList() {
|
||||
getDataList() { // 获取数据
|
||||
this.loading = true;
|
||||
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||
this.searchForm.startTime = this.selectDate[0].getTime();
|
||||
|
@ -346,18 +317,6 @@ export default {
|
|||
getPlatformCouponList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
res.result.records.forEach((item) => {
|
||||
if (this.selectCoupon.length != 0) {
|
||||
this.selectCoupon.forEach((child) => {
|
||||
if (item.id == child.id) {
|
||||
item.___selected = true;
|
||||
item._checked = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
item.___selected = false;
|
||||
});
|
||||
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
|
@ -365,43 +324,11 @@ export default {
|
|||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.modalType === 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
this.postRequest("/coupon/insertOrUpdate", this.form).then(
|
||||
(res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
// 编辑
|
||||
this.postRequest("/coupon/insertOrUpdate", this.form).then(
|
||||
(res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
edit(v) {
|
||||
|
||||
edit(v) { // 跳转编辑页面
|
||||
this.$router.push({ name: "edit-platform-coupon", query: { id: v.id } });
|
||||
},
|
||||
remove(v) {
|
||||
remove(v) { // 下架优惠券
|
||||
this.$Modal.confirm({
|
||||
title: "确认下架",
|
||||
// 记得确认修改此处
|
||||
|
@ -426,7 +353,7 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
delAll() {
|
||||
delAll() { // 批量下架
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要下架的优惠券");
|
||||
return;
|
||||
|
@ -456,41 +383,12 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
upAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("请选择要上架的优惠券");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认上架",
|
||||
content: "您确认要上架所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = [];
|
||||
this.selectList.forEach(function (e) {
|
||||
ids.push(e.id);
|
||||
});
|
||||
let params = {
|
||||
couponIds: ids.toString(),
|
||||
promotionStatus: "START",
|
||||
};
|
||||
// 批量上架
|
||||
updatePlatformCouponStatus(params).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("上架成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
//如果作为组件方式,传入了类型值,则搜索参数附加类型
|
||||
if (this.getType) {
|
||||
this.searchForm.getType = this.getType;
|
||||
this.columns.pop()
|
||||
}
|
||||
this.init();
|
||||
},
|
||||
|
|
|
@ -229,11 +229,11 @@ export default {
|
|||
],
|
||||
publishNum: [
|
||||
{required: true, message: "请输入发放数量"},
|
||||
{pattern: regular.integer, message: "请输入正整数"},
|
||||
{pattern: regular.Integer, message: "请输入正整数"},
|
||||
],
|
||||
couponLimitNum: [
|
||||
{required: true, message: "领取限制不能为空"},
|
||||
{pattern: regular.integer, message: "请输入正整数"},
|
||||
{pattern: regular.Integer, message: "请输入正整数"},
|
||||
],
|
||||
description: [{required: true, message: "请输入范围描述"}],
|
||||
},
|
||||
|
|
|
@ -1,172 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<Form ref="form" :model="form" :label-width="120">
|
||||
<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 style="width: 260px" />
|
||||
</FormItem>
|
||||
<FormItem label="目标客户" prop="vipType">
|
||||
<RadioGroup v-model="vipType">
|
||||
<Radio :label="0">全平台客户</Radio>
|
||||
<Radio :label="1">指定客户</Radio>
|
||||
</RadioGroup>
|
||||
<Button type="primary" v-if="vipType==1" icon="ios-add" @click="addVip" ghost>添加客户</Button>
|
||||
</FormItem>
|
||||
<FormItem label="发放时间" prop="couponDiscount">
|
||||
<DatePicker type="datetime" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :options="options" style="width: 260px">
|
||||
</DatePicker>
|
||||
</FormItem>
|
||||
<FormItem label="选择优惠券" prop="couponType">
|
||||
<Button type="primary" icon="ios-add" @click="checkCoupon=!checkCoupon" ghost>选择优惠券</Button>
|
||||
<Table class="table" :columns="couponColumns" :data="couponData"></Table>
|
||||
</FormItem>
|
||||
</div>
|
||||
|
||||
<div style="margin-left:100px">
|
||||
<Button type="text" @click="closeCurrentPage">返回</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</Form>
|
||||
<Modal width="1200" v-model="checkCoupon">
|
||||
<couponList checked @selected="callbackSelectCoupon" />
|
||||
</Modal>
|
||||
<Modal width="1200" v-model="checkUserList">
|
||||
<userList @selected="callbackSelectUser" ref="memberLayout" />
|
||||
</Modal>
|
||||
</Card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addCouponActivity } from "@/api/promotion";
|
||||
|
||||
import couponList from "./coupon";
|
||||
import userList from "@/views/member/list/index";
|
||||
// import userList from ''
|
||||
export default {
|
||||
components: {
|
||||
couponList,
|
||||
userList,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
// 选择优惠券
|
||||
checkCoupon: false,
|
||||
// 选择用户
|
||||
checkUserList: false,
|
||||
// 优惠券表格title
|
||||
couponColumns: [
|
||||
{
|
||||
title: "优惠券名称",
|
||||
key: "name",
|
||||
},
|
||||
{
|
||||
title: "有效期",
|
||||
key: "age",
|
||||
},
|
||||
{
|
||||
title: "优惠券数量",
|
||||
key: "address",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
},
|
||||
],
|
||||
// datpicker时间设置
|
||||
options: {
|
||||
disabledDate(date) {
|
||||
return date && date.valueOf() < Date.now() - 86400000;
|
||||
},
|
||||
},
|
||||
|
||||
//
|
||||
vipType: 0, //客户会员类型 0全平台客户 1指定客户
|
||||
form: {},
|
||||
formRule: {},
|
||||
id: this.$route.query.id, // 优惠券id
|
||||
|
||||
callbackCoupon: [],
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
|
||||
// 添加指定用户
|
||||
addVip() {
|
||||
this.checkUserList = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.memberLayout.selectedMember = true;
|
||||
});
|
||||
},
|
||||
// 返回已选择的用户
|
||||
callbackSelectUser(val){
|
||||
console.log(val)
|
||||
},
|
||||
|
||||
// 返回已选择的优惠券
|
||||
callbackSelectCoupon(val) {
|
||||
if (val.___selected) {
|
||||
this.callbackCoupon.forEach((item, index) => {
|
||||
if (item.id == val.id) this.callbackCoupon.splice(index, 1);
|
||||
});
|
||||
} else {
|
||||
this.callbackCoupon.push(val);
|
||||
}
|
||||
},
|
||||
// 关闭当前页面
|
||||
closeCurrentPage() {
|
||||
this.$store.commit("removeTag", "add-coupon-specify");
|
||||
localStorage.pageOpenedList = JSON.stringify(
|
||||
this.$store.state.app.pageOpenedList
|
||||
);
|
||||
this.$router.go(-1);
|
||||
},
|
||||
|
||||
async handleSubmit() {
|
||||
let res = await addCouponActivity();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scpoed>
|
||||
.table {
|
||||
width: 800px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
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 {
|
||||
margin: 20px 0;
|
||||
}
|
||||
.describe {
|
||||
font-size: 12px;
|
||||
margin-left: 10px;
|
||||
color: #999;
|
||||
}
|
||||
.effectiveDays {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
> * {
|
||||
margin: 0 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,250 +0,0 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<template slot-scope="{ row }" slot="rangeTime">
|
||||
<div>{{ row.startTime }} ~ {{ row.endTime }}</div>
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button
|
||||
type="error"
|
||||
ghost
|
||||
size="small"
|
||||
:disabled="row.memberCouponStatus != 'NEW'"
|
||||
@click="remove(row)"
|
||||
>作废</Button
|
||||
>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="page">
|
||||
<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>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getMemberReceiveCouponList,
|
||||
deleteMemberReceiveCoupon,
|
||||
} from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
name: "memberReceiveCoupon",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
id: this.$route.query.id, // 优惠券id
|
||||
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
title: "优惠券编号",
|
||||
key: "couponId",
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: "面额",
|
||||
key: "price",
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "消费门槛",
|
||||
key: "consumeThreshold",
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.consumeThreshold, "¥")
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "有效期",
|
||||
slot: "rangeTime",
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: "会员名称",
|
||||
key: "memberName",
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: "适用范围",
|
||||
key: "couponType",
|
||||
minWidth: 50,
|
||||
render: (h, params) => {
|
||||
let text = "未知";
|
||||
if (params.row.scopeType == "ALL") {
|
||||
text = "全品类";
|
||||
} else if (params.row.scopeType == "PORTION_CATEGORY") {
|
||||
text = "部分商品分类";
|
||||
} else if (params.row.scopeType == "PORTION_GOODS") {
|
||||
text = "指定商品";
|
||||
}
|
||||
return h("div", [text]);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "会员名称",
|
||||
key: "memberName",
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "memberCouponStatus",
|
||||
minWidth: 50,
|
||||
render: (h, params) => {
|
||||
let text = "未知",
|
||||
color = "";
|
||||
if (params.row.memberCouponStatus == "NEW") {
|
||||
text = "未使用";
|
||||
color = "default";
|
||||
} else if (params.row.memberCouponStatus == "USED") {
|
||||
text = "已使用";
|
||||
color = "green";
|
||||
} else if (params.row.memberCouponStatus == "EXPIRE") {
|
||||
text = "已过期";
|
||||
color = "red";
|
||||
} else if (params.row.memberCouponStatus == "CLOSED") {
|
||||
text = "已作废";
|
||||
color = "red";
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: color,
|
||||
},
|
||||
},
|
||||
text
|
||||
),
|
||||
]);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
slot: "action",
|
||||
align: "center",
|
||||
width: 100,
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
},
|
||||
/** 查询单个优惠券领取详情 */
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getMemberReceiveCouponList(this.id).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
/** 作废优惠券 */
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认作废",
|
||||
content: "您确认要作废此优惠券?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
deleteMemberReceiveCoupon(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("作废成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "@/styles/table-common.scss";
|
||||
</style>
|
|
@ -282,7 +282,6 @@ export default {
|
|||
couponId: item.id,
|
||||
}
|
||||
});
|
||||
console.log(this.form.couponActivityItems)
|
||||
},
|
||||
|
||||
// 添加指定用户
|
||||
|
@ -308,7 +307,6 @@ export default {
|
|||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = JSON.parse(JSON.stringify(this.form));
|
||||
console.log(params);
|
||||
this.submitLoading = true;
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete params.id;
|
||||
|
|
|
@ -187,11 +187,11 @@ export default {
|
|||
],
|
||||
publishNum: [
|
||||
{ required: true, message: "请输入发放数量" },
|
||||
{ pattern: regular.integer, message: "请输入正整数" },
|
||||
{ pattern: regular.Integer, message: "请输入正整数" },
|
||||
],
|
||||
couponLimitNum: [
|
||||
{ required: true, message: "请输入领取限制" },
|
||||
{ pattern: regular.integer, message: "请输入正整数" },
|
||||
{ pattern: regular.Integer, message: "请输入正整数" },
|
||||
],
|
||||
description: [{ required: true, message: "请输入范围描述" }],
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<a class="item" href="https://pickmall.cn/" target="_blank">{{ $t('terms') }}</a>
|
||||
</Row>
|
||||
<Row type="flex" justify="center" class="copyright">
|
||||
Copyright © 2020 - Present
|
||||
Copyright © {{year}} - Present
|
||||
<a
|
||||
href="https://pickmall.cn/"
|
||||
target="_blank"
|
||||
|
@ -18,7 +18,12 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: "footer"
|
||||
name: "footer",
|
||||
data() {
|
||||
return {
|
||||
year: new Date().getFullYear()
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="imgBox" :style="{width:data.originalWidth+'px',height:data.originalHeight + 'px'}">
|
||||
<img :src="data.backImage" style="width:100%;height:100%" alt="">
|
||||
<img class="slider" :src="data.slidingImage" :style="{left:distance+'px',top:data.randomY+'px'}" :width="data.sliderWidth" :height="data.sliderHeight" alt="">
|
||||
<Icon type="md-refresh" class="refresh" @click="refresh" />
|
||||
<Icon type="md-refresh" class="refresh" @click="init" />
|
||||
</div>
|
||||
<div class="handle" :style="{width:data.originalWidth+'px'}">
|
||||
<span class="bgcolor" :style="{width:distance + 'px',background:bgColor}"></span>
|
||||
|
@ -82,27 +82,24 @@ export default {
|
|||
this.verifyText = '解锁失败';
|
||||
let that = this;
|
||||
setTimeout(() => {
|
||||
that.refresh();
|
||||
that.init();
|
||||
}, 1000);
|
||||
this.$emit('change', { status: false, distance: this.distance });
|
||||
}
|
||||
} else {
|
||||
this.refresh()
|
||||
this.init()
|
||||
}
|
||||
|
||||
}).catch(()=>{
|
||||
this.refresh()
|
||||
this.init()
|
||||
});
|
||||
},
|
||||
refresh () { // 刷新滑块
|
||||
init () { // 初始化数据
|
||||
this.flag = false;
|
||||
this.downX = 0;
|
||||
this.distance = 0;
|
||||
this.bgColor = '#04ad11';
|
||||
this.verifyText = '拖动滑块解锁';
|
||||
this.init();
|
||||
},
|
||||
init () { // 初始化数据
|
||||
getVerifyImg(this.type).then(res => {
|
||||
if (res.result) {
|
||||
this.data = res.result;
|
||||
|
|
|
@ -108,7 +108,7 @@ export default {
|
|||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
params.row.receivedNum + "/" + (params.row.publishNum === 0 ? '无限制' : params.row.publishNum)
|
||||
params.row.receivedNum + "/" + (params.row.publishNum === 0 ? '不限制' : params.row.publishNum)
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue