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({
onLaunch: function() {
onShow: function() {
var that = this;
wx.getSystemInfo({
success: function (res) {
that.globalData.winWidth = res.windowWidth;
that.globalData.winHeight = res.windowHeight;
}
});
},
globalData: {
winHeight: 0,
winWidth: 0,
phoneNum: "",
openID: "",
appName: "WeChat",


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

@ -1,19 +1,40 @@
// 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({
/**
* 页面的初始数据
*/
data: {
winHeight: app.globalData.winHeight,
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;
that.setData({
currentTab: e.detail.current
@ -23,7 +44,7 @@ Page({
/**
* 点击tab切换
*/
swichNav: function (e) {
swichNav: function(e) {
var that = this;
if (this.data.currentTab === e.target.dataset.current) {
return false;
@ -36,64 +57,58 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
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>
<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>
</view>
</scroll-view>
<view class='addGoodsName' catchtap='addGoodsName'>添加存货明细</view>
@ -23,37 +25,20 @@
<!-- 收藏夹 -->
<swiper-item class="swiper-items2">
<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>
</swiper-item>
</swiper>
<template name="outStoreOrderTemplate">
<template name="customerChoiceTemplate">
<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 class='horizontallineView'></view>
</template>

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

@ -1,6 +1,6 @@
/* pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss */
page{
background:#EAF1F8;
background:#EFEFF6;
height: 100%;
}
@ -73,12 +73,33 @@ page{
}
.scroll-views {
height: calc(100% - 80px);
margin-top: 25rpx;
height: calc(100% - 97px);
width: 100%;
display: flex;
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{
height: 45px;
width: 100%;


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

@ -180,7 +180,7 @@ Page({
allBillMoney: 0,
array: [],
showView: false,
winHeight: 0
winHeight: app.globalData.winHeight,
},
/**
@ -194,15 +194,6 @@ Page({
title: '业务担保单No.' + 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
var app = getApp();
var network = require("../../utils/net.js")
var timechage = require("../../utils/dateTimeUtil.js")
var PageIndexN = 0
@ -65,8 +66,7 @@ Page({
* 页面的初始数据
*/
data: {
winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换
currentTab: 0,
@ -81,18 +81,6 @@ Page({
*/
onLoad: function (options) {
var that = this;
/**
* 获取系统信息
*/
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
getListN(that, PageIndexN, PageSizeN)
getListY(that, PageIndexY, PageSizeY)
},


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

@ -94,7 +94,7 @@ Page({
requestMoney: 0,
allBillMoney: 0,
array: [],
winHeight: 0
winHeight: app.globalData.winHeight,
},
/**
@ -111,16 +111,6 @@ Page({
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: {
winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换
currentTab: 0,
arrayOut:[],
@ -95,17 +94,6 @@ Page({
onLoad: function (options) {
customerid = Number(options.customerid)
var that = this;
/**
* 获取系统信息
*/
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
getBillForDetail777(that, customerid)
getBillForDetail792(that, customerid)
getBillForDetail776(that, customerid)


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

@ -130,7 +130,7 @@ Page({
*/
which: "",
winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换
currentTab: 0,
obj: [],
@ -237,20 +237,6 @@ Page({
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: "",
winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换
currentTab: 0,
obj: [],
@ -146,7 +146,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
var that = this;
// 获取完整的年月日 时分秒,以及默认显示的数组
var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
@ -160,19 +159,7 @@ Page({
dateTimeArray1: obj1.dateTimeArray,
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: [],
scrollTop: 0,
scrollHeight: 0,
winHeight: 0
winHeight: app.globalData.winHeight,
},
/**
@ -85,14 +85,7 @@ Page({
* 生命周期函数--监听页面显示
*/
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: "",
winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换
currentTab: 0,
obj: [],
@ -237,20 +237,6 @@ Page({
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: "",
winWidth: 0,
winHeight: 0,
winHeight: app.globalData.winHeight,
// tab切换
currentTab: 0,
obj: [],
@ -167,19 +167,7 @@ Page({
dateTimeArray1: obj1.dateTimeArray,
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: [],
unCheckDataArr: [],
currentTab: 0,
winHeight: 0,
winWidth: 0,
winHeight: app.globalData.winHeight,
Customer_ID: null,
},
@ -160,14 +159,6 @@ Page({
Customer_ID: app.globalData.selectCustomer_ID,
})
var that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
UnCheckPageIndex = 0;
CheckedPageIndex = 0;
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize);


Loading…
Cancel
Save