|
|
@@ -4,6 +4,8 @@ var baseUrl = BASEURL.BaseUrl()
|
|
|
var baseutils = require('../../utils/baseUtils.js')
|
|
|
var netUtil = require('../../utils/network.js')
|
|
|
var dateutil = require('../../utils/DateTime.js')
|
|
|
+var isregistered
|
|
|
+
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
|
@@ -40,38 +42,49 @@ Page({
|
|
|
btnClick: function (event) {
|
|
|
var that = this
|
|
|
var id = event.currentTarget.id
|
|
|
+ isregistered = wx.getStorageSync('isregistered')
|
|
|
+ console.log('isregistered', isregistered)
|
|
|
+ if (!isregistered) {
|
|
|
+ if (wx.getStorageSync('wxnickName')) {
|
|
|
+ if (id == that.data.idgoBind) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../bindphone/bindphone',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ that.comToast('您当前尚未进行微信授权登录')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!isregistered) {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '您当前尚未与企业关联绑定,是否立即去绑定?',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../bindphone/bindphone',
|
|
|
+ })
|
|
|
+ } else if (res.cancel) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
if (id == that.data.idMyInfo){
|
|
|
- if (!that.data.isregistered){
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '您当前尚未与企业关联绑定,是否立即去绑定?',
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- wx.navigateTo({
|
|
|
- url: '../bindphone/bindphone',
|
|
|
- })
|
|
|
- } else if (res.cancel) {
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
wx.navigateTo({
|
|
|
url: '../perinfo/perinfo',
|
|
|
})
|
|
|
- }
|
|
|
} else if (id == that.data.idCompanyInfo){
|
|
|
wx.navigateTo({
|
|
|
url: '../corporateInfo/corporateInfo',
|
|
|
})
|
|
|
} else if (id == that.data.idAbout){
|
|
|
|
|
|
- } else if (id == that.data.idgoBind){
|
|
|
- wx.navigateTo({
|
|
|
- url: '../bindphone/bindphone',
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
@@ -85,7 +98,10 @@ Page({
|
|
|
headerImg: wx.getStorageSync('wxavatarUrl'),
|
|
|
wxNickname: wx.getStorageSync('wxnickName'),
|
|
|
})
|
|
|
-
|
|
|
+ isregistered = wx.getStorageSync('isregistered')
|
|
|
+ if (!isregistered){
|
|
|
+ return
|
|
|
+ }
|
|
|
that.getMyRank()
|
|
|
},
|
|
|
|
|
|
@@ -101,6 +117,7 @@ Page({
|
|
|
if (res.data.data.pointdata){
|
|
|
var pointdata = res.data.data.pointdata
|
|
|
that.setData({
|
|
|
+ isregistered: res.data.data.isregistered,
|
|
|
pointdata: pointdata,
|
|
|
"curmonth_points": pointdata.curmonth_points, //本月当前积分
|
|
|
"curmonth_rank": pointdata.curmonth_rank,//本月当前排名
|
|
|
@@ -121,7 +138,8 @@ Page({
|
|
|
bindGetUserInfo: function (e) {
|
|
|
var that = this
|
|
|
var userInfo = e.detail.userInfo
|
|
|
- // console.log('bindGetUserInfo', userInfo)
|
|
|
+ if (!userInfo) return
|
|
|
+ console.log('bindGetUserInfo', userInfo)
|
|
|
var nickName = userInfo.nickName
|
|
|
var avatarUrl = userInfo.avatarUrl
|
|
|
var gender = userInfo.gender //性别 0:未知、1:男、2:女
|
|
|
@@ -129,11 +147,9 @@ Page({
|
|
|
var city = userInfo.city
|
|
|
var country = userInfo.country
|
|
|
if (nickName && avatarUrl) {
|
|
|
-
|
|
|
- baseutils.getComOpenid() //获取openid
|
|
|
baseutils.getPersonlEmp()
|
|
|
baseutils.judgeisReg()
|
|
|
-
|
|
|
+ that.getMyRank()
|
|
|
that.setData({
|
|
|
wxNickname: nickName,
|
|
|
wxHeader: avatarUrl,
|
|
|
@@ -148,7 +164,13 @@ Page({
|
|
|
|
|
|
},
|
|
|
|
|
|
-
|
|
|
+ comToast: function (title) {
|
|
|
+ wx.showToast({
|
|
|
+ title: title,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
|
|
|
|