瀏覽代碼

[停车][修改]:停车绑定车牌修改

tags/2.2.4
meo 6 年之前
父節點
當前提交
febe3a038a
共有 3 個檔案被更改,包括 100 行新增50 行删除
  1. +8
    -4
      pages/addPark/addPark.js
  2. +1
    -1
      pages/addPark/addPark.wxml
  3. +91
    -45
      pages/passCar/passCar.js

+ 8
- 4
pages/addPark/addPark.js 查看文件

@@ -58,9 +58,13 @@ Page({
onLoad: function (options) {
console.log(options);
let that = this;
that.setData({
flags:options.flags
})

if (Object.keys(options).length!=0){
console.log("标识")
that.setData({
flags: options.flags
})
}
},
jumpTo: function () {
// 返回
@@ -69,6 +73,7 @@ Page({
})
},
handleTap: function (e) {
console.log(e);
this.buttonStatus();
this.setData({
choose: e.target.dataset.cardata,
@@ -345,7 +350,6 @@ Page({
addCar: carNumber
})
console.log(carNumber);
console.log("carNumber");
if (this.data.flags =='managepalte'){
wx.navigateBack({
url: '/pages/managelicenseplate/managelicenseplate?addcar=' + carNumber,


+ 1
- 1
pages/addPark/addPark.wxml 查看文件

@@ -12,7 +12,7 @@
<view class="addpark-num-center-border {{chooseTop == 'carData.numSix' ? 'choose-title' : ''}}" data-carData="carData.numSix" data-msg="{{numSix}}">{{numSix}}</view>
</view>
<view class="addpark-num-new">
<view data-carData="carData.numSource">{{numSource}}</view>
<view data-carData="carData.numSource" data-msg="{{numSource}}">{{numSource}}</view>
</view>
<view class='newsource'>新能源</view>
</view>


+ 91
- 45
pages/passCar/passCar.js 查看文件

@@ -23,7 +23,7 @@ Page({
/**
* 车牌轮播滑动
*/
onSlideChangeEnd: function (e) {
onSlideChangeEnd: function(e) {
var that = this;
/**
* 获得当前的车牌号码
@@ -38,12 +38,12 @@ Page({
*/
that.getStopFee(listCardNum);
},
gotomange: function () {
gotomange: function() {
wx.navigateTo({
url: '/pages/managelicenseplate/managelicenseplate',
})
},
showquan:function(){
showquan: function() {
wx.navigateTo({
url: '/pages/passCar/couponList/couponList',
})
@@ -51,13 +51,13 @@ Page({
/**
* 待完成
*/
gotodetail:function(e){
gotodetail: function(e) {
console.log(e.target.dataset.rule);
wx.navigateTo({
url: `/pages/payrule/payrule?rule=${e.target.dataset.rule}`,
})
},
onShow: function (options) {
onShow: function(options) {
var that = this;
that.getList();
that.init();
@@ -71,9 +71,21 @@ Page({
key: 'chosed',
data: '',
})
};
that.initUsrCarList();
if (that.data.addCar) {
// 绑车牌
if (app.globalData.carLogin) {
that.bindCar(that.data.addCar);
} else {
that.bindCar(that.data.addCar);
}
that.setData({
addCar: null
});
}
},
onLoad: function (options) {
onLoad: function(options) {
var that = this;
/**
* 获得分享小程序的
@@ -81,11 +93,11 @@ Page({
* desc
*/
Http.get({
url: config.api.getWeapNote,
data: {
appId: config.weapp.AppId,
}
})
url: config.api.getWeapNote,
data: {
appId: config.weapp.AppId,
}
})
.then(res => {
let weapNote = JSON.parse(res.data.weapNote);
that.setData({
@@ -96,12 +108,12 @@ Page({
},


jumpToAdd: function () {
jumpToAdd: function() {
wx.navigateTo({
url: "/pages/addPark/addPark"
url: `/pages/addPark/addPark?flags=managepalte`
});
},
passc: function () {
passc: function() {
wx.navigateTo({
url: '/pages/ques/ques',
})
@@ -111,7 +123,7 @@ Page({
/**
* 券绑定车牌
*/
bindCoupon: function (quanid) {
bindCoupon: function(quanid) {
var that = this;
/**
* etcp
@@ -119,9 +131,6 @@ Page({
var etcpData = {
etcpToken: app.globalData.etcpToken,
carNumber: that.data.listCardNum,
/**
* 待解决
*/
couponOrderId: quanid
};
console.log(etcpData);
@@ -133,9 +142,9 @@ Page({
};
var postCouponData = app.globalData.parkVendor == 1 ? etcpData : tjdData;
Http.post({
url: config.api.getCarCoupon,
data: postCouponData
})
url: config.api.getCarCoupon,
data: postCouponData
})
.then(res => {
that.initUsrCarList();
})
@@ -151,19 +160,19 @@ Page({
/**
* 选择优惠券
*/
gotoquan: function () {
gotoquan: function() {
let that = this;
console.log(that.data.quanid);
if (that.data.quanid){
if (that.data.quanid) {
wx.navigateTo({
url: `/pages/passCar/choicecoupon/choicecoupon?quanid=${that.data.quanid}`,
})
}else{
} else {
wx.navigateTo({
url: '/pages/passCar/choicecoupon/choicecoupon',
})
}
},

//获取名下停车券列表
@@ -188,7 +197,7 @@ Page({
/**
* 共同登录
*/
init: function (carNumber) {
init: function(carNumber) {
var that = this;
app.parkInitCallback = token => {
that.initPark();
@@ -197,9 +206,9 @@ Page({
* 判断是否授权手机号
*/
Http.post({
url: config.api.checkPhoneStatus,
data: {}
})
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => {
console.log(res);
Http.post({
@@ -248,6 +257,42 @@ Page({
/**
* 绑定车牌
*/
// bindCar: function(carNum) {
// var that = this;
// // ETCP
// var etcpData = {
// etcpToken: app.globalData.etcpToken,
// carNumber: carNum
// };
// var tjdData = {
// carNumber: carNum
// };
// var postData = app.globalData.parkVendor == 1 ? etcpData : tjdData;
// Http.post({
// url: config.api.bindCar,
// data: postData
// })
// .then(res => {
// console.log(res);
// // that.initUsrCarList();
// wx.showModal({
// title: "提示",
// showCancel: false,
// content: "绑车牌成功!",
// success: function() {}
// });
// })
// .catch(error => {
// console.log(error);
// wx.showModal({
// title: "提示",
// showCancel: false,
// content: error.message,
// success: function() {}
// });
// });
// },

bindCar: function (carNum) {
var that = this;
// ETCP
@@ -265,7 +310,10 @@ Page({
})
.then(res => {
console.log(res);
// that.initUsrCarList();
that.setData({
addCar: null
});
that.initUsrCarList();
wx.showModal({
title: "提示",
showCancel: false,
@@ -278,17 +326,15 @@ Page({
wx.showModal({
title: "提示",
showCancel: false,
content: error.message,
content: error.data.message,
success: function () { }
});
});
},


/**
* 车场信息获取
*/
initPark: function () {
initPark: function() {
var that = this;
Http.get({
url: config.api.getParkInfo,
@@ -304,7 +350,7 @@ Page({
/**
* 绑定车获取
*/
initUsrCarList: function (flag) {
initUsrCarList: function(flag) {
console.log(flag);
var that = this;
Http.get({
@@ -336,16 +382,16 @@ Page({
/**
* 获得停车费用修改
*/
getStopFee: function (carNumber) {
getStopFee: function(carNumber) {
var that = this;
var postData =
app.globalData.parkVendor == 1 ? {
etcpToken: app.globalData.etcpToken,
carNumber: carNumber
} : {
carNumber: carNumber,
outCarId: outCarId
};
carNumber: carNumber,
outCarId: outCarId
};
var extraDataStr = {
params: {
CarNumber: carNumber
@@ -355,9 +401,9 @@ Page({
extraData: extraDataStr
});
Http.post({
url: config.api.getCarStopFee,
data: postData
})
url: config.api.getCarStopFee,
data: postData
})
.then(res => {
that.setData({
stopFees: res.data
@@ -382,17 +428,17 @@ Page({
/**
* 下拉刷新
*/
onPullDownRefresh: function (e) {
onPullDownRefresh: function(e) {
let that = this;
that.initUsrCarList("flags");
wx.stopPullDownRefresh();
},
// 用户点击右上角分享
onShareAppMessage: function () {
onShareAppMessage: function() {
return {
title: this.data.title,
desc: this.data.desc,
success: function (res) {
success: function(res) {
wx.showToast({
title: "分享成功",
duration: 1000,


Loading…
取消
儲存