|
- const util = require("../../utils/util.js");
- const Http = require("../../utils/HttpBasics");
- const config = require("../../config/config");
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- showPage: false,
- showPage1:false
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- let that = this;
- if(options&&options.id){
- that.signIn(options.id);
- that.setData({
- id:options.id
- })
- }
- },
- signIn(id){
- let that = this;
- Http.post({
- url: config.api.activitySign,
- data: {
- activityId:id
- }
- }).then(res => {
- console.log(res)
- that.setData({
- showPage:true
- })
- }).catch(err=>{
- console.log(err);
- that.setData({
- showPage1: true
- })
- })
- },
- //跳转到报名详情页
- goSignUp(e) {
- let activityId = e.currentTarget.dataset.id;
- if (activityId){
- wx.navigateTo({
- url: `/pages/radetail/index?id=${activityId}`,
- })
- }else{
- wx.showToast({
- title: '此活动报名已结束',
- })
- }
-
- },
- goback: function () {
- wx.switchTab({
- url: '/pages/main/index',
- })
- },
- })
|