| | |
| | | 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), |
| | |
| | | }; |
| | | }, |
| | | 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) { |
| | |
| | | _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(); |
| | | } |
| | | } |
| | | }, _callee); |
| | | }))(); |
| | | }, |
| | | onPageScroll: function onPageScroll(e) { |
| | | this.top = e.scrollTop; |
| | | }, |
| | | methods: { |
| | | jumpX: function jumpX() { |
| | |
| | | res.data.forEach(function (item, index) { |
| | | _this2.markers.push({ |
| | | id: index, |
| | | width: 30, |
| | | width: 40, |
| | | height: 40, |
| | | latitude: item.latitude, |
| | | longitude: item.longitude, |
| | |
| | | this.isDisabled = false; |
| | | this.$u.api.goodsOrderSettlement({}).then(function (res) { |
| | | if (res.code === 200) { |
| | | _this3.refresh(); |
| | | _this3.show3 = false; |
| | | _this3.show6 = false; |
| | | _this3.show7 = false; |
| | | uni.showToast({ |
| | | title: '结算成功!', |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }); |
| | | _this3.show3 = false; |
| | | _this3.show7 = false; |
| | | _this3.isDisabled = true; |
| | | _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; |
| | | } |
| | | }, |
| | |
| | | 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 { |
| | |
| | | // 骑行明细 |
| | | 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) |
| | | }); |
| | | }, |
| | | // 跳转故障上报 |
| | |
| | | }, |
| | | // 押金支付 |
| | | 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: '请先勾选协议', |
| | |
| | | return; |
| | | } |
| | | var that = this; |
| | | // 扫码解锁骑行 |
| | | 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; |
| | | // 扫码解锁骑行 |
| | | 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; // 循环查看解锁结果 |
| | | 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; // 循环查看解锁结果 |
| | | 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 === 180) { |
| | | 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() { |
| | |
| | | case 2: |
| | | res = _context4.sent; |
| | | if (!(res.code === 200)) { |
| | | _context4.next = 10; |
| | | _context4.next = 13; |
| | | break; |
| | | } |
| | | _this4.info = res.data; |
| | |
| | | case 7: |
| | | _this4.show2 = false; |
| | | // 已换车 |
| | | if (res.data.rideStatus === 2) { |
| | | _this4.show6 = true; |
| | | 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 10: |
| | | case 13: |
| | | case "end": |
| | | return _context4.stop(); |
| | | } |
| | |
| | | } |
| | | 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; |
| | | } |