-
+
+
![]()
- {{preName(item.name)}} {{item.userScore}}分 第{{(index % listData.length)+1}}名;
+ {{preName(item.name)}} {{item.userScore}}分 第{{item?.sort}}名;
@@ -215,6 +215,7 @@
perScore: 0
},
listData: [],
+ orderListData: [],
// 餐品热度数据:包含名称和热度值
valList: [],
// 轮播数据:支持图片和视频
@@ -239,11 +240,12 @@
},
computed: {
animationCss() {
- return this.listData && this.listData.length > 0 ? {
+ return this.orderListData && this.orderListData.length > 0 ? {
// animationName: 'scroll',
- animationDuration: (this.listData.length * 3 < 10 ? 10 : this.listData.length * 3) + 's',
+ animationDuration: (this.orderListData.length * 3 < 10 ? 10 : this.orderListData.length * 3) + 's',
animationTimingFunction: 'linear',
- animationIterationCount: 'infinite'
+ // animationIterationCount: 'infinite',
+ animationFillMode: 'forwards'
} : {}
}
},
@@ -338,6 +340,7 @@
_this.mealTimeStart = res.data.mealTimeStart;
_this.mealTimeEnd = res.data.mealTimeEnd;
_this.listData = res.data.userScoreInfos || [];
+ _this.orderListData = res.data.userOrderInfos || [];
const maxWeight = res.data.foodSortInfos && res.data.foodSortInfos.length > 0 ? res.data.foodSortInfos[0].foodWeight || 0 : 0;
_this.valList = (res.data.foodSortInfos || []).map((item) => {
item['weightPoint'] = maxWeight === 0 ? 0 : parseFloat(((item?.foodWeight || 0) / maxWeight * 100).toFixed(2));
@@ -417,17 +420,16 @@
const currentItem = this.swiperList[currentIndex];
if (this.swiperList[currentIndex !== 0 ? currentIndex - 1 : this.swiperList.length - 1].type === '2') {
const refD = this.$refs[`videRef${currentIndex !== 0 ? currentIndex - 1 : this.swiperList.length - 1}`];
- if (refD.length > 0 && refD[0]) {
+ if (refD && refD.length > 0 && refD[0]) {
refD[0].currentTime = 0;
refD[0].pause();
}
const refD1 = this.$refs[`videRef${currentIndex === this.swiperList.length ? this.swiperList.length - 1 : currentIndex + 1 }`];
- if (refD1.length > 0 && refD1[0]) {
+ if (refD1 && refD1.length > 0 && refD1[0]) {
refD1[0].currentTime = 0;
refD1[0].pause();
}
}
- console.log('currentItem', JSON.stringify(currentItem));
if (currentItem.type === '1') {
// 图片:按设定时长自动切换
this.swiperTimer = setTimeout(() => {
@@ -936,7 +938,7 @@
transform: translateX(0);
}
100% {
- transform: translateX(-50%); /* 移动一半距离,因为复制了一份 */
+ transform: translateX(-100%); /* 移动一半距离,因为复制了一份 */
}
}