awardDetail.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. var app = getApp()
  2. var that;
  3. Page({
  4. data: {
  5. date: app.globalData.month,
  6. review_id: '',
  7. userId: '',
  8. see_log: 1,
  9. },
  10. onLoad(e) {
  11. that = this;
  12. dd.setNavigationBar({ title: "事件详情" });
  13. that.setData({
  14. userId: app.globalData.userData.id
  15. })
  16. if (e.id) {
  17. that.setData({
  18. review_id: e.id
  19. })
  20. }
  21. },
  22. onShow() {
  23. if (app.globalData.userData) {
  24. dd.hideLoading();
  25. that.getDetail();
  26. that.cheakAx();
  27. } else {
  28. app.login(app.globalData.corpId, function (is) {
  29. if (is) {
  30. dd.hideLoading();
  31. that.getDetail();
  32. that.cheakAx();
  33. } else {
  34. dd.reLaunch({
  35. url: '../../noJurisdiction/noJurisdiction'
  36. })
  37. }
  38. }, function () { })
  39. }
  40. },
  41. cheakAx() {
  42. app.$get("api/integral/site/config", {}).then((res) => {
  43. var data = res.data.data;
  44. this.setData({ see_log: data.see_log ? data.see_log : 0 })
  45. })
  46. },
  47. openCx() {
  48. dd.confirm({
  49. title: '撤销奖扣',
  50. content: '你确定撤销此项吗?',
  51. confirmButtonText: '确定',
  52. cancelButtonText: '取消',
  53. success: (result) => {
  54. if (result.confirm) {
  55. app.$post("api/integral/review/prize/destroy", { target_id: that.data.review_id, type: 1 }).then((res) => {
  56. app.globalData.showToast("已撤销");
  57. // var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
  58. // var active=pages[pages.length-2];
  59. // if(active.data.page!=1){
  60. // active.refreshData(that.data.review_id);
  61. // }
  62. setTimeout(() => {
  63. dd.navigateBack({
  64. delta: 1
  65. })
  66. }, 1000);
  67. })
  68. }
  69. },
  70. });
  71. },
  72. // 查看日志详情
  73. openLog() {
  74. dd.navigateTo({
  75. url: '../logDetail/logDetail?id=' + this.data.review_id
  76. })
  77. },
  78. showImg(e) {
  79. var index = e.target.dataset.index;
  80. var item = e.target.dataset.item
  81. dd.previewImage({
  82. current: index,
  83. urls: item
  84. });
  85. },
  86. activeItem(e) {
  87. var index = e.target.dataset.index;
  88. this.setData({ activeIndex: index })
  89. },
  90. openSearch() {
  91. app.globalData.showToast("暂不支持筛选");
  92. },
  93. getDetail() {
  94. app.$get("api/integral/statistics/integral/info", { event_id: that.data.review_id }).then((res) => {
  95. var data = res.data.data;
  96. app.globalData.types.forEach(item => {
  97. if (item.id == data.pt_id) {
  98. data.typeName = item.name
  99. }
  100. });
  101. this.setData({ dataDetail: data })
  102. })
  103. },
  104. });