shareOrderInfo.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. var app = getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. order: []
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad: function (options) {
  13. let order_id = options.order_id || 0;
  14. if (order_id == undefined || !order_id){
  15. wx.redirectTo({
  16. url: '/lionfish_comshop/pages/index/index',
  17. })
  18. }
  19. wx.showLoading();
  20. this.getData(order_id);
  21. },
  22. /**
  23. * 生命周期函数--监听页面显示
  24. */
  25. onShow: function () {
  26. },
  27. /**
  28. * 获取数据
  29. */
  30. getData: function (order_id) {
  31. let that = this;
  32. app.util.request({
  33. 'url': 'entry/wxapp/index',
  34. 'data': {
  35. controller: 'order.order_head_info',
  36. id: order_id,
  37. is_share: 1
  38. },
  39. dataType: 'json',
  40. method: 'POST',
  41. success: function (res) {
  42. wx.hideLoading();
  43. if(res.data.code == 0){
  44. that.setData({
  45. order: res.data.data
  46. })
  47. }
  48. }
  49. })
  50. },
  51. /**
  52. * 去商品详情
  53. */
  54. goGoodsDetails: function(e){
  55. let id = e.currentTarget.dataset.id || 0;
  56. wx.navigateTo({
  57. url: '/lionfish_comshop/pages/goods/goodsDetail?id=' + id,
  58. })
  59. },
  60. /**
  61. * 生命周期函数--监听页面隐藏
  62. */
  63. onHide: function () {
  64. },
  65. /**
  66. * 生命周期函数--监听页面卸载
  67. */
  68. onUnload: function () {
  69. },
  70. /**
  71. * 页面相关事件处理函数--监听用户下拉动作
  72. */
  73. onPullDownRefresh: function () {
  74. }
  75. })