DetailsOfRefund.js 5.9 KB

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