From d320fdf0032d12bc07c847a0e74b537bdd7ef815 Mon Sep 17 00:00:00 2001 From: chenxuhui Date: Tue, 27 Nov 2018 10:59:59 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=202=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A2=84=E6=8A=A5=E5=88=97=E8=A1=A8=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=9B=9E=E8=B0=83=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 3 +- pages/outStore/outStore.js | 32 +---- pages/outStore/outStore.wxml | 4 +- .../outStore/outStoreDetail/outStoreDetail.js | 93 +++++++++++++ .../outStoreDetail/outStoreDetail.json | 3 + .../outStoreDetail/outStoreDetail.wxml | 42 ++++++ .../outStoreDetail/outStoreDetail.wxss | 124 ++++++++++++++++++ pages/saleForecastList/saleForecastList.js | 4 +- 8 files changed, 273 insertions(+), 32 deletions(-) create mode 100644 pages/outStore/outStoreDetail/outStoreDetail.js create mode 100644 pages/outStore/outStoreDetail/outStoreDetail.json create mode 100644 pages/outStore/outStoreDetail/outStoreDetail.wxml create mode 100644 pages/outStore/outStoreDetail/outStoreDetail.wxss diff --git a/app.json b/app.json index cea2b76..b97cc37 100644 --- a/app.json +++ b/app.json @@ -21,7 +21,8 @@ "pages/customerChooseTemplate/customerChooseTemplate", "pages/specialOrderApplication/specialOrderApplication", "pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder", - "pages/outStore/outStore" + "pages/outStore/outStore", + "pages/outStore/outStoreDetail/outStoreDetail" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/outStore/outStore.js b/pages/outStore/outStore.js index 313edbd..e48ea95 100644 --- a/pages/outStore/outStore.js +++ b/pages/outStore/outStore.js @@ -81,8 +81,7 @@ Page({ * 页面的初始数据 */ data: { - winWidth: 0, - winHeight: 0, + winHeight: app.globalData.winHeight, // tab切换 currentTab: 0, @@ -96,25 +95,6 @@ Page({ EndDate: null }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - var that = this; - /** - * 获取系统信息 - */ - wx.getSystemInfo({ - success: function (res) { - that.setData({ - winWidth: res.windowWidth, - winHeight: res.windowHeight - }); - } - }); - - }, - onShow: function () { /* var that = this; @@ -230,16 +210,12 @@ Page({ }) } }, - itemclickN: function (e) { - wx.navigateTo({ - url: '/pages/SaleOutStoreInfo/SaleOutStoreInfo?ID=' + e.currentTarget.dataset.data.ID, - }) - }, - itemclickY: function (e) { + itemclick: function (e) { wx.navigateTo({ - url: '/pages/SaleOutStoreInfo/SaleOutStoreInfo?ID=' + e.currentTarget.dataset.data.ID, + url: 'outStoreDetail/outStoreDetail?ID=' + e.currentTarget.dataset.data.ID, }) }, + chose: function (e) { wx.navigateTo({ url: '/pages/SaleOutStoreChose/SaleOutStoreChose', diff --git a/pages/outStore/outStore.wxml b/pages/outStore/outStore.wxml index 4842264..5dd9b3a 100644 --- a/pages/outStore/outStore.wxml +++ b/pages/outStore/outStore.wxml @@ -11,7 +11,7 @@ - + No.{{item.ID}} 金额:{{item.Money}} @@ -34,7 +34,7 @@ - + No.{{item.ID}} 金额:{{item.Money}} diff --git a/pages/outStore/outStoreDetail/outStoreDetail.js b/pages/outStore/outStoreDetail/outStoreDetail.js new file mode 100644 index 0000000..b254a00 --- /dev/null +++ b/pages/outStore/outStoreDetail/outStoreDetail.js @@ -0,0 +1,93 @@ +// pages/outStore/outStoreDetail/outStoreDetail.js + +var network = require("../../../utils/net.js"); + +Page({ + data: { + dataArr: [], + balance: 0, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var that = this; + var detailItemID = parseInt(options.ID); + let arrayLast = []; + let totalMoney = 0; + let method = '/MainSystem/B3MiniProgramRpc/Rpcs/CustomerRpc/SaleOutStoreRpc/GetSaleOutStoreDetail'; + let params = [detailItemID]; + network.transfer_request(method, params, function (res) { + var array = res.result; + for (var i = 0; i < array.length; i++) { + if (array[i].Money) { + totalMoney = totalMoney + parseFloat(array[i].Money); + } + var dmo = { + goodsName: array[i].Goods_Name, + goodsMoney: array[i].Money, + goodsNum: array[i].Number, + goodsPrice: array[i].Price, + } + arrayLast.push(dmo); + } + if (!totalMoney) { + totalMoney = 0; + } + that.setData({ + dataArr: arrayLast, + balance: totalMoney, + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/outStore/outStoreDetail/outStoreDetail.json b/pages/outStore/outStoreDetail/outStoreDetail.json new file mode 100644 index 0000000..968c624 --- /dev/null +++ b/pages/outStore/outStoreDetail/outStoreDetail.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "出库单详情" +} \ No newline at end of file diff --git a/pages/outStore/outStoreDetail/outStoreDetail.wxml b/pages/outStore/outStoreDetail/outStoreDetail.wxml new file mode 100644 index 0000000..8d5ccbb --- /dev/null +++ b/pages/outStore/outStoreDetail/outStoreDetail.wxml @@ -0,0 +1,42 @@ + + + + + 总金额 + + + ¥{{balance}} + + + + + + + + +