repetitive_tasks_detail.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. formSubmit() {
  20. dd.confirm({
  21. title: '删除任务',
  22. content: '删除此任务将会删除其相关记录和积分数据,确认删除吗?',
  23. confirmButtonText: '确定',
  24. cancelButtonText: '取消',
  25. success: (result) => {
  26. if (result.confirm) {
  27. app.$get('api/integral/schedule/delete', { schedule_id: this.data.id }).then(res => {
  28. app.globalData.showToast(res.data.msg);
  29. setTimeout(() => {
  30. dd.navigateBack({ delta: 1 })
  31. }, 1000);
  32. })
  33. }
  34. },
  35. });
  36. },
  37. //显示图片
  38. showImg(e) {
  39. var index = e.target.dataset.index;
  40. var item = e.target.dataset.item
  41. dd.previewImage({
  42. current: index,
  43. urls: item
  44. });
  45. },
  46. getDetail(id) {
  47. app.$get("api/integral/schedule", { schedule_id: id }).then((res) => {
  48. var data=res.data.data;
  49. data.img_url=app.globalData.userData.img_url;
  50. this.setData({ dataDetail: res.data.data })
  51. })
  52. },
  53. });