推荐直播间,修改部分代码,新增劵活动一些部分

master
lemon橪 2021-06-16 18:21:11 +08:00
parent f73bdce1a1
commit ab53a1ecc2
13 changed files with 394 additions and 274 deletions

View File

@ -14,7 +14,7 @@ export const getPromotionSeckill = params => {
// 是否推荐直播间 // 是否推荐直播间
export const whetherStar = params => { export const whetherStar = params => {
return getRequest(`/broadcast/studio/id/${params.id}&recommend=${params.recommend}`); return putRequest(`/broadcast/studio/recommend/${params.id}`,params);
}; };
// 添加优惠券活动 // 添加优惠券活动

View File

@ -21,10 +21,10 @@ export default {
// buyer: "https://buyer-api.pickmall.cn", // buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn", // seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn" // manager: "https://admin-api.pickmall.cn"
common: 'http://192.168.0.100:8890', common: 'http://192.168.0.109:8890',
buyer: 'http://192.168.0.100:8888', buyer: 'http://192.168.0.109:8888',
seller: 'http://192.168.0.100:8889', seller: 'http://192.168.0.109:8889',
manager: 'http://192.168.0.100:8887' manager: 'http://192.168.0.109:8887'
}, },
api_prod: { api_prod: {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",

View File

@ -1,172 +1,180 @@
<template> <template>
<div class="renovation"> <div class="renovation">
<!-- 左侧模块列表 --> <!-- 左侧模块列表 -->
<div class="model-list"> <div class="model-list">
<div class="classification-title">基础模块</div> <div class="classification-title">基础模块</div>
<draggable tag="ul" :list="modelData" <draggable tag="ul" :list="modelData" v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}" @end="handleMoveEnd" @start="handleMoveStart" :move="handleMove">
v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}" <li v-for="(model, index) in modelData" :key="index" class="model-item">
@end="handleMoveEnd" <Icon :type="model.icon" />
@start="handleMoveStart" <span>{{model.name}}</span>
:move="handleMove" </li>
> </draggable>
<li v-for="(model, index) in modelData" :key="index" class="model-item">
<Icon :type="model.icon" />
<span>{{model.name}}</span>
</li>
</draggable>
</div>
<!-- 中间展示模块 -->
<div class="show-content">
<model-form ref="modelForm" :data="modelForm"></model-form>
</div>
<!-- 保存按钮 -->
<div class="btn-bar"><Button type="primary" @click="saveTemplate"></Button> <Button @click="resetTemplate"></Button></div>
</div> </div>
<!-- 中间展示模块 -->
<div class="show-content">
<model-form ref="modelForm" :data="modelForm"></model-form>
</div>
<!-- 保存按钮 -->
<div class="btn-bar"><Button type="primary" @click="saveTemplate"></Button> <Button @click="resetTemplate"></Button></div>
</div>
</template> </template>
<script> <script>
import { modelData } from './modelConfig'; import { modelData } from "./modelConfig";
import Draggable from "vuedraggable"; import Draggable from "vuedraggable";
import ModelForm from './modelForm.vue'; import ModelForm from "./modelForm.vue";
import * as API_floor from '@/api/other.js'; import * as API_floor from "@/api/other.js";
export default { export default {
components:{ components: {
Draggable, ModelForm Draggable,
}, ModelForm,
mounted(){ },
this.getTemplateItem(this.$route.query.id) mounted() {
}, this.getTemplateItem(this.$route.query.id);
data() { },
return { data() {
modelData, // return {
modelForm:{list:[]} // modelData, //
} modelForm: { list: [] }, //
}, };
methods:{ },
saveTemplate(){ // methods: {
this.modelForm.list.unshift(this.$refs.modelForm.navList) saveTemplate() {
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert) //
const modelForm = JSON.stringify(this.modelForm) this.$Modal.confirm({
const data = { title: "Title",
id:this.$route.query.id, content: "<p>Content of dialog</p><p>Content of dialog</p>",
pageData:modelForm, onOk: () => {
} this.$Message.info("Clicked ok");
API_floor.updateHome(this.$route.query.id, data).then(res=> {
if(res.success) {
this.$Message.success('保存模板成功');
} else {
this.$Message.error(res.message)
}
})
}, },
resetTemplate(){ // onCancel: () => {
this.getTemplateItem(this.$route.query.id) this.$Message.info("Clicked cancel");
}, },
getTemplateItem(id){ // });
API_floor.getHomeData(id).then(res => {
if (res.success) { this.modelForm.list.unshift(this.$refs.modelForm.navList);
let pageData = res.result.pageData; this.modelForm.list.unshift(this.$refs.modelForm.topAdvert);
if(pageData) { const modelForm = JSON.stringify(this.modelForm);
pageData = JSON.parse(pageData); const data = {
if (pageData.list[0].type === 'topAdvert') { // topAdvert 广 navList id: this.$route.query.id,
this.$refs.modelForm.topAdvert = pageData.list[0]; pageData: modelForm,
this.$refs.modelForm.navList = pageData.list[1]; };
pageData.list.splice(0,2) API_floor.updateHome(this.$route.query.id, data).then((res) => {
this.modelForm = pageData; if (res.success) {
} else { this.$Message.success("保存模板成功");
this.modelForm = {list:[]} } else {
} this.$Message.error(res.message);
} else {
this.modelForm = {list:[]}
}
}
// this.$refs.modelForm.topAdvert = {};
// this.$refs.modelForm.navList = {}
})
} }
});
}, },
watch: { resetTemplate() {
modelForm: { //
deep: true, this.getTemplateItem(this.$route.query.id);
handler: function (val) { },
console.log(val) getTemplateItem(id) {
//
API_floor.getHomeData(id).then((res) => {
if (res.success) {
let pageData = res.result.pageData;
if (pageData) {
pageData = JSON.parse(pageData);
if (pageData.list[0].type === "topAdvert") {
// topAdvert 广 navList
this.$refs.modelForm.topAdvert = pageData.list[0];
this.$refs.modelForm.navList = pageData.list[1];
pageData.list.splice(0, 2);
this.modelForm = pageData;
} else {
this.modelForm = { list: [] };
} }
} } else {
} this.modelForm = { list: [] };
} }
}
// this.$refs.modelForm.topAdvert = {};
// this.$refs.modelForm.navList = {}
});
},
},
watch: {
modelForm: {
deep: true,
handler: function (val) {
console.log(val);
},
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.renovation{ .renovation {
position: relative; position: relative;
display: flex; display: flex;
} }
.model-list{ .model-list {
width: 120px; width: 120px;
height:auto; height: auto;
padding: 10px; padding: 10px;
background: #fff; background: #fff;
margin-top: 60px; margin-top: 60px;
position: fixed; position: fixed;
z-index: 100; z-index: 100;
box-shadow: 1px 1px 10px #999; box-shadow: 1px 1px 10px #999;
.classification-title{ .classification-title {
width: 100%;
height: 30px;
line-height: 30px;
}
.model-item{
width: 100px;
height: 30px;
background: #eee;
margin-top: 10px;
line-height: 30px;
text-align: center;
color: #999;
&:hover{
border: 1px dashed #409EFF;
color: #409EFF;
cursor: move;
}
}
.ghost::after{
border:none;
height: 0;
content: '';
}
}
.show-content{
margin-left: 150px;
margin-top: 60px;
}
.ghost{
background: #fff;
height: 30px;
position: relative;
&::after{
content: '松开鼠标添加模块';
position: absolute;
background: #fff;
border: 1px dashed #409EFF;
color: #409EFF;
top: 0;
left: 0;
width: 100%;
height: 50px;
text-align: center;
line-height: 50px;
}
}
.btn-bar{
position: fixed;
width: 100%; width: 100%;
background:#fff; height: 30px;
height: 50px; line-height: 30px;
padding: 10px; }
box-shadow: 1px 1px 10px #999; .model-item {
z-index: 99; width: 100px;
top: 100px; height: 30px;
background: #eee;
margin-top: 10px;
line-height: 30px;
text-align: center;
color: #999;
&:hover {
border: 1px dashed #409eff;
color: #409eff;
cursor: move;
}
}
.ghost::after {
border: none;
height: 0;
content: "";
}
} }
.show-content {
</style> margin-left: 150px;
margin-top: 60px;
}
.ghost {
background: #fff;
height: 30px;
position: relative;
&::after {
content: "松开鼠标添加模块";
position: absolute;
background: #fff;
border: 1px dashed #409eff;
color: #409eff;
top: 0;
left: 0;
width: 100%;
height: 50px;
text-align: center;
line-height: 50px;
}
}
.btn-bar {
position: fixed;
width: 100%;
background: #fff;
height: 50px;
padding: 10px;
box-shadow: 1px 1px 10px #999;
z-index: 99;
top: 100px;
}
</style>

View File

@ -55,6 +55,7 @@ export default {
}, },
methods: { methods: {
changeMenu(name) { // changeMenu(name) { //
console.log(name)
this.$router.push({ this.$router.push({
name: name name: name
}); });

View File

@ -312,6 +312,7 @@ export default {
], ],
data: [], // data: [], //
total: 0, // total: 0, //
selectMember: [], //
}; };
}, },
props: { props: {
@ -320,18 +321,66 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
//
selectedList: {
type: null,
default: "",
},
},
watch: {
selectedList: {
handler(val) {
this.$set(this, "selectMember", JSON.parse(JSON.stringify(val)));
this.init(this.data);
//
},
deep: true,
immediate: true,
},
}, },
methods: { methods: {
// //
callback(val, index) { callback(val, index) {
val.___selected = !val.___selected; this.$set(val, "___selected", !val.___selected);
console.log(val.___selected);
let findUser = this.selectMember.find((item) => {
return item.id == val.id;
});
//
if (!findUser) {
this.selectMember.push(val);
} else {
//
this.selectMember.map((item, index) => {
if (item.id == findUser.id) {
this.selectMember.splice(index, 1);
}
});
}
this.$emit("callback", val); this.$emit("callback", val);
}, },
init() { //
this.getData(); init(data) {
data.forEach((item) => {
if (this.selectMember.length != 0) {
this.selectMember.forEach((member) => {
if (member.id == item.id) {
this.$set(item, "___selected", true);
}
});
} else {
this.$set(item, "___selected", false);
}
});
this.data = data;
}, },
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v; this.searchForm.pageNumber = v;
//
//selectedMember
this.getData(); this.getData();
}, },
changePageSize(v) { changePageSize(v) {
@ -387,15 +436,13 @@ export default {
} }
}); });
}, },
// //
getData() { getData() {
API_Member.getMemberListData(this.searchForm).then((res) => { API_Member.getMemberListData(this.searchForm).then((res) => {
if (res.result.records) { if (res.result.records) {
this.loading = false; this.loading = false;
res.result.records.forEach((item) => { this.init(res.result.records);
item.___selected = false;
});
this.data = res.result.records;
this.total = res.result.total; this.total = res.result.total;
} }
}); });
@ -484,7 +531,7 @@ export default {
}, },
}, },
mounted() { mounted() {
this.init(); this.getData();
}, },
}; };
</script> </script>

