From d81915d73a29e0595c1638c1344a141b28d19967 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 20 十二月 2023 14:40:37 +0800
Subject: [PATCH] Mr.Shi
---
bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js | 504 +++++++++++++++++++++++++++++++++----------------------
1 files changed, 300 insertions(+), 204 deletions(-)
diff --git a/bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js b/bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js
index c9a11b6..72731d5 100644
--- a/bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js
+++ b/bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js
@@ -364,12 +364,19 @@
},
minute: function minute() {
this.show3 = false;
- console.log(this.info.rideStatus);
if (this.info.rideStatus != -1) {
this.show6 = true;
}
},
settlement: function settlement() {
+ if (this.info.depositStatus === 2) {
+ uni.showToast({
+ title: '缁撶畻鐢宠鎻愪氦鎴愬姛锛岃鑰愬績绛夊緟閫�娆撅紒',
+ icon: 'none',
+ duration: 2000
+ });
+ return;
+ }
this.show6 = false;
this.show3 = true;
},
@@ -381,43 +388,102 @@
},
// 璺宠浆
jump: function jump(item) {
- if (item.id === 3) {
- uni.navigateTo({
- url: '/pages/pricingRules/pricingRules'
- });
- } else if (item.id === 4) {
- uni.navigateTo({
- url: '/pages/consumptionDetails/consumptionDetails'
- });
- } else if (item.id === 2) {
- if (this.info.rideStatus === 1) {
- uni.showToast({
- title: '楠戣涓笉鑳界粨绠楁娂閲�',
- icon: 'none',
- duration: 2000
- });
- return;
- }
- if (this.info.depositStatus === 1) {
- this.show3 = true;
- } else {
- uni.showToast({
- title: '鎮ㄦ殏鏃犳娂閲戯紝鏃犻渶缁撶畻锛�',
- icon: 'none',
- duration: 2000
- });
- }
- } else if (item.id === 1) {
- if (this.info.depositStatus === 1) {
- uni.showToast({
- title: '鎶奸噾宸插厖鍊�',
- icon: 'none',
- duration: 2000
- });
- return;
- }
- this.show1 = true;
- }
+ var _this4 = this;
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
+ return _regenerator.default.wrap(function _callee2$(_context2) {
+ while (1) {
+ switch (_context2.prev = _context2.next) {
+ case 0:
+ _context2.next = 2;
+ return _this4.refresh();
+ case 2:
+ if (!(item.id === 3)) {
+ _context2.next = 6;
+ break;
+ }
+ uni.navigateTo({
+ url: '/pages/pricingRules/pricingRules'
+ });
+ _context2.next = 27;
+ break;
+ case 6:
+ if (!(item.id === 4)) {
+ _context2.next = 10;
+ break;
+ }
+ uni.navigateTo({
+ url: '/pages/consumptionDetails/consumptionDetails'
+ });
+ _context2.next = 27;
+ break;
+ case 10:
+ if (!(item.id === 2)) {
+ _context2.next = 17;
+ break;
+ }
+ if (!(_this4.info.rideStatus === 1)) {
+ _context2.next = 14;
+ break;
+ }
+ uni.showToast({
+ title: '楠戣涓笉鑳界粨绠楁娂閲�',
+ icon: 'none',
+ duration: 2000
+ });
+ return _context2.abrupt("return");
+ case 14:
+ if (_this4.info.depositStatus === 1) {
+ _this4.show3 = true;
+ } else if (_this4.info.depositStatus === 2) {
+ uni.showToast({
+ title: '缁撶畻鐢宠鎻愪氦鎴愬姛锛岃鑰愬績绛夊緟閫�娆撅紒',
+ icon: 'none',
+ duration: 2000
+ });
+ } else {
+ uni.showToast({
+ title: '鎮ㄦ殏鏃犳娂閲戯紝鏃犻渶缁撶畻锛�',
+ icon: 'none',
+ duration: 2000
+ });
+ }
+ _context2.next = 27;
+ break;
+ case 17:
+ if (!(item.id === 1)) {
+ _context2.next = 27;
+ break;
+ }
+ if (!(_this4.info.depositStatus === 1)) {
+ _context2.next = 23;
+ break;
+ }
+ uni.showToast({
+ title: '鎶奸噾宸插厖鍊�',
+ icon: 'none',
+ duration: 2000
+ });
+ return _context2.abrupt("return");
+ case 23:
+ if (!(_this4.info.depositStatus === 2)) {
+ _context2.next = 26;
+ break;
+ }
+ uni.showToast({
+ title: '缁撶畻鐢宠鎻愪氦鎴愬姛锛岃鑰愬績绛夊緟閫�娆撅紒',
+ icon: 'none',
+ duration: 2000
+ });
+ return _context2.abrupt("return");
+ case 26:
+ _this4.show1 = true;
+ case 27:
+ case "end":
+ return _context2.stop();
+ }
+ }
+ }, _callee2);
+ }))();
},
// 楠戣鏄庣粏
toRidingDetails: function toRidingDetails() {
@@ -505,110 +571,140 @@
},
// 鎵爜绉熻溅
carRental: function carRental() {
- // 鍒ゆ柇鏈夋病鏈変氦鎶奸噾
- if (this.info.depositStatus === 0) {
- this.show1 = true;
- return;
- }
- var that = this;
- if (!that.disable) {
- that.disable = true;
- // 鎵爜瑙i攣楠戣
- uni.scanCode({
- success: function () {
- var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(result) {
- var res, num, timer;
- return _regenerator.default.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- // 鎵撳紑寮�閿佸脊妗�
- that.show5 = true;
- // 璋冪敤寮�閿佹帴鍙�
- _context3.next = 3;
- return that.$u.api.openLock({
- code: result.result
- });
- case 3:
- res = _context3.sent;
- if (res.code === 200) {
- that.disable = false;
- that.show6 = false;
- that.show5 = true;
- // 寰幆娆℃暟
- num = 1; // 寰幆鏌ョ湅瑙i攣缁撴灉
- timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
- var res1;
- return _regenerator.default.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- num += 1;
- _context2.next = 3;
- return that.$u.api.refreshLock({
- id: res.data.id
- });
- case 3:
- res1 = _context2.sent;
- // 寮�閿佹垚鍔�
- if (res1.data.status === 1) {
- that.refresh();
- clearInterval(timer);
- that.show5 = false;
- setTimeout(function () {
- that.show2 = true;
- }, 500);
- }
- // 寮�閿佸け璐�
- if (res1.data.status === 3) {
- that.refresh();
- clearInterval(timer);
- that.show5 = false;
- uni.showToast({
- title: '寮�閿佸け璐�',
- icon: 'error',
- duration: 2000
- });
- }
- // 寮�閿佽秴鏃�
- if (num === 180) {
- that.refresh();
- clearInterval(timer);
- that.show5 = false;
- uni.showToast({
- title: '寮�閿佽秴鏃�',
- icon: 'error',
- duration: 2000
- });
- }
- case 7:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2);
- })), 1000);
- } else {
- that.show5 = false;
- that.disable = false;
- }
- case 5:
- case "end":
- return _context3.stop();
- }
+ var _this5 = this;
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
+ var that;
+ return _regenerator.default.wrap(function _callee5$(_context5) {
+ while (1) {
+ switch (_context5.prev = _context5.next) {
+ case 0:
+ _context5.next = 2;
+ return _this5.refresh();
+ case 2:
+ if (!(_this5.info.depositStatus === 0)) {
+ _context5.next = 7;
+ break;
}
- }, _callee3);
- }));
- function success(_x) {
- return _success.apply(this, arguments);
+ _this5.show1 = true;
+ return _context5.abrupt("return");
+ case 7:
+ if (!(_this5.info.depositStatus === 2)) {
+ _context5.next = 10;
+ break;
+ }
+ uni.showToast({
+ title: '缁撶畻鐢宠鎻愪氦鎴愬姛锛岃鑰愬績绛夊緟閫�娆撅紒',
+ icon: 'none',
+ duration: 2000
+ });
+ return _context5.abrupt("return");
+ case 10:
+ that = _this5;
+ if (!that.disable) {
+ that.disable = true;
+ // 鎵爜瑙i攣楠戣
+ uni.scanCode({
+ success: function () {
+ var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(result) {
+ var res, num, timer;
+ return _regenerator.default.wrap(function _callee4$(_context4) {
+ while (1) {
+ switch (_context4.prev = _context4.next) {
+ case 0:
+ // 鎵撳紑寮�閿佸脊妗�
+ that.show5 = true;
+ // 璋冪敤寮�閿佹帴鍙�
+ _context4.next = 3;
+ return that.$u.api.openLock({
+ code: result.result
+ });
+ case 3:
+ res = _context4.sent;
+ if (res.code === 200) {
+ that.disable = false;
+ that.show6 = false;
+ that.show5 = true;
+ // 寰幆娆℃暟
+ num = 1; // 寰幆鏌ョ湅瑙i攣缁撴灉
+ timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
+ var res1;
+ return _regenerator.default.wrap(function _callee3$(_context3) {
+ while (1) {
+ switch (_context3.prev = _context3.next) {
+ case 0:
+ num += 1;
+ _context3.next = 3;
+ return that.$u.api.refreshLock({
+ id: res.data.id
+ });
+ case 3:
+ res1 = _context3.sent;
+ // 寮�閿佹垚鍔�
+ if (res1.data.status === 1) {
+ that.refresh();
+ clearInterval(timer);
+ that.show5 = false;
+ setTimeout(function () {
+ that.show2 = true;
+ }, 500);
+ }
+ // 寮�閿佸け璐�
+ if (res1.data.status === 3) {
+ that.refresh();
+ clearInterval(timer);
+ that.show5 = false;
+ uni.showToast({
+ title: '寮�閿佸け璐�',
+ icon: 'error',
+ duration: 2000
+ });
+ }
+ // 寮�閿佽秴鏃�
+ if (num === 180) {
+ that.refresh();
+ clearInterval(timer);
+ that.show5 = false;
+ uni.showToast({
+ title: '寮�閿佽秴鏃�',
+ icon: 'error',
+ duration: 2000
+ });
+ }
+ case 7:
+ case "end":
+ return _context3.stop();
+ }
+ }
+ }, _callee3);
+ })), 1000);
+ } else {
+ that.show5 = false;
+ that.disable = false;
+ }
+ case 5:
+ case "end":
+ return _context4.stop();
+ }
+ }
+ }, _callee4);
+ }));
+ function success(_x) {
+ return _success.apply(this, arguments);
+ }
+ return success;
+ }(),
+ fail: function fail() {
+ that.disable = false;
+ }
+ });
+ }
+ case 12:
+ case "end":
+ return _context5.stop();
}
- return success;
- }(),
- fail: function fail() {
- that.disable = false;
}
- });
- }
+ }, _callee5);
+ }))();
},
// 鑾峰彇缁忕含搴�
getAddress: function getAddress() {
@@ -744,91 +840,91 @@
},
// 鍒锋柊楠戣鐘舵��
refreshStatus: function refreshStatus() {
- var _this4 = this;
- this.timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
+ var _this6 = this;
+ this.timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
var res;
- return _regenerator.default.wrap(function _callee4$(_context4) {
+ return _regenerator.default.wrap(function _callee6$(_context6) {
while (1) {
- switch (_context4.prev = _context4.next) {
+ switch (_context6.prev = _context6.next) {
case 0:
- _context4.next = 2;
- return _this4.$u.api.home();
+ _context6.next = 2;
+ return _this6.$u.api.home();
case 2:
- res = _context4.sent;
+ res = _context6.sent;
if (!(res.code === 200)) {
- _context4.next = 13;
+ _context6.next = 13;
break;
}
- _this4.info = res.data;
+ _this6.info = res.data;
// 楠戣涓�
if (!(res.data.rideStatus === 1)) {
- _context4.next = 7;
+ _context6.next = 7;
break;
}
- return _context4.abrupt("return");
+ return _context6.abrupt("return");
case 7:
- _this4.show2 = false;
+ _this6.show2 = false;
// 宸叉崲杞�
if (!(res.data.rideStatus === 2)) {
- _context4.next = 11;
+ _context6.next = 11;
break;
}
- _this4.show6 = true;
- return _context4.abrupt("return");
+ _this6.show6 = true;
+ return _context6.abrupt("return");
case 11:
if (res.data.rideStatus === -1) {
- _this4.show6 = false;
+ _this6.show6 = false;
}
- clearInterval(_this4.timer);
+ clearInterval(_this6.timer);
case 13:
case "end":
- return _context4.stop();
+ return _context6.stop();
}
}
- }, _callee4);
+ }, _callee6);
})), 10000);
},
// 鑾峰彇棣栭〉淇℃伅
getHomeInfo: function getHomeInfo() {
- var _this5 = this;
+ var _this7 = this;
this.$u.api.home().then(function (res) {
if (res.code === 200) {
- _this5.info = res.data;
+ _this7.info = res.data;
// 鏄惁寮瑰嚭骞垮憡鍥�
if (res.data.adList.length > 0) {
- _this5.show = true;
+ _this7.show = true;
}
// 瑙i攣涓�
if (res.data.rideStatus === 0) {
- _this5.show5 = true;
+ _this7.show5 = true;
// 寰幆娆℃暟
var num = 1;
// 寰幆鏌ョ湅瑙i攣缁撴灉
- var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
+ var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
var res1;
- return _regenerator.default.wrap(function _callee5$(_context5) {
+ return _regenerator.default.wrap(function _callee7$(_context7) {
while (1) {
- switch (_context5.prev = _context5.next) {
+ switch (_context7.prev = _context7.next) {
case 0:
num += 1;
- _context5.next = 3;
- return _this5.$u.api.refreshLock({
+ _context7.next = 3;
+ return _this7.$u.api.refreshLock({
id: res.data.memberRidesResponse.rideId
});
case 3:
- res1 = _context5.sent;
+ res1 = _context7.sent;
// 寮�閿佹垚鍔�
if (res1.data.status === 1) {
clearInterval(timer);
- _this5.show5 = false;
+ _this7.show5 = false;
setTimeout(function () {
- _this5.show2 = true;
+ _this7.show2 = true;
}, 500);
}
// 寮�閿佸け璐�
if (res1.data.status === 3) {
clearInterval(timer);
- _this5.show5 = false;
+ _this7.show5 = false;
uni.showToast({
title: '寮�閿佸け璐�',
icon: 'error',
@@ -838,7 +934,7 @@
// 寮�閿佽秴鏃�
if (num === 180) {
clearInterval(timer);
- _this5.show5 = false;
+ _this7.show5 = false;
uni.showToast({
title: '寮�閿佽秴鏃�',
icon: 'error',
@@ -847,77 +943,77 @@
}
case 7:
case "end":
- return _context5.stop();
+ return _context7.stop();
}
}
- }, _callee5);
+ }, _callee7);
})), 1000);
}
// 楠戣涓�
if (res.data.rideStatus === 1) {
- _this5.show2 = true;
- _this5.refreshStatus();
+ _this7.show2 = true;
+ _this7.refreshStatus();
}
if (res.data.rideStatus === 5) {
- _this5.show5 = true;
+ _this7.show5 = true;
}
if (res.data.rideStatus === 2) {
- _this5.show6 = true;
- _this5.refreshStatus();
+ _this7.show6 = true;
+ _this7.refreshStatus();
}
// 鏄惁钀ヤ笟
if (res.data.isBusiness === 0) {
- _this5.title = '鏆傚仠钀ヤ笟鎻愰啋';
- _this5.content = res.data.unBusinessTips;
- _this5.show4 = true;
+ _this7.title = '鏆傚仠钀ヤ笟鎻愰啋';
+ _this7.content = res.data.unBusinessTips;
+ _this7.show4 = true;
return;
}
// 鏄惁鍋滄鏈嶅姟
if (res.data.isStopServe === 1) {
- _this5.title = '鏆傚仠鏈嶅姟鎻愰啋';
- _this5.content = res.data.stopServeTips;
- _this5.show4 = true;
+ _this7.title = '鏆傚仠鏈嶅姟鎻愰啋';
+ _this7.content = res.data.stopServeTips;
+ _this7.show4 = true;
}
}
});
},
// 鍒锋柊棣栭〉淇℃伅
refresh: function refresh() {
- var _this6 = this;
+ var _this8 = this;
this.$u.api.home().then(function (res) {
if (res.code === 200) {
- _this6.info = res.data;
+ _this8.info = res.data;
// 瑙i攣涓�
if (res.data.rideStatus === 0) {
- _this6.show5 = true;
+ _this8.show5 = true;
// 寰幆娆℃暟
var num = 1;
// 寰幆鏌ョ湅瑙i攣缁撴灉
- var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
+ var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
var res1;
- return _regenerator.default.wrap(function _callee6$(_context6) {
+ return _regenerator.default.wrap(function _callee8$(_context8) {
while (1) {
- switch (_context6.prev = _context6.next) {
+ switch (_context8.prev = _context8.next) {
case 0:
num += 1;
- _context6.next = 3;
- return _this6.$u.api.refreshLock({
+ _context8.next = 3;
+ return _this8.$u.api.refreshLock({
id: res.data.memberRidesResponse.rideId
});
case 3:
- res1 = _context6.sent;
+ res1 = _context8.sent;
// 寮�閿佹垚鍔�
if (res1.data.status === 1) {
clearInterval(timer);
- _this6.show5 = false;
+ _this8.show5 = false;
setTimeout(function () {
- _this6.show2 = true;
+ _this8.show2 = true;
}, 500);
}
// 寮�閿佸け璐�
if (res1.data.status === 3) {
clearInterval(timer);
- _this6.show5 = false;
+ _this8.show5 = false;
uni.showToast({
title: '寮�閿佸け璐�',
icon: 'error',
@@ -927,7 +1023,7 @@
// 寮�閿佽秴鏃�
if (num === 180) {
clearInterval(timer);
- _this6.show5 = false;
+ _this8.show5 = false;
uni.showToast({
title: '寮�閿佽秴鏃�',
icon: 'error',
@@ -936,21 +1032,21 @@
}
case 7:
case "end":
- return _context6.stop();
+ return _context8.stop();
}
}
- }, _callee6);
+ }, _callee8);
})), 1000);
}
if (res.data.rideStatus === 1) {
- _this6.show2 = true;
- _this6.refreshStatus();
+ _this8.show2 = true;
+ _this8.refreshStatus();
}
if (res.data.rideStatus === 5) {
- _this6.show5 = true;
+ _this8.show5 = true;
}
if (res.data.rideStatus === 2) {
- _this6.show6 = true;
+ _this8.show6 = true;
}
}
});
--
Gitblit v1.9.3