|
@@ -15,6 +15,7 @@ Page({
|
|
|
height: app.globalData.height * 2 + 20,
|
|
|
},
|
|
|
currentTab: 0,
|
|
|
+ sHeight:'100vh',
|
|
|
policyPageIndex: 0,
|
|
|
policyPageSize: 6,
|
|
|
policyHasMore: true,
|
|
@@ -46,6 +47,25 @@ Page({
|
|
|
that.setData({
|
|
|
currentTab: e.detail.current
|
|
|
});
|
|
|
+
|
|
|
+ if(this.data.currentTab === 0){
|
|
|
+ console.log(this.data.currentTab);
|
|
|
+ let query = wx.createSelectorQuery();
|
|
|
+ query.select('#policy').boundingClientRect(function (rect) {
|
|
|
+ that.setData({
|
|
|
+ sHeight: 180*(that.data.policyList.length)+'rpx'
|
|
|
+ })
|
|
|
+ }).exec();
|
|
|
+ }else {
|
|
|
+ console.log(this.data.currentTab);
|
|
|
+ let query = wx.createSelectorQuery();
|
|
|
+ query.select('#unscramble').boundingClientRect(function (rect) {
|
|
|
+ that.setData({
|
|
|
+ sHeight: 180*(that.data.unscrambleList.length)+'rpx'
|
|
|
+ })
|
|
|
+ }).exec();
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
policyListDetail: function (e) {
|
|
@@ -74,13 +94,33 @@ Page({
|
|
|
},*/
|
|
|
//点击切换
|
|
|
clickTab: function (e) {
|
|
|
+ console.log('点击切换');
|
|
|
var that = this;
|
|
|
if (this.data.currentTab === e.target.dataset.current) {
|
|
|
return false;
|
|
|
} else {
|
|
|
that.setData({
|
|
|
currentTab: e.target.dataset.current
|
|
|
- })
|
|
|
+ });
|
|
|
+
|
|
|
+ if(this.data.currentTab === 0){
|
|
|
+ console.log(this.data.currentTab);
|
|
|
+ let query = wx.createSelectorQuery();
|
|
|
+ query.select('#policy').boundingClientRect(function (rect) {
|
|
|
+ that.setData({
|
|
|
+ sHeight: 180*(that.data.policyList.length)+'rpx'
|
|
|
+ })
|
|
|
+ }).exec();
|
|
|
+ }else {
|
|
|
+ console.log(this.data.currentTab);
|
|
|
+ let query = wx.createSelectorQuery();
|
|
|
+ query.select('#unscramble').boundingClientRect(function (rect) {
|
|
|
+ that.setData({
|
|
|
+ sHeight: 180*(that.data.unscrambleList.length)+'rpx'
|
|
|
+ })
|
|
|
+ }).exec();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
// 切换菜单
|
|
@@ -133,6 +173,15 @@ Page({
|
|
|
console.log(newList);
|
|
|
console.log(res.data.total);
|
|
|
let flag = this.data.policyPageIndex * this.data.policyPageSize < res.data.total;
|
|
|
+
|
|
|
+ let query = wx.createSelectorQuery();
|
|
|
+ let that = this;
|
|
|
+ query.select('#policy').boundingClientRect(function (rect) {
|
|
|
+ that.setData({
|
|
|
+ sHeight: 180*(newList.length)+'rpx'
|
|
|
+ })
|
|
|
+ }).exec();
|
|
|
+
|
|
|
this.setData({
|
|
|
policyList: newList,
|
|
|
policyHasMore: flag,
|
|
@@ -161,6 +210,15 @@ Page({
|
|
|
console.log(newList);
|
|
|
console.log(res.data.total);
|
|
|
let flag = this.data.unscramblePageIndex * this.data.unscramblePageSize < res.data.total;
|
|
|
+
|
|
|
+ let query = wx.createSelectorQuery();
|
|
|
+ let that = this;
|
|
|
+ query.select('#unscramble').boundingClientRect(function (rect) {
|
|
|
+ that.setData({
|
|
|
+ sHeight: 180*(newList.length)+'rpx'
|
|
|
+ })
|
|
|
+ }).exec();
|
|
|
+
|
|
|
this.setData({
|
|
|
unscrambleList: newList,
|
|
|
unscrambleHasMore: flag,
|
|
@@ -193,6 +251,15 @@ Page({
|
|
|
console.log(newList);
|
|
|
console.log(res.data.total);
|
|
|
let flag = this.data.policyPageIndex * this.data.policyPageSize < res.data.total;
|
|
|
+
|
|
|
+ let query = wx.createSelectorQuery();
|
|
|
+ let that = this;
|
|
|
+ query.select('#policy').boundingClientRect(function (rect) {
|
|
|
+ that.setData({
|
|
|
+ sHeight: 180*(newList.length)+'rpx'
|
|
|
+ })
|
|
|
+ }).exec();
|
|
|
+
|
|
|
this.setData({
|
|
|
policyList: newList,
|
|
|
policyHasMore: flag,
|