// pages/outStore/outStoreDetail/outStoreDetail.js
|
|
var app = getApp()
|
|
var network = require("../../../utils/net.js");
|
|
|
|
Page({
|
|
data: {
|
|
dataArr: [],
|
|
balance: 0,
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
//正常登录流程进入值为0,分享页面直接进入值为1
|
|
if (app.globalData.shareInState == 1) {
|
|
return;
|
|
}
|
|
var detailItemID = 0;
|
|
if (app.globalData.shareInParameter.id) {
|
|
detailItemID = parseInt(app.globalData.shareInParameter.id);
|
|
// wx.showModal({
|
|
// title: '看下ID值',
|
|
// content: '+++' + detailItemID + '+++',
|
|
// })
|
|
// detailItemType = app.globalData.shareInParameter.detailItemType;
|
|
} else {
|
|
detailItemID = parseInt(options.ID);
|
|
}
|
|
|
|
var that = this;
|
|
let arrayLast = [];
|
|
let totalMoney = 0;
|
|
let method = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/SaleOutStoreRpc/GetSaleOutStoreDetail';
|
|
let params = [detailItemID];
|
|
network.transfer_request(method, params, function (res) {
|
|
app.globalData.shareInParameter = {};
|
|
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 () {
|
|
|
|
}
|
|
})
|