diff --git a/app.json b/app.json
index 6f84ecc..c654f2c 100644
--- a/app.json
+++ b/app.json
@@ -25,6 +25,7 @@
"pages/addPark/addPark",
"pages/orderquanma/index",
"pages/passCar/couponList/couponList",
+ "pages/passCar/choicecoupon/choicecoupon",
"pages/passCar/couponDetail/couponDetail",
"pages/managelicenseplate/managelicenseplate"
],
diff --git a/assets/img/gou.png b/assets/img/gou.png
new file mode 100644
index 0000000..2b84bc8
Binary files /dev/null and b/assets/img/gou.png differ
diff --git a/pages/passCar/choicecoupon/choicecoupon.js b/pages/passCar/choicecoupon/choicecoupon.js
new file mode 100644
index 0000000..966a00f
--- /dev/null
+++ b/pages/passCar/choicecoupon/choicecoupon.js
@@ -0,0 +1,74 @@
+const format = require("../../../utils/util.js");
+const config = require("../../../config/config.js");
+const app = getApp();
+const Http = require("../../../utils/HttpBasics");
+Page({
+ data: {
+ list: [],
+ current: "0",
+ current_scroll: "0",
+ page: 1,
+ allow_load: true
+ },
+ onLoad(options) {
+ this.getList(0, 0);
+ if (options.quanid){
+ this.setData({
+ quanid: options.quanid
+ })
+ }
+ },
+
+ /**
+ * 选择使用的优惠券
+ */
+ choicecoupon: function(e) {
+ wx.navigateBack();
+ console.log(e);
+ var pages = getCurrentPages();
+ var prevPage = pages[pages.length - 2] //上一个页面
+ var that = this;
+ var quantitle = e.currentTarget.dataset.title;
+ var quanid = e.currentTarget.dataset.id;
+ prevPage.setData({
+ quantitle: quantitle,
+ quanid: quanid,
+ });
+ wx.setStorage({
+ key: 'chosed',
+ data: 'chosed',
+ })
+ },
+ getList(key, pageNum) {
+ var that = this;
+ console.log(key);
+ console.log(pageNum);
+ if (that.data.allow_load) {
+ Http.get({
+ url: config.api.couponOrderList + "?type=5",
+ data: {
+ pageNum: pageNum,
+ pageSize: 20,
+ couponOrderStatus: key
+ }
+ }).then(res => {
+ console.log(res);
+ res.data.list.map(file => {
+ file.expiredTime = format.formatTime(
+ file.expiredTime,
+ "yyyy-MM-dddd hh:mm:ss"
+ );
+ });
+ if (pageNum > res.data.pages) {
+ that.setData({
+ allow_load: false
+ });
+ }
+ that.data.list = that.data.list.concat(res.data.list);
+ that.setData({
+ list: that.data.list
+ });
+ });
+ }
+ },
+});
\ No newline at end of file
diff --git a/pages/passCar/choicecoupon/choicecoupon.json b/pages/passCar/choicecoupon/choicecoupon.json
new file mode 100644
index 0000000..2d7e370
--- /dev/null
+++ b/pages/passCar/choicecoupon/choicecoupon.json
@@ -0,0 +1,3 @@
+{
+ "navigationBarTitleText": "停车券"
+}
\ No newline at end of file
diff --git a/pages/passCar/choicecoupon/choicecoupon.wxml b/pages/passCar/choicecoupon/choicecoupon.wxml
new file mode 100644
index 0000000..b50189d
--- /dev/null
+++ b/pages/passCar/choicecoupon/choicecoupon.wxml
@@ -0,0 +1,39 @@
+
+
+
+
+ 请您敬请期待
+ 我们正在筹备一大波优惠活动
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+ {{item.subTitle}}
+
+ {{item.salePrice/100}}
+ 元
+
+
+
+
+
+ 有效期至:
+ {{item.expiredTime}}
+
+
+
+
+ {{content}}
+
+
+
\ No newline at end of file
diff --git a/pages/passCar/choicecoupon/choicecoupon.wxss b/pages/passCar/choicecoupon/choicecoupon.wxss
new file mode 100644
index 0000000..8b98674
--- /dev/null
+++ b/pages/passCar/choicecoupon/choicecoupon.wxss
@@ -0,0 +1,211 @@
+.market {
+ width: 100%;
+ height: 100%;
+ /* background: #f5f5f5; */
+}
+
+.tabs {
+ width: 100% !important;
+ height: 88rpx;
+ text-align: center;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 100000;
+}
+
+.i-tab {
+ width: 25% !important;
+ display: inline-block;
+}
+
+.section {
+ position: relative;
+}
+
+.mms {
+ position: relative;
+ width: 690rpx;
+ background: #fff;
+ padding: 20rpx 0 0;
+ margin: 0 auto 46rpx;
+ border-top: 8rpx solid #02b7ff;
+ box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.10);
+}
+
+.detail_msg {
+ display: flex;
+}
+
+.expiretime {
+ display: block;
+ width: 100%;
+ text-align: left;
+ text-indent: 1em;
+ height: 50rpx;
+ line-height: 50rpx;
+ font-size: 22rpx;
+ color: #999;
+ letter-spacing: 0;
+}
+
+.liness {
+ display: block;
+ width: 100%;
+ margin-top: 20rpx;
+}
+
+.logo {
+ width: 60rpx;
+ height: 60rpx;
+ border: 1px solid #f8f8f8;
+ border-radius: 50rpx;
+ display: block;
+ margin-left: 20rpx;
+}
+
+.logo image {
+ width: 60rpx;
+ height: 60rpx;
+ border-radius: 50%;
+}
+
+.info view:nth-child(1) {
+ display: flex;
+ justify-content: space-between;
+ padding: 0 2%;
+}
+
+.info {
+ width: 100%;
+}
+
+.info view:nth-child(1) text {
+ font-size: 32rpx;
+ line-height: 32rpx;
+ height: 32rpx;
+ color: #333;
+ letter-spacing: 0;
+ width: 400rpx;
+ display: inline-block;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+.info view:nth-child(2) {
+ padding-left: 2%;
+ font-size: 22rpx;
+ color: #333;
+ letter-spacing: 0;
+ margin-top: 6rpx;
+ display: inline-block;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ width: 400rpx;
+}
+
+.info view:nth-child(3) {
+ margin-left: 20rpx;
+}
+
+.btns {
+ position: absolute;
+ right: 57rpx;
+ top: 0;
+ bottom: 0;
+ margin: auto;
+ width: 180rpx;
+ height: 48rpx;
+ line-height: 48rpx;
+ text-align: right;
+ color: #f96563;
+ font-size: 40rpx;
+}
+
+.yuan {
+ color: #333;
+ font-size: 26rpx;
+}
+
+.txt1 {
+ font-size: 22rpx;
+ color: #333;
+ letter-spacing: 0;
+}
+
+.nocoupon image {
+ width: 300rpx;
+ display: block;
+ margin: 3% auto 0;
+}
+
+.txt001 {
+ display: block;
+ line-height: 48rpx;
+ font-size: 34rpx;
+ color: #333;
+ letter-spacing: 0;
+ text-align: center;
+}
+
+.txt002 {
+ display: block;
+ margin-top: 1%;
+ font-size: 28rpx;
+ color: #999;
+ letter-spacing: 0;
+ line-height: 40rpx;
+ text-align: center;
+}
+
+.nocoupon button {
+ background: #00c0ff;
+ color: #fff;
+ font-style: 30rpx;
+ width: 100%;
+ border-radius: 60rpx;
+}
+
+.loading {
+ text-align: center;
+ height: 80rpx;
+ line-height: 80rpx;
+ font-size: 26rpx;
+ color: #999;
+}
+
+.loading image {
+ width: 60rpx;
+ height: 60rpx;
+ vertical-align: middle;
+ margin-right: 10rpx;
+}
+
+.active {
+ opacity: 0.6;
+}
+
+.nav {
+ position: absolute;
+ bottom: 3.3%;
+ left: 0;
+ right: 0;
+ margin: auto;
+ width: 670rpx;
+ border-radius: 60rpx;
+ background: #02c0ff;
+ font-size: 32px;
+ color: #fff;
+ text-align: center;
+ line-height: 32px;
+}
+
+.gou {
+ position: absolute;
+ top: -15rpx;
+ right: -10rpx;
+ width: 60rpx;
+}
diff --git a/pages/passCar/couponDetail/couponDetail.wxss b/pages/passCar/couponDetail/couponDetail.wxss
index 7cee945..6da2aa7 100644
--- a/pages/passCar/couponDetail/couponDetail.wxss
+++ b/pages/passCar/couponDetail/couponDetail.wxss
@@ -73,6 +73,7 @@
}
.coupon_detail {
padding: 0 20rpx;
+ margin-top: 30rpx;
}
.fl {
@@ -154,8 +155,8 @@
display: flex;
flex-direction: column;
background: #fff;
- border-bottom: 20rpx solid #f5f5f5;
- border-top: 20rpx solid #f5f5f5;
+ border-bottom: 6rpx solid #f5f5f5;
+ border-top: 6rpx solid #f5f5f5;
position: relative;
}
diff --git a/pages/passCar/couponList/couponList.wxml b/pages/passCar/couponList/couponList.wxml
index 873e410..6eca002 100644
--- a/pages/passCar/couponList/couponList.wxml
+++ b/pages/passCar/couponList/couponList.wxml
@@ -16,9 +16,9 @@
-
+
{{item.title}}
@@ -26,7 +26,7 @@
{{item.subTitle}}
- 去使用
+ 查看
查看
diff --git a/pages/passCar/passCar.js b/pages/passCar/passCar.js
index 5e34cd1..fd6c643 100644
--- a/pages/passCar/passCar.js
+++ b/pages/passCar/passCar.js
@@ -43,6 +43,23 @@ Page({
url: '/pages/managelicenseplate/managelicenseplate',
})
},
+
+ onShow: function (options) {
+ var that = this;
+ that.getList();
+ that.init();
+ /**
+ * 只有用户选择了优惠券
+ * 才会进行券和车牌的绑定
+ */
+ if (wx.getStorageSync("chosed") && that.data.quanid) {
+ that.bindCoupon(that.data.quanid);
+ wx.setStorage({
+ key: 'chosed',
+ data: '',
+ })
+ }
+ },
onLoad: function (options) {
var that = this;
/**
@@ -50,13 +67,12 @@ Page({
* title
* 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({
@@ -64,7 +80,6 @@ Page({
title: weapNote.carpage.title
})
});
-
},
@@ -80,48 +95,62 @@ Page({
},
- //券绑定车牌
- bindCoupon: function (e) {
- console.log(e);
+ /**
+ * 券绑定车牌
+ */
+ bindCoupon: function (quanid) {
var that = this;
- wx.showLoading({
- title: '加载中...',
- });
- if (that.data.couponList.length > 0) {
- /**
- * etcp
- */
- var etcpData = {
- etcpToken: app.globalData.etcpToken,
- carNumber: that.data.listCardNum,
- /**
- * 待解决
- */
- couponOrderId: that.data.couponList[0].id
- };
- console.log(etcpData);
+ /**
+ * etcp
+ */
+ var etcpData = {
+ etcpToken: app.globalData.etcpToken,
+ carNumber: that.data.listCardNum,
/**
- * 停简单
+ * 待解决
*/
- var tjdData = {
- carNumber: that.data.listCardNum
- };
- var postCouponData = app.globalData.parkVendor == 1 ? etcpData : tjdData;
- Http.post({
- url: config.api.getCarCoupon,
- data: postCouponData
- })
- .then(res => {
- that.initUsrCarList();
- wx.hideLoading();
- })
- .catch(error => {
- console.log(error);
+ couponOrderId: quanid
+ };
+ console.log(etcpData);
+ /**
+ * 停简单
+ */
+ var tjdData = {
+ carNumber: that.data.listCardNum
+ };
+ var postCouponData = app.globalData.parkVendor == 1 ? etcpData : tjdData;
+ Http.post({
+ url: config.api.getCarCoupon,
+ data: postCouponData
+ })
+ .then(res => {
+ that.initUsrCarList();
+ })
+ .catch(error => {
+ wx.showModal({
+ content: error.message,
+ showCancel: false,
+ confirmText: "确定",
})
- } else {
- console.log("没有停车券可以绑定")
- wx.hideLoading();
+ console.log(error);
+ })
+ },
+ /**
+ * 选择优惠券
+ */
+ gotoquan: function () {
+ let that = this;
+ console.log(that.data.quanid);
+ if (that.data.quanid){
+ wx.navigateTo({
+ url: `/pages/passCar/choicecoupon/choicecoupon?quanid=${that.data.quanid}`,
+ })
+ }else{
+ wx.navigateTo({
+ url: '/pages/passCar/choicecoupon/choicecoupon',
+ })
}
+
},
//获取名下停车券列表
@@ -142,16 +171,70 @@ Page({
});
},
- onShow: function (options) {
+
+ /**
+ * 共同登录
+ */
+ init: function (carNumber) {
var that = this;
- that.getList();
- that.init();
+ app.parkInitCallback = token => {
+ that.initPark();
+ if (!app.globalData.carLogin) {
+ /**
+ * 判断是否授权手机号
+ */
+ Http.post({
+ url: config.api.checkPhoneStatus,
+ data: {}
+ })
+ .then(res => {
+ console.log(res);
+ Http.post({
+ url: config.api.carInit,
+ data: {
+ phone: app.globalData.phone
+ }
+ }).then(res => {
+ console.log(res);
+ app.globalData.carLogin = true;
+ app.globalData.parkVendor = res.data.vendor;
+ if (res.data.token) {
+ app.globalData.etcpToken = res.data.token;
+ }
+ /**
+ * 获得停车费用
+ */
+ that.initUsrCarList("flags");
+ console.log(app.globalData.etcpToken);
+ });
+ })
+ .catch(err => {
+ console.log(err);
+ if (err.code == 11005) {
+ // 用户手机未授权
+ /**
+ * 将值传到用户手机号授权的页面
+ *
+ */
+ wx.redirectTo({
+ url: "/pages/getphoneInfo/index"
+ });
+ } else if (err.code == 11006) {
+ // 用户手机已加密
+ wx.redirectTo({
+ url: "/pages/phoneinput/phoneinput"
+ });
+ }
+ })
+ }
+ };
+ if (app.globalData.token && app.globalData.token != null) {
+ app.parkInitCallback(app.globalData.token);
+ }
},
-
/**
* 绑定车牌
*/
-
bindCar: function (carNum) {
var that = this;
// ETCP
@@ -164,9 +247,9 @@ Page({
};
var postData = app.globalData.parkVendor == 1 ? etcpData : tjdData;
Http.post({
- url: config.api.bindCar,
- data: postData
- })
+ url: config.api.bindCar,
+ data: postData
+ })
.then(res => {
console.log(res);
// that.initUsrCarList();
@@ -174,7 +257,7 @@ Page({
title: "提示",
showCancel: false,
content: "绑车牌成功!",
- success: function () {}
+ success: function () { }
});
})
.catch(error => {
@@ -183,7 +266,7 @@ Page({
title: "提示",
showCancel: false,
content: error.message,
- success: function () {}
+ success: function () { }
});
});
},
@@ -223,7 +306,7 @@ Page({
* flag ==flags
* 表示从首页onShow进来的
*/
- if (flag == "flags") {
+ if (flag == "flags" && res.data.length > 0) {
var listCardNum = res.data[0].carNumber;
console.log(listCardNum);
that.setData({
@@ -247,9 +330,9 @@ Page({
etcpToken: app.globalData.etcpToken,
carNumber: carNumber
} : {
- carNumber: carNumber,
- outCarId: outCarId
- };
+ carNumber: carNumber,
+ outCarId: outCarId
+ };
var extraDataStr = {
params: {
CarNumber: carNumber
@@ -259,9 +342,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
@@ -284,69 +367,9 @@ Page({
},
/**
- * 共同登录
- */
- init: function (carNumber) {
- var that = this;
- app.parkInitCallback = token => {
- that.initPark();
- if (!app.globalData.carLogin) {
- /**
- * 判断是否授权手机号
- */
- Http.post({
- url: config.api.checkPhoneStatus,
- data: {}
- })
- .then(res => {
- console.log(res);
- Http.post({
- url: config.api.carInit,
- data: {
- phone: app.globalData.phone
- }
- }).then(res => {
- console.log(res);
- app.globalData.carLogin = true;
- app.globalData.parkVendor = res.data.vendor;
- if (res.data.token) {
- app.globalData.etcpToken = res.data.token;
- }
- /**
- * 获得停车费用
- */
- that.initUsrCarList("flags");
- console.log(app.globalData.etcpToken);
- });
- })
- .catch(err => {
- console.log(err);
- if (err.code == 11005) {
- // 用户手机未授权
- /**
- * 将值传到用户手机号授权的页面
- *
- */
- wx.redirectTo({
- url: "/pages/getphoneInfo/index"
- });
- } else if (err.code == 11006) {
- // 用户手机已加密
- wx.redirectTo({
- url: "/pages/phoneinput/phoneinput"
- });
- }
- })
- }
- };
- if (app.globalData.token && app.globalData.token != null) {
- app.parkInitCallback(app.globalData.token);
- }
- },
- /**
* 下拉刷新
*/
- onPullDownRefresh: function(e) {
+ onPullDownRefresh: function (e) {
let that = this;
that.initUsrCarList("flags");
wx.stopPullDownRefresh();
diff --git a/pages/passCar/passCar.wxml b/pages/passCar/passCar.wxml
index 600a5c7..bc90ad7 100644
--- a/pages/passCar/passCar.wxml
+++ b/pages/passCar/passCar.wxml
@@ -4,9 +4,9 @@
{{park.addr}}
-
- 总车位:{{park.number}}个
-
+
+
+ 总车位:{{park.number}}个
停车费:
@@ -19,8 +19,7 @@
-
+
@@ -47,18 +46,27 @@
停车时长:
{{timecha}}
-
+
+
+
券优惠券:
- 2小时优免券
+
+ {{quantitle}}
+ {{couponList.length}}张可用
+
+
+
+
+
待缴费用:
- {{stopFees.remainingFee}}元
+ {{stopFees.remainingFee}}元
-
-
+
+
+
@@ -98,16 +106,5 @@
-
-
\ No newline at end of file
diff --git a/pages/passCar/passCar.wxss b/pages/passCar/passCar.wxss
index e334774..394451a 100644
--- a/pages/passCar/passCar.wxss
+++ b/pages/passCar/passCar.wxss
@@ -3,7 +3,11 @@
page {
background-color: #fff;
}
+.container{
+ padding-bottom: 60rpx;
+}
.top{
+ padding-bottom: 34rpx;
}
.headBox {
width: 690rpx;
@@ -60,7 +64,7 @@ page {
width: 690rpx;
font-size: 28rpx;
color: #999;
- margin: 10rpx auto 60rpx;
+ margin: 10rpx auto 0;
}
.time {
@@ -150,7 +154,10 @@ page {
.bottonBox {
width: 750rpx;
- margin-top: 30rpx;
+ margin-top: 32rpx;
+ margin-bottom: 80rpx;
+ border-top: 16rpx #f8f8f8 solid;
+ padding-top: 13rpx;
}
.textStyle {
@@ -218,7 +225,7 @@ page {
.passNumberBox {
width: 690rpx;
- margin: 50rpx auto 0;
+ margin: 32rpx auto 0;
position: relative;
background-color: white;
}
@@ -383,7 +390,7 @@ page {
background: #fff;
position: relative;
height: 88rpx;
- margin-top: 50rpx;
+ margin-top: 30rpx;
}
.buy {
@@ -415,15 +422,15 @@ page {
.borderBox {
width: 750rpx;
- border-top: 4rpx #f8f8f8 solid;
+ border-top: 16rpx #f8f8f8 solid;
}
.carmanage {
position: relative;
width: 690rpx;
- margin: 0 auto;
- height: 80rpx;
- line-height: 82rpx;
+ margin: 15rpx auto 0;
+ height: 60rpx;
+ line-height: 60rpx;
/* border-bottom: 1rpx solid #eee; */
}
@@ -464,7 +471,7 @@ page {
.mycar {
display: inline-block;
font-size: 33rpx;
- color: #333;
+ color: #666;
line-height: 35rpx;
letter-spacing: 1.16rpx;
}
@@ -579,13 +586,13 @@ button::after {
}
.orderBox .fl {
- line-height: 60rpx;
+ line-height: 67rpx;
font-size: 28rpx;
color: #333;
}
.orderBox .fr {
- line-height: 60rpx;
+ line-height: 67rpx;
font-size: 28rpx;
color: #ff4949;
}
@@ -602,3 +609,11 @@ button::after {
border-radius: 6rpx;
margin-right: 6rpx;
}
+.jiant{
+ display: inline-block;
+ width: 44rpx;
+ height: 44rpx;
+ vertical-align: middle;
+ margin-top: -6rpx;
+ margin-right: -10rpx;
+}
\ No newline at end of file
diff --git a/pages/ques/ques.wxss b/pages/ques/ques.wxss
index ad4e9f4..3c83dca 100644
--- a/pages/ques/ques.wxss
+++ b/pages/ques/ques.wxss
@@ -1,5 +1,5 @@
.content {
- padding: 0 30rpx;
+ padding: 0 30rpx 30rpx 30rpx;
margin: 30rpx auto;
}
diff --git a/pages/user/index.wxml b/pages/user/index.wxml
index 6543b23..9302def 100644
--- a/pages/user/index.wxml
+++ b/pages/user/index.wxml
@@ -67,7 +67,7 @@
- 版本号:2.0.8
+ 版本号:2.0.9