转盘助力
This commit is contained in:
parent
3acbc71ac5
commit
987129ebff
|
@ -11,36 +11,40 @@
|
|||
<el-radio :label="1">未中奖</el-radio>
|
||||
<el-radio :label="10">免单</el-radio>
|
||||
<el-radio :label="11">实物</el-radio>
|
||||
<!-- <el-radio :label="5">优惠券</el-radio> -->
|
||||
<!-- <el-radio :label="2">铸源星</el-radio> -->
|
||||
<el-radio :label="5">优惠券</el-radio>
|
||||
<el-radio :label="2">铸源星</el-radio>
|
||||
<!-- <el-radio :label="6">站内商品</el-radio> -->
|
||||
<!-- <el-radio :label="4"></el-radio> -->
|
||||
<!-- <el-radio :label="3">折扣券</el-radio> -->
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="赠送优惠券:" v-if="formValidate.type == 5">
|
||||
<el-input
|
||||
<el-form-item
|
||||
label="赠送优惠券:"
|
||||
v-if="formValidate.type == 5"
|
||||
prop="coupon_id"
|
||||
label-width="100px"
|
||||
>
|
||||
<!-- <el-input
|
||||
v-model="formValidate.coupon_id"
|
||||
:maxlength="10"
|
||||
placeholder="请输入优惠券id"
|
||||
style="width: 300px"
|
||||
></el-input>
|
||||
<!-- <div v-if="couponName.length" class="mb20">
|
||||
<el-tag
|
||||
closable
|
||||
v-for="(item, index) in couponName"
|
||||
:key="index"
|
||||
@close="handleClose(item)"
|
||||
>{{ item.title }}</el-tag
|
||||
>
|
||||
></el-input> -->
|
||||
<div v-if="formValidate.coupon_id" class="mb20">
|
||||
<el-tag closable @close="handleClose">{{
|
||||
this.formValidate.coupon_name
|
||||
}}</el-tag>
|
||||
</div>
|
||||
<el-button type="primary" @click="addCoupon" v-if="!couponName.length"
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="sendCoupon"
|
||||
v-if="!formValidate.coupon_id"
|
||||
>添加优惠券</el-button
|
||||
> -->
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="[3, 4].includes(formValidate.type) ? '金额信息' : '积分数量'"
|
||||
:label="[3, 4].includes(formValidate.type) ? '金额信息' : '铸源星数量'"
|
||||
prop="num"
|
||||
v-if="[2, 3, 4].includes(formValidate.type)"
|
||||
>
|
||||
|
@ -124,6 +128,21 @@
|
|||
style="width: 300px"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="必中金额:"
|
||||
prop="sure_condition"
|
||||
v-if="formValidate.type == 11"
|
||||
>
|
||||
<el-input-number
|
||||
:controls="false"
|
||||
v-model="formValidate.sure_condition"
|
||||
placeholder="请输入奖品数量"
|
||||
:max="9999999999"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
style="width: 300px"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="奖品权重:" prop="chance">
|
||||
<el-input-number
|
||||
:controls="false"
|
||||
|
@ -215,6 +234,21 @@
|
|||
></uploadPictures>
|
||||
</el-dialog> -->
|
||||
<goods-list ref="goodslistf" @getProduct="getProduct"></goods-list>
|
||||
<!-- 选择优惠券 -->
|
||||
<el-dialog
|
||||
v-if="visibleCoupon"
|
||||
title="优惠券列表"
|
||||
:visible.sync="visibleCoupon"
|
||||
append-to-body
|
||||
width="1000px"
|
||||
>
|
||||
<coupon-List
|
||||
v-if="visibleCoupon"
|
||||
ref="couponList"
|
||||
@sendSuccess="sendSuccess"
|
||||
@getCouponData="getCouponData"
|
||||
/>
|
||||
</el-dialog>
|
||||
<!-- <coupon-list
|
||||
ref="couponTemplates"
|
||||
:luckDraw="true"
|
||||
|
@ -233,9 +267,10 @@
|
|||
// import couponList from '@/components/couponList';
|
||||
import uploadPictures from "@/components/uploadPicture";
|
||||
import goodsList from "./components/goodsList";
|
||||
import couponList from "./components/couponList";
|
||||
// import freightTemplate from '@/components/freightTemplate';
|
||||
export default {
|
||||
components: { uploadPictures, goodsList },
|
||||
components: { uploadPictures, goodsList, couponList },
|
||||
data() {
|
||||
return {
|
||||
modalPic: false,
|
||||
|
@ -243,6 +278,7 @@ export default {
|
|||
isChoice: "单选",
|
||||
updateIds: [],
|
||||
updateName: [],
|
||||
visibleCoupon: false,
|
||||
goodsData: {
|
||||
pic: "",
|
||||
product_id: "",
|
||||
|
@ -264,7 +300,8 @@ export default {
|
|||
amount: "",
|
||||
goods_image: "", //自用商品图
|
||||
coupon_title: "", //优惠券名称
|
||||
sort: 0, //排序
|
||||
sort: 0, //排序,
|
||||
sure_condition: 0,
|
||||
},
|
||||
|
||||
couponName: [],
|
||||
|
@ -292,6 +329,13 @@ export default {
|
|||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
coupon_id: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择优惠券",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
goods_image: [
|
||||
{
|
||||
required: true,
|
||||
|
@ -360,6 +404,18 @@ export default {
|
|||
// this.generateDaysArray();
|
||||
},
|
||||
methods: {
|
||||
sendCoupon() {
|
||||
this.visibleCoupon = true;
|
||||
},
|
||||
sendSuccess() {
|
||||
this.visibleCoupon = false;
|
||||
},
|
||||
getCouponData(row) {
|
||||
console.log(row);
|
||||
this.formValidate.coupon_id = row.coupon_id;
|
||||
this.formValidate.coupon_name = row.title;
|
||||
this.visibleCoupon = false;
|
||||
},
|
||||
generateDaysArray() {
|
||||
// 将输入的日期字符串转换为 Date 对象
|
||||
const start = new Date(this.dateTime[0]);
|
||||
|
|
|
@ -0,0 +1,248 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<div class="header clearfix">
|
||||
<div class="container">
|
||||
<el-form inline size="small" @submit.native.prevent>
|
||||
<el-form-item label="优惠劵名称:">
|
||||
<el-input
|
||||
v-model="tableFrom.coupon_name"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入优惠券名称"
|
||||
class="selWidth"
|
||||
clearable
|
||||
size="small"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" @click="getList(1)"
|
||||
>查询</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="listLoading"
|
||||
:data="tableData.data"
|
||||
size="small"
|
||||
max-height="400"
|
||||
tooltip-effect="dark"
|
||||
>
|
||||
<el-table-column width="55">
|
||||
<template slot-scope="scope">
|
||||
<!-- {{ scope.row.coupon_id }} -->
|
||||
<el-radio
|
||||
v-model="templateRadio"
|
||||
:label="scope.row.coupon_id"
|
||||
@change.native="getTemplateRow(scope.row)"
|
||||
> </el-radio
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="coupon_id" label="ID" min-width="50" />
|
||||
<el-table-column prop="title" label="优惠券名称" min-width="120" />
|
||||
<el-table-column label="优惠劵类型" min-width="100">
|
||||
<template slot-scope="{ row }">
|
||||
<span>{{ row.type | couponTypeFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="coupon_price" label="优惠券面值" min-width="90" />
|
||||
<el-table-column label="最低消费额" min-width="90">
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
scope.row.use_min_price === 0 ? "不限制" : scope.row.use_min_price
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="有效期限" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
scope.row.coupon_type === 1
|
||||
? scope.row.use_start_time + "-" + scope.row.use_end_time
|
||||
: scope.row.coupon_time + "天"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余数量" min-width="90">
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
scope.row.is_limited === 0 ? "不限量" : scope.row.remain_count
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" min-width="120" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
class="mr10"
|
||||
:disabled="multipleSelection.coupon_id != scope.row.coupon_id"
|
||||
@click="send(scope.row.coupon_id)"
|
||||
>发送</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<div class="block mb20">
|
||||
<el-pagination
|
||||
background
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<!-- <el-button size="small" type="primary" class="fr" @click="ok">确定</el-button> -->
|
||||
<!-- <el-button size="small" class="fr mr20" @click="close">取消</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import { couponSendApi, platformLstApi } from "@/api/marketing";
|
||||
import { roterPre } from "@/settings";
|
||||
export default {
|
||||
name: "CouponList",
|
||||
props: {
|
||||
// couponForm: {
|
||||
// type: Object,
|
||||
// required: true,
|
||||
// },
|
||||
// checkedIds: {
|
||||
// type: Array,
|
||||
// default: [],
|
||||
// },
|
||||
// allCheck: {
|
||||
// type: Boolean,
|
||||
// default: false,
|
||||
// },
|
||||
// userFrom: {
|
||||
// type: Object,
|
||||
// required: true,
|
||||
// },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
roterPre: roterPre,
|
||||
listLoading: true,
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 5,
|
||||
not_send_type: 5,
|
||||
coupon_name: "",
|
||||
status: 1,
|
||||
},
|
||||
multipleSelection: {
|
||||
coupon_id: "",
|
||||
},
|
||||
templateRadio: 0,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.tableFrom.page = 1;
|
||||
this.getList(1);
|
||||
},
|
||||
methods: {
|
||||
getTemplateRow(row) {
|
||||
console.log(row);
|
||||
|
||||
this.multipleSelection = { coupon_id: row.coupon_id, title: row.title };
|
||||
this.$emit("getCouponData", this.multipleSelection);
|
||||
},
|
||||
// 发送优惠券
|
||||
send(id) {
|
||||
// delete this.userFrom['page']
|
||||
// delete this.userFrom['limit']
|
||||
// let that = this;
|
||||
// that
|
||||
// .$confirm(
|
||||
// "确定要发送优惠券吗?发送优惠券后将无法恢复,请谨慎操作!",
|
||||
// "提示",
|
||||
// {
|
||||
// confirmButtonText: "确定",
|
||||
// cancelButtonText: "取消",
|
||||
// type: "warning",
|
||||
// }
|
||||
// )
|
||||
// .then(() => {
|
||||
// let params = {
|
||||
// coupon_id: id,
|
||||
// search: that.userFrom,
|
||||
// mark: that.filter(this.couponForm),
|
||||
// is_all: that.allCheck ? 1 : 0,
|
||||
// uid: that.checkedIds
|
||||
// }
|
||||
// couponSendApi(params).then(res => {
|
||||
// that.$message.success(res.message)
|
||||
// that.$emit("sendSuccess");
|
||||
// }).catch(res => {
|
||||
// that.$message.error(res.message)
|
||||
// })
|
||||
// })
|
||||
// .catch((action) => {
|
||||
// that.$message({
|
||||
// type: "info",
|
||||
// message: "已取消",
|
||||
// });
|
||||
// });
|
||||
},
|
||||
filter(data) {
|
||||
for (var key in data) {
|
||||
if (data[key] === "") {
|
||||
delete data[key];
|
||||
}
|
||||
}
|
||||
return data;
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
platformLstApi(this.tableFrom)
|
||||
.then((res) => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch((res) => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList("");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.seachTiele {
|
||||
line-height: 35px;
|
||||
}
|
||||
.fr {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
|
@ -593,6 +593,14 @@ export default {
|
|||
name: "大转盘",
|
||||
type: "1",
|
||||
},
|
||||
{
|
||||
name: "好友助力",
|
||||
type: "2",
|
||||
},
|
||||
{
|
||||
name: "新人礼",
|
||||
type: "3",
|
||||
},
|
||||
// {
|
||||
// name: "订单支付",
|
||||
// type: "3",
|
||||
|
@ -855,6 +863,8 @@ export default {
|
|||
|
||||
if (valid) {
|
||||
this.submitOpen = true;
|
||||
console.log(this.formValidate.id);
|
||||
|
||||
if (this.formValidate.id) {
|
||||
lotteryEdit(this.formValidate.id, this.formValidate)
|
||||
.then(async (res) => {
|
||||
|
|
|
@ -840,7 +840,7 @@
|
|||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="systemadmin.real_name:"
|
||||
prop="systemadmin.real_name"
|
||||
label="操作人"
|
||||
min-width="100"
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue