123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- 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 })
- })
- },
- });
|