|
@@ -5,14 +5,30 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
-
|
|
|
+ winWidth: 0,
|
|
|
+ winHeight: 0,
|
|
|
+ currentTab: 0,
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
+ var that = this;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前设备的宽高
|
|
|
+ */
|
|
|
+ wx.getSystemInfo( {
|
|
|
+
|
|
|
+ success: function( res ) {
|
|
|
+ that.setData( {
|
|
|
+ winWidth: res.windowWidth,
|
|
|
+ winHeight: res.windowHeight
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -62,5 +78,24 @@ Page({
|
|
|
*/
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
- }
|
|
|
-})
|
|
|
+ },
|
|
|
+ swichNav: function( e ) {
|
|
|
+
|
|
|
+ var that = this;
|
|
|
+
|
|
|
+ if( this.data.currentTab === e.target.dataset.current ) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ that.setData( {
|
|
|
+ currentTab: e.target.dataset.current
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ bindChange: function( e ) {
|
|
|
+
|
|
|
+ var that = this;
|
|
|
+ that.setData( { currentTab: e.detail.current });
|
|
|
+
|
|
|
+ },
|
|
|
+})
|