转盘助力

This commit is contained in:
faiz 2024-12-02 10:12:52 +08:00
parent 3acbc71ac5
commit 987129ebff
4 changed files with 333 additions and 19 deletions

View File

@ -11,36 +11,40 @@
<el-radio :label="1">未中奖</el-radio> <el-radio :label="1">未中奖</el-radio>
<el-radio :label="10">免单</el-radio> <el-radio :label="10">免单</el-radio>
<el-radio :label="11">实物</el-radio> <el-radio :label="11">实物</el-radio>
<!-- <el-radio :label="5">优惠券</el-radio> --> <el-radio :label="5">优惠券</el-radio>
<!-- <el-radio :label="2">铸源星</el-radio> --> <el-radio :label="2">铸源星</el-radio>
<!-- <el-radio :label="6">站内商品</el-radio> --> <!-- <el-radio :label="6">站内商品</el-radio> -->
<!-- <el-radio :label="4"></el-radio> --> <!-- <el-radio :label="4"></el-radio> -->
<!-- <el-radio :label="3">折扣券</el-radio> --> <!-- <el-radio :label="3">折扣券</el-radio> -->
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="赠送优惠券:" v-if="formValidate.type == 5"> <el-form-item
<el-input label="赠送优惠券:"
v-if="formValidate.type == 5"
prop="coupon_id"
label-width="100px"
>
<!-- <el-input
v-model="formValidate.coupon_id" v-model="formValidate.coupon_id"
:maxlength="10" :maxlength="10"
placeholder="请输入优惠券id" placeholder="请输入优惠券id"
style="width: 300px" style="width: 300px"
></el-input> ></el-input> -->
<!-- <div v-if="couponName.length" class="mb20"> <div v-if="formValidate.coupon_id" class="mb20">
<el-tag <el-tag closable @close="handleClose">{{
closable this.formValidate.coupon_name
v-for="(item, index) in couponName" }}</el-tag>
:key="index"
@close="handleClose(item)"
>{{ item.title }}</el-tag
>
</div> </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-button
> --> >
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="[3, 4].includes(formValidate.type) ? '金额信息' : '积分数量'" :label="[3, 4].includes(formValidate.type) ? '金额信息' : '铸源星数量'"
prop="num" prop="num"
v-if="[2, 3, 4].includes(formValidate.type)" v-if="[2, 3, 4].includes(formValidate.type)"
> >
@ -124,6 +128,21 @@
style="width: 300px" style="width: 300px"
></el-input-number> ></el-input-number>
</el-form-item> </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-form-item label="奖品权重:" prop="chance">
<el-input-number <el-input-number
:controls="false" :controls="false"
@ -215,6 +234,21 @@
></uploadPictures> ></uploadPictures>
</el-dialog> --> </el-dialog> -->
<goods-list ref="goodslistf" @getProduct="getProduct"></goods-list> <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 <!-- <coupon-list
ref="couponTemplates" ref="couponTemplates"
:luckDraw="true" :luckDraw="true"
@ -233,9 +267,10 @@
// import couponList from '@/components/couponList'; // import couponList from '@/components/couponList';
import uploadPictures from "@/components/uploadPicture"; import uploadPictures from "@/components/uploadPicture";
import goodsList from "./components/goodsList"; import goodsList from "./components/goodsList";
import couponList from "./components/couponList";
// import freightTemplate from '@/components/freightTemplate'; // import freightTemplate from '@/components/freightTemplate';
export default { export default {
components: { uploadPictures, goodsList }, components: { uploadPictures, goodsList, couponList },
data() { data() {
return { return {
modalPic: false, modalPic: false,
@ -243,6 +278,7 @@ export default {
isChoice: "单选", isChoice: "单选",
updateIds: [], updateIds: [],
updateName: [], updateName: [],
visibleCoupon: false,
goodsData: { goodsData: {
pic: "", pic: "",
product_id: "", product_id: "",
@ -264,7 +300,8 @@ export default {
amount: "", amount: "",
goods_image: "", // goods_image: "", //
coupon_title: "", // coupon_title: "", //
sort: 0, // sort: 0, //,
sure_condition: 0,
}, },
couponName: [], couponName: [],
@ -292,6 +329,13 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], ],
coupon_id: [
{
required: true,
message: "请选择优惠券",
trigger: "blur",
},
],
goods_image: [ goods_image: [
{ {
required: true, required: true,
@ -360,6 +404,18 @@ export default {
// this.generateDaysArray(); // this.generateDaysArray();
}, },
methods: { 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() { generateDaysArray() {
// Date // Date
const start = new Date(this.dateTime[0]); const start = new Date(this.dateTime[0]);

View File

@ -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)"
>&nbsp</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 CRMEBCRMEB
// +----------------------------------------------------------------------
// | 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>

View File

@ -593,6 +593,14 @@ export default {
name: "大转盘", name: "大转盘",
type: "1", type: "1",
}, },
{
name: "好友助力",
type: "2",
},
{
name: "新人礼",
type: "3",
},
// { // {
// name: "", // name: "",
// type: "3", // type: "3",
@ -855,6 +863,8 @@ export default {
if (valid) { if (valid) {
this.submitOpen = true; this.submitOpen = true;
console.log(this.formValidate.id);
if (this.formValidate.id) { if (this.formValidate.id) {
lotteryEdit(this.formValidate.id, this.formValidate) lotteryEdit(this.formValidate.id, this.formValidate)
.then(async (res) => { .then(async (res) => {

View File

@ -840,7 +840,7 @@
min-width="100" min-width="100"
/> />
<el-table-column <el-table-column
prop="systemadmin.real_name:" prop="systemadmin.real_name"
label="操作人" label="操作人"
min-width="100" min-width="100"
/> />