prizeBuckleDetail.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. is:false,
  10. is2:false,
  11. },
  12. onLoad(e) {
  13. that = this;
  14. dd.setNavigationBar({ title: "事件详情" });
  15. that.setData({
  16. userId: app.globalData.userData.id
  17. })
  18. if (e.id) {
  19. that.setData({
  20. review_id: e.id
  21. })
  22. }
  23. if(e.is){
  24. that.setData({
  25. is:true
  26. })
  27. }
  28. if(e.is2){
  29. that.setData({
  30. is2:true
  31. })
  32. }
  33. },
  34. onShow() {
  35. if (app.globalData.userData) {
  36. dd.hideLoading();
  37. that.getDetail();
  38. that.cheakAx();
  39. } else {
  40. app.login(app.globalData.corpId, function (is) {
  41. if (is) {
  42. dd.hideLoading();
  43. that.getDetail();
  44. that.cheakAx();
  45. } else {
  46. dd.reLaunch({
  47. url: '../../noJurisdiction/noJurisdiction'
  48. })
  49. }
  50. }, function () { })
  51. }
  52. },
  53. openDetail(){
  54. dd.navigateTo({
  55. url: '../awardDetail/awardDetail?event_id=' + that.data.review_id
  56. })
  57. },
  58. cheakAx() {
  59. app.$get("api/integral/site/config", {}).then((res) => {
  60. var data = res.data.data;
  61. this.setData({ see_log: data.see_log ? data.see_log : 0 })
  62. })
  63. },
  64. openJp(){
  65. dd.confirm({
  66. title: '提示',
  67. content: '你确定发放奖票吗?',
  68. confirmButtonText: '确定',
  69. cancelButtonText: '取消',
  70. success: (result) => {
  71. if (result.confirm) {
  72. app.$post("api/integral/ticket/create", { event_ids: that.data.review_id},'application/vnd.test.v2+json').then((res) => {
  73. app.globalData.showToast("已发放");
  74. dd.navigateTo({
  75. url: '../awardDetail/awardDetail?event_id=' + that.data.review_id
  76. })
  77. })
  78. }
  79. },
  80. });
  81. },
  82. openCx() {
  83. dd.confirm({
  84. title: '撤销奖扣',
  85. content: '你确定撤销此项吗?',
  86. confirmButtonText: '确定',
  87. cancelButtonText: '取消',
  88. success: (result) => {
  89. if (result.confirm) {
  90. app.$post("api/integral/review/prize/destroy", { target_id: that.data.review_id, type: 1 }).then((res) => {
  91. app.globalData.showToast("已撤销");
  92. setTimeout(() => {
  93. dd.navigateBack({
  94. delta: 1
  95. })
  96. }, 1000);
  97. })
  98. }
  99. },
  100. });
  101. },
  102. // 查看日志详情
  103. openLog() {
  104. dd.navigateTo({
  105. url: '../logDetail/logDetail?id=' + this.data.review_id
  106. })
  107. },
  108. showImg(e) {
  109. var index = e.target.dataset.index;
  110. var item = e.target.dataset.item
  111. dd.previewImage({
  112. current: index,
  113. urls: item
  114. });
  115. },
  116. activeItem(e) {
  117. var index = e.target.dataset.index;
  118. this.setData({ activeIndex: index })
  119. },
  120. openSearch() {
  121. app.globalData.showToast("暂不支持筛选");
  122. },
  123. getDetail() {
  124. app.$get("api/integral/statistics/integral/info", { event_id: that.data.review_id }).then((res) => {
  125. var data = res.data.data;
  126. app.globalData.types.forEach(item => {
  127. if (item.id == data.pt_id) {
  128. data.typeName = item.name
  129. }
  130. });
  131. this.setData({ dataDetail: data })
  132. })
  133. },
  134. });