|
@@ -195,6 +195,21 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="优惠券" prop="content" v-if="form.taskType == 5">
|
|
|
|
|
+ <el-select v-model="form.content" placeholder="请选择优惠券" ref="selectCoupon" >
|
|
|
|
|
+ <el-option v-for="i in couponOptions" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
|
|
|
+ <!-- 加载载中状态 -->
|
|
|
|
|
+ <div v-if="isLoading" class="loading-indicator">
|
|
|
|
|
+ <i class="el-icon-loading"></i>
|
|
|
|
|
+ <span>加载中...</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 没有更多数据 -->
|
|
|
|
|
+ <div v-if="!hasMore && !isLoading" class="no-more">
|
|
|
|
|
+ 没有更多数据了
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="触发时间" prop="content">
|
|
<el-form-item label="触发时间" prop="content">
|
|
|
<el-time-picker
|
|
<el-time-picker
|
|
|
default-value="2025-01-01 00:00:00"
|
|
default-value="2025-01-01 00:00:00"
|
|
@@ -237,6 +252,7 @@ import { listTask, getTask, delTask, addTask, updateTask, exportTask } from "@/a
|
|
|
import {listLiveGoods} from "@/api/live/liveGoods";
|
|
import {listLiveGoods} from "@/api/live/liveGoods";
|
|
|
import {listLiveRedConfOn} from "@/api/live/liveRedConf";
|
|
import {listLiveRedConfOn} from "@/api/live/liveRedConf";
|
|
|
import {listLiveLotteryConfOn} from "@/api/live/liveLotteryConf";
|
|
import {listLiveLotteryConfOn} from "@/api/live/liveLotteryConf";
|
|
|
|
|
+import {listLiveCouponOn} from "@/api/live/liveCoupon";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
props:{
|
|
props:{
|
|
@@ -260,6 +276,10 @@ export default {
|
|
|
{
|
|
{
|
|
|
value: 4,
|
|
value: 4,
|
|
|
label: "定时抽奖"
|
|
label: "定时抽奖"
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 5,
|
|
|
|
|
+ label: "定时优惠券"
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
statusOptions:[{
|
|
statusOptions:[{
|
|
@@ -275,10 +295,12 @@ export default {
|
|
|
haveData:{
|
|
haveData:{
|
|
|
goods:false,
|
|
goods:false,
|
|
|
red:false,
|
|
red:false,
|
|
|
- lottery:false
|
|
|
|
|
|
|
+ lottery:false,
|
|
|
|
|
+ coupon:false
|
|
|
},
|
|
},
|
|
|
redOptions:[],
|
|
redOptions:[],
|
|
|
lotteryOptions:[],
|
|
lotteryOptions:[],
|
|
|
|
|
+ couponOptions:[],
|
|
|
// 遮罩层
|
|
// 遮罩层
|
|
|
loading: true,
|
|
loading: true,
|
|
|
// 导出遮罩层
|
|
// 导出遮罩层
|
|
@@ -410,6 +432,8 @@ export default {
|
|
|
return "定时发送红包";
|
|
return "定时发送红包";
|
|
|
case 4:
|
|
case 4:
|
|
|
return "定时抽奖";
|
|
return "定时抽奖";
|
|
|
|
|
+ case 5:
|
|
|
|
|
+ return "定时优惠券";
|
|
|
default:
|
|
default:
|
|
|
return "--";
|
|
return "--";
|
|
|
}
|
|
}
|
|
@@ -480,6 +504,8 @@ export default {
|
|
|
await this.addRedList();
|
|
await this.addRedList();
|
|
|
}else if (this.form.taskType == 4) {
|
|
}else if (this.form.taskType == 4) {
|
|
|
await this.addLotteryList();
|
|
await this.addLotteryList();
|
|
|
|
|
+ }else if(this.form.taskType == 5){
|
|
|
|
|
+ await this.addCouponList();
|
|
|
}
|
|
}
|
|
|
}catch ( err){
|
|
}catch ( err){
|
|
|
console.error('加载数据失败:', err);
|
|
console.error('加载数据失败:', err);
|
|
@@ -553,7 +579,7 @@ export default {
|
|
|
// 判断是否还有更多数据
|
|
// 判断是否还有更多数据
|
|
|
this.hasMore = this.lotteryOptions.length < res.total;
|
|
this.hasMore = this.lotteryOptions.length < res.total;
|
|
|
if (this.hasMore) {
|
|
if (this.hasMore) {
|
|
|
- this.addRedList();
|
|
|
|
|
|
|
+ this.addLotteryList();
|
|
|
} else {
|
|
} else {
|
|
|
this.haveData.lottery = true
|
|
this.haveData.lottery = true
|
|
|
}
|
|
}
|
|
@@ -563,6 +589,31 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ addCouponList() {
|
|
|
|
|
+ if(this.haveData.coupon) return
|
|
|
|
|
+ listLiveCouponOn(this.listParams).then(res => {
|
|
|
|
|
+ if(res.rows.length > 0) {
|
|
|
|
|
+ res.rows.forEach(item => {
|
|
|
|
|
+ // 根据productName和goodsId组装成为label和value
|
|
|
|
|
+ this.couponOptions.push({
|
|
|
|
|
+ value: item.couponId,
|
|
|
|
|
+ label: item.title
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ this.listParams.pageNum++;
|
|
|
|
|
+ // 判断是否还有更多数据
|
|
|
|
|
+ this.hasMore = this.couponOptions.length < res.total;
|
|
|
|
|
+ if (this.hasMore) {
|
|
|
|
|
+ this.addCouponList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.haveData.coupon = true
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.haveData.coupon = true
|
|
|
|
|
+ this.hasMore = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
/** 查询直播间自动化任务配置列表 */
|
|
/** 查询直播间自动化任务配置列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
if(this.liveId == null) {
|
|
if(this.liveId == null) {
|
|
@@ -636,6 +687,8 @@ export default {
|
|
|
await this.addRedList();
|
|
await this.addRedList();
|
|
|
}else if(row.taskType == 4){
|
|
}else if(row.taskType == 4){
|
|
|
await this.addLotteryList();
|
|
await this.addLotteryList();
|
|
|
|
|
+ }else if(row.taskType == 5) {
|
|
|
|
|
+ await this.addCouponList();
|
|
|
}
|
|
}
|
|
|
const id = row.id || this.ids
|
|
const id = row.id || this.ids
|
|
|
getTask(id).then(response => {
|
|
getTask(id).then(response => {
|
|
@@ -647,6 +700,8 @@ export default {
|
|
|
this.form.content = content.desc;
|
|
this.form.content = content.desc;
|
|
|
}else if (this.form.taskType == 4) {
|
|
}else if (this.form.taskType == 4) {
|
|
|
this.form.content = content.desc;
|
|
this.form.content = content.desc;
|
|
|
|
|
+ }else if(this.form.taskType == 5){
|
|
|
|
|
+ this.form.content = content.couponId;
|
|
|
}
|
|
}
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
this.title = "修改直播间自动化任务配置";
|
|
this.title = "修改直播间自动化任务配置";
|