Commit 4f057847 authored by zhengke's avatar zhengke

Merge branch 'master' into 1.4.0

parents 7f9ca70a 1f4d91d5
<template>
<div class="InsufficientDate-form animate__animated animate__fadeInDown">
<div class="row items-center">
<el-icon color="#564bec">
<IconAttention theme="multi-color" size="48" :fill="['#564bec' ,'#564bec' ,'#FFF' ,'#43CCF8']"></IconAttention>
</el-icon>
<div class="col q-pl-md q-pr-lg">
<span class="fz14 q-pl-md PingFangSC">您好,您的云服务将于{{userInfo.expire}}正式到期,截止目前仅剩{{EndDays}}天,到期后将无法正常登录使用、为了保证正常使用,请及时续费!如果已启动付费流程,请忽略此消息。</span>
<a class="fz14 PingFangSC cursor-pointer" @click="goRenew">立即续费→</a>
</div>
<span class="close-btn cursor-pointer column items-center flex-center"
@click.stop="Off"><IconClose :size="16"></IconClose></span>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, reactive } from "vue";
import { useRouter } from "vue-router";
import { useUserStore } from "@/store";
import { storeToRefs } from "pinia";
import { openNewBlank, dateDiffer } from "@/utils/common";
const router = useRouter();
const useUser = useUserStore();
const { userInfo } = storeToRefs(useUser);
const props = defineProps({
DetaTem:{
type: Boolean,
default: false,
},
Details:{
type: Object,
default: {},
}
})
const emit = defineEmits<{
(event: 'close'): void,
(event: 'scanCode'): void,
}>()
if(router.currentRoute.value.path=='/p/show') emit('close')
const EndDays = dateDiffer(userInfo.value.expire)
const Off = () => {
emit('close')
}
const goRenew = () =>{
router.push({
path:`/p/show`
})
}
</script>
<style lang="scss" scoped>
.InsufficientDate-form{
position: fixed;
left: 0;
top: 0;
right: 0;
background: #dedcff;
border-radius: 10px;
padding: 10px 20px;
z-index: 9;
}
.close-btn{
text-align: center;
color: black;
border-radius: 50%;
z-index: 3;
}
.close-btn:hover{
color:$themeColor;
}
</style>
\ No newline at end of file
......@@ -104,21 +104,24 @@
<!-- 创建设计 -->
<temDesign :addTem="addVisible" @close="addVisible=false"/>
<OrderReview v-if="orderVisible" :show-person="isShowPerson" :default-type="isShowPerson?1:2" @close="()=>orderVisible=false"></OrderReview>
<!-- 关注 -->
<follow v-show="isPublicAccount" :show="isPublicAccount" @close="isPublicAccount=false"
@success="isPublicAccount=false,getInfo()"></follow>
<InsufficientDate v-if="EndDays<30&&!userInfo.OffEndDaysTisp" @close="closeEndDays"></InsufficientDate>
</template>
<script lang="ts" setup>
import { ref, reactive } from "vue";
import { useUserStore } from "@/store";
import { storeToRefs } from "pinia";
import { useRouter } from "vue-router";
import { openNewBlank } from "@/utils/common";
import { openNewBlank, dateDiffer } from "@/utils/common";
import temDesign from "@/components/home/temDesign.vue";
import { EntMemberRight, ENT_USER_THEME, FreeMemberRight, PersonMemberRight, VIP_USER_THEME } from "@/configs/customer";
import OrderReview from '@/views/components/Order/Review.vue'
import UserServices from "@/services/UserService";
import { ApiResult } from "@/configs/axios";
import follow from "@/components/home/follow.vue";
import InsufficientDate from "./InsufficientDate.vue";
const props = defineProps({
size: {
......@@ -159,6 +162,13 @@ const TravelDesign = ref({} as any)
const personalInfor = ref({} as any)
const EndDays = dateDiffer(userInfo.value.expire)
// 关闭到期提示
const closeEndDays = () =>{
userInfo.value.OffEndDaysTisp = true
}
const goDesNorm = () => {
openNewBlank('/d')
}
......
......@@ -90,14 +90,17 @@ export const getHtmlPlainText = (html_str:string) => {
}
}
// 计算距离当前多少天
export const getDaysBetween = (date1:any, date2:any) => {
const ONE_DAY = 1000 * 60 * 60 * 24; // 一天的毫秒数
const date1Time = date1.getTime(); // 获取时间戳
const date2Time = date2.getTime();
const difference = Math.abs(date1Time - date2Time); // 获取时间差
return Math.round(difference / ONE_DAY); // 两个日期之间的天数
// 计算距离天数
export const dateDiffer = (DateEnd: string) => {
//date1结束时间
let date1 = new Date(DateEnd);
//date2当前时间
let date2 = new Date();
date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
date2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
const diff = date1.getTime() - date2.getTime(); //目标时间减去当前时间
const diffDate = diff / (24 * 60 * 60 * 1000); //计算当前时间与结束时间之间相差天数
return diffDate
}
export const dateFormat = (value: number|string|Date = Date.now(), format = 'YYYY-MM-DD HH:mm:ss'): string => {
......
......@@ -331,7 +331,7 @@ const queryObj = reactive({
TemplateType: 0,//0 不限 1模版 2广告
type: 0,
OrderByType: 1,//排序方式
QAuthType: userInfo.value.isp?1:'',//1-免费,2-VIP,3-私有
QAuthType: '',//1-免费,2-VIP,3-私有
})
const queryColor = ref({
DictKey: 'Trip_Template_Color',
......
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