|
@@ -0,0 +1,51 @@
|
|
|
+// components/topbar.js
|
|
|
+Component({
|
|
|
+ /**
|
|
|
+ * 组件的属性列表
|
|
|
+ */
|
|
|
+ properties: {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 组件的初始数据
|
|
|
+ */
|
|
|
+ data: {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ attached: function() {
|
|
|
+ var url =getCurrentPages()[getCurrentPages().length-1].route
|
|
|
+
|
|
|
+ let dwObj = wx.getMenuButtonBoundingClientRect()
|
|
|
+ let navHeight_ = (dwObj.top + dwObj.height)
|
|
|
+ let capsuleTop_ = dwObj.top
|
|
|
+ let windowHeight = wx.getSystemInfoSync().windowHeight
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ navHeight: navHeight_,
|
|
|
+ capsuleTop:capsuleTop_,
|
|
|
+ capHeight: dwObj.height,
|
|
|
+ bodyHeight: windowHeight - navHeight_,
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 组件的方法列表
|
|
|
+ */
|
|
|
+ methods: {
|
|
|
+ handleBack() {
|
|
|
+ let routeLen = getCurrentPages().length;
|
|
|
+ if (routeLen == 1) {
|
|
|
+ wx.reLaunch({
|
|
|
+ url: '/pages/welfareMall/index/index',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const url =getCurrentPages()[getCurrentPages().length-2].route
|
|
|
+ wx.switchTab({
|
|
|
+ url: "/" + url,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|