<view class="flex-center">
<text v-if="i.showTip.startsWith('敬请期待')">{
{i.showTip}}</text>
<text v-if="i.showTip.startsWith('即将开售')" style="color: #fff;"> 即将开售
{
{i.showtime}}</text>
</view>
// 初始化时间
formatTime(prellTime) {
let date = new Date().getTime();
let lefttime = prellTime - date,
lefth = Math.floor(lefttime / (1000 * 60 * 60)), //计算小时数
leftm = Math.floor(lefttime / (1000 * 60) % 60), //计算分钟数
lefts = Math.floor(lefttime / 1000 % 60); //计算秒数
//返回倒计时的字符串
return lefttime >= 0 ? lefth + ":" + leftm + ":" + lefts : null;
},
showTime() {
this.timer = setInterval(() => {
this.list.forEach(i => {
// startsWith()方法用来判断当前字符串是否是以