Commit de1fbc00 by chenyu

update: 分享有礼到期校验

parent 41deb665
......@@ -18,6 +18,7 @@
"echarts": "^4.4.0",
"element-ui": "^2.12.0",
"file-saver": "^1.3.8",
"moment": "^2.29.1",
"sass": "^1.26.11",
"tinymce": "^4.9.6",
"v-charts": "^1.19.0",
......
......@@ -130,9 +130,15 @@ import { _debounce } from '@/common/js/public';
// import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import timeFormat from '@/common/js/timeFormat';
import moment from 'moment'
export default {
name: 'base-config',
props: {},
props: {
endDate: {
type: Number,
default: new Date().getTime()
}
},
components: {
limitInput
},
......@@ -154,6 +160,12 @@ export default {
callback(new Error('请选择开始日期'));
} else if(!value[1]) {
callback(new Error('请选择结束日期'));
} else if(value[0]&&value[1]&&new Date(this.activeInfoData.endDate).getTime()> this.endDate){
this.$message({
message: `您的分享有礼功能${moment(this.endDate).format('YYYY年MM月DD日')}到期,活动结束时间无法超过该日期。`,
type: 'warning'
});
callback(new Error(' '));
} else {
callback();
}
......@@ -183,7 +195,7 @@ export default {
},
rules: {
activityName: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
dateRange: [{ validator: checkDate, trigger: 'change' }]
dateRange: [{ validator: checkDate, trigger: 'blur' }]
},
choiceDateCopy: [],
pickerOptions: {
......@@ -216,10 +228,10 @@ export default {
disabledDate: time => {
let disabled = time.getTime() < Date.now() - 8.64e7;
if(this.activeInfoData.startDate) {
disabled = disabled || (time.getTime() < new Date(this.activeInfoData.startDate).getTime());
disabled = disabled || time.getTime() > this.endDate||(time.getTime() < new Date(this.activeInfoData.startDate).getTime());
}
if(!this.activeInfoData.startDate || (new Date(this.activeInfoData.startDate).toDateString() === new Date().toDateString())) {
disabled = disabled || (time.getTime() <= new Date().setHours(0,0,0));
disabled = disabled || time.getTime() > this.endDate||(time.getTime() <= new Date().setHours(0,0,0));
}
return disabled;
}
......
......@@ -14,62 +14,25 @@ import activeSelect from '@/components/active/active-select.vue';
<template>
<div class="active-select border-box">
<div class="active-select-title font-22 color-303133 font-w-600">请选择您的活动目的</div>
<ul class="flex flex-pack-center">
<template v-for="(item, index) in firstData">
<li
:class="['li-cell flex-1 ', firstGoal.goalId == item.goalId ? 'li-cell-active' : '']"
:key="index + 'first'"
@click="selectFirst(item)"
>
<div class="li-cell-inner flex ">
<div class="li-cell-left flex flex-align-center flex-pack-center">
<img
:src="firstGoal.goalId == item.goalId ? item.selectedIconUrl : item.iconUrl"
alt=""
/>
</div>
<div class="li-cell-right border-box flex flex-column ">
<div class="li-cell-active_name flex flex-align-center font-18 color-303133">{{ item.goalName }}</div>
<div class="li-cell-active_description flex flex-align-center font-14 color-606266">{{ item.description }}</div>
</div>
</div>
<div class="common-cell-check">
<div class="common-cell-triangle">
<div class="common-cell-outer">
<i class="el-icon-upload-success el-icon-check"></i>
</div>
</div>
</div>
</li>
</template>
</ul>
<div v-if="!!firstGoal.goalId">
<div class="active-select-next"></div>
<div class="active-select-title font-22 color-303133 font-w-600">请进一步明确活动目的</div>
<ul class="flex flex-pack-center m-t-48">
<template v-for="(item, index) in secondData">
<template v-if="isOverdue===0">
<div class="active-select-title font-22 color-303133 font-w-600">请选择您的活动目的</div>
<ul class="flex flex-pack-center">
<template v-for="(item, index) in firstData">
<li
:class="['li-cell li-second-cell flex-1 ', secondGoal.goalId == item.goalId ? 'li-second-active' : '']"
:key="index + 'second'"
@click="selectSecond(item)"
:class="['li-cell flex-1 ', firstGoal.goalId == item.goalId ? 'li-cell-active' : '']"
:key="index + 'first'"
@click="selectFirst(item)"
>
<div class="li-cell-inner">
<div class="li-cell-top border-box flex flex-align-center flex-pack-center">
<div class="li-cell-inner flex ">
<div class="li-cell-left flex flex-align-center flex-pack-center">
<img
:src="secondGoal.goalId == item.goalId ? item.selectedIconUrl : item.iconUrl"
:src="firstGoal.goalId == item.goalId ? item.selectedIconUrl : item.iconUrl"
alt=""
/><span class="p-l-15 font-18 color-303133 font-w-700">{{ item.goalName }}</span>
/>
</div>
<div class="li-cell-bottom border-box">
<div class="li-cell-scene">
<div class="li-cell-scene_title font-14 color-303133">适用场景</div>
<div class="li-cell-scene_text font-14 color-606266">{{ item.description['适用场景'] }}</div>
</div>
<div class="li-cell-quality">
<div class="li-cell-quality_title font-14 color-303133">优劣分析</div>
<div class="li-cell-quality_text font-14 color-606266">{{ item.description['优劣分析'] }}</div>
</div>
<div class="li-cell-right border-box flex flex-column ">
<div class="li-cell-active_name flex flex-align-center font-18 color-303133">{{ item.goalName }}</div>
<div class="li-cell-active_description flex flex-align-center font-14 color-606266">{{ item.description }}</div>
</div>
</div>
<div class="common-cell-check">
......@@ -82,135 +45,180 @@ import activeSelect from '@/components/active/active-select.vue';
</li>
</template>
</ul>
</div>
<div v-if="!!secondGoal.goalId">
<div class="active-select-next"></div>
<div class="active-select-title font-22 color-303133 font-w-600 m-b-0">请配置受邀人的转化路径</div>
<div class="active-select-subtitle font-14 color-606266">基于您的活动设计期望,配置受邀人的转化路径(即受邀人需要经历的交互步骤)。系统会根据您所选择的转化路径,自动配置服务号关注后回复、认证后卡券投放等营销脚本。您只需要根据自身需求选择路径,并选择相关的营销活动页、游戏计划或卡券。</div>
<ul class="flex flex-pack-center m-t-50">
<template v-for="(item, index) in thirdData">
<li
v-if="item.display == 1"
:class="['li-cell li-third-cell flex-1 ', item.check ? 'li-third-active' : '', item.mustFlag ? 'li-third-active-disable' : '']"
:key="index + 'third'"
@click="selectThird(item)"
>
<div class="li-cell-inner border-box">
<div class="li-cell-path_img flex flex-pack-center flex-pack--center">
<img
:src="item.iconUrl"
alt=""
/>
<div v-if="!!firstGoal.goalId">
<div class="active-select-next"></div>
<div class="active-select-title font-22 color-303133 font-w-600">请进一步明确活动目的</div>
<ul class="flex flex-pack-center m-t-48">
<template v-for="(item, index) in secondData">
<li
:class="['li-cell li-second-cell flex-1 ', secondGoal.goalId == item.goalId ? 'li-second-active' : '']"
:key="index + 'second'"
@click="selectSecond(item)"
>
<div class="li-cell-inner">
<div class="li-cell-top border-box flex flex-align-center flex-pack-center">
<img
:src="secondGoal.goalId == item.goalId ? item.selectedIconUrl : item.iconUrl"
alt=""
/><span class="p-l-15 font-18 color-303133 font-w-700">{{ item.goalName }}</span>
</div>
<div class="li-cell-bottom border-box">
<div class="li-cell-scene">
<div class="li-cell-scene_title font-14 color-303133">适用场景</div>
<div class="li-cell-scene_text font-14 color-606266">{{ item.description['适用场景'] }}</div>
</div>
<div class="li-cell-quality">
<div class="li-cell-quality_title font-14 color-303133">优劣分析</div>
<div class="li-cell-quality_text font-14 color-606266">{{ item.description['优劣分析'] }}</div>
</div>
</div>
</div>
<div class="li-cell-path_title font-16 color-303133 text-center">{{ item.transName }}</div>
<div class="li-cell-path_text font-14 color-606266">{{ item.description }}</div>
</div>
<div class="common-cell-check">
<div class="common-cell-triangle">
<div class="common-cell-outer">
<i class="el-icon-upload-success el-icon-check"></i>
<div class="common-cell-check">
<div class="common-cell-triangle">
<div class="common-cell-outer">
<i class="el-icon-upload-success el-icon-check"></i>
</div>
</div>
</div>
</div>
</li>
</template>
</ul>
</div>
<div v-if="pathNames.includes('访问活动营销页') || pathNames.includes('游戏参与') || pathNames.includes('卡券领取')">
<div class="active-select-next"></div>
<div class="active-select-title font-22 color-303133 font-w-600 m-b-0">活动创建前准备工作</div>
<div class="active-select-subtitle font-14 color-606266">根据您配置的转化路径,请确保完成以下工作,否则活动无法被正常执行。</div>
<ul class="flex flex-pack-center m-t-50">
<template v-for="(item, index) in fourData">
<li
v-if="(item.id == 'marking' && pathNames.includes('访问活动营销页')) || (item.id == 'game' && pathNames.includes('游戏参与')) || (item.id == 'card' && pathNames.includes('卡券领取'))"
class="li-four-cell flex-1 "
:key="index + 'four'"
>
<div class="li-cell-inner border-box">
<div class="li-cell-title font-18 color-303133 font-w-600">{{ item.title }}</div>
<div class="li-cell-subtitle font-14 color-606266">{{ item.text }}</div>
<div
v-if="item.id == 'marking'"
class="li-cell-tip font-14 color-303133"
>如果您还没有创建活动营销页,请立即前往创建。</div>
<div
v-if="item.id == 'game'"
class="li-cell-tip font-14 color-303133"
>如果您还没有创建游戏计划,请立即前往创建。</div>
<div
v-if="item.id == 'card'"
class="li-cell-tip font-14 color-303133"
>如果您还没有创建卡券,请立即前往创建。</div>
<div
v-if="item.id == 'marking'"
class="li-cell-select"
>
<el-select
size="large"
v-model="markingValue"
placeholder="请选择活动着陆页"
@change="changeMarking"
>
<el-option
v-for="item in markingList"
:key="item.pageId"
:label="item.name"
:value="item.pageId"
> </el-option>
</el-select>
</li>
</template>
</ul>
</div>
<div v-if="!!secondGoal.goalId">
<div class="active-select-next"></div>
<div class="active-select-title font-22 color-303133 font-w-600 m-b-0">请配置受邀人的转化路径</div>
<div class="active-select-subtitle font-14 color-606266">基于您的活动设计期望,配置受邀人的转化路径(即受邀人需要经历的交互步骤)。系统会根据您所选择的转化路径,自动配置服务号关注后回复、认证后卡券投放等营销脚本。您只需要根据自身需求选择路径,并选择相关的营销活动页、游戏计划或卡券。</div>
<ul class="flex flex-pack-center m-t-50">
<template v-for="(item, index) in thirdData">
<li
v-if="item.display == 1"
:class="['li-cell li-third-cell flex-1 ', item.check ? 'li-third-active' : '', item.mustFlag ? 'li-third-active-disable' : '']"
:key="index + 'third'"
@click="selectThird(item)"
>
<div class="li-cell-inner border-box">
<div class="li-cell-path_img flex flex-pack-center flex-pack--center">
<img
:src="item.iconUrl"
alt=""
/>
</div>
<div class="li-cell-path_title font-16 color-303133 text-center">{{ item.transName }}</div>
<div class="li-cell-path_text font-14 color-606266">{{ item.description }}</div>
</div>
<div
v-if="item.id == 'game'"
class="li-cell-select"
>
<game-select
v-model="gameValue"
@changeGame="changeGame"
></game-select>
<div class="common-cell-check">
<div class="common-cell-triangle">
<div class="common-cell-outer">
<i class="el-icon-upload-success el-icon-check"></i>
</div>
</div>
</div>
<div
v-if="item.id == 'card'"
class="li-cell-select"
>
<el-select
size="large"
v-model="cardValue"
placeholder="请选择卡券"
@change="changeCard"
</li>
</template>
</ul>
</div>
<div v-if="pathNames.includes('访问活动营销页') || pathNames.includes('游戏参与') || pathNames.includes('卡券领取')">
<div class="active-select-next"></div>
<div class="active-select-title font-22 color-303133 font-w-600 m-b-0">活动创建前准备工作</div>
<div class="active-select-subtitle font-14 color-606266">根据您配置的转化路径,请确保完成以下工作,否则活动无法被正常执行。</div>
<ul class="flex flex-pack-center m-t-50">
<template v-for="(item, index) in fourData">
<li
v-if="(item.id == 'marking' && pathNames.includes('访问活动营销页')) || (item.id == 'game' && pathNames.includes('游戏参与')) || (item.id == 'card' && pathNames.includes('卡券领取'))"
class="li-four-cell flex-1 "
:key="index + 'four'"
>
<div class="li-cell-inner border-box">
<div class="li-cell-title font-18 color-303133 font-w-600">{{ item.title }}</div>
<div class="li-cell-subtitle font-14 color-606266">{{ item.text }}</div>
<div
v-if="item.id == 'marking'"
class="li-cell-tip font-14 color-303133"
>如果您还没有创建活动营销页,请立即前往创建。</div>
<div
v-if="item.id == 'game'"
class="li-cell-tip font-14 color-303133"
>如果您还没有创建游戏计划,请立即前往创建。</div>
<div
v-if="item.id == 'card'"
class="li-cell-tip font-14 color-303133"
>如果您还没有创建卡券,请立即前往创建。</div>
<div
v-if="item.id == 'marking'"
class="li-cell-select"
>
<el-option
v-for="item in cardList"
:key="item.coupCardId"
:label="item.cardName"
:value="item.coupCardId"
> </el-option>
</el-select>
</div>
<div class="li-cell-seperator">OR</div>
<div class="li-cell-btn">
<el-button
type="primary"
plain
@click="toRedirectPage(item)"
>立即前往创建</el-button>
<el-select
size="large"
v-model="markingValue"
placeholder="请选择活动着陆页"
@change="changeMarking"
>
<el-option
v-for="item in markingList"
:key="item.pageId"
:label="item.name"
:value="item.pageId"
> </el-option>
</el-select>
</div>
<div
v-if="item.id == 'game'"
class="li-cell-select"
>
<game-select
v-model="gameValue"
@changeGame="changeGame"
></game-select>
</div>
<div
v-if="item.id == 'card'"
class="li-cell-select"
>
<el-select
size="large"
v-model="cardValue"
placeholder="请选择卡券"
@change="changeCard"
>
<el-option
v-for="item in cardList"
:key="item.coupCardId"
:label="item.cardName"
:value="item.coupCardId"
> </el-option>
</el-select>
</div>
<div class="li-cell-seperator">OR</div>
<div class="li-cell-btn">
<el-button
type="primary"
plain
@click="toRedirectPage(item)"
>立即前往创建</el-button>
</div>
</div>
</div>
</li>
</template>
</ul>
</div>
</li>
</template>
</ul>
</div>
<div class="to-active-config">
<div class="to-active-tip font-14 color-606266">确认完成了所有前期准备工作,即可前往活动配置。</div>
<div class="to-active-btn">
<el-button
type="primary"
:disabled="disableCreate"
@click="toCreate"
>前往活动配置<i class="el-icon-right"></i></el-button>
<div class="to-active-config">
<div class="to-active-tip font-14 color-606266">确认完成了所有前期准备工作,即可前往活动配置。</div>
<div class="to-active-btn">
<el-button
type="primary"
:disabled="disableCreate"
@click="toCreate"
>前往活动配置<i class="el-icon-right"></i></el-button>
</div>
</div>
</template>
<template v-else>
<div class="overdue-wrap">
<img :src="require('@/assets/images/Icon-guoqila.png')" alt="">
<p>您的分享有礼功能已过期,如需继续使用,请联系达摩运营经理购买使用</p>
</div>
</div>
</template>
</div>
</template>
<script>
......@@ -223,6 +231,12 @@ export default {
components: {
gameSelect
},
props: {
isOverdue: {
type: Number,
default: 0 // 是否过期,0:未过期,1:已过期
}
},
data() {
return {
firstGoal: {},
......@@ -407,7 +421,6 @@ export default {
return false;
}
item.check = item.check ? false : true;
console.log(item, item.check)
that.pathIds = [];
that.thirdData.forEach(ele => {
if (ele.check && ele.display) {
......@@ -772,7 +785,6 @@ export default {
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
console.log('indexObj:', indexObj);
that.$store.dispatch('saveIndexInfo', indexObj);
that.$router.push('/createActive');
return false;
......@@ -1187,4 +1199,23 @@ export default {
}
}
}
.overdue-wrap{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 191px;
img{
display: block;
width: 94px;
height: 94px;
}
p{
margin-top: 20px;
font-size: 14px;
font-weight: 400;
color: #303133;
line-height: 20px;
}
}
</style>
......@@ -13,8 +13,14 @@ import inProgressActive from '@/components/active/in-progress-active.vue';
-->
<template>
<div v-if="inProgressData.length">
<div class="separator-space">- 当前有计划中的活动,无法创建新的活动 -</div>
<div v-if="inProgressData.length" style="margin-top:-9px;">
<div class="flex-top-wrap">
<div class="separator-space">- 当前有计划中的活动,无法创建新的活动 -</div>
<div class="alert-wrap" v-if="dueData.dueDay<=90"
><i class="el-icon-warning" ></i
><template v-if="dueData.isOverdue===0">您的分享有礼功能将在 <span class="red">{{dueData.dueDay}}</span> 天后过期,为不影响使用,请及时联系达摩运营经理购买(<span class="red">过期截止时间{{dueData.endDate|dateFilter}}</span></template
><template v-else>您的分享有礼功能<span class="red">已过期</span>,如需继续使用,请联系达摩运营经理购买使用。</template></div>
</div>
<div class="in-progress-active border-box">
<ul>
<template v-for="(item, index) in inProgressData">
......@@ -151,11 +157,25 @@ import { _debounce } from '@/common/js/public';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { getRequest } from '@/api/api';
import moment from 'moment'
export default {
name: 'in-progress-active',
components: {
outDateActive
},
props: {
dueData: {
type: Object,
default: ()=>{
return {
dueDay: 0, // 即将到期天数
endDate: new Date().getTime(), // 到期时间
isOverdue: 0, // 是否过期,0:未过期,1:已过期
overdueDay: 0 // 过期天数
}
}
}
},
data() {
return {
funnelData: {},
......@@ -328,6 +348,11 @@ export default {
mounted() {
const that = this;
that.getTableList();
},
filters:{
dateFilter(v){
return moment(v).format('YYYY年MM月DD日')
}
}
};
</script>
......@@ -335,17 +360,43 @@ export default {
.m-t-7 {
margin-top: 7px;
}
.separator-space {
.red{
color:red;
}
.flex-top-wrap{
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
width: 100%;
height: 60px;
line-height: 60px;
text-align: center;
font-size: 14px;
color: #909399;
font-weight: 600;
&.no-active {
height: 40px;
line-height: 20px;
height: 40px;
margin-bottom: 9px;
.separator-space {
margin-right: 19px;
line-height: 40px;
text-align: center;
font-size: 14px;
color: #909399;
font-weight: 600;
&.no-active {
height: 40px;
line-height: 20px;
}
}
.alert-wrap{
// width:774px;
height:40px;
padding:0 7px 0 17px;
line-height:40px;
background:#FFFBE6;
border-radius:4px;
border:1pxsolid#FFE58F;
color:#606266;
font-size:14px;
.el-icon-warning{
margin-right:9px;
color:#FAAD14;
}
}
}
.in-progress-active {
......
......@@ -233,7 +233,7 @@ export default {
url = '//' + window.location.host + '/gic-web/#/reportCenter';
} */
if (window.location.origin.includes('gicdev')) {
window.open('/gic-web/reportCenter');
window.open('/gic-web/#/reportCenter');
return false;
}
window.open('/gic-web/#/reportCenter');
......
......@@ -8,7 +8,7 @@ const BASEURL = host.indexOf('localhost') > -1 ? 'http://gicdev.demogic.com/gic-
const server = axios.create({
baseURL: BASEURL,
timeout: 10000
timeout: 10000,
});
server.interceptors.request.use(
......
// 解析时间
export function dateformat(time, fmt) {
let o = {
"M+": time.getMonth() + 1, //月份
"d+": time.getDate(), //日
"h+": time.getHours(), //小时
"m+": time.getMinutes(), //分
"s+": time.getSeconds(), //秒
"q+": Math.floor((time.getMonth() + 3) / 3), //季度
"S": time.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (time.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
}
return fmt;
let o = {
"M+": time.getMonth() + 1, //月份
"d+": time.getDate(), //日
"h+": time.getHours(), //小时
"m+": time.getMinutes(), //分
"s+": time.getSeconds(), //秒
"q+": Math.floor((time.getMonth() + 3) / 3), //季度
"S": time.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (time.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
}
return fmt;
}
export const __VERSION = '1.1';
......@@ -21,6 +21,7 @@
<div class="step-body">
<base-config
v-if="activeStep == '1'"
:endDate="dueData.endDate"
@submitNext="submitNext"
></base-config>
<center-config
......@@ -57,6 +58,8 @@ import centerConfig from '@/components/active-config/center-config.vue';
import cardConfig from '@/components/active-config/card-config.vue';
import posterConfig from '@/components/active-config/poster-config.vue';
import rewardConfig from '@/components/active-config/reward-config.vue';
import { getRequest } from '@/api/api';
import errMsg from '@/common/js/error';
export default {
name: 'createCompletion',
components: {
......@@ -105,6 +108,12 @@ export default {
hasSet: false
}
],
dueData: {
dueDay: 0, // 即将到期天数
endDate: new Date().getTime(), // 到期时间
isOverdue: 0, // 是否过期,0:未过期,1:已过期
overdueDay: 0 // 过期天数
}
}
},
watch: {
......@@ -116,6 +125,28 @@ export default {
},
methods: {
/**
* 是否过期
*/
judgeDue() {
const that = this;
let para = {};
getRequest('/sharing-core-web/isOverdue', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.dueData=Object.assign({},that.dueData,resData.result)
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 下一步
*/
submitNext() {
......@@ -128,11 +159,13 @@ export default {
*/
submitBack() {
const that = this;
console.log(that.activeStep)
that.activeStep--;
that.stepData[that.activeStep - 1 ].hasSet = false;
}
},
mounted(){
this.judgeDue()
}
}
</script>
<style lang="less" scoped>
......
......@@ -10,15 +10,19 @@
<div class="share-index common-wrap">
<div class="right-content border-box">
<div v-if="canCreate">
<div class="separator-space no-active">
- 当前无进行中的活动,请创建活动,别让业绩白白流失!-
</div>
<active-select></active-select>
<div class="flex-top-wrap">
<div class="separator-space">- 当前无进行中的活动,请创建活动,别让业绩白白流失! -</div>
<div class="alert-wrap" v-if="dueData.isOverdue===0"
><i class="el-icon-warning" ></i>您的分享有礼功能将在 <span class="red">{{dueData.dueDay}}</span> 天后过期,为不影响使用,请及时联系达摩运营经理购买(<span class="red">过期截止时间{{dueData.endDate|dateFilter}}</span></div>
</div>
<active-select :isOverdue="dueData.isOverdue"></active-select>
</div>
<div>
<!-- v-if="!canCreate" -->
<in-progress-active></in-progress-active>
<in-progress-active v-if="!canCreate" :dueData="dueData"></in-progress-active>
<!-- <div class="separator-space">- 当前有未开始的活动 -</div>
<will-start-active></will-start-active> -->
......@@ -36,6 +40,7 @@ import finishedActive from '@/components/active/finished-active.vue';
// import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { getRequest } from '@/api/api';
import moment from 'moment'
export default {
name: 'share-index',
components: {
......@@ -46,11 +51,39 @@ export default {
},
data() {
return {
canCreate: true
canCreate: true,
dueData: {
dueDay: 0, // 即将到期天数
endDate: new Date().getTime(), // 到期时间
isOverdue: 0, // 是否过期,0:未过期,1:已过期
overdueDay: 0 // 过期天数
}
};
},
methods: {
/**
* 是否过期
*/
judgeDue() {
const that = this;
let para = {};
getRequest('/sharing-core-web/isOverdue', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.dueData=Object.assign({},that.dueData,resData.result)
return false;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 是否可以创建活动
*/
judgeCreate() {
......@@ -102,19 +135,34 @@ export default {
beforeMount() {
const that = this;
that.judgePay();
that.judgeDue();
},
mounted() {
const that = this;
that.judgeCreate();
},
filters: {
dateFilter(v){
return moment(v).format('YYYY年MM月DD日')
}
}
};
</script>
<style lang="less" scoped>
.share-index {
.red{
color:red;
}
.flex-top-wrap{
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
width: 100%;
height: 40px;
margin-bottom: 9px;
.separator-space {
width: 100%;
height: 60px;
line-height: 60px;
margin-right: 19px;
line-height: 40px;
text-align: center;
font-size: 14px;
color: #909399;
......@@ -124,5 +172,20 @@ export default {
line-height: 20px;
}
}
.alert-wrap{
// width:774px;
height:40px;
padding:0 7px 0 17px;
line-height:40px;
background:#FFFBE6;
border-radius:4px;
border:1pxsolid#FFE58F;
color:#606266;
font-size:14px;
.el-icon-warning{
margin-right:9px;
color:#FAAD14;
}
}
}
</style>
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