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,6 +14,7 @@ import activeSelect from '@/components/active/active-select.vue';
<template>
<div class="active-select border-box">
<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">
......@@ -211,6 +212,13 @@ import activeSelect from '@/components/active/active-select.vue';
>前往活动配置<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>
</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 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,10 +360,20 @@ 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;
height: 40px;
margin-bottom: 9px;
.separator-space {
margin-right: 19px;
line-height: 40px;
text-align: center;
font-size: 14px;
color: #909399;
......@@ -347,6 +382,22 @@ export default {
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 {
width: 100%;
......
......@@ -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(
......
......@@ -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 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></active-select>
<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 {
.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;
height: 40px;
margin-bottom: 9px;
.separator-space {
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