|
- const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px';
- 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");
- const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
- let configUrls = extConfig.attr.configUrl;
- Page({
- data: {
- fenxiang: imgurl.fenxiang1.url,
- navigationBarHeight,
- data: {},
- status: 1,
- couponId: null,
- orderId: "",
- question: [],
- day: "",
- hour: "",
- activityId: "",
- homeSelectedO: imgurl.homeSelectedO.url,
- wmhome: imgurl.wmhome.url,
- minute: "",
- nodes: '',
- },
- onLoad(options) {
- let that = this;
- wx.hideShareMenu();
- if(options&&options.id){
- that.setData({
- activityId: options.id
- })
- that.findById(options.id);
- }
- },
- findById(id) {
- let that = this;
- Http.get({
- url: config.api.acfindById,
- data: {
- id: id
- }
- }).then(res => {
-
- that.setData({
- status: res.data.status
- });
- if (res && res.data && res.data.activity) {
- that.setData({
- data: res.data.activity
- })
-
- that.setData({
- activityStartTime: util.formatTime(res.data.activity.activityStartTime, "yyyy-MM-dd hh:mm:ss"),
- activityEndTime: util.formatTime(res.data.activity.activityEndTime, "yyyy-MM-dd hh:mm:ss"),
- startTime: util.formatTime(res.data.activity.startTime, "yyyy-MM-dd hh:mm:ss"),
- endTime: util.formatTime(res.data.activity.endTime, "yyyy-MM-dd hh:mm:ss")
- })
- if (res.data.activity.type == 2) {
- var temp = WxParse.wxParse('article', 'html', res.data.activity.html, that, 5);
- }
- }
- }).catch(err => {
- wx.showToast({
- title: err.errMsg,
- icon: 'none',
- duration: 2000,
- mask: false
- })
- })
-
- },
- //跳转到报名详情页
- goSignUp(e) {
- wx.showLoading({
- title: '报名中...',
- })
- let activityId = e.currentTarget.dataset.activityid;
- this.checkUserStatus(activityId);
- },
- checkUserStatus(activityId){
- let that = this;
- Http.get({
- url: config.api.checkPhoneStatus,
- data: {}
- }).then(res=>{
- wx.hideLoading()
- wx.navigateTo({
- url: `/pages/radetail/joinActivity/edit?activityId=${activityId}`,
- })
- }).catch(err=>{
- wx.hideLoading()
- wx.navigateTo({
- url: `/pages/getphoneInfo/index?signActivity=${activityId}`,
- })
- })
- },
- goback: function() {
- wx.switchTab({
- url: '/index/index',
- })
- },
- onShareAppMessage: function (options) {
- var that = this;
- let shareObj = {};
- // 来自页面内的按钮的转发
- if (options.from == 'button') {
- var eData = options.target.dataset.id;
- shareObj.path = `/pages/index/index?id=${eData}&type=ra`;
- }
- return shareObj;
- },
- });
|