MrShi
2023-10-31 e9af167156ca9d1b404a76ab0fc8c82c26fe6a11
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(
@@ -263,7 +263,9 @@
        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'])),
@@ -293,6 +295,11 @@
    }))();
  },
  methods: {
    jumpX: function jumpX() {
      uni.navigateTo({
        url: '/pages/leaseNotice/leaseNotice'
      });
    },
    jumpMap: function jumpMap() {
      uni.navigateTo({
        url: '/pages/maps/maps'
@@ -318,9 +325,7 @@
              longitude: item.longitude,
              title: item.name,
              iconPath: '/static/icon/ic_bike@2x.png',
              addr: item.addr,
              clusterId: 1,
              joinCluster: true
              addr: item.addr
            });
          });
        }
@@ -329,22 +334,22 @@
    // 结算
    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.refresh();
            uni.showToast({
              title: '结算成功!',
              icon: 'success',
              duration: 2000
            });
            _this3.show3 = false;
            _this3.show7 = false;
            _this3.isDisabled = true;
          }
        });
      }
    },
    minute: function minute() {
      this.show3 = false;
@@ -374,8 +379,6 @@
        });
      } else if (item.id === 2) {
        if (this.info.depositStatus === 1) {
          // this.settlement1()
          // this.show7 = true
          this.show3 = true;
        } else {
          uni.showToast({
@@ -703,100 +706,55 @@
        }
      });
    },
    // 刷新骑行状态
    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 = 10;
                  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) {
                  _this4.show6 = true;
                }
                clearInterval(_this4.timer);
              case 10:
              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;
          }
          // 解锁中
          if (res.data.rideStatus === 0) {
            _this4.show5 = true;
            // 循环次数
            var num = 1;
            // 循环查看解锁结果
            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;
          }
          // 解锁中
          if (res.data.rideStatus === 0) {
            _this5.show5 = true;
@@ -852,14 +810,101 @@
              }, _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;
          }
          // 是否营业
          if (res.data.isBusiness === 0) {
            _this5.content = res.data.unBusinessTips;
            _this5.show4 = true;
            return;
          }
          // 是否停止服务
          if (res.data.isStopServe === 1) {
            _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;
          // 解锁中
          if (res.data.rideStatus === 0) {
            _this6.show5 = true;
            // 循环次数
            var num = 1;
            // 循环查看解锁结果
            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 === 120) {
                        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 +915,9 @@
        phoneNumber: mobile
      });
    }
  },
  destroyed: function destroyed() {
    clearInterval(this.timer);
  }
};
exports.default = _default;