// pages/homePage/homePage.js
|
|
var app = getApp()
|
|
var network = require("../../utils/net.js")
|
|
function GetUserProfile(successtion) {
|
|
let method = '/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetUserProfile';
|
|
let params = [];
|
|
|
|
network.transfer_request(method, params, function (res) {
|
|
successtion();
|
|
if (res.result.AccountingUnit_ID != null) {
|
|
app.globalData.accountingUnit_ID = res.result.AccountingUnit_ID;
|
|
app.globalData.accountingUnit_Name = res.result.AccountingUnit_Name
|
|
}
|
|
|
|
if (res.result.Department_ID != null) {
|
|
app.globalData.department_ID = res.result.Department_ID;
|
|
app.globalData.department_Name = res.result.Department_Name
|
|
}
|
|
})
|
|
}
|
|
|
|
Page({
|
|
data: {
|
|
|
|
},
|
|
|
|
onLoad: function (options) {
|
|
// 进入过首页 可以由分享进入页面
|
|
app.globalData.shareInState = 0;
|
|
GetUserProfile(function (res) {
|
|
var shareURL = app.globalData.shareInPath;
|
|
if (shareURL) {
|
|
wx.navigateTo({
|
|
url: "../../" + shareURL,
|
|
complete: function (res) {
|
|
app.globalData.shareInPath = "";
|
|
},
|
|
})
|
|
}
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 点击页面按钮进行跳转
|
|
*/
|
|
transBtnClicked: function (event) {
|
|
var btnID = event.currentTarget.dataset.itemid;
|
|
var transferURL = '';
|
|
switch (btnID) {
|
|
// 销售预报
|
|
case "1":
|
|
transferURL = '/pages/saleForecastList/saleForecastList';
|
|
// transferURL = '/pages/goodaNameChooseTemplate/goodaNameChooseTemplate';
|
|
break;
|
|
// 销售订单
|
|
case "2":
|
|
transferURL = '/pages/order/order';
|
|
break;
|
|
// 特价申请
|
|
case "3":
|
|
transferURL = '/pages/specialOrderApplication/specialOrderApplication';
|
|
break;
|
|
// 销售出库
|
|
case "4":
|
|
transferURL = '/pages/outStore/outStore';
|
|
break;
|
|
// 担保单
|
|
case "5":
|
|
transferURL = '/pages/guarantee/guarantee';
|
|
break;
|
|
}
|
|
|
|
wx.navigateTo({
|
|
url: transferURL,
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
|
|
}
|
|
})
|