|
@@ -50,7 +50,23 @@ Page({
|
|
|
//比赛报名
|
|
|
toSign: function (e) {
|
|
|
const { item } = e.currentTarget.dataset;
|
|
|
- wx.navigateTo({ url: `/pagesMatch/match/sign?id=${item._id}` })
|
|
|
+ wx.getStorage({
|
|
|
+ key: 'user',
|
|
|
+ success: async res => {
|
|
|
+ if (res.data.type == '10') {
|
|
|
+ wx.showModal({ title: '提示', content: '游客不能进入比赛系统,请注册成为正式用户' })
|
|
|
+ } else {
|
|
|
+ const arr = await app.$post(`/user/login`, { openid: res.data.openid }, 'race');
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ wx.setStorageSync('raceuser', arr.data);
|
|
|
+ wx.navigateTo({ url: `/pagesMatch/match/sign?id=${item._id}` })
|
|
|
+ } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }); }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: async res => {
|
|
|
+ wx.redirectTo({ url: '/pages/index/index' })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 赛事项目详细信息
|
|
|
toAchieve: function (e) {
|