hmOrderDetail.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. const util = require("../../../utils/util");
  2. const api = require('../../../api/api.js');
  3. var app = getApp();
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. isCurent:true,
  10. isShowLeftLine:true,
  11. order:{},
  12. myqr_show: false, //显示追加信息框
  13. myqr_blur: 1, //背景模糊值
  14. remark:'',
  15. payId:''
  16. },
  17. goAddContent(){
  18. wx.pageScrollTo({
  19. scrollTop: 0
  20. });
  21. this.setData({
  22. myqr_show:true,
  23. myqr_blur:1
  24. })
  25. },
  26. qrtouchstart: function () {
  27. this.setData({
  28. myqr_blur: 1,
  29. myqr_show: false
  30. });
  31. },
  32. /**
  33. * 生命周期函数--监听页面加载
  34. */
  35. onLoad: function (options) {
  36. let that=this
  37. let payId=options.payId;
  38. that.setData({
  39. payId:payId
  40. })
  41. this.getInfo();
  42. },
  43. getInfo(){
  44. let that=this
  45. wx.showLoading();
  46. util.request(api.HmPyamentOrderDetail, {
  47. payId: that.data.payId
  48. }).then(function (res) {
  49. wx.hideLoading();
  50. console.info(res.data)
  51. if (res.errno === 0) {
  52. that.setData({
  53. order:res.data
  54. });
  55. }
  56. });
  57. },
  58. goSaveContent(){
  59. let that=this
  60. if (!that.data.remark) {
  61. wx.showToast({
  62. title: '请输入追加内容',
  63. duration: 3000
  64. });
  65. return;
  66. }
  67. wx.showLoading();
  68. util.request(api.HmPyamentOrderAddMemo, {
  69. payId: that.data.payId,
  70. remark:that.data.remark
  71. }).then(function (res) {
  72. wx.hideLoading();
  73. if (res.errno === 0) {
  74. that.getInfo();
  75. that.setData({
  76. remark:'',
  77. myqr_blur: 1,
  78. myqr_show: false
  79. })
  80. wx.showToast({
  81. title: '追加成功',
  82. duration: 3000
  83. });
  84. }
  85. });
  86. },
  87. makeCall(e) {
  88. wx.makePhoneCall({
  89. phoneNumber: e.currentTarget.dataset.phone,
  90. })
  91. },
  92. bindRemark(e){
  93. this.setData({
  94. remark: e.detail.value
  95. })
  96. },
  97. /**
  98. * 生命周期函数--监听页面初次渲染完成
  99. */
  100. onReady: function () {
  101. },
  102. /**
  103. * 生命周期函数--监听页面显示
  104. */
  105. onShow: function () {
  106. },
  107. /**
  108. * 生命周期函数--监听页面隐藏
  109. */
  110. onHide: function () {
  111. },
  112. /**
  113. * 生命周期函数--监听页面卸载
  114. */
  115. onUnload: function () {
  116. },
  117. /**
  118. * 页面相关事件处理函数--监听用户下拉动作
  119. */
  120. onPullDownRefresh: function () {
  121. },
  122. /**
  123. * 页面上拉触底事件的处理函数
  124. */
  125. onReachBottom: function () {
  126. },
  127. /**
  128. * 用户点击右上角分享
  129. */
  130. onShareAppMessage: function () {
  131. }
  132. })