repetitive_tasks_detail.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var app = getApp()
  2. var that;
  3. Page({
  4. data: {
  5. date: app.globalData.month,
  6. activeIndex: 1,
  7. id: '',
  8. },
  9. onLoad(e) {
  10. that = this;
  11. dd.setNavigationBar({ title: "重复任务详情" });
  12. if (e.id) {
  13. that.getDetail(e.id);
  14. this.setData({
  15. id: e.id,
  16. })
  17. }
  18. },
  19. //显示图片
  20. showImg(e) {
  21. var index = e.target.dataset.index;
  22. var item = e.target.dataset.item
  23. dd.previewImage({
  24. current: index,
  25. urls: item
  26. });
  27. },
  28. formSubmit() {
  29. dd.confirm({
  30. title: '删除任务',
  31. content: '删除此任务将会删除其相关记录和积分数据,确认删除吗?',
  32. confirmButtonText: '确定',
  33. cancelButtonText: '取消',
  34. success: (result) => {
  35. if (result.confirm) {
  36. app.$get('api/integral/schedule/delete', { schedule_id: this.data.id }).then(res => {
  37. app.globalData.showToast(res.data.msg);
  38. setTimeout(() => {
  39. dd.navigateBack({ delta: 1 })
  40. }, 1000);
  41. })
  42. }
  43. },
  44. });
  45. },
  46. //显示图片
  47. showImg(e) {
  48. var index = e.target.dataset.index;
  49. var item = e.target.dataset.item
  50. dd.previewImage({
  51. current: index,
  52. urls: item
  53. });
  54. },
  55. getDetail(id) {
  56. app.$get("api/integral/schedule", { schedule_id: id }).then((res) => {
  57. var data=res.data.data;
  58. data.img_url=app.globalData.userData.img_url;
  59. this.setData({ dataDetail: res.data.data })
  60. })
  61. },
  62. });