| @ -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 () { | |||||
| } | |||||
| }) | |||||
| @ -0,0 +1,3 @@ | |||||
| { | |||||
| "navigationBarTitleText": "出库单详情" | |||||
| } | |||||
| @ -0,0 +1,42 @@ | |||||
| <!--pages/outStore/outStoreDetail/outStoreDetail.wxml--> | |||||
| <view class='imageView'> | |||||
| <image class='currentImage' src="/imgs/blueBtn.png"> | |||||
| <view class='totalMoneyView'> | |||||
| <text class='totalMoney'>总金额</text> | |||||
| </view> | |||||
| <view class='balanceView'> | |||||
| <text class='balance'>¥{{balance}}</text> | |||||
| </view> | |||||
| </image> | |||||
| </view> | |||||
| <view class='listContainer'> | |||||
| <scroll-view scroll-x="false" scroll-y="true" class='scrollView'> | |||||
| <block wx:for="{{dataArr}}" wx:for-item="item"> | |||||
| <template is="outStoreDetailTemplate" data="{{item}}" /> | |||||
| </block> | |||||
| </scroll-view> | |||||
| </view> | |||||
| <template name="outStoreDetailTemplate"> | |||||
| <view class='listItem'> | |||||
| <view class='topView'> | |||||
| <view class='goodsNameView'> | |||||
| <text>{{item.goodsName}}</text> | |||||
| </view> | |||||
| <view class='priceView'> | |||||
| <text>单价:{{item.goodsPrice}}</text> | |||||
| </view> | |||||
| </view> | |||||
| <view class='bottomView'> | |||||
| <view class='goodsNum'> | |||||
| <text class='goodsNumText'>数量:{{item.goodsNum}}</text> | |||||
| </view> | |||||
| <view class='goodsMoney'> | |||||
| <text class='goodsMoneyText'>金额:{{item.goodsMoney}}</text> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| </template> | |||||
| @ -0,0 +1,124 @@ | |||||
| /* pages/outStore/outStoreDetail/outStoreDetail.wxss */ | |||||
| .imageView { | |||||
| height: 150px; | |||||
| margin-top: 10px; | |||||
| margin-left: 15px; | |||||
| margin-right: 15px; | |||||
| margin-bottom: 10px; | |||||
| position: relative; | |||||
| align-items: center; | |||||
| } | |||||
| .currentImage { | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| } | |||||
| .totalMoneyView { | |||||
| position: absolute; | |||||
| width: 100%; | |||||
| /* height: 100%; */ | |||||
| top: 100rpx; | |||||
| text-align: center; | |||||
| } | |||||
| .balanceView { | |||||
| position: absolute; | |||||
| width: 100%; | |||||
| /* height: 100%; */ | |||||
| top: 150rpx; | |||||
| text-align: center; | |||||
| } | |||||
| .totalMoney { | |||||
| color: white; | |||||
| font-size: 20px; | |||||
| } | |||||
| .balance { | |||||
| color: white; | |||||
| font-size: 30px; | |||||
| } | |||||
| .listContainer { | |||||
| width: 100%; | |||||
| /* height: 100%; */ | |||||
| height: calc(100% - 170px); | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| } | |||||
| .scrollView{ | |||||
| height: 100%; | |||||
| } | |||||
| .listItem { | |||||
| /* width: 100%; */ | |||||
| height: 150rpx; | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| background-color: #fff; | |||||
| padding: 0 20rpx 20rpx 20rpx; | |||||
| border-bottom: 1rpx solid #ddd; | |||||
| background: white; | |||||
| } | |||||
| .topView{ | |||||
| height: 50%; | |||||
| width: 100%; | |||||
| display: flex; | |||||
| flex-direction: row; | |||||
| padding-top: 20rpx; | |||||
| } | |||||
| .goodsNameView { | |||||
| height: 100%; | |||||
| width: 50%; | |||||
| } | |||||
| .priceView{ | |||||
| /* padding-right: 20px; */ | |||||
| height: 100%; | |||||
| width: 50%; | |||||
| text-align: right; | |||||
| } | |||||
| .bottomView { | |||||
| height: 50%; | |||||
| width: 100%; | |||||
| display: flex; | |||||
| flex-direction: row; | |||||
| padding-top: 20rpx; | |||||
| } | |||||
| .goodsNum { | |||||
| height: 100%; | |||||
| width: 50%; | |||||
| /* padding-top: 20rpx; */ | |||||
| } | |||||
| .goodsNumText { | |||||
| font-size: 16px; | |||||
| color: #666; | |||||
| } | |||||
| .goodsMoney { | |||||
| height: 100%; | |||||
| width: 50%; | |||||
| /* padding-right: 20px; */ | |||||
| text-align: right; | |||||
| } | |||||
| .goodsMoneyText { | |||||
| font-size: 16px; | |||||
| color: #666; | |||||
| } | |||||
| page { | |||||
| background-color: #f0eff5; | |||||
| height: 100%; | |||||
| width: 100%; | |||||
| } | |||||