repetitive_tasks_detail.js 1.7 KB

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