Browse Source

upload

checkUser
HolyKnightIX 2 years ago
parent
commit
9631b4c7c1
4 changed files with 124 additions and 87 deletions
  1. +106
    -84
      index/passCar.js
  2. +0
    -1
      index/user.js
  3. +8
    -1
      pages/getphoneInfo/index.js
  4. +10
    -1
      pages/passCar/showList/showList.js

+ 106
- 84
index/passCar.js View File

@@ -301,68 +301,75 @@ Page({
showCancel: false,
})
},

onShow: function (options) {
this.setData({
goHomeUrl: app.globalData.goHomeUrl
})
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 2
})
}
var that = this;
that.setData({
etcpAppId: extConfig.attr.car.etcp.etcpAppId,
carMiniVersion: extConfig.attr.car.version,
etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl,
payPath: extConfig.attr.car.etcp.payPath,
ifHaveCarModular: extConfig.attr.ifHaveCarModular
})
console.log(this.data.ifHaveCarModular, 'ifHaveCarModular');
if (app.globalData.token) {
that.getList();
that.init();
} else {
that.init();
}
/**
* 只有用户选择了优惠券
* 才会进行券和车牌的绑定
*/
/* if (wx.getStorageSync("chosed") && that.data.quanid) {
that.getStopFee(that.data.listCardNum);
that.bindCoupon(that.data.quanid);
wx.setStorage({
key: 'chosed',
data: '',
Http.get({
url: config.api.checkPhoneStatus,
data: {}
}).then(res => {
this.setData({
goHomeUrl: app.globalData.goHomeUrl
})
}; */
if (app.globalData.token) {
// that.initUsrCarList();
that.initUsrCarList("flags");
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 2
})
}

that.setData({
current: 0
etcpAppId: extConfig.attr.car.etcp.etcpAppId,
carMiniVersion: extConfig.attr.car.version,
etcpCallbackUrl: extConfig.attr.car.etcp.etcpCallbackUrl,
payPath: extConfig.attr.car.etcp.payPath,
ifHaveCarModular: extConfig.attr.ifHaveCarModular
})
}

if (that.data.addCar) {
// 绑车牌
if (app.globalData.carLogin) {
that.bindCar(that.data.addCar);
console.log(this.data.ifHaveCarModular, 'ifHaveCarModular');
if (app.globalData.token) {
that.getList();
that.init();
} else {
that.bindCar(that.data.addCar);
that.init();
}
/**
* 只有用户选择了优惠券
* 才会进行券和车牌的绑定
*/
/* if (wx.getStorageSync("chosed") && that.data.quanid) {
that.getStopFee(that.data.listCardNum);
that.bindCoupon(that.data.quanid);
wx.setStorage({
key: 'chosed',
data: '',
})
}; */
if (app.globalData.token) {
// that.initUsrCarList();
that.initUsrCarList("flags");
that.setData({
current: 0
})
}
that.setData({
addCar: null
});
}

this.getTicketList(0, 1);


if (that.data.addCar) {
// 绑车牌
if (app.globalData.carLogin) {
that.bindCar(that.data.addCar);
} else {
that.bindCar(that.data.addCar);
}
that.setData({
addCar: null
});
}

this.getTicketList(0, 1);
}).catch(err => {
that.init();
})
},

cancelMove: function () {
console.log(111)
return false;
@@ -376,39 +383,45 @@ Page({
})
},
onLoad: function (options) {

var that = this;
/**
* 获得分享小程序的
* title
* desc
*/

Http.get({
url: config.api.getWeapNote,
data: {
appId: config.weapp.AppId,
url: config.api.checkPhoneStatus,
data: {}
}).then(res => {
/**
* 获得分享小程序的
* title
* desc
*/
Http.get({
url: config.api.getWeapNote,
data: {
appId: config.weapp.AppId,
}
})
.then(res => {
let weapNote = JSON.parse(res.data.weapNote);
that.setData({
desc: weapNote.carpage.desc,
title: weapNote.carpage.title
})
})
.catch(err => {
console.log(err);
})
// 登录
var scene = decodeURIComponent(options.scene);
that.setData({
scene: scene
});
if (app.globalData.token) { } else {
// app.getLocation();
that.userLogin()
}
}).catch(err => {
return
})
.then(res => {
let weapNote = JSON.parse(res.data.weapNote);
that.setData({
desc: weapNote.carpage.desc,
title: weapNote.carpage.title
})
})
.catch(err => {
console.log(err);
})
// 登录
var scene = decodeURIComponent(options.scene);
that.setData({
scene: scene
});
if (app.globalData.token) { } else {
// app.getLocation();
that.userLogin()
}

},
/**
* 用户登录
@@ -499,9 +512,18 @@ Page({
.catch(err => { })
},
jumpToAdd: function () {
wx.navigateTo({
url: `/pages/addPark/addPark?flags=managepalte`
});
Http.get({
url: config.api.checkPhoneStatus,
data: {}
}).then(res => {
wx.navigateTo({
url: `/pages/addPark/addPark?flags=managepalte`
});
}).catch(err => {
wx.navigateTo({
url: `/pages/getphoneInfo/index?mineFlag=passCar`,
})
})
},
passc: function () {
wx.navigateTo({


+ 0
- 1
index/user.js View File

@@ -101,7 +101,6 @@ Page({
},
//是否授权手机号
ifPhoneInfo() {
let that = this;
Http.get({
url: config.api.checkPhoneStatus,
data: {}


+ 8
- 1
pages/getphoneInfo/index.js View File

@@ -227,10 +227,13 @@ Page({
url: `/pages/radetail/joinActivity/edit?activityId=${that.data.signActivity}`
})
} else if (that.data.mineFlag == 'mine') {

wx.switchTab({
url: '/index/user'
});
} else if (that.data.mineFlag == 'passCar') {
wx.switchTab({
url: '/index/passCar'
});
} else if (that.data.mineFlag == 'index') {
wx.switchTab({
url: app.globalData.goHomeUrl
@@ -243,6 +246,10 @@ Page({
wx.navigateTo({
url: `/pages/index/searchbar/detail/index?id=${that.data.id}`
})
} else if (that.data.path == 'passCarList') {
wx.navigateTo({
url: `/pages/passCar/showList/showList`
})
} else {
wx.showToast({
title: res.data.msg,


+ 10
- 1
pages/passCar/showList/showList.js View File

@@ -112,7 +112,16 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getList(this.data.pageNum)
Http.get({
url: config.api.checkPhoneStatus,
data: {}
}).then(res => {
this.getList(this.data.pageNum)
}).catch(err => {
wx.navigateTo({
url: `/pages/getphoneInfo/index?path=passCarList`,
})
})
},

/**


Loading…
Cancel
Save