Commit ad2cba02 by 李嘉林

热区加判断

parent 0f26750f
...@@ -152,6 +152,7 @@ Component({ ...@@ -152,6 +152,7 @@ Component({
.selectAll(".imgBox") .selectAll(".imgBox")
.boundingClientRect(rect => { .boundingClientRect(rect => {
rect && rect.map((item, index) => { rect && rect.map((item, index) => {
if (imgList[index].imgWidth) {
Math.ceil(item.width); Math.ceil(item.width);
console.log('imgBox-width', item, imgList[index]); console.log('imgBox-width', item, imgList[index]);
let ratio = Math.ceil(item.width) / imgList[index].imgWidth; let ratio = Math.ceil(item.width) / imgList[index].imgWidth;
...@@ -163,6 +164,7 @@ Component({ ...@@ -163,6 +164,7 @@ Component({
item1.renderLeft = item1.left * ratio; item1.renderLeft = item1.left * ratio;
}) })
console.log('imgList', imgList) console.log('imgList', imgList)
}
}) })
_this.setData({ _this.setData({
imgList, imgList,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment