From 19d17f0f0fb02f46342d70b5180e40a0ad1b66d3 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 09 十一月 2023 18:16:13 +0800
Subject: [PATCH] MrShi
---
bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js | 588 +++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 375 insertions(+), 213 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 a854da8..e42ecf1 100644
--- a/bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js
+++ b/bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js
@@ -35,7 +35,7 @@
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony import */ var _index_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.vue?vue&type=style&index=0&lang=css& */ 174);
/* harmony import */ var _index_vue_vue_type_style_index_1_id_57280228_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index.vue?vue&type=style&index=1&id=57280228&lang=scss&scoped=true& */ 176);
-/* harmony import */ var _HBuilderX_3_8_12_20230817_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../鍔炲叕/HBuilderX.3.8.12.20230817/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 33);
+/* harmony import */ var _HBuilderX_3_8_12_20230817_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../鍔炲叕/HBuilderX.3.8.12.20230817/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 36);
var renderjs
@@ -103,10 +103,10 @@
try {
components = {
uPopup: function () {
- return Promise.all(/*! import() | node-modules/uview-ui/components/u-popup/u-popup */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-popup/u-popup.vue */ 246))
+ return Promise.all(/*! import() | node-modules/uview-ui/components/u-popup/u-popup */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-popup/u-popup.vue */ 265))
},
uModal: function () {
- return Promise.all(/*! import() | node-modules/uview-ui/components/u-modal/u-modal */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-modal/u-modal")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-modal/u-modal.vue */ 254))
+ return Promise.all(/*! import() | node-modules/uview-ui/components/u-modal/u-modal */[__webpack_require__.e("common/vendor"), __webpack_require__.e("node-modules/uview-ui/components/u-modal/u-modal")]).then(__webpack_require__.bind(null, /*! uview-ui/components/u-modal/u-modal.vue */ 273))
},
}
} catch (e) {
@@ -131,66 +131,39 @@
var _h = _vm.$createElement
var _c = _vm._self._c || _h
var g0 = (_vm.info.deposit / 100).toFixed(2)
- var g1 = _vm.info.memberRidesResponse
- ? _vm.info.memberRidesResponse.rideStartTime.substring(10, 16)
- : null
- var g2 = _vm.info.memberRidesResponse
- ? (_vm.info.memberRidesResponse.rideTime / 60).toFixed(1)
- : null
- var g3 = _vm.info.memberRidesResponse
- ? (_vm.info.memberRidesResponse.baseTime / 60).toFixed(1)
- : null
- var g4 = _vm.info.memberRidesResponse
- ? (_vm.info.memberRidesResponse.basePrice / 100).toFixed(2)
- : null
- var g5 = _vm.info.memberRidesResponse
- ? (_vm.info.memberRidesResponse.unitPrice / 100).toFixed(2)
- : null
- var g6 = _vm.info.memberRidesResponse
- ? _vm.info.memberRidesResponse.rideStartTime.substring(5, 16)
- : null
- var g7 = _vm.info.memberRidesResponse
- ? _vm.info.memberRidesResponse.rideEndTime.substring(11, 16)
- : null
- var g8 = _vm.info.memberRidesResponse
- ? (_vm.info.memberRidesResponse.baseTime / 60).toFixed(1)
- : null
- var g9 = _vm.info.memberRidesResponse
- ? (_vm.info.memberRidesResponse.basePrice / 100).toFixed(2)
- : null
- var g10 = _vm.info.memberRidesResponse
- ? (_vm.info.memberRidesResponse.unitPrice / 100).toFixed(2)
- : null
if (!_vm._isMounted) {
_vm.e0 = function ($event) {
- _vm.show = false
+ _vm.show1 = false
}
_vm.e1 = function ($event) {
- _vm.show = false
+ _vm.active = !_vm.active
}
_vm.e2 = function ($event) {
_vm.show1 = false
}
_vm.e3 = function ($event) {
- _vm.active = !_vm.active
+ _vm.show5 = false
}
_vm.e4 = function ($event) {
- _vm.show1 = false
- }
- _vm.e5 = function ($event) {
- _vm.show1 = false
- }
- _vm.e6 = function ($event) {
_vm.show2 = false
}
- _vm.e7 = function ($event) {
+ _vm.e5 = function ($event) {
_vm.show6 = false
}
- _vm.e8 = function ($event) {
+ _vm.e6 = function ($event) {
_vm.show3 = false
}
- _vm.e9 = function ($event) {
+ _vm.e7 = function ($event) {
_vm.show4 = false
+ }
+ _vm.e8 = function ($event) {
+ _vm.show7 = false
+ }
+ _vm.e9 = function ($event) {
+ _vm.show = false
+ }
+ _vm.e10 = function ($event) {
+ _vm.show = false
}
}
_vm.$mp.data = Object.assign(
@@ -198,16 +171,6 @@
{
$root: {
g0: g0,
- g1: g1,
- g2: g2,
- g3: g3,
- g4: g4,
- g5: g5,
- g6: g6,
- g7: g7,
- g8: g8,
- g9: g9,
- g10: g10,
},
}
)
@@ -251,25 +214,38 @@
value: true
});
exports.default = void 0;
-var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 58));
-var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 60));
+var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
+var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
-var _vuex = __webpack_require__(/*! vuex */ 30);
+var _vuex = __webpack_require__(/*! vuex */ 33);
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var _default = {
data: function data() {
return {
+ disable: false,
+ top: 0,
+ title: '',
latitude: null,
longitude: null,
bgImg: __webpack_require__(/*! @/static/images/bg_service@2x.png */ 169),
show: false,
+ // 骞垮憡
show1: false,
+ // 缂寸撼鎶奸噾
show2: false,
+ // 楠戣涓�
show3: false,
+ // 纭缁撶畻
show4: false,
+ // 鎻愮ず
show5: false,
+ // 寮�閿�
show6: false,
+ // 宸茶繕杞�
+ show7: false,
+ // 纭缁撶畻寮规
+
active: false,
markers: [],
functionList: [{
@@ -290,11 +266,13 @@
icon: __webpack_require__(/*! @/static/images/home_ic_mingxi@2x.png */ 173)
}],
info: {},
- content: ''
+ content: '',
+ timer: null,
+ isDisabled: true
};
},
computed: _objectSpread({}, (0, _vuex.mapState)(['navHeight', 'statusbarHeight', 'userInfo'])),
- onLoad: function onLoad() {
+ onLoad: function onLoad(options) {
var _this = this;
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
return _regenerator.default.wrap(function _callee$(_context) {
@@ -308,10 +286,11 @@
_context.next = 3;
return _this.$onLaunched;
case 3:
+ console.log(decodeURIComponent(options.scene));
_this.getAddress();
_this.getHomeInfo();
_this.getSite();
- case 6:
+ case 7:
case "end":
return _context.stop();
}
@@ -319,7 +298,20 @@
}, _callee);
}))();
},
+ onPageScroll: function onPageScroll(e) {
+ this.top = e.scrollTop;
+ },
methods: {
+ jumpX: function jumpX() {
+ uni.navigateTo({
+ url: '/pages/leaseNotice/leaseNotice'
+ });
+ },
+ jumpMap: function jumpMap() {
+ uni.navigateTo({
+ url: '/pages/maps/maps'
+ });
+ },
// 璁′环瑙勫垯
jumpgz: function jumpgz() {
uni.navigateTo({
@@ -334,15 +326,13 @@
res.data.forEach(function (item, index) {
_this2.markers.push({
id: index,
- width: 30,
+ width: 40,
height: 40,
latitude: item.latitude,
longitude: item.longitude,
title: item.name,
iconPath: '/static/icon/ic_bike@2x.png',
- addr: item.addr,
- clusterId: 1,
- joinCluster: true
+ addr: item.addr
});
});
}
@@ -351,24 +341,31 @@
// 缁撶畻
settlement1: function settlement1() {
var _this3 = this;
- this.$u.api.goodsOrderSettlement({
- orderId: this.info.goodsOrderId
- }).then(function (res) {
- if (res.code === 200) {
- uni.showToast({
- title: '缁撶畻鎴愬姛锛�',
- icon: 'success',
- duration: 2000
- });
- _this3.info.rideStatus = -1;
- _this3.info.depositStatus = 0;
- _this3.show3 = false;
- }
- });
+ if (this.isDisabled) {
+ this.isDisabled = false;
+ this.$u.api.goodsOrderSettlement({}).then(function (res) {
+ if (res.code === 200) {
+ _this3.show3 = false;
+ _this3.show6 = false;
+ _this3.show7 = false;
+ uni.showToast({
+ title: '缁撶畻鎴愬姛锛�',
+ icon: 'success',
+ duration: 2000
+ });
+ _this3.refresh();
+ }
+ }).finally(function () {
+ _this3.isDisabled = true;
+ });
+ }
},
minute: function minute() {
this.show3 = false;
- this.show6 = true;
+ console.log(this.info.rideStatus);
+ if (this.info.rideStatus != -1) {
+ this.show6 = true;
+ }
},
settlement: function settlement() {
this.show6 = false;
@@ -391,8 +388,16 @@
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.settlement1();
+ this.show3 = true;
} else {
uni.showToast({
title: '鎮ㄦ殏鏃犳娂閲戯紝鏃犻渶缁撶畻锛�',
@@ -401,13 +406,21 @@
});
}
} else if (item.id === 1) {
+ if (this.info.depositStatus === 1) {
+ uni.showToast({
+ title: '鎶奸噾宸插厖鍊�',
+ icon: 'none',
+ duration: 2000
+ });
+ return;
+ }
this.show1 = true;
}
},
// 楠戣鏄庣粏
toRidingDetails: function toRidingDetails() {
uni.navigateTo({
- url: "/pages/ridingDetails/ridingDetails?id=".concat(this.info.goodsOrderId)
+ url: "/pages/ridingDetails/ridingDetails?id=".concat(this.info.goodsOrderId, "&price=").concat(this.info.deposit / 100)
});
},
// 璺宠浆鏁呴殰涓婃姤
@@ -418,33 +431,43 @@
},
// 鎶奸噾鏀粯
depositPayment: function depositPayment() {
+ var that = this;
if (this.active) {
- var that = this;
- this.$u.api.createGoodsOrderPay().then(function (res) {
- if (res.code === 200) {
- wx.requestPayment({
- timeStamp: res.data.timeStamp,
- nonceStr: res.data.nonceStr,
- package: res.data.packageValue,
- signType: 'MD5',
- paySign: res.data.paySign,
- success: function success(res) {
- if (res.errMsg = 'requestPayment:ok') {
- that.show1 = false;
- uni.showToast({
- title: '鍏呭�兼垚鍔�',
- icon: 'success',
- duration: 2000
- });
- that.info.depositStatus = 1;
+ if (!this.disable) {
+ that.disable = true;
+ that.$u.api.createGoodsOrderPay().then(function (res) {
+ if (res.code === 200) {
+ wx.requestPayment({
+ timeStamp: res.data.timeStamp,
+ nonceStr: res.data.nonceStr,
+ package: res.data.packageValue,
+ signType: 'MD5',
+ paySign: res.data.paySign,
+ success: function success(res) {
+ that.disable = false;
+ if (res.errMsg = 'requestPayment:ok') {
+ that.show1 = false;
+ that.info.depositStatus = 1;
+ that.carRental();
+ that.refresh();
+ uni.showToast({
+ title: '鍏呭�兼垚鍔�',
+ icon: 'success',
+ duration: 2000
+ });
+ }
+ },
+ fail: function fail(err) {
+ that.disable = false;
+ console.log(err);
}
- },
- fail: function fail(err) {
- console.log(err);
- }
- });
- }
- });
+ });
+ }
+ }).catch(function (err) {
+ that.disable = false;
+ console.log(err);
+ });
+ }
} else {
uni.showToast({
title: '璇峰厛鍕鹃�夊崗璁�',
@@ -486,93 +509,104 @@
return;
}
var that = this;
- // 鎵爜瑙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.show6 = false;
+ 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;
- // 寰幆娆℃暟
- 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) {
- clearInterval(timer);
- that.show5 = false;
- setTimeout(function () {
- that.show2 = true;
- }, 500);
- }
- // 寮�閿佸け璐�
- if (res1.data.status === 3) {
- clearInterval(timer);
- that.show5 = false;
- uni.showToast({
- title: '寮�閿佸け璐�',
- icon: 'error',
- duration: 2000
+ // 璋冪敤寮�閿佹帴鍙�
+ _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
});
- }
- // 寮�閿佽秴鏃�
- if (num === 10) {
- clearInterval(timer);
- that.show5 = false;
- uni.showToast({
- title: '寮�閿佽秴鏃�',
- icon: 'error',
- duration: 2000
- });
- }
- case 7:
- case "end":
- return _context2.stop();
+ 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;
- }
- case 5:
- case "end":
- return _context3.stop();
+ }, _callee2);
+ })), 1000);
+ } else {
+ that.show5 = false;
+ that.disable = false;
+ }
+ case 5:
+ case "end":
+ return _context3.stop();
+ }
}
- }
- }, _callee3);
- }));
- function success(_x) {
- return _success.apply(this, arguments);
+ }, _callee3);
+ }));
+ function success(_x) {
+ return _success.apply(this, arguments);
+ }
+ return success;
+ }(),
+ fail: function fail() {
+ that.disable = false;
}
- return success;
- }()
- });
+ });
+ }
},
// 鑾峰彇缁忕含搴�
getAddress: function getAddress() {
@@ -706,47 +740,93 @@
}
});
},
+ // 鍒锋柊楠戣鐘舵��
+ refreshStatus: function refreshStatus() {
+ var _this4 = this;
+ this.timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
+ var res;
+ return _regenerator.default.wrap(function _callee4$(_context4) {
+ while (1) {
+ switch (_context4.prev = _context4.next) {
+ case 0:
+ _context4.next = 2;
+ return _this4.$u.api.home();
+ case 2:
+ res = _context4.sent;
+ if (!(res.code === 200)) {
+ _context4.next = 13;
+ break;
+ }
+ _this4.info = res.data;
+ // 楠戣涓�
+ if (!(res.data.rideStatus === 1)) {
+ _context4.next = 7;
+ break;
+ }
+ return _context4.abrupt("return");
+ case 7:
+ _this4.show2 = false;
+ // 宸叉崲杞�
+ if (!(res.data.rideStatus === 2)) {
+ _context4.next = 11;
+ break;
+ }
+ _this4.show6 = true;
+ return _context4.abrupt("return");
+ case 11:
+ if (res.data.rideStatus === -1) {
+ _this4.show6 = false;
+ }
+ clearInterval(_this4.timer);
+ case 13:
+ case "end":
+ return _context4.stop();
+ }
+ }
+ }, _callee4);
+ })), 10000);
+ },
// 鑾峰彇棣栭〉淇℃伅
getHomeInfo: function getHomeInfo() {
- var _this4 = this;
+ var _this5 = this;
this.$u.api.home().then(function (res) {
if (res.code === 200) {
- _this4.info = res.data;
+ _this5.info = res.data;
// 鏄惁寮瑰嚭骞垮憡鍥�
if (res.data.adList.length > 0) {
- _this4.show = true;
+ _this5.show = true;
}
// 瑙i攣涓�
if (res.data.rideStatus === 0) {
- _this4.show5 = true;
+ _this5.show5 = true;
// 寰幆娆℃暟
var num = 1;
// 寰幆鏌ョ湅瑙i攣缁撴灉
- var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
+ var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
var res1;
- return _regenerator.default.wrap(function _callee4$(_context4) {
+ return _regenerator.default.wrap(function _callee5$(_context5) {
while (1) {
- switch (_context4.prev = _context4.next) {
+ switch (_context5.prev = _context5.next) {
case 0:
num += 1;
- _context4.next = 3;
- return _this4.$u.api.refreshLock({
+ _context5.next = 3;
+ return _this5.$u.api.refreshLock({
id: res.data.memberRidesResponse.rideId
});
case 3:
- res1 = _context4.sent;
+ res1 = _context5.sent;
// 寮�閿佹垚鍔�
if (res1.data.status === 1) {
clearInterval(timer);
- _this4.show5 = false;
+ _this5.show5 = false;
setTimeout(function () {
- _this4.show2 = true;
+ _this5.show2 = true;
}, 500);
}
// 寮�閿佸け璐�
if (res1.data.status === 3) {
clearInterval(timer);
- _this4.show5 = false;
+ _this5.show5 = false;
uni.showToast({
title: '寮�閿佸け璐�',
icon: 'error',
@@ -754,9 +834,9 @@
});
}
// 寮�閿佽秴鏃�
- if (num === 10) {
+ if (num === 180) {
clearInterval(timer);
- _this4.show5 = false;
+ _this5.show5 = false;
uni.showToast({
title: '寮�閿佽秴鏃�',
icon: 'error',
@@ -765,31 +845,110 @@
}
case 7:
case "end":
- return _context4.stop();
+ return _context5.stop();
}
}
- }, _callee4);
+ }, _callee5);
})), 1000);
}
+ // 楠戣涓�
if (res.data.rideStatus === 1) {
- _this4.show2 = true;
+ _this5.show2 = true;
+ _this5.refreshStatus();
}
if (res.data.rideStatus === 5) {
- _this4.show5 = true;
+ _this5.show5 = true;
}
if (res.data.rideStatus === 2) {
- _this4.show6 = true;
+ _this5.show6 = true;
+ _this5.refreshStatus();
}
// 鏄惁钀ヤ笟
if (res.data.isBusiness === 0) {
- _this4.content = res.data.unBusinessTips;
- _this4.show4 = true;
+ _this5.title = '鏆傚仠钀ヤ笟鎻愰啋';
+ _this5.content = res.data.unBusinessTips;
+ _this5.show4 = true;
return;
}
// 鏄惁鍋滄鏈嶅姟
if (res.data.isStopServe === 1) {
- _this4.content = res.data.stopServeTips;
- _this4.show4 = true;
+ _this5.title = '鏆傚仠鏈嶅姟鎻愰啋';
+ _this5.content = res.data.stopServeTips;
+ _this5.show4 = true;
+ }
+ }
+ });
+ },
+ // 鍒锋柊棣栭〉淇℃伅
+ refresh: function refresh() {
+ var _this6 = this;
+ this.$u.api.home().then(function (res) {
+ if (res.code === 200) {
+ _this6.info = res.data;
+ // 瑙i攣涓�
+ if (res.data.rideStatus === 0) {
+ _this6.show5 = true;
+ // 寰幆娆℃暟
+ var num = 1;
+ // 寰幆鏌ョ湅瑙i攣缁撴灉
+ var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
+ var res1;
+ return _regenerator.default.wrap(function _callee6$(_context6) {
+ while (1) {
+ switch (_context6.prev = _context6.next) {
+ case 0:
+ num += 1;
+ _context6.next = 3;
+ return _this6.$u.api.refreshLock({
+ id: res.data.memberRidesResponse.rideId
+ });
+ case 3:
+ res1 = _context6.sent;
+ // 寮�閿佹垚鍔�
+ if (res1.data.status === 1) {
+ clearInterval(timer);
+ _this6.show5 = false;
+ setTimeout(function () {
+ _this6.show2 = true;
+ }, 500);
+ }
+ // 寮�閿佸け璐�
+ if (res1.data.status === 3) {
+ clearInterval(timer);
+ _this6.show5 = false;
+ uni.showToast({
+ title: '寮�閿佸け璐�',
+ icon: 'error',
+ duration: 2000
+ });
+ }
+ // 寮�閿佽秴鏃�
+ if (num === 180) {
+ clearInterval(timer);
+ _this6.show5 = false;
+ uni.showToast({
+ title: '寮�閿佽秴鏃�',
+ icon: 'error',
+ duration: 2000
+ });
+ }
+ case 7:
+ case "end":
+ return _context6.stop();
+ }
+ }
+ }, _callee6);
+ })), 1000);
+ }
+ if (res.data.rideStatus === 1) {
+ _this6.show2 = true;
+ _this6.refreshStatus();
+ }
+ if (res.data.rideStatus === 5) {
+ _this6.show5 = true;
+ }
+ if (res.data.rideStatus === 2) {
+ _this6.show6 = true;
}
}
});
@@ -800,6 +959,9 @@
phoneNumber: mobile
});
}
+ },
+ destroyed: function destroyed() {
+ clearInterval(this.timer);
}
};
exports.default = _default;
--
Gitblit v1.9.3