Commit 58e0c738 by 前端

去除掉无用的key定义

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