mineOrderProgress.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. // pages/mineOrderProgress/mineOrderProgress.js
  2. const request = require("../../utils/request.js");
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. popover_Status: true,
  9. bbosId: null,
  10. infoList: {},
  11. orderInfo: {},
  12. userAddressId: null
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad(options) {
  18. let that = this;
  19. const eventChannel = this.getOpenerEventChannel()
  20. eventChannel.on('getInfoList', function(data) {
  21. that.setData({
  22. infoList: data.infolist,
  23. bbosId: data.infolist[0].bbosId
  24. })
  25. that.geOrderInfo();
  26. })
  27. },
  28. /**
  29. * 生命周期函数--监听页面初次渲染完成
  30. */
  31. onReady() {
  32. },
  33. /**
  34. * 生命周期函数--监听页面显示
  35. */
  36. onShow() {
  37. },
  38. /**
  39. * 生命周期函数--监听页面隐藏
  40. */
  41. onHide() {
  42. },
  43. /**
  44. * 生命周期函数--监听页面卸载
  45. */
  46. onUnload() {
  47. },
  48. /**
  49. * 页面相关事件处理函数--监听用户下拉动作
  50. */
  51. onPullDownRefresh() {
  52. },
  53. /**
  54. * 页面上拉触底事件的处理函数
  55. */
  56. onReachBottom() {
  57. },
  58. /**
  59. * 用户点击右上角分享
  60. */
  61. onShareAppMessage() {
  62. },
  63. geOrderInfo() {
  64. let that = this;
  65. request.getData(
  66. 'app/box/order/sp/info',{bbosId: that.data.bbosId},
  67. res => {
  68. that.setData({
  69. orderInfo: res.data.data
  70. })
  71. },
  72. res => {
  73. console.log(res)
  74. }
  75. )
  76. },
  77. orderDateFun() {
  78. this.setData({
  79. popover_Status: false
  80. })
  81. },
  82. popoverFun() {
  83. this.setData({
  84. popover_Status: !this.data.popover_Status
  85. })
  86. },
  87. checkExpress(event) {
  88. let busiData = event.currentTarget.dataset.busi;
  89. wx.setClipboardData({
  90. data: busiData,
  91. success (res) {
  92. wx.navigateToMiniProgram({
  93. appId: 'wxd4185d00bf7e08ac',
  94. path: '',
  95. extraData: {},
  96. success(res) {
  97. // 打开成功
  98. }
  99. })
  100. // wx.getClipboardData({
  101. // success (res) {
  102. // console.log(res.data)
  103. // }
  104. // })
  105. }
  106. })
  107. },
  108. switchDate(event) {
  109. let bbosId = event.currentTarget.dataset.bbosid;
  110. this.setData({
  111. bbosId: bbosId
  112. })
  113. this.geOrderInfo();
  114. this.setData({
  115. popover_Status: true
  116. })
  117. },
  118. toChangeAd() {
  119. let that = this;
  120. wx.navigateTo({
  121. url: '../mineAddress/mineAddress',
  122. events: {
  123. getSelectAd: function(data) {
  124. that.setData({
  125. userAddressId: data.userAddressId
  126. })
  127. that.updateAd();
  128. }
  129. },
  130. })
  131. },
  132. //修改地址
  133. updateAd() {
  134. let that = this;
  135. request.postData(
  136. 'app/box/update/addree',
  137. {
  138. bbosId: that.data.bbosId,
  139. applyAll: '1',
  140. userAddressId: that.data.userAddressId,
  141. },
  142. res => {
  143. that.geOrderInfo();
  144. wx.showToast({
  145. title: '修改地址成功',
  146. icon: 'success',
  147. duration: 2000
  148. })
  149. }
  150. )
  151. },
  152. })