refunding.js 2.2 KB

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