|
|
|
@ -49,6 +49,8 @@ Page({ |
|
|
|
lon: null, |
|
|
|
lat: null, |
|
|
|
scrollLeft: 0, |
|
|
|
scrollDom: "", |
|
|
|
scrollDomLeft:0, |
|
|
|
windowWidth: 375, |
|
|
|
prod_phone: "", |
|
|
|
}, |
|
|
|
@ -128,10 +130,15 @@ Page({ |
|
|
|
console.log(rect) |
|
|
|
if (rect) { |
|
|
|
let targetScrollLeft = rect.left + (rect.width / 2) - (windowWidth / 2)+_this.data.scrollLeft; |
|
|
|
console.log(e, targetScrollLeft) |
|
|
|
console.log((rect.width / 2) - (windowWidth / 2)) |
|
|
|
this.setData({ |
|
|
|
scrollLeft: targetScrollLeft |
|
|
|
scrollLeft: targetScrollLeft||0, |
|
|
|
scrollDomLeft: (rect.width / 2) - (windowWidth / 2), |
|
|
|
|
|
|
|
}); |
|
|
|
this.setData({ |
|
|
|
scrollDom: domId, |
|
|
|
}) |
|
|
|
} |
|
|
|
}).exec() |
|
|
|
|
|
|
|
|