|
@@ -7,6 +7,7 @@ Page({
|
|
data: {
|
|
data: {
|
|
url:'../../images/timg.jpg',
|
|
url:'../../images/timg.jpg',
|
|
motto: '',
|
|
motto: '',
|
|
|
|
+ currentTab: 0,
|
|
userInfo: {},
|
|
userInfo: {},
|
|
hasUserInfo: false,
|
|
hasUserInfo: false,
|
|
canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
|
canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
|
@@ -167,16 +168,16 @@ Page({
|
|
computeScrollViewHeight() {
|
|
computeScrollViewHeight() {
|
|
var that = this
|
|
var that = this
|
|
let query = wx.createSelectorQuery().in(that)
|
|
let query = wx.createSelectorQuery().in(that)
|
|
- query.select('.userinfo').boundingClientRect()
|
|
|
|
- query.select('.search').boundingClientRect()
|
|
|
|
|
|
+ // query.select('.userinfo').boundingClientRect()
|
|
|
|
+ // query.select('.search').boundingClientRect()
|
|
query.select('.news').boundingClientRect()
|
|
query.select('.news').boundingClientRect()
|
|
query.exec(res => {
|
|
query.exec(res => {
|
|
- let topHeight = res[0].height
|
|
|
|
- let searchHeight = res[1].height
|
|
|
|
- let titleHeight = res[2].height
|
|
|
|
|
|
+ // let topHeight = res[0].height
|
|
|
|
+ // let searchHeight = res[1].height
|
|
|
|
+ let titleHeight = res[0].height
|
|
let windowHeight = wx.getSystemInfoSync().windowHeight
|
|
let windowHeight = wx.getSystemInfoSync().windowHeight
|
|
let windowWidth = wx.getSystemInfoSync().windowWidth
|
|
let windowWidth = wx.getSystemInfoSync().windowWidth
|
|
- let height = windowHeight - topHeight - searchHeight - titleHeight
|
|
|
|
|
|
+ let height = windowHeight - titleHeight
|
|
let ratio = 750 / windowWidth
|
|
let ratio = 750 / windowWidth
|
|
let scrollHeight = height * ratio + 20
|
|
let scrollHeight = height * ratio + 20
|
|
that.setData({ scrollHeight: scrollHeight})
|
|
that.setData({ scrollHeight: scrollHeight})
|
|
@@ -195,6 +196,18 @@ Page({
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url:"../news/news"
|
|
url:"../news/news"
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
+ swichNav: function(e) {
|
|
|
|
+ var that = this;
|
|
|
|
+ if (this.data.currentTab === e.target.dataset.current) {
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ that.setData({
|
|
|
|
+ currentTab: e.target.dataset.current
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
getUserInfo: function(e) {
|
|
getUserInfo: function(e) {
|
|
console.log(e)
|
|
console.log(e)
|