diff --git a/app.json b/app.json
index 10e7a0c..d3d179c 100644
--- a/app.json
+++ b/app.json
@@ -25,6 +25,7 @@
"pages/wangdian/wangdian",
"pages/duiquan/duiquan",
"pages/refund/refund",
+ "pages/washing/washing",
"pages/OnlineCarHailing/OnlineCarHailing"
],
"window": {
diff --git a/pages/index/index.js b/pages/index/index.js
index 8546907..2c0bc09 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -94,6 +94,8 @@ Page({
a.setData({
user: e.data || [],
});
+ // 存储进度订单
+ wx.setStorageSync('progressorder', e.data.progressorder || []);
});
},
load: function (e) {
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
index f8595eb..ad37654 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -6,12 +6,22 @@
- {{notice}}
+
+ {{notice}}
+
+
+ 您有一笔洗车订单进行中...
+ 点击查看>
+
- 扫码启动
- 立即启动
-
+
+ 扫码启动
+
+
+ 立即启动
+
+
\ No newline at end of file
diff --git a/pages/index/index.wxss b/pages/index/index.wxss
index be5e925..0a1cbba 100644
--- a/pages/index/index.wxss
+++ b/pages/index/index.wxss
@@ -157,4 +157,18 @@
right: 0;
display: block;
background-color: #37CE05;
+}
+
+.washing {
+ justify-content: space-between;
+ margin: 30rpx 0 0;
+ padding: 20rpx 28rpx;
+ display: flex;
+ background-color: #0056A3;
+ color: #fff;
+ font-size: 28rpx;
+}
+
+.washing .l {
+ flex: 1;
}
\ No newline at end of file
diff --git a/pages/washing/washing.js b/pages/washing/washing.js
new file mode 100644
index 0000000..20d8038
--- /dev/null
+++ b/pages/washing/washing.js
@@ -0,0 +1,163 @@
+var t = getApp(), e = require("../../utils/login.js");
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ countdown: '',
+ agentname: '',
+ devicecode: '',
+ remainingTime: 0,
+ orderid: ''
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ const orderInfo = wx.getStorageSync('progressorder');
+ if (!orderInfo) {
+ wx.showToast({
+ title: '没有进行中的订单',
+ icon: 'none',
+ duration: 2000
+ });
+ setTimeout(() => {
+ wx.switchTab({
+ url: '/pages/index/index'
+ });
+ }, 2000);
+ return;
+ }
+
+ const currentTime = Math.floor(Date.now() / 1000);
+ const remainingTime = Math.max(0, orderInfo.timestamp + orderInfo.siteoccupationTime * 60 - currentTime);
+
+ this.setData({
+ agentname: orderInfo.agentname,
+ devicecode: orderInfo.devicecode,
+ remainingTime: remainingTime,
+ orderid: orderInfo.id
+ });
+
+ if (remainingTime > 0) {
+ this.countdown();
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ },
+ handleSettlement() {
+ wx.showModal({
+ title: '确认结算',
+ content: '确定要结算此次洗车订单吗?',
+ success: (res) => {
+ if (res.confirm) {
+ e.request('/miniprogram/machine/shutdown', {
+ orderid: this.data.orderid
+ }, true).then((res) => {
+ if (res.code === 200) {
+ wx.showToast({
+ title: res.message || '结算成功',
+ icon: 'success',
+ duration: 2000
+ });
+ setTimeout(() => {
+ wx.removeStorageSync('progressorder');
+ wx.reLaunch({
+ url: '/pages/index/index'
+ });
+ }, 2000);
+ }
+ }).catch((err) => {
+ // setTimeout(() => {
+ // wx.removeStorageSync('progressorder');
+ // wx.reLaunch({
+ // url: '/pages/index/index'
+ // });
+ // }, 2000);
+ })
+ }
+ }
+ });
+ },
+
+ countdown() {
+
+ // 没有 Cannot read property 'remainingTime' of undefined
+ if (!this.data.remainingTime) {
+ this.setData({
+ countdown: '00:00'
+ });
+ return;
+ }
+
+
+ if (this.data.remainingTime <= 0) {
+ this.setData({
+ countdown: '00:00'
+ });
+ return;
+ }
+
+ const minute = Math.floor(this.data.remainingTime / 60);
+ const second = this.data.remainingTime % 60;
+ const formattedMinute = minute < 10 ? '0' + minute : minute;
+ const formattedSecond = second < 10 ? '0' + second : second;
+
+ this.setData({
+ countdown: formattedMinute + ':' + formattedSecond,
+ remainingTime: this.data.remainingTime - 1
+ });
+
+ setTimeout(this.countdown, 1000);
+ },
+})
\ No newline at end of file
diff --git a/pages/washing/washing.json b/pages/washing/washing.json
new file mode 100644
index 0000000..d78ffd9
--- /dev/null
+++ b/pages/washing/washing.json
@@ -0,0 +1,5 @@
+{
+ "usingComponents": {
+ "service-tel": "../../template/serviceTel/serviceTel"
+ }
+}
\ No newline at end of file
diff --git a/pages/washing/washing.wxml b/pages/washing/washing.wxml
new file mode 100644
index 0000000..bf361d5
--- /dev/null
+++ b/pages/washing/washing.wxml
@@ -0,0 +1,42 @@
+
+
+ {{agentname}}
+ {{countdown}}
+ {{devicecode}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/washing/washing.wxss b/pages/washing/washing.wxss
new file mode 100644
index 0000000..c16203b
--- /dev/null
+++ b/pages/washing/washing.wxss
@@ -0,0 +1,167 @@
+.btn {
+ padding: 80rpx 100rpx 40rpx;
+}
+
+.spinner {
+ margin: 200rpx auto 80rpx;
+ width: 400rpx;
+ height: 400rpx;
+ position: relative;
+ border-radius: 400rpx;
+ border: 10rpx solid green;
+}
+
+.spinner .time {
+ font-family: 'Consolas', 'Lucida Console', 'DejaVu Sans Mono', monospace;
+ position: absolute;
+ width: 400rpx;
+ height: 320rpx;
+ padding-top: 80rpx;
+ text-align: center;
+ color: green;
+}
+
+.spinner .time text {
+ display: block;
+}
+.wangdian, .macid {
+ line-height: 2;
+ font-size: 40rpx;
+}
+.mactime {
+ font-size: 80rpx;
+ font-weight: 700;
+}
+
+.container1 > view, .container2 > view, .container3 > view, .container4 > view, .container5 > view {
+ width: 20rpx;
+ height: 20rpx;
+ background-color: green;
+ border-radius: 100%;
+ position: absolute;
+ -webkit-animation: bouncedelay 2.2s infinite ease-in-out;
+ animation: bouncedelay 2.2s infinite ease-in-out;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+}
+.spinner .spinner-container {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+}
+.container2 {
+ -webkit-transform: rotateZ(22.5deg);
+ transform: rotateZ(22.5deg);
+}
+.container3 {
+ -webkit-transform: rotateZ(45deg);
+ transform: rotateZ(45deg);
+}
+.container4 {
+ -webkit-transform: rotateZ(67.5deg);
+ transform: rotateZ(67.5deg);
+}
+.container5 {
+ -webkit-transform: rotateZ(90deg);
+ transform: rotateZ(90deg);
+}
+
+.circle1 { top: 0; left: 0; }
+.circle2 { top: 0; right: 0; }
+.circle3 { right: 0; bottom: 0; }
+.circle4 { left: 0; bottom: 0; }
+.container1 .circle1 {
+ -webkit-animation-delay: -2s;
+ animation-delay: -2s;
+}
+.container2 .circle1 {
+ -webkit-animation-delay: -1.9s;
+ animation-delay: -1.9s;
+}
+.container3 .circle1 {
+ -webkit-animation-delay: -1.8s;
+ animation-delay: -1.8s;
+}
+.container4 .circle1 {
+ -webkit-animation-delay: -1.7s;
+ animation-delay: -1.7s;
+}
+.container5 .circle1 {
+ -webkit-animation-delay: -1.6s;
+ animation-delay: -1.6s;
+}
+.container1 .circle2 {
+ -webkit-animation-delay: -1.5s;
+ animation-delay: -1.5s;
+}
+.container2 .circle2 {
+ -webkit-animation-delay: -1.4s;
+ animation-delay: -1.4s;
+}
+.container3 .circle2 {
+ -webkit-animation-delay: -1.3s;
+ animation-delay: -1.3s;
+}
+.container4 .circle2 {
+ -webkit-animation-delay: -1.2s;
+ animation-delay: -1.2s;
+}
+.container5 .circle2 {
+ -webkit-animation-delay: -1.1s;
+ animation-delay: -1.1s;
+}
+.container1 .circle3 {
+ -webkit-animation-delay: -1s;
+ animation-delay: -1s;
+}
+.container2 .circle3 {
+ -webkit-animation-delay: -0.9s;
+ animation-delay: -0.9s;
+}
+.container3 .circle3 {
+ -webkit-animation-delay: -0.8s;
+ animation-delay: -0.8s;
+}
+.container4 .circle3 {
+ -webkit-animation-delay: -0.7s;
+ animation-delay: -0.7s;
+}
+.container5 .circle3 {
+ -webkit-animation-delay: -0.6s;
+ animation-delay: -0.6s;
+}
+.container1 .circle4 {
+ -webkit-animation-delay: -0.5s;
+ animation-delay: -0.5s;
+}
+.container2 .circle4 {
+ -webkit-animation-delay: -0.4s;
+ animation-delay: -0.4s;
+}
+.container3 .circle4 {
+ -webkit-animation-delay: -0.3s;
+ animation-delay: -0.3s;
+}
+.container4 .circle4 {
+ -webkit-animation-delay: -0.2s;
+ animation-delay: -0.2s;
+}
+.container5 .circle4 {
+ -webkit-animation-delay: -0.1s;
+ animation-delay: -0.1s;
+}
+@-webkit-keyframes bouncedelay {
+ 0%, 80%, 100% { -webkit-transform: scale(0.0) }
+ 40% { -webkit-transform: scale(2.0) }
+}
+@keyframes bouncedelay {
+ 0%, 80%, 100% {
+ transform: scale(0.0);
+ -webkit-transform: scale(0.0);
+ } 40% {
+ transform: scale(2.0);
+ -webkit-transform: scale(2.0);
+ }
+}
+
+