1.修改走马灯从右侧进入,且速度恒定。

2.排名屏添加文件mqtt
This commit is contained in:
2026-03-20 18:21:27 +08:00
parent 9a838a3ef1
commit e8b30a8f7c
2 changed files with 26 additions and 10 deletions
+24 -9
View File
@@ -237,12 +237,13 @@
},
created() {
this.initMttqF()
this.initMttqFile()
},
computed: {
animationCss() {
return this.orderListData && this.orderListData.length > 0 ? {
// animationName: 'scroll',
animationDuration: (this.orderListData.length * 3 < 10 ? 10 : this.orderListData.length * 3) + 's',
animationDuration: (this.orderListData.length === 0 ? 0 : 45) + 's',
animationTimingFunction: 'linear',
// animationIterationCount: 'infinite',
animationFillMode: 'forwards'
@@ -251,15 +252,19 @@
},
mounted() {
callBackMqttMessage((data) => {
console.log('loadData===', data)
if (data.message?.type === 'rankingFileUpdate') {
this.initSwiperData()
console.log('loadData=============='+data.topic+'==='+dayjs().format('YYYY-MM-DD HH:mm:ss'), data)
if (data.topic === 'yx/device/rankingScreen/needUpdate') {
// if (data.message?.type === 'rankingFileUpdate') {
// this.initSwiperData()
// } else {
this.initData(data.message?.userId);
// }
} else {
this.initData();
this.initSwiperData()
}
})
this.initTime();
this.initData();
this.initData('');
this.initSwiperData();
// this.$nextTick(() => {
// this.initSwiper();
@@ -288,6 +293,15 @@
console.log(err)
})
},
initMttqFile() {
initMqtt('deviceId-' + Math.random().toString(16).substring(2, 8),'yx/device/rankingFile/needUpdate','led', {username: process.env.VUE_APP_LED_MQTT_USERNAME, password: process.env.VUE_APP_LED_MQTT_PASSWORD, head: 'wss'})
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
},
preName(name) {
if (!name) return;
if (name === '匿名用户') return name
@@ -327,10 +341,10 @@
console.log(err)
})
},
initData() {
initData(userId) {
let _this = this;
this.orderListData = [];
httpRequest("GET", this.url + 'terminal/neglect/large-screen/ranking' , {}, {"authorization": "57ee87183f2a4fa59683ec9ef41c8f5d"}).then(function (res) {
httpRequest("GET", this.url + 'terminal/neglect/large-screen/ranking' , {userId}, {"authorization": "57ee87183f2a4fa59683ec9ef41c8f5d"}).then(function (res) {
if (res?.code === '00000') {
_this.dinnerType = res.data.dinnerType;
_this.dataOverview = res.data.dataOverview || {
@@ -921,6 +935,7 @@
.scroll-content {
display: inline-block;
width: 100%;
div {
display: flex;
@@ -936,7 +951,7 @@
@keyframes scroll {
0% {
transform: translateX(0);
transform: translateX(100%);
}
100% {
transform: translateX(-100%); /* 移动一半距离,因为复制了一份 */
+2 -1
View File
@@ -22,6 +22,7 @@
import RowDom from "./components/rowDom.vue";
import {callBackMqttMessage, initMqtt} from "@/utils/mqtt";
import {httpRequest} from "@/XMLHttpRequest";
import dayjs from "dayjs";
export default {
name: "led",
@@ -216,7 +217,7 @@ export default {
},
mounted() {
callBackMqttMessage((data) => {
console.log(data)
console.log(`data============${dayjs().format('YYYY-MM-DD HH:mm:ss')}`, data);
this.getInfoByDeviceId(data?.message || {});
})
},