Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-ui

This commit is contained in:
Chopper
2021-08-02 18:45:01 +08:00
13 changed files with 778 additions and 430 deletions

View File

@@ -25,6 +25,7 @@ import ModelForm from '@/components/indexDecorate/ModelForm';
import HoverSearch from '@/components/header/hoverSearch';
import storage from '@/plugins/storage';
import { indexData } from '@/api/index.js';
import {seckillByDay} from '@/api/promotion'
export default {
name: 'Index',
mounted () {
@@ -54,11 +55,28 @@ export default {
if (res.success) {
let dataJson = JSON.parse(res.result.pageData);
this.modelForm = dataJson;
// 秒杀活动不是装修的数据,需要调用接口判断是否有秒杀商品
for (let i = 0; i < dataJson.list.length; i++) {
if (dataJson.list[i].type === 'discountAdvert') {
let seckill = this.getListByDay()
dataJson.list[i].options.list = seckill
break;
}
}
storage.setItem('navList', dataJson.list[1])
this.showNav = true
this.topAdvert = dataJson.list[0];
}
});
},
async getListByDay () { // 当天秒杀活动
const res = await seckillByDay()
console.log(res);
if (res.success && res.result.length) {
return res.result
} else {
return []
}
}
},
components: {

View File

@@ -1,5 +1,5 @@
<template>
<div>
<div class="pay-done">
<BaseHeader></BaseHeader>
<div class="pay-done-box">
<img src="../../assets/images/pay-success.png">
@@ -14,7 +14,10 @@
<script>
export default {
name: 'PayDone'
name: 'PayDone',
mounted () {
document.querySelector('.pay-done').style.height = window.innerHeight + 'px'
}
};
</script>
@@ -23,7 +26,6 @@ export default {
margin: 100px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.pay-btn{

View File

@@ -68,6 +68,10 @@ export default {
nowHour: new Date().getHours() // 当前小时数
}
},
beforeDestroy () {
// 销毁前清除定时器
clearInterval(this.interval);
},
watch: {
currIndex (val) {
clearInterval(this.interval)