Browse Source

feat:轮播图修改

dev
zhaobing’ 1 year ago
parent
commit
71151235b1
  1. 4
      web/client/src/sections/projectGroup/components/AutoRollComponent.jsx
  2. 7
      web/client/src/sections/projectGroup/containers/bigscreen.jsx

4
web/client/src/sections/projectGroup/components/AutoRollComponent.jsx

@ -7,7 +7,7 @@ export default class AutoRollComponent extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.scrollElem = null; this.scrollElem = null;
this.stopscroll = true; this.stopscroll = false;
this.preTop = 0; this.preTop = 0;
this.cloneEle = null; this.cloneEle = null;
this.currentTop = 0; this.currentTop = 0;
@ -57,7 +57,7 @@ export default class AutoRollComponent extends Component {
this.scrollElem.scrollTop = this.marqueesHeight; this.scrollElem.scrollTop = this.marqueesHeight;
this.scrollElem.scrollTop = this.scrollElem.scrollTop + offset; this.scrollElem.scrollTop = this.scrollElem.scrollTop + offset;
} }
}, 40); }, 100);
} }
componentWillUnmount() { componentWillUnmount() {

7
web/client/src/sections/projectGroup/containers/bigscreen.jsx

@ -103,16 +103,13 @@ const Bigscreen = ({ dispatch, actions, user, match, history, clientHeight, grou
setXData([bigD, (bigD - bigD / 5), (bigD - bigD * 2 / 5), (bigD - bigD * 3 / 5), (bigD - bigD * 4 / 5), 0, (bigD - bigD * 4 / 5), (bigD - bigD * 3 / 5), (bigD - bigD * 2 / 5), (bigD - bigD / 5), bigD]) setXData([bigD, (bigD - bigD / 5), (bigD - bigD * 2 / 5), (bigD - bigD * 3 / 5), (bigD - bigD * 4 / 5), 0, (bigD - bigD * 4 / 5), (bigD - bigD * 3 / 5), (bigD - bigD * 2 / 5), (bigD - bigD / 5), bigD])
} }
setBiggest(bigD) setBiggest(bigD)
if (mockData && mockData.length > 3 && mockData.length < 21) {
const newArray = mockData.slice(3)
setAlarmData(newArray)
}
if (mockData && mockData.length > 21) { if (mockData && mockData.length > 21) {
//2020 //2020
const newArray = mockData.slice(0, 20) const newArray = mockData.slice(0, 20)
console.log('newArray',newArray)
setAlarmData(newArray) setAlarmData(newArray)
}else{
setAlarmData(mockData)
} }
}, [mockData]) }, [mockData])

Loading…
Cancel
Save