refunddetail.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. // pages/order/refunddetail.js
  2. var util = require('../../utils/util.js');
  3. var app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. hide_cancle: true,
  10. ref_id: 0,
  11. pingtai_deal: 0
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad: function (options) {
  17. var ref_id = options.id;
  18. var token = wx.getStorageSync('token');
  19. var that = this;
  20. this.setData({
  21. ref_id: ref_id
  22. })
  23. app.util.request({
  24. 'url': 'entry/wxapp/user',
  25. 'data': {
  26. controller: 'user.refunddetail',
  27. 'token': token,
  28. ref_id: ref_id
  29. },
  30. dataType: 'json',
  31. success: function (res) {
  32. if (res.data.code == 3) {
  33. //un login
  34. } else if (res.data.code == 1) {
  35. //
  36. //code goods_image
  37. that.setData({
  38. pingtai_deal: res.data.pingtai_deal,
  39. order_refund: res.data.order_refund,
  40. order_id: res.data.order_id,
  41. order_refund_history: res.data.order_refund_history,
  42. order_refund_historylist: res.data.order_refund_historylist,
  43. refund_images: res.data.refund_images,
  44. order_goods: res.data.order_goods,
  45. order_info: res.data.order_info
  46. })
  47. }
  48. }
  49. })
  50. },
  51. /**
  52. * 生命周期函数--监听页面初次渲染完成
  53. */
  54. onReady: function () {
  55. },
  56. /**
  57. * 生命周期函数--监听页面显示
  58. */
  59. onShow: function () {
  60. },
  61. /**
  62. * 生命周期函数--监听页面隐藏
  63. */
  64. onHide: function () {
  65. },
  66. /**
  67. * 生命周期函数--监听页面卸载
  68. */
  69. onUnload: function () {
  70. },
  71. /**
  72. * 页面相关事件处理函数--监听用户下拉动作
  73. */
  74. onPullDownRefresh: function () {
  75. },
  76. cancle_shen: function () {
  77. this.setData({
  78. hide_cancle: false
  79. })
  80. },
  81. hide_cancle: function () {
  82. this.setData({
  83. hide_cancle: true
  84. })
  85. },
  86. sub_cancle: function () {
  87. var order_id = this.data.order_id;
  88. var ref_id = this.data.ref_id;
  89. var token = wx.getStorageSync('token');
  90. var that = this;
  91. app.util.request({
  92. 'url': 'entry/wxapp/user',
  93. 'data': {
  94. controller: 'user.cancel_refund',
  95. 'token': token,
  96. ref_id: ref_id
  97. },
  98. dataType: 'json',
  99. success: function (res) {
  100. if (res.data.code == 3) {
  101. //un login
  102. } else if (res.data.code == 1) {
  103. //
  104. //code goods_image
  105. wx.showToast({
  106. title: '撤销成功',
  107. icon: 'success',
  108. duration: 1000,
  109. success: function (res) {
  110. wx.redirectTo({
  111. url: "/lionfish_comshop/pages/order/order?id=" + order_id
  112. })
  113. }
  114. })
  115. }
  116. }
  117. })
  118. },
  119. pingtai_deal: function () {
  120. var order_id = this.data.order_id;
  121. var token = wx.getStorageSync('token');
  122. var that = this;
  123. },
  124. /**
  125. * 页面上拉触底事件的处理函数
  126. */
  127. onReachBottom: function () {
  128. },
  129. /**
  130. * 用户点击右上角分享
  131. */
  132. onShareAppMessage: function () {
  133. }
  134. })