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
......
const WXRequest = require('../../utils/wxrequest.js'); const WXRequest = require('../../utils/wxrequest.js');
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
modalHidden: true, modalHidden: true,
userInfoAuth: true, userInfoAuth: true,
isSharePage: false, isSharePage: false,
sns: null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options.code) {
wx.setStorageSync('publicCode', options.code);
/*wx.showModal({
content: options.code,
showCancel: false
});*/
}
if(options.carShareInfo){
wx.setStorageSync('carShareInfo', JSON.parse(decodeURIComponent(options.carShareInfo)));
wx.setStorageSync('loginUserId', options.loginUserId);
}else{
wx.setStorageSync('carShareInfo', null)
}
if(options.sns){ // 新e盾找车
this.setData({
sns: decodeURIComponent(options.sns)
})
} else {
this.setData({
sns: null sns: null
}) },
}
if (options.isSharePage) { /**
this.setData({ * 生命周期函数--监听页面加载
isSharePage: true */
}) onLoad: function (options) {
} if (options.code) {
wx.setStorageSync('publicCode', options.code);
/* wx.showModal({ /*wx.showModal({
content: String(options.test), content: options.code,
showCancel: false showCancel: false
});*/ });*/
}
}, if (options.carShareInfo) {
wx.setStorageSync('carShareInfo', JSON.parse(decodeURIComponent(options.carShareInfo)));
/** wx.setStorageSync('loginUserId', options.loginUserId);
* 生命周期函数--监听页面初次渲染完成 } else {
*/ wx.setStorageSync('carShareInfo', null)
onReady: function () { }
if (options.sns) { // 新e盾找车
}, this.setData({
sns: decodeURIComponent(options.sns)
/** })
* 生命周期函数--监听页面显示 } else {
*/ this.setData({
onShow: function (options) { sns: null
var that = this; })
}
WXRequest.login().then(()=>{ if (options.isSharePage) {
const userStatus = wx.getStorageSync("userStatus"); this.setData({
const scene = wx.getStorageSync('scene'); isSharePage: true
if(scene == '1007' || scene =='1008' || scene == '1044' ){//转发场景 })
}
if(userStatus === 2){//转发新用户
that.setData({ /* wx.showModal({
modalHidden: false, content: String(options.test),
userInfoAuth: false showCancel: false
}); });*/
return;
wx.getSetting({ },
success(res) {console.log(res)
if (!res.authSetting['scope.userInfo']) { /**
that.setData({ * 生命周期函数--监听页面初次渲染完成
modalHidden: false, */
userInfoAuth: false onReady: function () {
});
}else{ },
wx.switchTab({
url: '../../pages/findCar/findCar' /**
}); * 生命周期函数--监听页面显示
} */
onShow: function (options) {
var that = this;
WXRequest.login().then(() => {
const userStatus = wx.getStorageSync("userStatus");
const scene = wx.getStorageSync('scene');
if (scene == '1007' || scene == '1008' || scene == '1044') { //转发场景
if (userStatus === 2) { //转发新用户
that.setData({
modalHidden: false,
userInfoAuth: false
});
return;
wx.getSetting({
success(res) {
console.log(res)
if (!res.authSetting['scope.userInfo']) {
that.setData({
modalHidden: false,
userInfoAuth: false
});
} else {
wx.switchTab({
url: '../../pages/findCar/findCar'
});
}
}
});
} else if (userStatus === 1) {
wx.switchTab({
url: '../../pages/findCar/findCar'
});
} else if (userStatus === 0) {
wx.setStorageSync('carShareInfo', null);
wx.switchTab({
url: '../../pages/home/home'
});
}
} else {
if (userStatus === 2) {
wx.redirectTo({
url: '../../pages/login/login'
});
} else {
wx.switchTab({
url: '../../pages/home/home'
});
/*wx.redirectTo({
url: '../../pages/collectCarDetail/collectCarDetail'
});*/
}
} }
}); })
}else if(userStatus === 1){
if (!this.data.isSharePage) { // 老e盾页面分享
wx.switchTab({
url: '../../pages/findCar/findCar'
}); /*setTimeout(()=>{
} else {
wx.reLaunch({
url: `../../pages/newFindCar/findCar?sns=${encodeURIComponent(this.data.sns)}&isSharePage=true`
});
}
}else if(userStatus === 0){
wx.setStorageSync('carShareInfo', null);
wx.switchTab({ wx.switchTab({
url: '../../pages/home/home' url: '../../pages/findCar/findCar'
}); });
} },5000)*/
}else{
if(userStatus === 2){ /*console.log(wx.getStorageSync('scene'))
wx.redirectTo({ if(wx.getStorageSync('scene') == '1044'){
url: '../../pages/login/login' wx.switchTab({
url: '../../pages/mine/mine'
}); });
}else{ }else{
wx.switchTab({ wx.switchTab({
url: '../../pages/home/home' url: '../../pages/findCar/findCar'
}); });
/*wx.redirectTo({ }*/
url: '../../pages/collectCarDetail/collectCarDetail' },
});*/
} /**
} * 生命周期函数--监听页面隐藏
}) */
onHide: function () {
},
onGotUserInfo(e) {
/*setTimeout(()=>{
wx.switchTab({ if (e.detail.errMsg === 'getUserInfo:ok') {
url: '../../pages/findCar/findCar' this.setData({
}); modalHidden: true,
},5000)*/ userInfoAuth: true
});
/*console.log(wx.getStorageSync('scene')) wx.login({
if(wx.getStorageSync('scene') == '1044'){ success: res => {
wx.switchTab({ wx.request({
url: '../../pages/mine/mine' url: `${WXRequest.domain}loginWxUser`,
}); data: {
}else{ ...e.detail.userInfo,
wx.switchTab({ code: res.code
url: '../../pages/findCar/findCar' },
}); success: function (res) {
}*/
}, const data = res.data;
if (res.statusCode === 200) {
/** const data = res.data;
* 生命周期函数--监听页面隐藏 if (data.returnCode === '0') {
*/ wx.setStorageSync("sessionid", res.header["Set-Cookie"]);
onHide: function () { wx.setStorageSync("userStatus", 1);
wx.setStorageSync("userinfo", data.data);
}, wx.switchTab({
onGotUserInfo(e) { url: '../../pages/findCar/findCar'
});
if(e.detail.errMsg === 'getUserInfo:ok'){ } else {
this.setData({ wx.showModal({
modalHidden: true, content: data.message,
userInfoAuth: true showCancel: false
}); });
wx.login({ }
success: res => { } else if (res.statusCode === 401) {
wx.request({ wx.redirectTo({
url: `${WXRequest.domain}loginWxUser`, url: '../../pages/login/login'
data: { });
...e.detail.userInfo, }
code: res.code },
}, fail() {
success: function(res) { console.log('fail')
}
const data = res.data;
if(res.statusCode === 200){
const data = res.data;
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{
wx.showModal({
content: data.message,
showCancel: false
});
} }
}else if(res.statusCode === 401){ });
wx.redirectTo({
url: '../../pages/login/login'
});
}
},
fail(){
console.log('fail')
}
});
} }
}); wx.setStorageSync('wxUserInfo', e.detail.userInfo)
console.log(e.detail.userInfo)
console.log(e.detail.rawData)
} }
wx.setStorageSync('wxUserInfo', e.detail.userInfo)
console.log(e.detail.userInfo)
console.log(e.detail.rawData)
}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -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'
...@@ -16,7 +19,8 @@ function redirectToLogin(){console.log('redirectToLogin') ...@@ -16,7 +19,8 @@ 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!