Browse Source

接收模版消息跳转订单详情

master
chenxuhui 7 years ago
parent
commit
913fd59f64
3 changed files with 41 additions and 5 deletions
  1. +17
    -3
      app.js
  2. +10
    -1
      pages/homePage/homePage.js
  3. +14
    -1
      pages/order/detail/detail.js

+ 17
- 3
app.js View File

@ -1,6 +1,6 @@
//app.js
App({
onShow: function() {
onLaunch: function() {
var that = this;
wx.getSystemInfo({
success: function (res) {
@ -9,9 +9,24 @@ App({
}
});
},
onShow: function (options) {
var that = this;
var path = options.path;
if (options.query.id) {
wx.reLaunch({
url: '/pages/login/login',
complete: function (res) {
that.globalData.shareInPath = path;
that.globalData.shareInParameter = options.query;
},
});
}
},
globalData: {
shareInPath: "",
shareInParameter: {},
shareInState: 1,
customerArray:[],
goodsNameArray:[],
winHeight: 0,
@ -32,7 +47,6 @@ App({
selectBillState: null,
billInfo: [],
billInfoUp: [],
shareInState:1,
accountingUnit_ID:0,
accountingUnit_Name: "请选择会计单位",
department_ID:0,


+ 10
- 1
pages/homePage/homePage.js View File

@ -26,7 +26,16 @@ Page({
onLoad: function (options) {
GetUserProfile(function (res) {
var shareURL = app.globalData.shareInPath;
if (shareURL) {
app.globalData.shareInState = 0,
wx.navigateTo({
url: "../../" + shareURL,
complete: function (res) {
app.globalData.shareInPath = "";
},
})
}
});
},


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

@ -104,8 +104,21 @@ Page({
},
onLoad: function(options) {
//正常登录流程进入值为0,分享页面直接进入值为1
if (app.globalData.shareInState == 1) {
return;
}
if (app.globalData.shareInParameter.id) {
var detailItemID = parseInt(app.globalData.shareInParameter.id);
// detailItemType = app.globalData.shareInParameter.detailItemType;
} else {
var detailItemID = parseInt(options.ID);
}
var that = this;
network.transfer_request(load, [Number(options.ID)], function(res) {
network.transfer_request(load, [detailItemID], function(res) {
app.globalData.shareInParameter = {};
res.result.LoadTime = timechage.formatTimeTwo(res.result.LoadTime.substring(6, 19), 'Y-M-D h:m');
console.log(res.result);
that.setData({


Loading…
Cancel
Save