Commit 58e0c738 by 前端

去除掉无用的key定义

1 parent c5be6e69
......@@ -38,6 +38,7 @@ Page({
ifUpdate: false
}) */
if(wx.getStorageSync('initFindCar')){
let _url = `${WXRequest.domain}h5/dist/index.html?sessionid=${sessionid}&sns=${carInfo.sns}&standno=${carInfo.standno}&name=${carInfo.name}&vehicleid=${carInfo.vehicleid}`;
if(carInfo.loginUserId){
_url += `&loginUserId=${carInfo.loginUserId}`;
......@@ -45,6 +46,8 @@ Page({
loginUserId: carInfo.loginUserId
});
}
console.log(sessionid)
console.log(_url);
this.setData({
url: encodeURI(_url),
ifUpdate: true
......
......@@ -22,13 +22,13 @@ Page({
showCancel: false
});*/
}
if(options.carShareInfo){
if (options.carShareInfo) {
wx.setStorageSync('carShareInfo', JSON.parse(decodeURIComponent(options.carShareInfo)));
wx.setStorageSync('loginUserId', options.loginUserId);
}else{
} else {
wx.setStorageSync('carShareInfo', null)
}
if(options.sns){ // 新e盾找车
if (options.sns) { // 新e盾找车
this.setData({
sns: decodeURIComponent(options.sns)
})
......@@ -63,56 +63,51 @@ Page({
onShow: function (options) {
var that = this;
WXRequest.login().then(()=>{
WXRequest.login().then(() => {
const userStatus = wx.getStorageSync("userStatus");
const scene = wx.getStorageSync('scene');
if(scene == '1007' || scene =='1008' || scene == '1044' ){//转发场景
if (scene == '1007' || scene == '1008' || scene == '1044') { //转发场景
if(userStatus === 2){//转发新用户
if (userStatus === 2) { //转发新用户
that.setData({
modalHidden: false,
userInfoAuth: false
});
return;
wx.getSetting({
success(res) {console.log(res)
success(res) {
console.log(res)
if (!res.authSetting['scope.userInfo']) {
that.setData({
modalHidden: false,
userInfoAuth: false
});
}else{
} else {
wx.switchTab({
url: '../../pages/findCar/findCar'
});
}
}
});
}else if(userStatus === 1){
if (!this.data.isSharePage) { // 老e盾页面分享
} else if (userStatus === 1) {
wx.switchTab({
url: '../../pages/findCar/findCar'
});
} else {
wx.reLaunch({
url: `../../pages/newFindCar/findCar?sns=${encodeURIComponent(this.data.sns)}&isSharePage=true`
});
}
}else if(userStatus === 0){
} else if (userStatus === 0) {
wx.setStorageSync('carShareInfo', null);
wx.switchTab({
url: '../../pages/home/home'
});
}
}else{
} else {
if(userStatus === 2){
if (userStatus === 2) {
wx.redirectTo({
url: '../../pages/login/login'
});
}else{
} else {
wx.switchTab({
url: '../../pages/home/home'
});
......@@ -152,7 +147,7 @@ Page({
},
onGotUserInfo(e) {
if(e.detail.errMsg === 'getUserInfo:ok'){
if (e.detail.errMsg === 'getUserInfo:ok') {
this.setData({
modalHidden: true,
userInfoAuth: true
......@@ -165,37 +160,31 @@ Page({
...e.detail.userInfo,
code: res.code
},
success: function(res) {
success: function (res) {
const data = res.data;
if(res.statusCode === 200){
if (res.statusCode === 200) {
const data = res.data;
if(data.returnCode === '0'){
if (data.returnCode === '0') {
wx.setStorageSync("sessionid", res.header["Set-Cookie"]);
wx.setStorageSync("userStatus", 1);
wx.setStorageSync("userinfo", data.data);
if (!this.data.isSharePage) {
wx.switchTab({
url: '../../pages/findCar/findCar'
});
} else { // 新e盾分享页
wx.reLaunch({
url: `../../pages/newFindCar/findCar?sns=${encodeURIComponent(this.data.sns)}&isSharePage=true`
});
}
}else{
} else {
wx.showModal({
content: data.message,
showCancel: false
});
}
}else if(res.statusCode === 401){
} else if (res.statusCode === 401) {
wx.redirectTo({
url: '../../pages/login/login'
});
}
},
fail(){
fail() {
console.log('fail')
}
});
......
......@@ -57,12 +57,6 @@ Page({
});
}
},
// 新E盾找车
NewEFindCar() {
wx.navigateTo({
url: '../../pages/newFindSearch/findSearch'
});
},
/**
* 生命周期函数--监听页面加载
*/
......
......@@ -33,10 +33,6 @@
<image src="../../images/cmd-freqlog.png"/>调频记录
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</view>
<!-- <view class="weui-cell active" bindtap="NewEFindCar">
<image src="../../images/new-findCar.png"/>"新E盾"找车
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</view> -->
</view>
<view class="cmd-list logout" bindtap="logout" hidden="{{false}}">
退出登录
......
......@@ -32,9 +32,9 @@
.cmd-list .weui-cell.active{
background-color: #fff;
}
.cmd-list .weui-cell .inn{
/* .cmd-list .weui-cell .inn{
}
} */
.cmd-list .weui-cell__ft_in-access{
position: absolute;
top: 50%;
......
......@@ -12,7 +12,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let domain = WXRequest.domain.split('//')[1]
let domain = WXRequest.wxDomain.split('//')[1]
//let _appid = 'wxcad686d44f4c8c4d'; // 旧公众号
let _appid = 'wxb75708fc3ebb3605'; //新公众号
let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${_appid}&redirect_uri=https%3a%2f%2f${domain}%2fopenid.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
......
//const domain = 'https://e-shield.didihu.com.cn/otmini/'; //正式环境
const domain = 'https://e-shield.hhxtechnology.com/otmini/'; //正式环境
// const domain = 'https://devwx.glsx.com.cn/otmini/'; //开发环境
//const domain = 'https://e-shield.hhxtechnology.com/otmini/'; //正式环境
const domain = 'https://devwx.glsx.com.cn/otmini/'; //开发环境
/*
新e盾找车
*/
......@@ -9,6 +9,9 @@ const domain = 'https://e-shield.hhxtechnology.com/otmini/'; //正式环境
// 生产:https://eshield.didihu.com.cn/
const newDomain = 'https://eshield.didihu.com.cn/'
// 公众号授权页面
const wxDomain = 'https://e-shield.hhxtechnology.com/otmini/'
function redirectToLogin(){console.log('redirectToLogin')
wx.redirectTo({
url: '../../pages/login/login'
......@@ -17,6 +20,7 @@ function redirectToLogin(){console.log('redirectToLogin')
module.exports = {
domain,
wxDomain,
login(data){
return new Promise(function(resolve, reject){
wx.showLoading();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!