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 | 578 +++++++++++++++++++++++++++++++++------------------------
1 files changed, 335 insertions(+), 243 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 91acd5b..e42ecf1 100644
--- a/bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js
+++ b/bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js
@@ -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 */ 255))
+ 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 */ 263))
+ 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) {
@@ -133,37 +133,37 @@
var g0 = (_vm.info.deposit / 100).toFixed(2)
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.e4 = function ($event) {
- _vm.show1 = false
- }
- _vm.e5 = function ($event) {
_vm.show5 = false
}
- _vm.e6 = function ($event) {
+ _vm.e4 = 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.e10 = function ($event) {
+ _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(
@@ -223,6 +223,9 @@
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),
@@ -263,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) {
@@ -281,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();
}
@@ -292,7 +298,15 @@
}, _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'
@@ -312,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
});
});
}
@@ -329,26 +341,29 @@
// 缁撶畻
settlement1: function settlement1() {
var _this3 = this;
- this.$u.api.goodsOrderSettlement({
- orderId: this.info.goodsOrderId
- }).then(function (res) {
- if (res.code === 200) {
- _this3.refresh();
- uni.showToast({
- title: '缁撶畻鎴愬姛锛�',
- icon: 'success',
- duration: 2000
- });
- // this.info.rideStatus = -1
- // this.info.depositStatus = 0
- _this3.show3 = false;
- _this3.show7 = 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;
- if (this.info.rideStatus !== -1) {
+ console.log(this.info.rideStatus);
+ if (this.info.rideStatus != -1) {
this.show6 = true;
}
},
@@ -373,9 +388,15 @@
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.show7 = true
this.show3 = true;
} else {
uni.showToast({
@@ -399,7 +420,7 @@
// 楠戣鏄庣粏
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)
});
},
// 璺宠浆鏁呴殰涓婃姤
@@ -410,35 +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;
- that.info.depositStatus = 1;
- that.carRental();
- that.refresh();
- uni.showToast({
- title: '鍏呭�兼垚鍔�',
- icon: 'success',
- duration: 2000
- });
+ 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: '璇峰厛鍕鹃�夊崗璁�',
@@ -480,96 +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) {
- 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
+ // 璋冪敤寮�閿佹帴鍙�
+ _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 === 120) {
- that.refresh();
- 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() {
@@ -703,100 +740,62 @@
}
});
},
+ // 鍒锋柊楠戣鐘舵��
+ 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;
- this.$u.api.home().then(function (res) {
- if (res.code === 200) {
- _this4.info = res.data;
- // 鏄惁寮瑰嚭骞垮憡鍥�
- if (res.data.adList.length > 0) {
- _this4.show = true;
- }
- // 瑙i攣涓�
- if (res.data.rideStatus === 0) {
- _this4.show5 = true;
- // 寰幆娆℃暟
- var num = 1;
- // 寰幆鏌ョ湅瑙i攣缁撴灉
- var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
- var res1;
- return _regenerator.default.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- num += 1;
- _context4.next = 3;
- return _this4.$u.api.refreshLock({
- id: res.data.memberRidesResponse.rideId
- });
- case 3:
- res1 = _context4.sent;
- // 寮�閿佹垚鍔�
- if (res1.data.status === 1) {
- clearInterval(timer);
- _this4.show5 = false;
- setTimeout(function () {
- _this4.show2 = true;
- }, 500);
- }
- // 寮�閿佸け璐�
- if (res1.data.status === 3) {
- clearInterval(timer);
- _this4.show5 = false;
- uni.showToast({
- title: '寮�閿佸け璐�',
- icon: 'error',
- duration: 2000
- });
- }
- // 寮�閿佽秴鏃�
- if (num === 120) {
- clearInterval(timer);
- _this4.show5 = false;
- uni.showToast({
- title: '寮�閿佽秴鏃�',
- icon: 'error',
- duration: 2000
- });
- }
- case 7:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4);
- })), 1000);
- }
- if (res.data.rideStatus === 1) {
- _this4.show2 = true;
- }
- if (res.data.rideStatus === 5) {
- _this4.show5 = true;
- }
- if (res.data.rideStatus === 2) {
- _this4.show6 = true;
- }
- // 鏄惁钀ヤ笟
- if (res.data.isBusiness === 0) {
- _this4.content = res.data.unBusinessTips;
- _this4.show4 = true;
- return;
- }
- // 鏄惁鍋滄鏈嶅姟
- if (res.data.isStopServe === 1) {
- _this4.content = res.data.stopServeTips;
- _this4.show4 = true;
- }
- }
- });
- },
- // 鍒锋柊棣栭〉淇℃伅
- refresh: function refresh() {
var _this5 = this;
this.$u.api.home().then(function (res) {
if (res.code === 200) {
_this5.info = res.data;
+ // 鏄惁寮瑰嚭骞垮憡鍥�
+ if (res.data.adList.length > 0) {
+ _this5.show = true;
+ }
// 瑙i攣涓�
if (res.data.rideStatus === 0) {
_this5.show5 = true;
@@ -835,7 +834,7 @@
});
}
// 寮�閿佽秴鏃�
- if (num === 120) {
+ if (num === 180) {
clearInterval(timer);
_this5.show5 = false;
uni.showToast({
@@ -852,14 +851,104 @@
}, _callee5);
})), 1000);
}
+ // 楠戣涓�
if (res.data.rideStatus === 1) {
_this5.show2 = true;
+ _this5.refreshStatus();
}
if (res.data.rideStatus === 5) {
_this5.show5 = true;
}
if (res.data.rideStatus === 2) {
_this5.show6 = true;
+ _this5.refreshStatus();
+ }
+ // 鏄惁钀ヤ笟
+ if (res.data.isBusiness === 0) {
+ _this5.title = '鏆傚仠钀ヤ笟鎻愰啋';
+ _this5.content = res.data.unBusinessTips;
+ _this5.show4 = true;
+ return;
+ }
+ // 鏄惁鍋滄鏈嶅姟
+ if (res.data.isStopServe === 1) {
+ _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;
}
}
});
@@ -870,6 +959,9 @@
phoneNumber: mobile
});
}
+ },
+ destroyed: function destroyed() {
+ clearInterval(this.timer);
}
};
exports.default = _default;
--
Gitblit v1.9.3