master
zsk 2 years ago
parent a7c8ea711e
commit ef72321926

@ -6,10 +6,12 @@ App({
sessionId: '',
headers2: {
"content-type": "multipart/form-data",
Authorization: "",
'Cookie': ''
},
headers: {
"content-type": "application/x-www-form-urlencoded",
Authorization: "",
'Cookie': ''
},
userLoginTokenInfo: {
@ -118,32 +120,91 @@ App({
},
getLoginUserTokenInfo: function() {
var that = this;
// debugger;
try {
var value = wx.getStorageSync('loginUserTokenInfo');
var value = wx.getStorageSync("loginUserTokenInfo");
console.log(value);
if (value) {
that.globalData.userLoginTokenInfo = value;
// console.log(that.isNotEmptyCheck(that.globalData.userLoginTokenInfo.token));
if (that.isNotEmptyCheck(that.globalData.userLoginTokenInfo.token)) {
let token = that.globalData.userLoginTokenInfo.token;
that.globalData.header.Authorization = "Bearer " + token;
that.globalData.headers2.Authorization = "Bearer " + token;
that.globalData.headers.Authorization = "Bearer " + token;
console.log(that.globalData.headers);
wx.request({
url: that.globalData.ip + "/checkToken",
method: "GET",
header: that.globalData.headers,
success: function (res) {
console.log(res);
if (res.data.status == 200) {
if (wx.getStorageSync("messageClick" + res.data.data.id)) {
console.log("messageClick" + res.data.data.id);
} else {
wx.setStorageSync("messageClick" + res.data.data.id, false);
}
that.globalData.isLogin = true;
that.globalData.test = "b";
that.globalData.user = res.data.data.user;
// that.globalData.user.idauth = 0;
if (that.isNotEmptyCheck(that.globalData.userLoginTokenInfo.tel)) {
that.globalData.loginUserInfo = res.data.data;
console.log(that.globalData.loginUserInfo);
that.getServiceInfo().then(() => {
console.log("getServiceInfo");
});
console.log("getLoginUserTokenInfo" + "+++++++++++++++++++++++++++++++++++++++++++");
if (that.userLoginCallback) {
that.userLoginCallback(res);
}
} else {
//已过期
that.globalData.autoLoginTag = 1;
// that.appLoginByTel();
// that.globalData.isLogin = false;
return new Promise(function (resolve, reject) {
try {
that.appLoginByTel(resolve, reject);
} catch (e) {
console.log('设置登录信息错误');
console.log("设置登录信息错误");
console.log(e);
reject();
}
});
}
},
});
// console.log(that.globalData.isLogin);
} else if (that.isNotEmptyCheck(that.globalData.userLoginTokenInfo.tel)) {
that.globalData.autoLoginTag = 1;
return new Promise(function (resolve, reject) {
try {
that.appLoginByTel(resolve, reject);
} catch (e) {
console.log("设置登录信息错误");
console.log(e);
reject();
}
});
}
console.log('获取用户登录信息---------------start');
console.log(value);
console.log('获取用户登录信息---------------end');
} else {
if (that.userLoginCallback) {
that.userLoginCallback();
}
}
console.log("获取用户登录信息---------------start");
console.log(that.globalData.test);
// that.globalData.isLogin = true
setTimeout(() => {
console.log(that.globalData.isLogin);
}, 1000);
console.log("获取用户登录信息---------------end");
} catch (e) {
console.log('获取登录信息错误');
console.log("获取登录信息错误");
console.log(e);
}
},
@ -226,11 +287,11 @@ App({
console.log(that.globalData);
console.log("login====result=======2");
wx.showToast({
title: '登录成功',
icon: 'success',
duration: 2000
})
// wx.showToast({
// title: '登录成功',
// icon: 'success',
// duration: 2000
// })
}
})
},
@ -243,6 +304,8 @@ App({
that.globalData.sessionId = '';
that.globalData.headers.Cookie = '';
that.globalData.headers2.Cookie = '';
that.globalData.headers.Authorization = "";
that.globalData.headers2.Authorization = "";
that.globalData.isLogin = false;
that.globalData.hasUserInfo = 0;
that.globalData.loginUserInfo = {};
@ -261,7 +324,7 @@ App({
title: title,
content: content,
showCancel: false,
confirmColor: "#e60012",
confirmColor: "#0dcc91",
confirmText: btxt,
success: function (res) {
if (res.confirm) {

@ -111,6 +111,10 @@
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"requiredPrivateInfos":[
"chooseLocation",
"getLocation"
],
"requiredBackgroundModes": [
"audio"
],

@ -824,7 +824,7 @@ button::after {
width: 260px;
height: 42px;
opacity: 1;
background: var(--color-yc);
background-color: var(--color-yc);
border-radius: 25px;
font-size: 18px;
font-weight: 601;
@ -834,7 +834,7 @@ button::after {
margin-top: 100px;
}
.loginOut:active,.loginOut:hover,.loginOut:focus{
background: var(--color-ych);
background-color: var(--color-ych);
}
.staticTitle {
margin-top: 20px;

@ -43,12 +43,12 @@
</view>
</scroll-view>
<view class="f12 tc c045 display-flex" style="align-items:center;margin-left:37px;margin-bottom: 16px;margin-top:120px;">
<!-- <switch checked="{{switch1Checked}}" class="dib" color="#027AFF" style="transform:scale(.5)" bindchange="switch1Change" /> -->
<!-- <switch checked="{{switch1Checked}}" class="dib" color="var(--color-yc)" style="transform:scale(.5)" bindchange="switch1Change" /> -->
<radio-group class="dib">
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="#027AFF" style="transform:scale(.7)" />
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="var(--color-yc)" style="transform:scale(.7)" />
</radio-group>
我已阅读并同意
<navigator url="../serviceTerm/index" class="aLink" style="color:#027AFF;">《用户服务协议》</navigator>
<navigator url="../serviceTerm/index" class="aLink" style="color:var(--color-yc);">《用户服务协议》</navigator>
<navigator url="../secret/index" style="color:#027AFF;">《隐私政策》</navigator>
<navigator url="../secret/index" style="color:var(--color-yc);">《隐私政策》</navigator>
</view>

@ -49,12 +49,12 @@
</navigator>
</view>
<view class="f12 tc c045 display-flex" style="align-items:center;margin-left:37px;margin-bottom: 16px;margin-top:120px;">
<!-- <switch checked="{{switch1Checked}}" class="dib" color="#027AFF" style="transform:scale(.5)" bindchange="switch1Change" /> -->
<!-- <switch checked="{{switch1Checked}}" class="dib" color="var(--color-yc)" style="transform:scale(.5)" bindchange="switch1Change" /> -->
<radio-group class="dib">
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="#027AFF" style="transform:scale(.7)" />
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="var(--color-yc)" style="transform:scale(.7)" />
</radio-group>
我已阅读并同意
<navigator url="../serviceTerm/index" class="aLink" style="color:#027AFF;">《用户服务协议》</navigator>
<navigator url="../serviceTerm/index" class="aLink" style="color:var(--color-yc);">《用户服务协议》</navigator>
<navigator url="../secret/index" style="color:#027AFF;">《隐私政策》</navigator>
<navigator url="../secret/index" style="color:var(--color-yc);">《隐私政策》</navigator>
</view>

@ -21,7 +21,7 @@
<i class="iconfont icon-jia f12"></i>
</view>
<view wx:if="{{item.classify == 1}}" class="f12" style="color:#027AFF;">
<view wx:if="{{item.classify == 1}}" class="f12" style="color:var(--color-yc);">
<i class="iconfont icon-gongsi f12"></i>
公司
</view>
@ -32,7 +32,7 @@
</view>
<view class="mt12">
<radio value="{{item.id}}" checked="{{item.defaultFlag == 1}}" color="#027AFF"
<radio value="{{item.id}}" checked="{{item.defaultFlag == 1}}" color="var(--color-yc)"
style="transform: scale(0.7);" />
<text class="f14 {{item.defaultFlag == 1 ? 'cf00' : 'c9'}}">{{item.defaultFlag == 1 ? '已设为默认' :
'设为默认'}}</text>

@ -95,9 +95,9 @@
</scroll-view>
<view class="f12 tc c045 mt36">
<!-- <switch checked="{{switch1Checked}}" class="dib" color="#027AFF" style="transform:scale(.5)" bindchange="switch1Change" /> -->
<!-- <switch checked="{{switch1Checked}}" class="dib" color="var(--color-yc)" style="transform:scale(.5)" bindchange="switch1Change" /> -->
<radio-group class="dib">
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="#027AFF" style="transform:scale(.7)" />
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="var(--color-yc)" style="transform:scale(.7)" />
</radio-group>
我已阅读并同意
<navigator url="../serviceTerm/index" class="aLink">

@ -7,7 +7,7 @@
<view>{{item.name}}</view>
</view>
<view class="weui-cell__ft">
<radio class="weui-check" value="{{item.value}}" checked="{{item.checked}}" color="#027AFF"/>
<radio class="weui-check" value="{{item.value}}" checked="{{item.checked}}" color="var(--color-yc)"/>
<i class="weui-icon-checked"></i>
</view>
</label>

@ -62,7 +62,7 @@
<view class="mg020 pb10 bb1 v-center">
<view wx:if="{{jobDetail.poses.store.latitude}}">
<i class="iconfont icon-dizhi11 f18 mr10 lh1" style="color:#027AFF;"></i>
<i class="iconfont icon-dizhi11 f18 mr10 lh1" style="color:var(--color-yc);"></i>
</view>
<view class="address" bindtap="openMap" data-lat="{{jobDetail.poses.store.latitude}}" data-lng="{{jobDetail.poses.store.longitude}}" data-address="{{jobDetail.poses.store.posContent}}">{{jobDetail.poses.store.posContent ? jobDetail.poses.store.posContent :'暂无地址信息'}}</view>
<view>

@ -1,12 +1,4 @@
/* pages/index/index.wxss */
#nav {
text-align: center;
background: #eeeeee;
margin: 1em;
padding: 1em;
border-radius: 5px;
}
#add {
margin: 1em;
page{
overflow-x: hidden !important;
}

@ -14,7 +14,7 @@ Page({
reg_type:'a',
wxCode: '',
btnColor:false,
switch1Checked: true,
switch1Checked: false,
},
switch1Change: function (e) {
console.log("radio发生change事件携带value值为", e.detail.value);
@ -178,10 +178,13 @@ Page({
code: that.data.wxCode,
iv: iv,
encryptedData: encryptedData,
type: "yishoudan",
appId:'wxd7aba642f7fd77fd'
},
success: function (res) {
console.log(res);
app.globalData.openId = res.data.data.openId;
app.globalData.unionid = res.data.data.unionid;
let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null);
promise.then(res => {
wx.reLaunch({
@ -209,6 +212,8 @@ Page({
code: res.code,
iv: iv,
encryptedData: encryptedData,
type: "dtdl",
appId:'wxd7aba642f7fd77fd'
},
success: function (res) {
console.log(res);
@ -288,7 +293,7 @@ Page({
}
wx.request({
url: app.globalData.ip + '/appLoginByTel',
url: app.globalData.ip + '/appLoginByTelYiShouDan',
data: {
tel: that.data.tel,
code: that.data.msgCode,
@ -297,6 +302,8 @@ Page({
autoLoginTag: 0,
loginType: 'login',
isScanQRCodes: app.globalData.isScanQRCodes,
wxCode: that.data.wxCode,
appId:'wxd7aba642f7fd77fd'
},
header: {
'content-type': 'application/json'
@ -307,71 +314,83 @@ Page({
console.log(res.data);
if (res.data.status == 200) {
that.setLoginData(res);
} else {
wx.showToast({
icon: "none",
title: res.data.msg,
duration: 2000
})
}
}
})
//console.log('form发生了submit事件携带数据为', e.detail.value)
},
setLoginData(res) {
app.globalData.user = res.data.data.user;
app.globalData.sessionId = res.data.data.sessionId;
app.globalData.headers.Cookie = 'JSESSIONID=' + res.data.data.sessionId;
app.globalData.headers2.Cookie = 'JSESSIONID=' + res.data.data.sessionId;
app.globalData.headers.Cookie = "JSESSIONID=" + res.data.data.sessionId;
app.globalData.headers2.Cookie = "JSESSIONID=" + res.data.data.sessionId;
app.globalData.isLogin = true;
app.globalData.agencyStatus = res.data.data.agencyStatus;
app.globalData.loginUserInfo = res.data.data;
//登录设置缓存
app.globalData.userLoginTokenInfo.tel = res.data.data.tel;
app.globalData.userLoginTokenInfo.token = null;
wx.setStorageSync('loginUserTokenInfo', app.globalData.userLoginTokenInfo);
wx.setStorageSync("loginUserTokenInfo", app.globalData.userLoginTokenInfo);
console.log(111);
try {
var comeFrom = wx.getStorageSync('comeFromPage');
var comeFrom = wx.getStorageSync("comeFromPage");
// var comeFromPageParam = wx.getStorageSync('comeFromPageParam');
if(comeFrom == 'me') {
console.log(comeFrom);
if (comeFrom == "me") {
wx.reLaunch({
url: '/pages/me/index'
})
} else if (comeFrom == 'index') {
url: "/pages/me/index",
});
} else if (comeFrom == "index") {
wx.reLaunch({
url: '/pages/tgIndex/index'
})
} else if (comeFrom == 'detail') {
url: "/pages/index/index",
});
} else if (comeFrom == "detail") {
wx.navigateBack({
delta: 1
})
delta: 1,
});
// wx.reLaunch({
// url: "/pages/detail/index?storeJobId=" + comeFromPageParam.storeJobId
// })
} else if (comeFrom == "collect") {
wx.reLaunch({
url: "/pages/collect/index",
});
} else if (comeFrom == "BillInfo") {
// console.log(wx.getStorageSync('QRBillInfo'));
// console.log(JSON.stringify(wx.getStorageSync('QRBillInfo')));
wx.reLaunch({
url: "/pages/wodeBillDetail/index?info=" + JSON.stringify(wx.getStorageSync("QRBillInfo")),
});
wx.removeStorageSync("QRBillInfo");
} else {
wx.setStorage({
key: "comeFrom",
data: "login"
})
data: "login",
});
wx.reLaunch({
url: "../me/index"
})
url: "/pages/index/index",
});
}
} catch (e) {
wx.setStorage({
key: "comeFrom",
data: "login"
})
data: "login",
});
wx.reLaunch({
url: "/pages/me/index"
})
}
console.log(222);
} else {
wx.showToast({
icon: "none",
title: res.data.msg,
duration: 2000
})
}
url: "/pages/index/index",
});
}
})
//console.log('form发生了submit事件携带数据为', e.detail.value)
},
ohShitfadeOut() {
var fadeOutTimeout = setTimeout(() => {

@ -4,7 +4,7 @@
<view class="container">
<view class='tc'>
<image src='https://matripe-cms.oss-cn-beijing.aliyuncs.com/pugongying/yicaiLogoBgf.png' class='logoPng' mode='aspectFit'></image>
<view class='logoTxt'>一才找人才啦</view>
<view class='logoTxt'>找工作,到一才!</view>
</view>
<view class="loginForm">
<form bindsubmit="formSubmit">
@ -48,12 +48,12 @@
<view class='ui-poptips-cnt'>{{popErrorMsg}}</view>
</view>
<view class="f12 tc c045 display-flex" style="align-items:center;margin-left:37px;margin-bottom: 16px;margin-top:120px;" wx:if="{{!isFinish}}">
<!-- <switch checked="{{switch1Checked}}" class="dib" color="#027AFF" style="transform:scale(.5)" bindchange="switch1Change" /> -->
<!-- <switch checked="{{switch1Checked}}" class="dib" color="var(--color-yc)" style="transform:scale(.5)" bindchange="switch1Change" /> -->
<radio-group class="dib">
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="#027AFF" style="transform:scale(.7)" />
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="var(--color-yc)" style="transform:scale(.7)" />
</radio-group>
我已阅读并同意
<navigator url="../serviceTerm/index" class="aLink" style="color:#027AFF;">《用户服务协议》</navigator>
<navigator url="../serviceTerm/index" class="aLink" style="color:var(--color-yc);">《用户服务协议》</navigator>
<navigator url="../secret/index" style="color:#027AFF;">《隐私政策》</navigator>
<navigator url="../secret/index" style="color:var(--color-yc);">《隐私政策》</navigator>
</view>

@ -34,7 +34,7 @@
<view class="f12 tc c045 mt36">
<radio-group class="dib">
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="#027AFF" style="transform:scale(.7);position:relative;top:-2px;" />
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="var(--color-yc)" style="transform:scale(.7);position:relative;top:-2px;" />
</radio-group>
我已阅读并同意
<navigator url="../serviceTerm/index" class="aLink">

@ -30,7 +30,7 @@
</form>
<view class="f12 tc c045 mt36">
<radio-group class="dib">
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="#027AFF" style="transform:scale(.7);position:relative;top:-2px;" />
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="var(--color-yc)" style="transform:scale(.7);position:relative;top:-2px;" />
</radio-group>
我已阅读并同意
<navigator url="../serviceTerm/index" class="aLink">

@ -34,7 +34,7 @@
<view class="f12 tc c045 mt36">
<radio-group class="dib">
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="#027AFF" style="transform:scale(.7);position:relative;top:-2px;" />
<radio checked="{{switch1Checked}}" catchtap="switch1Change" value="0" class="dib" color="var(--color-yc)" style="transform:scale(.7);position:relative;top:-2px;" />
</radio-group>
我已阅读并同意
<navigator url="../serviceTerm/index" class="aLink">

@ -31,7 +31,7 @@
</view>
</navigator>
</view>
<view class='loginOut' catchtap='loginOut' hover-class='thover'>
<view class='loginOut2' catchtap='loginOut' hover-class='thover'>
<view class='' >
<text class='f16'>退出登录</text>
</view>

@ -30,7 +30,7 @@ page{
line-height: 24px;
color: #b8b8b8;
}
.loginOut{
.loginOut2{
width: unset;
height: 56px;
background-color: #fff;
@ -43,3 +43,6 @@ page{
font-weight: 400;
overflow: hidden;
}
view.loginOut2:hover,view.loginOut2:active,view.loginOut2:focus{
background-color: #eee;
}

@ -65,5 +65,5 @@
"ignore": [],
"include": []
},
"appid": "wxb1f7c694803f6f00"
"appid": "wxd7aba642f7fd77fd"
}

@ -1,6 +1,6 @@
{
"setting": {
"urlCheck": false,
"urlCheck": true,
"compileHotReLoad": true
},
"condition": {

Loading…
Cancel
Save