首页,我的 写扫码点餐之前提交1.0.0

This commit is contained in:
wwz
2025-02-13 16:49:13 +08:00
parent 6cea5aeb42
commit f2513ef13a
48 changed files with 7757 additions and 514 deletions

View File

@@ -32,7 +32,10 @@
<script setup>
import {
defineProps
defineProps,
onBeforeUnmount,
reactive,
defineExpose
} from 'vue';
const props = defineProps({
bannervo: {
@@ -48,21 +51,18 @@
}] //
}
});
const timersetIntervalnewVal = () => {
this.timersetInterval = setInterval(() => {
this.endMove()
}, 2000);
}
const startMove = () => {
this.slideNote.x = e.changedTouches[0] ? e.changedTouches[0].pageX : 0;
this.slideNote.y = e.changedTouches[0] ? e.changedTouches[0].pageY : 0;
const slideNote = reactive({
x: 0,
y: 0
})
const startMove = (e) => {
slideNote.x = e.changedTouches[0] ? e.changedTouches[0].pageX : 0;
}
const endMove = (e) => {
// this.itemStyless = []
var newList = JSON.parse(JSON.stringify(this.itemStyle))
// console.log(newList)
// if ((e.changedTouches[0].pageX - this.slideNote.x) < 0) {
var newList = props.itemStyle
console.log(newList)
// if ((e.changedTouches[0].pageX - slideNote.x) < 0) {
// 向左滑动
var last = [newList.pop()]
newList = last.concat(newList)
@@ -71,10 +71,36 @@
// newList.push(newList[0])
// newList.splice(0, 1)
// }
this.$emit('changeValue', newList);
this.$forceUpdate();
console.log(newList)
// this.$emit('changeValue', newList);
}
// 定义定时器变量
let timer = null;
// 启动定时器
const startTimer = () => {
timer = setInterval(() => {
endMove()
}, 1000);
};
// 定义清除定时器的方法
const clearTimer = () => {
if (timer) {
clearInterval(timer);
timer = null;
}
};
// 在组件销毁前清除定时器
onBeforeUnmount(() => {
clearTimer();
});
// 向外暴露清除定时器和启动定时器的方法
defineExpose({
clearTimer,
startTimer
});
// 初始启动定时器
// startTimer();
</script>
<style scoped lang="scss">