|
- let config = require("../../config/config.js");
- let app = getApp();
- const Http = require("../../utils/HttpBasics");
- const util = require("../../utils/util");
- var WxParse = require('../../wxParse/wxParse.js');
- const imgurl = require("../../utils/imgurl");
- Page({
- data: {
- data: {},
- status:1,
- couponId: null,
- orderId: "",
- day: "",
- hour: "",
- activityId:"",
- wmhome: imgurl.wmhome.url,
- minute: "",
- nodes: ''
- },
- onLoad(options) {
- let that = this;
- if (options.id){
- that.setData({
- activityId: options.id
- })
- Http.get({
- url: config.api.acfindById,
- data: {
- id: options.id
- }
- }).then(res => {
- if (res && res.data && res.data.activity){
- that.setData({
- data: res.data.activity
- })
- if (res.data.activity.type == 2) {
- wx.request({
- url: 'https://ciformall.youlane.cn/C/api' + config.api.acPrintHtmlById,
- data: {
- id: options.id,
- date: new Date(),
- token: app.globalData.token,
- },
- header: {
- 'content-type': 'application/html'
- },
- success: function (res) {
- var temp = WxParse.wxParse('article', 'html', res.data, that, 5);
- }
- })
- }
- }
- if (res && res.data && res.data.status) {
- that.setData({
- status: res.data.status
- });
- }
-
- }).catch(err => {
- wx.showToast({
- title: err.errMsg,
- icon: 'none',
- duration: 2000,
- mask: false
- })
- })
- }
- },
- //跳转到报名详情页
- goSignUp(e){
- let activityId = e.currentTarget.dataset.activityid;
- wx.navigateTo({
- url: `/pages/radetail/joinActivity/edit?activityId=${activityId}`,
- })
- },
- goback: function () {
- wx.switchTab({
- url: '/pages/main/index',
- })
- },
- gotoactdetail:function(){
- let that = this;
- console.log(that.data.data.detail)
-
- wx.navigateTo({
- url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
- })
- }
- });
|