This commit is contained in:
Iruka 2025-02-20 17:46:20 +08:00
parent e791a00f58
commit b867eb5cf3

View File

@ -158,7 +158,8 @@
:show-arrow="false" v-for="(item, index) in dc.wo" :open="woloaded && woloaded[index].open"
v-show="(dc.forward && item.isOpened) || (!dc.forward && !item.isHidden)">
<template v-slot:title>
<view class="sf-title fixed" @click.stop="handleCollapseClick(index)">
<view class="sf-title fixed" @click.stop="handleCollapseClick($event, index)"
:ref="`item${index}`">
<view class="iconfont icon-diefa icon"></view>
<view class="text" style="min-width: 25px;">
{{ item.showName || item.branchCanalCode }}
@ -398,10 +399,13 @@
v-if="dc.dataObj[child.dataKey].btnObj.open2.work">
<span
v-if="dc.countdownObj[`${child.dataKey}_open2`]">
({{ dc.countdownObj[`${child.dataKey}_open2`] }})
({{
dc.countdownObj[`${child.dataKey}_open2`]
}})
</span>
<span v-else class="timeout">
{{ dc.timeoutObj[`${child.dataKey}_open2`] }}
{{ dc.timeoutObj[`${child.dataKey}_open2`]
}}
</span>
</span>
<span class="name"
@ -445,10 +449,13 @@
v-if="dc.dataObj[child.dataKey].btnObj.open4.work">
<span
v-if="dc.countdownObj[`${child.dataKey}_open4`]">
({{ dc.countdownObj[`${child.dataKey}_open4`] }})
({{
dc.countdownObj[`${child.dataKey}_open4`]
}})
</span>
<span v-else class="timeout">
{{ dc.timeoutObj[`${child.dataKey}_open4`] }}
{{ dc.timeoutObj[`${child.dataKey}_open4`]
}}
</span>
</span>
<span class="name"
@ -762,13 +769,13 @@
getApp().mqttSubscribes(e);
},
//
handleCollapseClick(index) {
handleCollapseClick(e, index) {
if (!this.woloaded) {
let woloaded = {};
this.dc.wo.forEach((_item, _index) => {
let time = 10;
let time = 20;
if (_item.children && _item.children.length) {
time = _item.children.length * 10
time = _item.children.length * 20
}
woloaded[_index] = {
loaded: false,
@ -791,13 +798,18 @@
this.woloaded[index].loaded = true;
}
this.woloaded[index].open = true;
this.$nextTick(() => {
setTimeout(() => {
this.$refs.collapseRef.resize();
this.$nextTick(() => {
uni.hideLoading();
this.scrollToCollapseItem(index);
}, this.woloaded[index].time)
uni.pageScrollTo({
scrollTop: e.touches[0].pageY - 150,
duration: 50 //
});
});
// this.scrollToCollapseItem(index);
}, this.woloaded[index].time)
},
//
scrollToCollapseItem(index) {