DetailsOfRefund.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. // pages/DetailsOfRefund/DetailsOfRefund.js
  2. var http = require('../../utils/http.js');
  3. var util = require('../../utils/util.js');
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. showView: true, //隐藏是展示
  10. applyTime: '', //申请时间
  11. applyType: 1, //申请类型:1,仅退款,2退款退货
  12. goodsNum: '', //退货数量
  13. handelTime: '', //卖家处理时间
  14. orderAmount: '', //订单总金额
  15. orderItems: {}, //订单项
  16. refundAmount: '', //退款金额
  17. goodsTotal:0,
  18. records:[],//退款流程
  19. refundStatusObj:{
  20. 1:'申请原因',
  21. 2:'商家待审核',
  22. 3:'审核通过',
  23. 4:'驳回',
  24. 5:'退款成功',
  25. },
  26. refundDelivery: [], //收货地址对象
  27. refundId: '', //记录ID
  28. refundTime: '', //退款时间
  29. returnMoneySts: 1, //处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭)
  30. updateTime: '', //更新时间
  31. refundSn: '', //退款编号
  32. rejectMessage: '', //拒绝理由
  33. buyerReason: '', //退款原因
  34. shopName: '', //店铺名称
  35. refundScore: 0, // 退款积分
  36. photoFiles:[],
  37. addCarshow: false,
  38. selectTimeshow: false,
  39. flowShow: false,
  40. userAddrDto: {},
  41. payer: '',
  42. sendPay:'',
  43. sts: 0,
  44. nomDay: '',
  45. tomorrowDay: '',
  46. timeIntervals: [],
  47. columns: [],
  48. combinedTextValue: '',
  49. sendInfo: {},
  50. currentSelectedIndex: -1, // 初始没有选中项,索引设为 -1
  51. cancelPay: false,
  52. remainingTime: '',
  53. timeFormat: '',
  54. orderNumSend:'',
  55. countdown_hours:'',
  56. countdown_minutes:'',
  57. statusObj:{
  58. 10:{
  59. title:'待审核',
  60. desc:'等待商家处理申请'
  61. },
  62. 20:{
  63. title:'处理中',
  64. desc:'申请通过后,将退回至原账户'
  65. },
  66. 30:{
  67. title:'驳回退款',
  68. desc:'您的申请已被商家拒绝'
  69. },
  70. 40:{
  71. title:'撤销退款',
  72. desc:'您已主动取消退款申请,如有需要可再次申请。'
  73. },
  74. 60:{
  75. title:'待退货',
  76. desc:''
  77. },
  78. 65:{
  79. title:'待确认收货',
  80. desc:'待商家收到商品,并确认不影响二次销售后,将为您退款'
  81. },
  82. 70:{
  83. title:'退款完成',
  84. desc:'申请已通过,已退回至原账户'
  85. },
  86. }
  87. },
  88. /**
  89. * 生命周期函数--监听页面加载
  90. */
  91. onLoad(options) {
  92. this.setData({
  93. orderNumSend:options.orderNumber
  94. })
  95. this.setData({
  96. refundSn: options.refundSn,
  97. });
  98. if(options.userAddrDto){
  99. this.setData({
  100. userAddrDto: JSON.parse(options.userAddrDto)
  101. })
  102. }
  103. //获取退款申请详情
  104. this.getRefundDetail()
  105. },
  106. /**
  107. * 获取退款申请详情
  108. */
  109. getRefundDetail: function (e) {
  110. var ths = this;
  111. // wx.showLoading({})
  112. var params = {
  113. url: "/p/orderRefund/info",
  114. method: "GET",
  115. data: {
  116. refundSn: this.data.refundSn //退款编号
  117. },
  118. callBack: function (res) {
  119. let img=''
  120. res.orderItems.map(item=>{
  121. img=item.pic.split(',')
  122. item.pic=img[0]
  123. })
  124. let photoFiles = []
  125. if(res.photoFiles){
  126. photoFiles = res.photoFiles.split(',')
  127. }
  128. ths.setData({
  129. applyTime: res.applyTime, //申请时间
  130. applyType: res.applyType, //申请类型:1,仅退款,2退款退货
  131. goodsNum: res.goodsNum, //退货数量
  132. handelTime: res.handelTime, //卖家处理时间
  133. orderAmount: res.orderAmount, //订单总金额
  134. orderItems: res.orderItems, //订单项
  135. orderNumber: res.orderNumber, //订单项
  136. refundSn: res.refundSn, //退款编号
  137. refundAmount: res.refundAmount, //退款金额
  138. goodsTotal:res.goodsTotal,
  139. records:res.records,//退款流程
  140. offsetPoints:res.offsetPoints,
  141. freightAmount:res.freightAmount,
  142. refundDelivery: res.refundDelivery, //收货地址对象
  143. refundId: res.refundId, //记录ID
  144. refundTime: res.refundTime, //退款时间
  145. returnMoneySts: res.returnMoneySts, //处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭)
  146. updateTime: res.updateTime, //更新时间
  147. rejectMessage: res.rejectMessage, //拒绝理由
  148. buyerReason: res.buyerReason, //退款原因
  149. photoFiles, //图片
  150. shopName: res.shopName,
  151. refundScore: res.refundScore, // 退款积分
  152. payer: res.refundDelivery.payer,//运费承担方
  153. sendPay:res.refundDelivery.deyNu //物流编号,判断是否提交成功
  154. })
  155. wx.hideLoading();
  156. ths.get_countDown()
  157. }
  158. };
  159. http.request(params);
  160. },
  161. // 一键复制事件
  162. copyBtn: function(e) {
  163. let data = e.currentTarget.dataset.value
  164. wx.setClipboardData({
  165. //准备复制的数据
  166. data,
  167. success: function(res) {
  168. wx.showToast({
  169. title: '复制成功',
  170. });
  171. }
  172. })
  173. },
  174. /**
  175. * 生命周期函数--监听页面初次渲染完成
  176. */
  177. onReady() {
  178. },
  179. /**
  180. * 生命周期函数--监听页面显示
  181. */
  182. onShow() {
  183. },
  184. /**
  185. * 生命周期函数--监听页面隐藏
  186. */
  187. onHide() {
  188. },
  189. /**
  190. * 生命周期函数--监听页面卸载
  191. */
  192. onUnload() {
  193. },
  194. /**
  195. * 页面相关事件处理函数--监听用户下拉动作
  196. */
  197. onPullDownRefresh() {
  198. },
  199. /**
  200. * 页面上拉触底事件的处理函数
  201. */
  202. onReachBottom() {
  203. },
  204. /**
  205. * 用户点击右上角分享
  206. */
  207. onShareAppMessage() {
  208. }
  209. })