|
- import * as UTIL from '../../utils/util.js';
- import * as API from '../../utils/API.js';
- Page({
- data: {
- //顶部胶囊按钮位置信息rect
- CustomMenuButton: null,
- wrokScrollHeight:0,
- userInfoObj:{} //用户信息
- },
- onLoad: function (options) {
-
- //获取用户信息
- this.getUserInfo()
-
-
- //获取滚动条高度
- this.computeBarLocation();
- },
- //跳转收入登记
- swichInCome:function(e){
- console.log(e.currentTarget.dataset.current);
- // let cur = e.currentTarget.dataset.current;
- // if (this.data.currentTaB == cur) {
- // return false;
- // }else{
- // wx.navigateTo({
- // url: '../inCome/index?id=' + id,
- // })
- // }
- wx.navigateTo({
- url: '../inCome/inCome?',
- })
- },
- //跳转支出申请
- swichPayment:function(e){
- console.log(e.currentTarget.dataset.current);
- // let cur = e.currentTarget.dataset.current;
- // if (this.data.currentTaB == cur) {
- // return false;
- // }else{
- // wx.navigateTo({
- // url: '../inCome/index?id=' + id,
- // })
- // }
- wx.navigateTo({
- url: '../apply/index?',
- })
- },
- //跳转个人设置
- swichSettle:function(e){
- console.log(e.currentTarget.dataset.current);
- // let cur = e.currentTarget.dataset.current;
- // if (this.data.currentTaB == cur) {
- // return false;
- // }else{
- // wx.navigateTo({
- // url: '../inCome/index?id=' + id,
- // })
- // }
- wx.navigateTo({
- url: 'settle/index?',
- })
- },
- /* 计算bar 高度*/
- computeBarLocation() {
- var that = this;
- let CustomMenuButton = wx.getMenuButtonBoundingClientRect();
- let CustomWidows = wx.getSystemInfoSync();
- // 根据文档,先创建一个SelectorQuery对象实例
- let query = wx.createSelectorQuery().in(this);
- query.select('.top_title').boundingClientRect();
- query.select('.information_header').boundingClientRect();
- query.select('.navList_main').boundingClientRect();
- query.select('.child_function').boundingClientRect();
- query.select('.work_plan').boundingClientRect();
-
- query.exec((res) => {
- let wrokScrollHeight = CustomWidows.windowHeight;
- res.forEach((v)=>{
- wrokScrollHeight = wrokScrollHeight - v.height;
- })
- wrokScrollHeight = wrokScrollHeight-CustomMenuButton.top-CustomMenuButton.bottom -15;
- that.setData({
- wrokScrollHeight: wrokScrollHeight,
- });
- })
- that.setData({
- CustomMenuButton: CustomMenuButton,
- });
- },
- /* 获取用户信息*/
- getUserInfo(){
- UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, {
- success: (res) => {
- if (res.code == API.SUCCESS_CODE) {
- this.setData({userInfoObj:res.user})
- }
- }
- })
- }
- })
|