View File

@ -4,7 +4,7 @@
<Row> <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">
<Form-item label="活动名称" prop="couponName"> <Form-item label="活动名称" prop="couponName">
<Input type="text" v-model="searchForm.couponName" placeholder="请输入活动名称" clearable style="width: 200px"/> <Input type="text" v-model="searchForm.couponName" placeholder="请输入活动名称" clearable style="width: 200px" />
</Form-item> </Form-item>
<Form-item label="活动状态" prop="promotionStatus"> <Form-item label="活动状态" prop="promotionStatus">
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px"> <Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
@ -15,8 +15,7 @@
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="活动时间"> <Form-item label="活动时间">
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" <DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
style="width: 200px"></DatePicker>
</Form-item> </Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button> <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form> </Form>
@ -26,21 +25,17 @@
<Button @click="delAll"></Button> <Button @click="delAll"></Button>
<!-- <Button @click="upAll" >批量上架</Button> --> <!-- <Button @click="upAll" >批量上架</Button> -->
</Row> </Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
@on-sort-change="changeSort" @on-selection-change="changeSelect">
<template slot-scope="{ row,index }" slot="action"> <template slot-scope="{ row,index }" slot="action">
<Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary" <Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary" size="small" style="margin-right: 10px" @click="edit(row)">
size="small" style="margin-right: 10px" @click="edit(row)">编辑
</Button> </Button>
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" <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> </Button>
</template> </template>
</Table> </Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize" <Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
size="small" show-total show-elevator show-sizer></Page>
</Row> </Row>
</Card> </Card>
</div> </div>
@ -68,7 +63,7 @@ export default {
pageSize: 10, // pageSize: 10, //
sort: "startTime", // sort: "startTime", //
order: "desc", // order: "desc", //
getType: '', // getType: "", //
}, },
form: { form: {
// //
@ -77,7 +72,7 @@ export default {
// //
formValidate: { formValidate: {
promotionName: [ promotionName: [
{required: true, message: "不能为空", trigger: "blur"}, { required: true, message: "不能为空", trigger: "blur" },
], ],
}, },
submitLoading: false, // submitLoading: false, //
@ -94,15 +89,16 @@ export default {
{ {
title: "活动名称", title: "活动名称",
key: "promotionName", key: "promotionName",
width: 120, minWidth: 100,
fixed: "left", fixed: "left",
}, },
{ {
title: "优惠券名称", title: "优惠券名称",
key: "couponName", key: "couponName",
width: 120, minWidth: 100,
tooltip: true tooltip: true,
}, { },
{
title: "面额/折扣", title: "面额/折扣",
key: "price", key: "price",
width: 120, width: 120,
@ -124,9 +120,11 @@ export default {
width: 150, width: 150,
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", params.row.receivedNum + "/" + params.row.publishNum) "div",
params.row.receivedNum + "/" + params.row.publishNum
);
}, },
minWidth:130, minWidth: 130,
}, },
{ {
title: "优惠券类型", title: "优惠券类型",
@ -162,20 +160,19 @@ export default {
}, },
{ {
title: "活动时间", title: "活动时间",
width: 120,
render: (h, params) => {
render: (h, params) => {
if (params.row.getType === "ACTIVITY") { if (params.row.getType === "ACTIVITY") {
return h("div", "长期有效"); return h("div", "长期有效");
} else { } else {
return h("div", { return h("div", {
domProps: { domProps: {
innerHTML: params.row.startTime + "<br/>" + params.row.endTime, innerHTML:
params.row.startTime + "<br/>" + params.row.endTime,
}, },
}); });
} }
}, },
minWidth:150,
}, },
{ {
title: "状态", title: "状态",
@ -210,14 +207,14 @@ export default {
), ),
]); ]);
}, },
minWidth:70, minWidth: 70,
}, },
{ {
title: "操作", title: "操作",
slot: "action", slot: "action",
align: "center", align: "center",
fixed: "right", fixed: "right",
minWidth: 140 maxWidth: 140,
}, },
], ],
data: [], // data: [], //
@ -233,13 +230,13 @@ export default {
// //
getType: { getType: {
type: String, type: String,
default: '' default: "",
}, },
// //
selectList: { selectedList: {
type: Array, type: Array,
default: [] default: [],
} },
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
@ -255,16 +252,27 @@ export default {
}, },
init() { init() {
this.getDataList(); this.getDataList();
//
if (this.selectedList.length != 0) {
// console.log(this.selectedList);
this.selectedList.forEach((item) => {
item._checked = true;
item.___selected = true;
});
this.$set(this, "data", this.selectedList);
console.log(this.data);
}
}, },
add() { add() {
this.$router.push({name: "add-platform-coupon"}); this.$router.push({ name: "add-platform-coupon" });
}, },
/** 跳转至领取详情页面 */ /** 跳转至领取详情页面 */
receiveInfo(v) { receiveInfo(v) {
this.$router.push({name: "member-receive-coupon", query: {id: v.id}}); 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}}); this.$router.push({ name: "platform-coupon-info", query: { id: v.id } });
}, },
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v - 1; this.searchForm.pageNumber = v - 1;
@ -294,7 +302,7 @@ export default {
changeSelect(e) { changeSelect(e) {
this.selectList = e; this.selectList = e;
this.selectCount = e.length; this.selectCount = e.length;
this.checked ? this.check() : ''; this.checked ? this.check() : "";
}, },
getDataList() { getDataList() {
this.loading = true; this.loading = true;
@ -309,9 +317,9 @@ export default {
getPlatformCouponList(this.searchForm).then((res) => { getPlatformCouponList(this.searchForm).then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.success) {
res.result.records.forEach(item => { res.result.records.forEach((item) => {
item.___selected = false item.___selected = false;
}) });
this.data = res.result.records; this.data = res.result.records;
this.total = res.result.total; this.total = res.result.total;
} }
@ -353,7 +361,7 @@ export default {
}); });
}, },
edit(v) { edit(v) {
this.$router.push({name: "edit-platform-coupon", query: {id: v.id}}); this.$router.push({ name: "edit-platform-coupon", query: { id: v.id } });
}, },
remove(v) { remove(v) {
this.$Modal.confirm({ this.$Modal.confirm({

View File

@ -6,12 +6,11 @@
<h4>活动信息</h4> <h4>活动信息</h4>
<div class="form-item-view"> <div class="form-item-view">
<FormItem label="活动名称" prop="promotionName"> <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>
<FormItem label="活动时间"> <FormItem label="活动时间">
<DatePicker type="datetimerange" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" <DatePicker type="datetimerange" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :options="options" style="width: 260px">
:options="options" style="width: 260px">
</DatePicker> </DatePicker>
</FormItem> </FormItem>
@ -27,15 +26,16 @@
<Radio label="DESIGNATED">指定会员</Radio> <Radio label="DESIGNATED">指定会员</Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="选择会员" prop="scopeType" <FormItem label="选择会员" prop="scopeType" v-if="form.couponActivityType==='SPECIFY' && form.activityScope==='DESIGNATED'">
v-if="form.couponActivityType==='SPECIFY' && form.activityScope==='DESIGNATED'">
<Button type="primary" icon="ios-add" @click="addVip" ghost>选择会员</Button> <Button type="primary" icon="ios-add" @click="addVip" ghost>选择会员</Button>
<div style="margin-top:24px;" v-if="form.activityScope == 'DESIGNATED'">
<Table border :columns="userColumns" :data="this.selectedMember">
</Table>
</div>
</FormItem> </FormItem>
{{ selectedMember }}
<FormItem label="活动描述" prop="activityScopeInfo"> <FormItem label="活动描述" prop="activityScopeInfo">
<Input v-model="form.activityScopeInfo" type="textarea" :rows="4" maxlength="50" show-word-limit clearable <Input v-model="form.activityScopeInfo" type="textarea" :rows="4" maxlength="50" show-word-limit clearable style="width: 260px" />
style="width: 260px"/>
</FormItem> </FormItem>
</div> </div>
<h4>配置优惠券</h4> <h4>配置优惠券</h4>
@ -47,8 +47,8 @@
<Table border :columns="columns" :data="this.selectCouponList"> <Table border :columns="columns" :data="this.selectCouponList">
<template slot="sendNum" slot-scope="scope"> <template slot="sendNum" slot-scope="scope">
<Input type="text" v-model="form.couponActivityItems[scope.index].num" placeholder="赠送数量"/> <Input type="text" v-model="form.couponActivityItems[scope.index].num" placeholder="赠送数量" />
<Input type="text" v-model="form.couponActivityItems[scope.index].couponId" v-show="false"/> <Input type="text" v-model="form.couponActivityItems[scope.index].couponId" v-show="false" />
</template> </template>
</Table> </Table>
</FormItem> </FormItem>
@ -61,12 +61,12 @@
</div> </div>
</Form> </Form>
</Card> </Card>
<Modal v-model="showCouponSelect" width="80%"> <Modal @on-ok="()=>{this.showCouponSelect = false}" @on-cancel="()=>{this.showCouponSelect = false}" v-model="showCouponSelect" width="80%">
<couponTemplate :checked="true" :selectList="selectCouponList" getType="ACTIVITY" @selected="selectedCoupon"/> <couponTemplate :checked="true" v-if="showCouponSelect" :selectedList="selectCouponList" getType="ACTIVITY" @selected="selectedCoupon" />
</Modal> </Modal>
<Modal width="1200" v-model="checkUserList"> <Modal width="1200" v-model="checkUserList">
<userList @callback="callbackSelectUser" ref="memberLayout"/> <userList v-if="checkUserList" @callback="callbackSelectUser" :selectedList="selectedMember" ref="memberLayout" />
</Modal> </Modal>
</div> </div>
</template> </template>
@ -76,10 +76,7 @@ import couponTemplate from "@/views/promotion/coupon/coupon";
import userList from "@/views/member/list/index"; import userList from "@/views/member/list/index";
import { import { saveActivityCoupon, updateCouponActivity } from "@/api/promotion";
saveActivityCoupon,
updateCouponActivity,
} from "@/api/promotion";
export default { export default {
name: "addCouponActivity", name: "addCouponActivity",
@ -89,30 +86,72 @@ export default {
}, },
data() { data() {
return { return {
showCouponSelect: false,// showCouponSelect: false, //
modalType: 0, // modalType: 0, //
rangeTime: '',// rangeTime: "", //
checkUserList: false,// checkUserList: false, //
selectedMember: [],// selectedMember: [], //
form: { form: {
promotionName: '', // promotionName: "", //
activityScope: 'ALL', // activityScope: "ALL", //
couponActivityType: 'REGISTERED', // couponActivityType: "REGISTERED", //
activityScopeInfo: '', // activityScopeInfo: "", //
startTime: '', // startTime: "", //
endTime: '', // endTime: "", //
couponActivityItems: [] couponActivityItems: [],
}, // }, //
id: this.$route.query.id, // id id: this.$route.query.id, // id
submitLoading: false, // submitLoading: false, //
selectCouponList: [],// selectCouponList: [], //
formRule: { formRule: {
promotionName: [{required: true, message: "活动名称不能为空"}], promotionName: [{ required: true, message: "活动名称不能为空" }],
rangeTime: [{required: true, message: "请选择活动有效期"}], rangeTime: [{ required: true, message: "请选择活动有效期" }],
description: [{required: true, message: "请输入范围描述"}], description: [{ required: true, message: "请输入范围描述" }],
}, },
// //
userColumns: [
{
title: "用户名称",
key: "nickName",
minWidth: 120,
},
{
title: "手机号",
key: "mobile",
render: (h, params) => {
return h("div", params.row.mobile || "暂未填写");
},
},
{
title: "最后登录时间",
key: "lastLoginDate",
},
{
title: "操作",
key: "action",
minWidth: 50,
align: "center",
render: (h, params) => {
return h(
"Button",
{
props: {
size: "small",
type: "error",
ghost: true,
},
on: {
click: () => {
this.delUser(params.index);
},
},
},
"删除"
);
},
},
],
//
columns: [ columns: [
{ {
title: "优惠券名称", title: "优惠券名称",
@ -175,7 +214,7 @@ export default {
}, },
on: { on: {
click: () => { click: () => {
// this.delGoods(params.index); this.delCoupon(params.index);
}, },
}, },
}, },
@ -194,14 +233,32 @@ export default {
} }
}, },
methods: { methods: {
//
delUser(index) {
this.selectedMember.splice(index, 1);
},
//
delCoupon(index) {
this.selectCouponList.splice(index, 1);
},
// //
callbackSelectUser(val) { callbackSelectUser(val) {
let index = this.selectedMember.indexOf(val) //
if (index > 0) { let findUser = this.selectedMember.find((item) => {
this.selectedMember.remove(val); return item.id == val.id;
});
//
if (!findUser) {
this.selectedMember.push(val);
} else {
//
this.selectedMember.map((item, index) => {
if (item.id == findUser.id) {
this.selectedMember.splice(index, 1);
}
});
} }
this.selectedMember.push(val);
}, },
// //
@ -218,17 +275,16 @@ export default {
/** /**
* 返回优惠券*/ * 返回优惠券*/
selectedCoupon(val) { selectedCoupon(val) {
this.selectCouponList = val this.selectCouponList = val;
// //
this.form.couponActivityItems = []; this.form.couponActivityItems = [];
val.forEach((item, index) => { val.forEach((item, index) => {
this.form.couponActivityItems.push({ this.form.couponActivityItems.push({
num: 0, num: 0,
couponId: item.id couponId: item.id,
}) });
}) });
console.log(val) console.log(val);
}, },
getCoupon() { getCoupon() {
@ -276,7 +332,6 @@ export default {
}, },
/** 保存平台优惠券 */ /** 保存平台优惠券 */
handleSubmit() { handleSubmit() {
this.form.startTime = this.$options.filters.unixToDate( this.form.startTime = this.$options.filters.unixToDate(
this.rangeTime[0] / 1000 this.rangeTime[0] / 1000
); );
@ -287,7 +342,7 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const params = JSON.parse(JSON.stringify(this.form)); const params = JSON.parse(JSON.stringify(this.form));
console.log(params) console.log(params);
this.submitLoading = true; this.submitLoading = true;
if (this.modalType === 0) { if (this.modalType === 0) {
// id // id
@ -318,7 +373,7 @@ export default {
this.$store.state.app.pageOpenedList this.$store.state.app.pageOpenedList
); );
this.$router.go(-1); this.$router.go(-1);
} },
}, },
}; };
</script> </script>

View File

@ -93,7 +93,7 @@ export default {
}, },
on: { on: {
"on-change": () => { "on-change": () => {
this.star(params.row,params.index); this.star(params.row, params.index);
}, },
}, },
}, },
@ -183,19 +183,19 @@ export default {
/** /**
* 是否推荐 * 是否推荐
*/ */
async star(val,index) { async star(val, index) {
let switched let switched;
if(this.liveData[index].recommend){ if (this.liveData[index].recommend) {
this.$set(this.liveData[index],'recommend',false) this.$set(this.liveData[index], "recommend", false);
switched = false switched = false;
} } else {
else{ this.$set(this.liveData[index], "recommend", true);
switched = true;
this.$set(this.liveData[index],'recommend',true)
switched = true
} }
await whetherStar({id:val.id,recommend:switched}); await whetherStar({ id: val.id, recommend: switched });
this.getStoreLives();
}, },
/** /**

View File

@ -22,10 +22,10 @@ export default {
// buyer: 'https://buyer-api.pickmall.cn', // buyer: 'https://buyer-api.pickmall.cn',
// seller: 'https://store-api.pickmall.cn', // seller: 'https://store-api.pickmall.cn',
// manager: 'https://admin-api.pickmall.cn', // manager: 'https://admin-api.pickmall.cn',
common: 'http://192.168.0.100:8890', common: 'http://192.168.0.109:8890',
buyer: 'http://192.168.0.100:8888', buyer: 'http://192.168.0.109:8888',
seller: 'http://192.168.0.100:8889', seller: 'http://192.168.0.109:8889',
manager: 'http://192.168.0.100:8887' manager: 'http://192.168.0.109:8887'
}, },
api_prod: { api_prod: {
common: 'https://common-api.pickmall.cn', common: 'https://common-api.pickmall.cn',

View File

@ -25,6 +25,8 @@
</Modal> </Modal>
<div class="step-list"> <div class="step-list">
<steps :current="activestep" simple style="height:60px;margin-top: 10px" process-status="process"> <steps :current="activestep" simple style="height:60px;margin-top: 10px" process-status="process">
<div class="step-view"> <div class="step-view">

View File

@ -153,7 +153,6 @@ import {
addLiveGoods, addLiveGoods,
editLive, editLive,
getLiveInfo, getLiveInfo,
delLiveGoods,
delRoomLiveGoods, delRoomLiveGoods,
} from "@/api/promotion"; } from "@/api/promotion";
import liveGoods from "./liveGoods"; import liveGoods from "./liveGoods";

View File

@ -276,10 +276,10 @@ export default {
async saveLiveGoods() { async saveLiveGoods() {
this.saveGoodsLoading = true; this.saveGoodsLoading = true;
let submit = this.liveGoodsData.map((element) => { let submit = this.liveGoodsData.map((element) => {
console.log(element.priceType); console.log(element);
return { return {
goodsId: element.goodsId, //id goodsId: element.goodsId, //id
goodsImage: element.small, // goodsImage: element.small, // 300 * 300
name: element.goodsName, // name: element.goodsName, //
price: parseInt(element.price), // price: parseInt(element.price), //
quantity: element.quantity, // quantity: element.quantity, //