refunding.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // pages/refunding/refunding.js
  2. var app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. orderId:'',
  9. url: app.globalData.urlImages,
  10. ordercon:[]
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function (options) {
  16. app.setBarColor();
  17. app.setUserInfo();
  18. if (options.id){
  19. this.setData({
  20. orderId: options.id
  21. })
  22. this.getOrder();
  23. }else{
  24. that.isBool();
  25. }
  26. },
  27. /**
  28. * 生命周期函数--监听页面初次渲染完成
  29. */
  30. onReady: function () {
  31. },
  32. getOrder:function(){
  33. var that = this;
  34. wx.request({
  35. url: app.globalData.url + '/routine/auth_api/get_order?uid=' + app.globalData.uid,
  36. data: { uni: that.data.orderId },
  37. method: 'get',
  38. success: function (res) {
  39. wx.hideLoading();
  40. if(res.data.code == 200){
  41. res.data.data.refund_reason_time = that.setTime(res.data.data.refund_reason_time);
  42. that.setData({
  43. ordercon: res.data.data
  44. });
  45. }else{
  46. that.isBool();
  47. }
  48. console.log(that.data.ordercon);
  49. },
  50. fail: function (res) {
  51. console.log('submit fail');
  52. },
  53. complete: function (res) {
  54. console.log('submit complete');
  55. }
  56. });
  57. },
  58. setTime: function (timestamp3){
  59. var newDate = new Date();
  60. newDate.setTime(timestamp3 * 1000);
  61. return newDate.toLocaleString();
  62. },
  63. isBool:function(){
  64. wx.showToast({
  65. title: '参数错误',
  66. icon: 'none',
  67. duration: 1000
  68. })
  69. setTimeout(function () {
  70. wx.navigateTo({
  71. url: '/pages/refund-order/refund-order'
  72. })
  73. }, 1200)
  74. },
  75. /**
  76. * 生命周期函数--监听页面显示
  77. */
  78. onShow: function () {
  79. },
  80. /**
  81. * 生命周期函数--监听页面隐藏
  82. */
  83. onHide: function () {
  84. },
  85. /**
  86. * 生命周期函数--监听页面卸载
  87. */
  88. onUnload: function () {
  89. },
  90. /**
  91. * 页面相关事件处理函数--监听用户下拉动作
  92. */
  93. onPullDownRefresh: function () {
  94. },
  95. /**
  96. * 页面上拉触底事件的处理函数
  97. */
  98. onReachBottom: function () {
  99. },
  100. /**
  101. * 用户点击右上角分享
  102. */
  103. onShareAppMessage: function () {
  104. }
  105. })