@ -0,0 +1,230 @@
|
||||
//app.js
|
||||
var Api = require('./utils/common.js'); |
||||
var code; |
||||
App({ |
||||
onLaunch: function () { |
||||
this.globalData = {}; |
||||
}, |
||||
onShow: function () { |
||||
this.getPower(); |
||||
// wx.getUserProfile({
|
||||
// success: function(res) {
|
||||
// console.log(res.userInfo)
|
||||
// }
|
||||
// })
|
||||
}, |
||||
getPower: function (res) { |
||||
var that = this; |
||||
try { |
||||
const value = wx.getStorageSync('openid') |
||||
if (!value || value == null) { |
||||
wx.redirectTo({ |
||||
url: "/pages/login" |
||||
}) |
||||
} else { |
||||
// that.getUser();
|
||||
} |
||||
} catch (e) {} |
||||
}, |
||||
getUser: function () { |
||||
var that = this; |
||||
wx.getUserProfile({ |
||||
desc:'获取用户信息', |
||||
success: res => { |
||||
console.log('xinxi',res) |
||||
// 保存用户信息到服务端
|
||||
var pid = wx.getStorageSync('user_pid') |
||||
if (!pid || pid == null) { |
||||
pid = 0; |
||||
} |
||||
var iv = res.iv; |
||||
var encryptedData = res.encryptedData; |
||||
that.goIndex(code, iv, encryptedData, pid) |
||||
} |
||||
}) |
||||
// wx.getSetting({
|
||||
// success: setting => {
|
||||
wx.login({ |
||||
success: function (res) { |
||||
if (res.code) { |
||||
code = res.code; |
||||
|
||||
|
||||
// wx.getUserProfile({
|
||||
// desc:'获取用户信息',
|
||||
// success: res => {
|
||||
// console.log('xinxi',res)
|
||||
// // 保存用户信息到服务端
|
||||
// var pid = wx.getStorageSync('user_pid')
|
||||
// if (!pid || pid == null) {
|
||||
// pid = 0;
|
||||
// }
|
||||
// var iv = res.iv;
|
||||
// var encryptedData = res.encryptedData;
|
||||
// that.goIndex(code, iv, encryptedData, pid)
|
||||
// }
|
||||
// })
|
||||
|
||||
|
||||
|
||||
} else { |
||||
console.log("error code " + res.errMsg); |
||||
} |
||||
} |
||||
}) |
||||
// }
|
||||
// })
|
||||
}, |
||||
goIndex: function (code, iv, encryptedData, pid) { |
||||
var that = this; |
||||
var phone; |
||||
wx.showLoading({ |
||||
title: '加载中', |
||||
}) |
||||
wx.request({ |
||||
url: Api.getAPILoader(), |
||||
data: { |
||||
jsCode: code, |
||||
}, |
||||
method: "get", |
||||
header: { |
||||
"Content-Type": "application/x-www-form-urlencoded" |
||||
}, |
||||
success: function (res) { |
||||
var res = res.data; |
||||
if (res.code == 0) { |
||||
var datas = res.data; |
||||
wx.request({ |
||||
url: Api.getphone(), |
||||
data: { |
||||
encryptedData: encryptedData, |
||||
iv: iv, |
||||
sessionKey: datas.sessionKey, |
||||
}, |
||||
method: "get", |
||||
header: { |
||||
"Content-Type": "application/x-www-form-urlencoded" |
||||
}, |
||||
success: function (res) { |
||||
var res = res.data; |
||||
if (res.code == 0) { |
||||
phone = res.data.phoneNumber |
||||
} |
||||
}, |
||||
fail: function (error) { |
||||
console.log(error); |
||||
} |
||||
}) |
||||
wx.request({ |
||||
url: Api.getUserInfo(), |
||||
data: { |
||||
encryptedData: encryptedData, |
||||
iv: iv, |
||||
sessionKey: datas.sessionKey, |
||||
}, |
||||
method: "get", |
||||
header: { |
||||
"Content-Type": "application/x-www-form-urlencoded" |
||||
}, |
||||
success: function (res) { |
||||
var res = res.data; |
||||
if (res.code == 0) { |
||||
that.sign(datas.openid, datas.unionid, res.data, phone); |
||||
} |
||||
}, |
||||
fail: function (error) { |
||||
console.log(error); |
||||
} |
||||
}) |
||||
} else { |
||||
wx.hideLoading(); |
||||
wx.showToast({ |
||||
title: '登录失败', |
||||
icon: 'none' |
||||
}) |
||||
} |
||||
}, |
||||
fail: function (error) { |
||||
console.log(error); |
||||
} |
||||
}) |
||||
|
||||
}, |
||||
sign: function (openid, unionid, info, phone) { |
||||
var that = this; |
||||
wx.request({ |
||||
url: Api.getAPISign(), |
||||
data: { |
||||
openId: openid, |
||||
unionId: unionid, |
||||
gender: info.gender, |
||||
nickname: info.nickName, |
||||
userPhoto: info.avatarUrl, |
||||
phone: phone |
||||
}, |
||||
method: "post", |
||||
header: { |
||||
"Content-Type": "application/x-www-form-urlencoded" |
||||
}, |
||||
success: function (res) { |
||||
var res = res.data; |
||||
if (res.code == 0) { |
||||
var datas = res.data; |
||||
wx.setStorage({ |
||||
key: 'user', |
||||
data: datas, |
||||
}) |
||||
that.getImgUrl(); |
||||
//判断用户是否初次登录
|
||||
if (!wx.getStorageSync('openid')) { |
||||
wx.setStorage({ |
||||
key: 'openid', |
||||
data: datas.openId, |
||||
}); |
||||
wx.setStorage({ |
||||
key: 'token', |
||||
data: datas.token, |
||||
}); |
||||
wx.switchTab({ |
||||
url: "/pages/index/index" |
||||
}) |
||||
} else { |
||||
wx.navigateBack({ |
||||
delta: 1 |
||||
}) |
||||
} |
||||
wx.hideLoading(); |
||||
}else { |
||||
wx.hideLoading(); |
||||
wx.showToast({ |
||||
title: '登录失败', |
||||
icon: 'none' |
||||
}) |
||||
} |
||||
}, |
||||
fail: function (error) { |
||||
console.log(error); |
||||
} |
||||
}) |
||||
}, |
||||
getImgUrl:function(){ |
||||
wx.request({ |
||||
url: Api.getImgUrl(), |
||||
data: {}, |
||||
method: "post", |
||||
header: { |
||||
"Content-Type": "application/x-www-form-urlencoded" |
||||
}, |
||||
success: function (res) { |
||||
wx.setStorage({ |
||||
key: 'imgUrl', |
||||
data: res.data.msg, |
||||
}); |
||||
}, |
||||
fail: function (error) { |
||||
console.log(error); |
||||
} |
||||
}) |
||||
|
||||
}, |
||||
}) |
@ -0,0 +1,112 @@
|
||||
{ |
||||
"pages": [ |
||||
"pages/index/index", |
||||
"pages/picker/picker", |
||||
"pages/login", |
||||
"pages/logs/logs", |
||||
"pages/club/club", |
||||
"pages/message/message", |
||||
"pages/rank/rank", |
||||
"pages/center/center", |
||||
"pages/index/search/search", |
||||
"pages/index/club/club", |
||||
"pages/index/active/active", |
||||
"pages/index/activeing/activeing", |
||||
"pages/index/rank/rank", |
||||
"pages/index/activeDetail/activeDetail", |
||||
"pages/index/join/join", |
||||
"pages/index/teamJoin/teamJoin", |
||||
"pages/index/myjoin/myjoin", |
||||
"pages/index/history/history", |
||||
"pages/index/editjoin/editjoin", |
||||
"pages/message/clubmessage/clubmessage", |
||||
"pages/message/sysmessage/sysmessage", |
||||
"pages/message/activemessage/activemessage", |
||||
"pages/message/hostmessage/hostmessage", |
||||
"pages/center/cash/cash", |
||||
"pages/center/cashok/cashok", |
||||
"pages/center/cashlist/cashlist", |
||||
"pages/center/coupon/coupon", |
||||
"pages/club/mark/mark", |
||||
"pages/club/createClub/createClub", |
||||
"pages/club/clubDetail/clubDetail", |
||||
"pages/club/manage/manage", |
||||
"pages/club/clubgroups/clubgroups", |
||||
"pages/club/clublist/clublist", |
||||
"pages/club/popname/popname", |
||||
"pages/club/removesb/removesb", |
||||
"pages/club/deputy/deputy", |
||||
"pages/club/account/account", |
||||
"pages/club/setadmin/setadmin", |
||||
"pages/club/album/album", |
||||
"pages/club/albumdetail/albumdetail", |
||||
"pages/release/release", |
||||
"pages/release/addactive/addactive", |
||||
"pages/release/addrequired/addrequired", |
||||
"pages/release/manageac/manageac", |
||||
"pages/release/manageIndex/manageIndex", |
||||
"pages/release/messageset/messageset", |
||||
"pages/release/signIndex/signIndex", |
||||
"pages/release/updateactive/updateactive", |
||||
"pages/release/addjoiner/addjoiner", |
||||
"pages/release/activeSign/activeSign", |
||||
"pages/club/clubTag/clubTag", |
||||
"pages/release/scave/scave", |
||||
"pages/center/info/info", |
||||
"pages/center/order/order", |
||||
"pages/center/orderdetail/orderdetail", |
||||
"pages/release/extend/extend", |
||||
"pages/release/census/census", |
||||
"pages/release/map/map", |
||||
"pages/release/sendmessage/sendmessage", |
||||
"pages/index/order/order", |
||||
"pages/center/advice/advice", |
||||
"pages/index/activeList/activeList", |
||||
"pages/release/quan/quan", |
||||
"pages/release/addCoupon/addcoupon", |
||||
"pages/index/payOK/payok" |
||||
], |
||||
"window": { |
||||
"backgroundTextStyle": "light", |
||||
"navigationBarBackgroundColor": "#FFCB12", |
||||
"navigationBarTitleText": "报名了", |
||||
"navigationBarTextStyle": "black" |
||||
}, |
||||
"tabBar": { |
||||
"list": [ |
||||
{ |
||||
"pagePath": "pages/index/index", |
||||
"iconPath": "/images/star.png", |
||||
"selectedIconPath": "/images/stars.png", |
||||
"text": "活动" |
||||
}, |
||||
{ |
||||
"pagePath": "pages/club/club", |
||||
"iconPath": "/images/ju.png", |
||||
"selectedIconPath": "/images/jus.png", |
||||
"text": "俱乐部" |
||||
}, |
||||
{ |
||||
"pagePath": "pages/release/release", |
||||
"iconPath": "/images/pai.png", |
||||
"selectedIconPath": "/images/pais.png", |
||||
"text": "发布" |
||||
}, |
||||
{ |
||||
"pagePath": "pages/message/message", |
||||
"iconPath": "/images/mes.png", |
||||
"selectedIconPath": "/images/mess.png", |
||||
"text": "消息" |
||||
}, |
||||
{ |
||||
"pagePath": "pages/center/center", |
||||
"iconPath": "/images/cen.png", |
||||
"selectedIconPath": "/images/cens.png", |
||||
"text": "个人中心" |
||||
} |
||||
], |
||||
"color": "#808080", |
||||
"selectedColor": "#F7C30C" |
||||
}, |
||||
"sitemapLocation": "sitemap.json" |
||||
} |
@ -0,0 +1,13 @@
|
||||
/**app.wxss**/ |
||||
page{background:#fafafa;} |
||||
.container { |
||||
height: 100%; |
||||
width:100%; |
||||
box-sizing: border-box; |
||||
background: #fafafa; |
||||
} |
||||
.defalt-style{color:#959595;font-size:26rpx;} |
||||
.red{color:#FF3C21} |
||||
.yellow{color:#FFAC0C} |
||||
.orangeO1{color:#F66A01} |
||||
.green{color:#00C777} |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 958 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 453 B |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 709 B |
After Width: | Height: | Size: 471 B |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 810 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 440 B |
After Width: | Height: | Size: 689 B |
After Width: | Height: | Size: 679 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 866 B |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 560 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 410 B |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 208 B |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 868 B |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 716 B |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 545 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 108 KiB |
After Width: | Height: | Size: 426 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 873 B |
After Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 683 B |
After Width: | Height: | Size: 689 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 790 B |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 947 B |
After Width: | Height: | Size: 1.1 KiB |