success.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. // pages/indexPages/yyqhPages/success/success.js
  2. import {
  3. xcxqxyy
  4. } from "../../../../apis/index"
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. business: {},
  11. infos: {}
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad(options) {
  17. let that = this
  18. that.init(options)
  19. },
  20. init(e) {
  21. let that = this
  22. if (e) {
  23. if (e.business) {
  24. that.setData({
  25. business: JSON.parse(e.business)
  26. })
  27. }
  28. }
  29. that.setData({
  30. infos: wx.getStorageSync('YYDATA')
  31. })
  32. wx.removeStorageSync('YYDATA')
  33. },
  34. lookCl() {
  35. let that = this
  36. wx.navigateTo({
  37. url: '../../workGuide/workGuide?business=' + JSON.stringify(that.data.business),
  38. })
  39. },
  40. cancle() {
  41. let that = this
  42. wx.showLoading({
  43. title: '正在取消...',
  44. })
  45. xcxqxyy({
  46. yymxxh: that.data.infos.yymxxh
  47. }).then(res => {
  48. wx.hideLoading()
  49. if (res.code == 200) {
  50. wx.showToast({
  51. title: '取消成功',
  52. duration: 2000
  53. })
  54. setTimeout(() => {
  55. wx.switchTab({
  56. url: '../../../index/index',
  57. })
  58. }, 2000);
  59. } else {
  60. wx.showToast({
  61. title: res.msg || res.message,
  62. icon: "none",
  63. duration: 5000
  64. })
  65. }
  66. })
  67. },
  68. backIndex() {
  69. wx.switchTab({
  70. url: '../../../index/index',
  71. })
  72. },
  73. /**
  74. * 生命周期函数--监听页面初次渲染完成
  75. */
  76. onReady() {
  77. },
  78. /**
  79. * 生命周期函数--监听页面显示
  80. */
  81. onShow() {
  82. },
  83. /**
  84. * 生命周期函数--监听页面隐藏
  85. */
  86. onHide() {
  87. },
  88. /**
  89. * 生命周期函数--监听页面卸载
  90. */
  91. onUnload() {
  92. },
  93. /**
  94. * 页面相关事件处理函数--监听用户下拉动作
  95. */
  96. onPullDownRefresh() {
  97. },
  98. /**
  99. * 页面上拉触底事件的处理函数
  100. */
  101. onReachBottom() {
  102. },
  103. /**
  104. * 用户点击右上角分享
  105. */
  106. onShareAppMessage() {
  107. }
  108. })