|
@@ -20,8 +20,26 @@ Page({
|
|
// 进入系统
|
|
// 进入系统
|
|
toJoin: function () {
|
|
toJoin: function () {
|
|
const that = this;
|
|
const that = this;
|
|
- that.setData({ skip: 0, page: 0, list: [] })
|
|
|
|
- wx.navigateTo({ url: `/pagesMatch/system/index` })
|
|
|
|
|
|
+ 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);
|
|
|
|
+ that.setData({ skip: 0, page: 0, list: [] })
|
|
|
|
+ wx.navigateTo({ url: `/pagesMatch/system/index` })
|
|
|
|
+ } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }); }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ fail: async res => {
|
|
|
|
+ wx.redirectTo({ url: '/pages/index/index' })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
},
|
|
},
|
|
// 选择类型
|
|
// 选择类型
|
|
typeChange: function (e) {
|
|
typeChange: function (e) {
|