Commit 499b22f7 authored by 罗超's avatar 罗超

1

parent efcb8f71
......@@ -81,7 +81,24 @@
</template>
</q-input>
</div>
<div class="col-6">
<q-input filled stack-label maxlength="40" :dense="false" v-model="addMsg.LocationName" ref="LocationName"
class="col-12 q-pb-lg" label="活动地址" :rules="[val => !!val || '请填写活动地址']">
</q-input>
</div>
<div class="col-6">
<q-input filled stack-label maxlength="40" disable :dense="false" v-model="addMsg.LonLat" ref="LonLat"
class="col-12 q-pb-lg" label="门店经纬度" :rules="[val => !!val || '请填写门店经纬度']">
<template v-slot:after>
<q-btn round color="black" icon="my_location" @click="getMapShow" />
</template>
</q-input>
<!-- 地图选址 -->
<el-dialog title="地图展示" :visible.sync="isShowMap" width="960px" style="zIndex:999999">
<Map @map-submit="mapEvent" :address="addMsg.LocationName" style="zIndex:999999"></Map>
</el-dialog>
</div>
<div class="col-6">
<div>是否免费:</div>
<q-toggle v-model="addMsg.IsFree" :true-value="1" :false-value="2"
......@@ -141,24 +158,7 @@
<div>报名取消确认:</div>
<q-toggle v-model="addMsg.IsCancelConfirm" :true-value="1" :false-value="2" />
</div>
<div class="col-6">
<q-input filled stack-label maxlength="40" :dense="false" v-model="addMsg.LocationName" ref="LocationName"
class="col-12 q-pb-lg" label="活动地址" :rules="[val => !!val || '请填写活动地址']">
</q-input>
</div>
<div class="col-6">
<q-input filled stack-label maxlength="40" disable :dense="false" v-model="addMsg.LonLat" ref="LonLat"
class="col-12 q-pb-lg" label="门店经纬度" :rules="[val => !!val || '请填写门店经纬度']">
<template v-slot:after>
<q-btn round color="black" icon="my_location" @click="getMapShow" />
</template>
</q-input>
<!-- 地图选址 -->
<el-dialog title="地图展示" :visible.sync="isShowMap" width="960px" style="zIndex:999999">
<Map @map-submit="mapEvent" :address="addMsg.LocationName" style="zIndex:999999"></Map>
</el-dialog>
</div>
<div class="col-6">
<q-uploader :style="{ backgroundImage: 'url(' + addMsg.CoverImg + ')' }"
......
<style scoped>
.header-box {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 40px;
}
.p_title {
color: #000000;
font-size: 20px;
/* height: 30px !important; */
display: flex;
align-items: center;
}
.activeDetail {
overflow-y: scroll;
}
.conbox{
height: calc(100vh - 220px);
overflow-y: scroll;
}
.conbox::-webkit-scrollbar {
/*滚动条整体样式*/
width : 5px; /*宽度竖滚动条的尺寸*/
height: 10px; /*高度横滚动条的尺寸*/
}
.conbox::-webkit-scrollbar-thumb {
/*滚动条里面的条*/
border-radius: 10px;
box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2);
background : #eee;
}
.conbox::-webkit-scrollbar-track {
/*滚动条里面轨道*/
border-radius: 5px;
background : #ffffff;
}
.listTitle{
font-size: 18px
}
</style>
<template>
<div class="page-body activeDetail">
<div class="header-box">
<div class="flex">
<q-btn color="accent" size="sm" class="q-mr-md" label="返回" @click="goBack" />
<span class="p_title">复制活动</span>
</div>
<div>
<q-btn color="accent" size="sm" class="q-mr-sm" label="新增活动" @click="addActiveList" />
<q-btn color="accent" size="sm" label="保存" @click="save" />
</div>
</div>
<div class="conbox">
<ActiveForm :save-obj="activedata" :activeTypeOptions="activityTypeList" ref="childForm"
@success="getactivedata" />
<div class="">
<div class="q-mt-lg q-mb-lg listTitle">
活动列表
</div>
<div v-for="(item,index) in ActivityTitle" :key="item.id" class="flex ">
<DetailItem :itemData="item" :index="index+1" @success="getItemData($event,index)" ref="child" />
<el-tooltip class="item" effect="dark" content="删除当前活动" placement="top" v-if="index>0">
<i class="iconfont icon-img_delete_small q-ml-sm" style="color: #2961FE" @click="delActiveList(index)"></i>
</el-tooltip>
</div>
</div>
</div>
</div>
</template>
<script>
import DetailItem from "../../components/activity/activeDetail-item"
import ActiveForm from '../../components/activity/active-from'
export default {
meta: {
title: "活动详情"
},
components: {
DetailItem,
ActiveForm
},
data() {
return {
msg: {
Id: 0,
ActivityTitle: []
},
activeBaseData: {
},
ActivityTitle: [{
Title: "", //活动大标题
TripSort: 0, //活动排序
ActivityPlanList: [ //活动安排
{
TripSort: 0, //排序
StartTime: "", //开始时间
ActivityDuration: "", //活动时长(单位:分钟)
LonLat: "", //活动地址经纬度
LocationName: "", //活动地址
TripTitle: "", //安排标题
TripContent: "", //内容
TripPicList: [] //图片
}
]
}],
activedata: {
},
activityTypeList: [],
}
},
mounted() {
this.getActiveTypeList();
if (this.$route.query.Id) {
this.msg.Id = this.$route.query.Id
this.getDetail()
}
},
methods: {
goBack() {
this.$router.go(-1)
},
addActiveList() {
let obj = {
Title: "", //活动大标题
TripSort: this.ActivityTitle.length, //活动排序
ActivityPlanList: [ //活动安排
{
TripSort: 0, //排序
StartTime: "", //开始时间
ActivityDuration: "", //活动时长(单位:分钟)
LonLat: "", //活动地址经纬度
LocationName: "", //活动地址
TripTitle: "", //安排标题
TripContent: "", //内容
TripPicList: [] //图片
}
]
}
this.ActivityTitle.push(obj)
},
delActiveList(index) {
this.ActivityTitle.splice(index, 1)
},
//活动详情列表数据
getItemData(val, index) {
this.msg.ActivityTitle[index] = val
},
//保存信息
save() {
this.msg.ActivityTitle = this.ActivityTitle
this.$refs.child.map(x => {
x.ruleVerification();
})
let res = this.$refs.child.every(x => {
return x.ruleVerification();
})
let res2 = this.$refs.childForm.saveRule()
if (res && res2) {
let msg = {
...this.msg,
...this.activeBaseData
}
msg.Id=0
this.apipostDS("/api/Education/SetActivity", msg, (res) => {
if (res.data.resultCode === 1) {
this.Success("操作成功");
// this.getDetail()
this.$router.push("/activity/activityList")
} else {
this.Error(res.data.message);
}
})
}
},
getDetail() {
this.apipostDS("/api/Education/GetActivity", {
Id: this.msg.Id
}, (res) => {
if (res.data.resultCode === 1) {
this.ActivityTitle = res.data.data.ActivityTitleList
this.activedata = res.data.data
console.log(192, this.activedata)
this.activedata.StartTime=""
this.activedata.StartTimeStr=""
this.activedata.EndTime=""
this.activedata.EndTimeStr=""
this.activedata.SignStartTime=""
this.activedata.SignStartTimeStr=""
this.activedata.SignEndTime=""
this.activedata.SignEndTimeStr=""
}
})
},
//获取活动类型下拉
getActiveTypeList() {
this.apipostDS("/api/Education/GetCommerceActivityTypeList", {}, (res) => {
if (res.data.resultCode === 1) {
this.activityTypeList = res.data.data;
this.activityTypeList.unshift({
Id: -1,
TypeName: "不限"
})
}
})
},
//活动基础数据
getactivedata(val) {
this.activeBaseData = val
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
......@@ -741,6 +741,11 @@ const routes = [{
component: () =>
import("pages/activity/activeDetail.vue")
},
{
path: "/activity/copyActive", //活动 复制活动
component: () =>
import("pages/activity/copyActive.vue")
},
{
path: "/activity/advmanager", //活动 广告图管理
component: () =>
......@@ -835,7 +840,7 @@ const routes = [{
component: () =>
import("pages/course/chapter.vue")
},
{
path: "/course/coursejob", //作业管理
component: () =>
......@@ -985,9 +990,9 @@ const routes = [{
},
},
{
path: "/course/chapter-editor", //章节管理
component: () =>
import("pages/course/chapterEditor.vue")
path: "/course/chapter-editor", //章节管理
component: () =>
import("pages/course/chapterEditor.vue")
},
{
path: "*",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment