Skip to content

Commit

Permalink
docs: 限时特惠活动结束
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Jan 1, 2025
1 parent 1bff6f4 commit c153213
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 136 deletions.
68 changes: 0 additions & 68 deletions docs/03.JS版本/01.JS版本.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,6 @@ article: false

`JS`版本让精简版更加精简,让代码编写更加顺手,让项目交付更加快速!

### 限时特惠活动

<p id="js-time" style="color: red" />

1. `JS`版本与`Max`版本的组合限时特惠,总价仅需`¥300`
2.[解答微信群](https://pure-admin.cn/pages/service/#%E8%A7%A3%E7%AD%94%E5%BE%AE%E4%BF%A1%E7%BE%A4) 仅需补差价即可

<script>
function padZero(num) {
return num < 10 ? '0' + num : num;
}

function updateCountdown(isServer) {
const now = new Date();
const targetDate = new Date('2025-01-01T00:00:00');
const diff = targetDate - now;

if (diff <= 0) {
if (!isServer) {
document.getElementById('js-time').textContent = "活动已结束";
} else {
console.log("活动已结束");
}
clearInterval(intervalId);
return;
}

const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);

if (!isServer) {
const element = document.getElementById('js-time');
if (element) {
element.textContent = `距活动结束还剩 ${padZero(days)}${padZero(hours)} 小时 ${padZero(minutes)} 分钟 ${padZero(seconds)}`;
}
} else {
console.log(`距活动结束还剩 ${padZero(days)}${padZero(hours)} 小时 ${padZero(minutes)} 分钟 ${padZero(seconds)}`);
}
}

const isServer = typeof window === 'undefined';

let intervalId = null;
if (!isServer) {
intervalId = setInterval(() => updateCountdown(isServer), 1000);
} else {
updateCountdown(isServer);
}
</script>

### 价格

永久价格:`¥268`
Expand Down Expand Up @@ -109,19 +57,3 @@ if (!isServer) {
<br />

![img](~@alias/img/js/6.jpg)

<style scoped>
.money-deleted {
position: relative;
text-decoration: none;
}
.money-deleted::before {
content: "";
position: absolute;
left: 0;
bottom: 35%;
width: 100%;
height: 1px;
background-color: black;
}
</style>
68 changes: 0 additions & 68 deletions docs/04.Max版本/01.Max版本.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,58 +26,6 @@ article: false
日历排班
:::

### 限时特惠活动

<p id="max-time" style="color: red" />

1. `JS`版本与`Max`版本的组合限时特惠,总价仅需`¥300`
2.[解答微信群](https://pure-admin.cn/pages/service/#%E8%A7%A3%E7%AD%94%E5%BE%AE%E4%BF%A1%E7%BE%A4) 仅需补差价即可

<script>
function padZero(num) {
return num < 10 ? '0' + num : num;
}

function updateCountdown(isServer) {
const now = new Date();
const targetDate = new Date('2025-01-01T00:00:00');
const diff = targetDate - now;

if (diff <= 0) {
if (!isServer) {
document.getElementById('max-time').textContent = "活动已结束";
} else {
console.log("活动已结束");
}
clearInterval(intervalId);
return;
}

const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);

if (!isServer) {
const element = document.getElementById('max-time');
if (element) {
element.textContent = `距活动结束还剩 ${padZero(days)}${padZero(hours)} 小时 ${padZero(minutes)} 分钟 ${padZero(seconds)}`;
}
} else {
console.log(`距活动结束还剩 ${padZero(days)}${padZero(hours)} 小时 ${padZero(minutes)} 分钟 ${padZero(seconds)}`);
}
}

const isServer = typeof window === 'undefined';

let intervalId = null;
if (!isServer) {
intervalId = setInterval(() => updateCountdown(isServer), 1000);
} else {
updateCountdown(isServer);
}
</script>

### 价格

<p style="color:red;">后续max版本不再单独售卖</p>
Expand Down Expand Up @@ -155,19 +103,3 @@ if (!isServer) {
<br />

![img](~@alias/img/max/overall-style/2.jpg)

<style scoped>
.money-deleted {
position: relative;
text-decoration: none;
}
.money-deleted::before {
content: "";
position: absolute;
left: 0;
bottom: 35%;
width: 100%;
height: 1px;
background-color: black;
}
</style>

0 comments on commit c153213

Please sign in to comment.