1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import Api from "../../model/api";
- import {logicStatus} from "../../model/enum";
- import User from "../../model/user";
- Page({
- data: {
- show: false,
- id: '',
- info: {},
- arr: [],
- logicStatusEnum: logicStatus,
- isComplete: null
- },
- async onLoad(options) {
- const {id, isComplete} = options;
- let res = await Api.getRecommendInfo(id, true);
- this.setData({
- isComplete, id,
- arr: res.data.rows[0],
- })
- },
- toNewsDetail(e) {
- console.log('e', e);
- // this.setData({
- // show: true
- // })
- wx.showModal({
- title: '是否确认报名?',
- success: (res) => {
- if (res.confirm) {
- this.submitSignup();
- }
- }
- });
- },
- async submitSignup() {
- const user = User.getUserInfoByLocal();
- await Api.signUp({
- teamId: this.data.id,
- name: user.name,
- phone: user.phone,
- }, true);
- this.setData({
- isComplete: logicStatus.YES
- })
- const eventChannel = this.getOpenerEventChannel()
- eventChannel.emit('sign');
- await wx.showToast({
- title: '报名成功',
- icon: 'success'
- });
- setTimeout(() => {
- wx.navigateBack()
- }, 500);
- }
- });
|