var app = getApp() var that; Page({ data: { date: app.globalData.month, review_id: '', userId: '', see_log: 1, is:false, is2:false, }, onLoad(e) { that = this; dd.setNavigationBar({ title: "事件详情" }); that.setData({ userId: app.globalData.userData.id }) if (e.id) { that.setData({ review_id: e.id }) } if(e.is){ that.setData({ is:true }) } if(e.is2){ that.setData({ is2:true }) } }, onShow() { if (app.globalData.userData) { dd.hideLoading(); that.getDetail(); that.cheakAx(); } else { app.login(app.globalData.corpId, function (is) { if (is) { dd.hideLoading(); that.getDetail(); that.cheakAx(); } else { dd.reLaunch({ url: '../../noJurisdiction/noJurisdiction' }) } }, function () { }) } }, openDetail(){ dd.navigateTo({ url: '../awardDetail/awardDetail?event_id=' + that.data.review_id }) }, cheakAx() { app.$get("api/integral/site/config", {}).then((res) => { var data = res.data.data; this.setData({ see_log: data.see_log ? data.see_log : 0 }) }) }, openJp(){ dd.confirm({ title: '提示', content: '你确定发放奖票吗?', confirmButtonText: '确定', cancelButtonText: '取消', success: (result) => { if (result.confirm) { app.$post("api/integral/ticket/create", { event_ids: that.data.review_id},'application/vnd.test.v2+json').then((res) => { app.globalData.showToast("已发放"); dd.navigateTo({ url: '../awardDetail/awardDetail?event_id=' + that.data.review_id }) }) } }, }); }, openCx() { dd.confirm({ title: '撤销奖扣', content: '你确定撤销此项吗?', confirmButtonText: '确定', cancelButtonText: '取消', success: (result) => { if (result.confirm) { app.$post("api/integral/review/prize/destroy", { target_id: that.data.review_id, type: 1 }).then((res) => { app.globalData.showToast("已撤销"); setTimeout(() => { dd.navigateBack({ delta: 1 }) }, 1000); }) } }, }); }, // 查看日志详情 openLog() { dd.navigateTo({ url: '../logDetail/logDetail?id=' + this.data.review_id }) }, showImg(e) { var index = e.target.dataset.index; var item = e.target.dataset.item dd.previewImage({ current: index, urls: item }); }, activeItem(e) { var index = e.target.dataset.index; this.setData({ activeIndex: index }) }, openSearch() { app.globalData.showToast("暂不支持筛选"); }, getDetail() { app.$get("api/integral/statistics/integral/info", { event_id: that.data.review_id }).then((res) => { var data = res.data.data; app.globalData.types.forEach(item => { if (item.id == data.pt_id) { data.typeName = item.name } }); this.setData({ dataDetail: data }) }) }, });