|
|
@@ -48,9 +48,30 @@ Component({
|
|
|
loading: false,
|
|
|
show: false,
|
|
|
comment: '',
|
|
|
- replyid: 0,
|
|
|
+ replyid: 0
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeShow() {
|
|
|
+ this.setData({
|
|
|
+ show: !this.data.show
|
|
|
+ })
|
|
|
+ if (this.data.quantity && this.data.show) {
|
|
|
+ const query = this.createSelectorQuery()
|
|
|
+ query.select('#CommentNode' + this.data.ownerid).boundingClientRect()
|
|
|
+ query.selectViewport().scrollOffset()
|
|
|
+ query.exec(function (res) {
|
|
|
+ if (res[0].top < 550) return;
|
|
|
+ let scrollTop = res[1].scrollTop + 200
|
|
|
+ wx.pageScrollTo({
|
|
|
+ scrollTop,
|
|
|
+ success() {
|
|
|
+ _Http.scrollTop = scrollTop
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
onInput(e) {
|
|
|
this.setData({
|
|
|
comment: e.detail.value
|