Browse Source

提取获得系统高度方法,统一在应用加载处取值,加载一次

master
chenxuhui 7 years ago
parent
commit
c348f3687d
14 changed files with 100 additions and 183 deletions
  1. +10
    -2
      app.js
  2. +41
    -26
      pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js
  3. +13
    -28
      pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxml
  4. +23
    -2
      pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss
  5. +1
    -10
      pages/guarantee/detail/detail.js
  6. +2
    -14
      pages/guarantee/guarantee.js
  7. +1
    -11
      pages/guarantee/newbill/newbill.js
  8. +1
    -13
      pages/guarantee/selectbill/selectbill.js
  9. +1
    -15
      pages/order/detail/detail.js
  10. +1
    -14
      pages/order/newBill/newBill.js
  11. +2
    -9
      pages/order/order.js
  12. +1
    -15
      pages/saleForecastList/Detail/Detail.js
  13. +2
    -14
      pages/saleForecastList/newBill/newBill.js
  14. +1
    -10
      pages/saleForecastList/saleForecastList.js

+ 10
- 2
app.js View File

@ -1,10 +1,18 @@
//app.js //app.js
App({ App({
onLaunch: function() {
onShow: function() {
var that = this;
wx.getSystemInfo({
success: function (res) {
that.globalData.winWidth = res.windowWidth;
that.globalData.winHeight = res.windowHeight;
}
});
}, },
globalData: { globalData: {
winHeight: 0,
winWidth: 0,
phoneNum: "", phoneNum: "",
openID: "", openID: "",
appName: "WeChat", appName: "WeChat",


+ 41
- 26
pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js View File

@ -1,19 +1,40 @@
// pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js // pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js
var app = getApp()
var network = require("../../utils/net.js")
var dateTimePicker = require('../../utils/dateTimePicker.js');
var utilll = require('../../utils/util.js');
var getAccountingUnit = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccountingUnit";
var getCustomer = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCustomer";
Page({ Page({
/**
* 页面的初始数据
*/
data: { data: {
winHeight: app.globalData.winHeight,
currentTab: 0, currentTab: 0,
winHeight: 0,
winWidth: 0,
unCheckDataArr:[1,2,3,4,5,6,7,8,9,1],
customerCollectionArray:[],
customerArray:[],
unCheckDataArr: [1, 2, 3, 4, 5, 6, 7, 8, 9, 1],
},
GetCustomer: function(inputValue) {
var that =this;
let method = getCustomer;
let params = [{
"InputValue": inputValue,
"PageIndex": 0,
"PageSize": 100
}];
network.transfer_request(method, params, function(res) {
that.setData({
customerArray: res.result
})
})
}, },
/** /**
* 滑动切换tab
*/
bindChange: function (e) {
* 滑动切换tab
*/
bindChange: function(e) {
var that = this; var that = this;
that.setData({ that.setData({
currentTab: e.detail.current currentTab: e.detail.current
@ -23,7 +44,7 @@ Page({
/** /**
* 点击tab切换 * 点击tab切换
*/ */
swichNav: function (e) {
swichNav: function(e) {
var that = this; var that = this;
if (this.data.currentTab === e.target.dataset.current) { if (this.data.currentTab === e.target.dataset.current) {
return false; return false;
@ -36,64 +57,58 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) {
onLoad: function(options) {
var that = this; var that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
this.GetCustomer();
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () {
onReady: function() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () {
onShow: function() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () {
onHide: function() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () {
onUnload: function() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () {
onPullDownRefresh: function() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () {
onReachBottom: function() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () {
onShareAppMessage: function() {
} }
}) })

+ 13
- 28
pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxml View File

@ -13,9 +13,11 @@
<view class='storageView'>收藏</view> <view class='storageView'>收藏</view>
</view> </view>
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="unCheckedScrollUpper" bindscrolltolower="unCheckedScrollLower"> <scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="unCheckedScrollUpper" bindscrolltolower="unCheckedScrollLower">
<block wx:for="{{unCheckDataArr}}" wx:for-item="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
<view class='listBackGroundView'>
<block wx:for="{{customerArray}}" wx:key="item" wx:for-index="idx">
<template is="customerChoiceTemplate" data="{{item}}" />
</block> </block>
</view>
</scroll-view> </scroll-view>
<view class='addGoodsName' catchtap='addGoodsName'>添加存货明细</view> <view class='addGoodsName' catchtap='addGoodsName'>添加存货明细</view>
@ -23,37 +25,20 @@
<!-- 收藏夹 --> <!-- 收藏夹 -->
<swiper-item class="swiper-items2"> <swiper-item class="swiper-items2">
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="checkedScrollUpper" bindscrolltolower="CheckedScrollLower"> <scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="checkedScrollUpper" bindscrolltolower="CheckedScrollLower">
<block wx:for="{{checkedDataArr}}" wx:for-item="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
<checkbox-group bindchange="checkboxChange">
<block wx:for="{{checkedDataArr}}" wx:for-item="item">
<template is="customerChoiceTemplate" data="{{item}}" />
</block>
</checkbox-group>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<template name="outStoreOrderTemplate">
<template name="customerChoiceTemplate">
<view class='listItem' catchtap='transToOrderDetail' data-detailitemid='{{item.orderID}}' data-detailitemstate='{{item.orderState}}'> <view class='listItem' catchtap='transToOrderDetail' data-detailitemid='{{item.orderID}}' data-detailitemstate='{{item.orderState}}'>
<!-- <view class='orderID'>
<text class='goodsIDText'>NO:{{item.orderID}}</text>
</view> -->
<view class='bottomView'>
<!-- <view class='goodsNum'>
<text class='goodsNumText'>{{item.Customer_Name}}</text>
</view> -->
<view class='goodsNum'>
<text class='goodsIDText'>NO:{{item.orderID}}</text>
</view>
<view class='goodsMoney'>
<text class='goodsMoneyText'>流程状态:{{item.workFlowState}}</text>
</view>
</view>
<view class='bottomView'>
<view class='goodsNum'>
<text class='goodsNumText'>{{item.Customer_Name}}</text>
</view>
<view class='goodsMoney'>
<text class='goodsMoneyText'>发货日期:{{item.time}}</text>
</view>
</view>
<view class='itemClass'>你大吉大利看见噶说;{{item.name}}</view>
<checkbox value="{{item.ID}}" checked="{{item.checked}}" />
</view> </view>
<view class='horizontallineView'></view>
</template> </template>

+ 23
- 2
pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss View File

@ -1,6 +1,6 @@
/* pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss */ /* pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss */
page{ page{
background:#EAF1F8;
background:#EFEFF6;
height: 100%; height: 100%;
} }
@ -73,12 +73,33 @@ page{
} }
.scroll-views { .scroll-views {
height: calc(100% - 80px);
margin-top: 25rpx;
height: calc(100% - 97px);
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.listBackGroundView{
background-color: #fff;
}
.listItem{
height: 80rpx;
display: flex;
padding: 10rpx 20rpx;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.horizontallineView {
height: 1rpx;
background-color: #dbdbdb;
margin-left: 20rpx;
margin-right: 0rpx;
}
.addGoodsName{ .addGoodsName{
height: 45px; height: 45px;
width: 100%; width: 100%;


+ 1
- 10
pages/guarantee/detail/detail.js View File

@ -180,7 +180,7 @@ Page({
allBillMoney: 0, allBillMoney: 0,
array: [], array: [],
showView: false, showView: false,
winHeight: 0
winHeight: app.globalData.winHeight,
}, },
/** /**
@ -194,15 +194,6 @@ Page({
title: '业务担保单No.' + ID, title: '业务担保单No.' + ID,
}) })
load(that, ID) load(that, ID)
wx.getSystemInfo({
success: function(res) {
that.setData({
winHeight: res.windowHeight
});
}
});
}, },
/** /**


+ 2
- 14
pages/guarantee/guarantee.js View File

@ -1,4 +1,5 @@
// pages/guarantee/guarantee.js // pages/guarantee/guarantee.js
var app = getApp();
var network = require("../../utils/net.js") var network = require("../../utils/net.js")
var timechage = require("../../utils/dateTimeUtil.js") var timechage = require("../../utils/dateTimeUtil.js")
var PageIndexN = 0 var PageIndexN = 0
@ -65,8 +66,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换 // tab切换
currentTab: 0, currentTab: 0,
@ -81,18 +81,6 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
var that = this; var that = this;
/**
* 获取系统信息
*/
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
getListN(that, PageIndexN, PageSizeN) getListN(that, PageIndexN, PageSizeN)
getListY(that, PageIndexY, PageSizeY) getListY(that, PageIndexY, PageSizeY)
}, },


+ 1
- 11
pages/guarantee/newbill/newbill.js View File

@ -94,7 +94,7 @@ Page({
requestMoney: 0, requestMoney: 0,
allBillMoney: 0, allBillMoney: 0,
array: [], array: [],
winHeight: 0
winHeight: app.globalData.winHeight,
}, },
/** /**
@ -111,16 +111,6 @@ Page({
Name: app.globalData.department_Name Name: app.globalData.department_Name
}], }],
}) })
var that = this
wx.getSystemInfo({
success: function(res) {
that.setData({
winHeight: res.windowHeight
});
}
});
}, },
/** /**


+ 1
- 13
pages/guarantee/selectbill/selectbill.js View File

@ -76,8 +76,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换 // tab切换
currentTab: 0, currentTab: 0,
arrayOut:[], arrayOut:[],
@ -95,17 +94,6 @@ Page({
onLoad: function (options) { onLoad: function (options) {
customerid = Number(options.customerid) customerid = Number(options.customerid)
var that = this; var that = this;
/**
* 获取系统信息
*/
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
getBillForDetail777(that, customerid) getBillForDetail777(that, customerid)
getBillForDetail792(that, customerid) getBillForDetail792(that, customerid)
getBillForDetail776(that, customerid) getBillForDetail776(that, customerid)


+ 1
- 15
pages/order/detail/detail.js View File

@ -130,7 +130,7 @@ Page({
*/ */
which: "", which: "",
winWidth: 0, winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换 // tab切换
currentTab: 0, currentTab: 0,
obj: [], obj: [],
@ -237,20 +237,6 @@ Page({
setTime(that) setTime(that)
}) })
/**
* 获取系统信息
*/
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
}, },
/** /**


+ 1
- 14
pages/order/newBill/newBill.js View File

@ -106,7 +106,7 @@ Page({
*/ */
which: "", which: "",
winWidth: 0, winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换 // tab切换
currentTab: 0, currentTab: 0,
obj: [], obj: [],
@ -146,7 +146,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function(options) { onLoad: function(options) {
var that = this;
// 获取完整的年月日 时分秒,以及默认显示的数组 // 获取完整的年月日 时分秒,以及默认显示的数组
var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear); var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
@ -160,19 +159,7 @@ Page({
dateTimeArray1: obj1.dateTimeArray, dateTimeArray1: obj1.dateTimeArray,
dateTime1: obj1.dateTime dateTime1: obj1.dateTime
}); });
/**
* 获取系统信息
*/
wx.getSystemInfo({
success: function(res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
}, },
/** /**


+ 2
- 9
pages/order/order.js View File

@ -61,7 +61,7 @@ Page({
arry: [], arry: [],
scrollTop: 0, scrollTop: 0,
scrollHeight: 0, scrollHeight: 0,
winHeight: 0
winHeight: app.globalData.winHeight,
}, },
/** /**
@ -85,14 +85,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() { onShow: function() {
var that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
winHeight: res.windowHeight
});
}
});
}, },
/** /**


+ 1
- 15
pages/saleForecastList/Detail/Detail.js View File

@ -130,7 +130,7 @@ Page({
*/ */
which: "", which: "",
winWidth: 0, winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换 // tab切换
currentTab: 0, currentTab: 0,
obj: [], obj: [],
@ -237,20 +237,6 @@ Page({
setTime(that) setTime(that)
}) })
/**
* 获取系统信息
*/
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
}, },
/** /**


+ 2
- 14
pages/saleForecastList/newBill/newBill.js View File

@ -113,7 +113,7 @@ Page({
*/ */
which: "", which: "",
winWidth: 0, winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换 // tab切换
currentTab: 0, currentTab: 0,
obj: [], obj: [],
@ -167,19 +167,7 @@ Page({
dateTimeArray1: obj1.dateTimeArray, dateTimeArray1: obj1.dateTimeArray,
dateTime1: obj1.dateTime dateTime1: obj1.dateTime
}); });
/**
* 获取系统信息
*/
wx.getSystemInfo({
success: function(res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
}, },
/** /**


+ 1
- 10
pages/saleForecastList/saleForecastList.js View File

@ -96,8 +96,7 @@ Page({
checkedDataArr: [], checkedDataArr: [],
unCheckDataArr: [], unCheckDataArr: [],
currentTab: 0, currentTab: 0,
winHeight: 0,
winWidth: 0,
winHeight: app.globalData.winHeight,
Customer_ID: null, Customer_ID: null,
}, },
@ -160,14 +159,6 @@ Page({
Customer_ID: app.globalData.selectCustomer_ID, Customer_ID: app.globalData.selectCustomer_ID,
}) })
var that = this; var that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
UnCheckPageIndex = 0; UnCheckPageIndex = 0;
CheckedPageIndex = 0; CheckedPageIndex = 0;
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize); getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize);


Loading…
Cancel
Save