Commit ad2cba02 by 李嘉林

热区加判断

parent 0f26750f
......@@ -152,17 +152,19 @@ Component({
.selectAll(".imgBox")
.boundingClientRect(rect => {
rect && rect.map((item, index) => {
Math.ceil(item.width);
console.log('imgBox-width', item, imgList[index]);
let ratio = Math.ceil(item.width) / imgList[index].imgWidth;
console.log('ratio', ratio)
imgList[index].hotList && imgList[index].hotList.forEach((item1, index1) => {
item1.renderWidth = item1.width * ratio;
item1.renderHeight = item1.height * ratio;
item1.renderTop = item1.top * ratio;
item1.renderLeft = item1.left * ratio;
})
console.log('imgList', imgList)
if (imgList[index].imgWidth) {
Math.ceil(item.width);
console.log('imgBox-width', item, imgList[index]);
let ratio = Math.ceil(item.width) / imgList[index].imgWidth;
console.log('ratio', ratio)
imgList[index].hotList && imgList[index].hotList.forEach((item1, index1) => {
item1.renderWidth = item1.width * ratio;
item1.renderHeight = item1.height * ratio;
item1.renderTop = item1.top * ratio;
item1.renderLeft = item1.left * ratio;
})
console.log('imgList', imgList)
}
})
_this.setData({
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