MrShi
2025-02-25 9dfc54bf6e0fdb3c746815707487c6ae50e98905
bicycle/unpackage/dist/dev/mp-weixin/pages/index/index.js
@@ -108,6 +108,9 @@
    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 */ 301))
    },
    tram: function () {
      return __webpack_require__.e(/*! import() | components/tram/tram */ "components/tram/tram").then(__webpack_require__.bind(null, /*! @/components/tram/tram.vue */ 309))
    },
  }
} catch (e) {
  if (
@@ -220,6 +223,11 @@
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 tram = function tram() {
  __webpack_require__.e(/*! require.ensure | components/tram/tram */ "components/tram/tram").then((function () {
    return resolve(__webpack_require__(/*! @/components/tram/tram.vue */ 309));
  }).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
};
var _default = {
  data: function data() {
    return {
@@ -268,8 +276,28 @@
      info: {},
      content: '',
      timer: null,
      isDisabled: true
      isDisabled: true,
      tcList: [],
      type: 1,
      types: [{
        name: '自行车',
        id: 1
      }, {
        name: '电动车',
        id: 2
      }],
      eleBusinessArea: [{
        points: [],
        fillColor: "#0077FF12",
        strokeColor: "#0077FF",
        strokeWidth: 3,
        zIndex: 7
      }],
      onPullDownRefresh: false
    };
  },
  components: {
    tram: tram
  },
  computed: _objectSpread({}, (0, _vuex.mapState)(['navHeight', 'statusbarHeight', 'userInfo'])),
  onLoad: function onLoad(options) {
@@ -302,10 +330,73 @@
      }, _callee);
    }))();
  },
  onPullDownRefresh: function onPullDownRefresh() {
    this.onPullDownRefresh = true;
    this.refresh();
  },
  onShow: function onShow() {
    this.refresh();
  },
  onPageScroll: function onPageScroll(e) {
    this.top = e.scrollTop;
  },
  methods: {
    clickcontrol: function clickcontrol() {
      var mapObjs = uni.createMapContext('mapId', this);
      mapObjs.moveToLocation({
        complete: function complete(res) {
          console.log('移动完成:', res);
        }
      });
    },
    getEleBikeList: function getEleBikeList() {
      var _this2 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
        var res;
        return _regenerator.default.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                _context2.next = 2;
                return _this2.$u.api.eleBikeList({});
              case 2:
                res = _context2.sent;
                if (res.code === 200) {
                  _this2.markers = [];
                  res.data.forEach(function (item, index) {
                    _this2.markers.push({
                      id: index,
                      width: 40,
                      height: 40,
                      latitude: item.latitude,
                      longitude: item.longitude,
                      title: item.name,
                      iconPath: '/static/icon/ic_bike@2x.png'
                    });
                  });
                  _this2.clickcontrol();
                }
              case 4:
              case "end":
                return _context2.stop();
            }
          }
        }, _callee2);
      }))();
    },
    clickType: function clickType(id) {
      this.type = id;
      if (id === 1) {
        this.getSite();
      } else {
        this.getEleBikeList();
      }
    },
    purchase: function purchase(id) {
      uni.navigateTo({
        url: "/pages/packageDetails/packageDetails?id=".concat(id)
      });
    },
    jumpTC: function jumpTC() {
      uni.navigateTo({
        url: '/pages/setMenu/setMenu'
@@ -313,25 +404,25 @@
    },
    // 微信打开小程序开锁方法
    carRentalCopy: function carRentalCopy(code) {
      var _this2 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
      var _this3 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
        var that, res, num, timer;
        return _regenerator.default.wrap(function _callee3$(_context3) {
        return _regenerator.default.wrap(function _callee4$(_context4) {
          while (1) {
            switch (_context3.prev = _context3.next) {
            switch (_context4.prev = _context4.next) {
              case 0:
                _context3.next = 2;
                return _this2.refresh();
                _context4.next = 2;
                return _this3.refresh();
              case 2:
                if (!(_this2.info.depositStatus === 0)) {
                  _context3.next = 7;
                if (!(_this3.info.depositStatus === 0)) {
                  _context4.next = 7;
                  break;
                }
                _this2.show1 = true;
                return _context3.abrupt("return");
                _this3.show1 = true;
                return _context4.abrupt("return");
              case 7:
                if (!(_this2.info.depositStatus === 2)) {
                  _context3.next = 10;
                if (!(_this3.info.depositStatus === 2)) {
                  _context4.next = 10;
                  break;
                }
                uni.showToast({
@@ -339,42 +430,42 @@
                  icon: 'none',
                  duration: 2000
                });
                return _context3.abrupt("return");
                return _context4.abrupt("return");
              case 10:
                that = _this2;
                that = _this3;
                if (that.disable) {
                  _context3.next = 18;
                  _context4.next = 18;
                  break;
                }
                that.disable = true;
                // 打开开锁弹框
                that.show5 = true;
                // 调用开锁接口
                _context3.next = 16;
                _context4.next = 16;
                return that.$u.api.openLock({
                  code: code
                });
              case 16:
                res = _context3.sent;
                res = _context4.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() {
                  timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
                    var res1;
                    return _regenerator.default.wrap(function _callee2$(_context2) {
                    return _regenerator.default.wrap(function _callee3$(_context3) {
                      while (1) {
                        switch (_context2.prev = _context2.next) {
                        switch (_context3.prev = _context3.next) {
                          case 0:
                            num += 1;
                            _context2.next = 3;
                            _context3.next = 3;
                            return that.$u.api.refreshLock({
                              id: res.data.id
                            });
                          case 3:
                            res1 = _context2.sent;
                            res1 = _context3.sent;
                            // 开锁成功
                            if (res1.data.status === 1) {
                              that.refresh();
@@ -408,10 +499,10 @@
                            }
                          case 7:
                          case "end":
                            return _context2.stop();
                            return _context3.stop();
                        }
                      }
                    }, _callee2);
                    }, _callee3);
                  })), 1000);
                } else {
                  that.show5 = false;
@@ -419,10 +510,10 @@
                }
              case 18:
              case "end":
                return _context3.stop();
                return _context4.stop();
            }
          }
        }, _callee3);
        }, _callee4);
      }))();
    },
    jumpX: function jumpX() {
@@ -432,7 +523,7 @@
    },
    jumpMap: function jumpMap() {
      uni.navigateTo({
        url: '/pages/maps/maps'
        url: "/pages/maps/maps?type=".concat(this.type)
      });
    },
    // 计价规则
@@ -442,12 +533,12 @@
      });
    },
    getSite: function getSite() {
      var _this3 = this;
      var _this4 = this;
      this.$u.api.rentSiteList().then(function (res) {
        if (res.code === 200) {
          _this3.markers = [];
          _this4.markers = [];
          res.data.forEach(function (item, index) {
            _this3.markers.push({
            _this4.markers.push({
              id: index,
              width: 40,
              height: 40,
@@ -458,19 +549,20 @@
              addr: item.addr
            });
          });
          _this4.clickcontrol();
        }
      });
    },
    // 结算
    settlement1: function settlement1() {
      var _this4 = this;
      var _this5 = this;
      if (this.isDisabled) {
        this.isDisabled = false;
        this.$u.api.goodsOrderSettlement({}).then(function (res) {
          if (res.code === 200) {
            _this4.show3 = false;
            _this4.show6 = false;
            _this4.show7 = false;
            _this5.show3 = false;
            _this5.show6 = false;
            _this5.show7 = false;
            uni.showToast({
              title: '结算申请提交成功,请耐心等待退款!',
              icon: 'none',
@@ -479,9 +571,9 @@
            // this.refresh()
          }
        }).finally(function () {
          _this4.refresh();
          _this4.show3 = false;
          _this4.isDisabled = true;
          _this5.refresh();
          _this5.show3 = false;
          _this5.isDisabled = true;
        });
      }
    },
@@ -511,47 +603,47 @@
    },
    // 跳转
    jump: function jump(item) {
      var _this5 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
        return _regenerator.default.wrap(function _callee4$(_context4) {
      var _this6 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
        return _regenerator.default.wrap(function _callee5$(_context5) {
          while (1) {
            switch (_context4.prev = _context4.next) {
            switch (_context5.prev = _context5.next) {
              case 0:
                _context4.next = 2;
                return _this5.refresh();
                _context5.next = 2;
                return _this6.refresh();
              case 2:
                if (!(item.id === 3)) {
                  _context4.next = 6;
                  _context5.next = 6;
                  break;
                }
                uni.navigateTo({
                  url: '/pages/pricingRules/pricingRules'
                });
                _context4.next = 31;
                _context5.next = 31;
                break;
              case 6:
                if (!(item.id === 4)) {
                  _context4.next = 10;
                  _context5.next = 10;
                  break;
                }
                uni.navigateTo({
                  url: '/pages/consumptionDetails/consumptionDetails'
                });
                _context4.next = 31;
                _context5.next = 31;
                break;
              case 10:
                if (!(item.id === 2)) {
                  _context4.next = 19;
                  _context5.next = 19;
                  break;
                }
                if (_this5.userInfo.mobile) {
                  _context4.next = 13;
                if (_this6.userInfo.mobile) {
                  _context5.next = 13;
                  break;
                }
                return _context4.abrupt("return");
                return _context5.abrupt("return");
              case 13:
                if (!(_this5.info.rideStatus === 1)) {
                  _context4.next = 16;
                if (!(_this6.info.rideStatus === 1)) {
                  _context5.next = 16;
                  break;
                }
                uni.showToast({
@@ -559,11 +651,11 @@
                  icon: 'none',
                  duration: 2000
                });
                return _context4.abrupt("return");
                return _context5.abrupt("return");
              case 16:
                if (_this5.info.depositStatus === 1) {
                  _this5.show3 = true;
                } else if (_this5.info.depositStatus === 2) {
                if (_this6.info.depositStatus === 1) {
                  _this6.show3 = true;
                } else if (_this6.info.depositStatus === 2) {
                  uni.showToast({
                    title: '结算申请提交成功,请耐心等待退款!',
                    icon: 'none',
@@ -576,21 +668,21 @@
                    duration: 2000
                  });
                }
                _context4.next = 31;
                _context5.next = 31;
                break;
              case 19:
                if (!(item.id === 1)) {
                  _context4.next = 31;
                  _context5.next = 31;
                  break;
                }
                if (_this5.userInfo.mobile) {
                  _context4.next = 22;
                if (_this6.userInfo.mobile) {
                  _context5.next = 22;
                  break;
                }
                return _context4.abrupt("return");
                return _context5.abrupt("return");
              case 22:
                if (!(_this5.info.depositStatus === 1)) {
                  _context4.next = 27;
                if (!(_this6.info.depositStatus === 1)) {
                  _context5.next = 27;
                  break;
                }
                uni.showToast({
@@ -598,10 +690,10 @@
                  icon: 'none',
                  duration: 2000
                });
                return _context4.abrupt("return");
                return _context5.abrupt("return");
              case 27:
                if (!(_this5.info.depositStatus === 2)) {
                  _context4.next = 30;
                if (!(_this6.info.depositStatus === 2)) {
                  _context5.next = 30;
                  break;
                }
                uni.showToast({
@@ -609,15 +701,15 @@
                  icon: 'none',
                  duration: 2000
                });
                return _context4.abrupt("return");
                return _context5.abrupt("return");
              case 30:
                _this5.show1 = true;
                _this6.show1 = true;
              case 31:
              case "end":
                return _context4.stop();
                return _context5.stop();
            }
          }
        }, _callee4);
        }, _callee5);
      }))();
    },
    // 骑行明细
@@ -662,7 +754,6 @@
                },
                fail: function fail(err) {
                  that.disable = false;
                  console.log(err);
                }
              });
            }
@@ -706,25 +797,26 @@
    },
    // 扫码租车
    carRental: function carRental() {
      var _this6 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
      var _this7 = this;
      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
        var that;
        return _regenerator.default.wrap(function _callee7$(_context7) {
        return _regenerator.default.wrap(function _callee9$(_context9) {
          while (1) {
            switch (_context7.prev = _context7.next) {
            switch (_context9.prev = _context9.next) {
              case 0:
                _context7.next = 2;
                return _this6.refresh();
              case 2:
                if (!(_this6.info.depositStatus === 0)) {
                  _context7.next = 7;
                that = _this7; // 刷新首页信息
                _context9.next = 3;
                return _this7.refresh();
              case 3:
                if (!(_this7.info.depositStatus === 0)) {
                  _context9.next = 8;
                  break;
                }
                _this6.show1 = true;
                return _context7.abrupt("return");
              case 7:
                if (!(_this6.info.depositStatus === 2)) {
                  _context7.next = 10;
                _this7.show1 = true;
                return _context9.abrupt("return");
              case 8:
                if (!(_this7.info.depositStatus === 2)) {
                  _context9.next = 11;
                  break;
                }
                uni.showToast({
@@ -732,115 +824,149 @@
                  icon: 'none',
                  duration: 2000
                });
                return _context7.abrupt("return");
              case 10:
                that = _this6;
                if (!that.disable) {
                  that.disable = true;
                  // 扫码解锁骑行
                return _context9.abrupt("return");
              case 11:
                // 自行车
                if (_this7.type === 1) {
                  if (!that.disable) {
                    that.disable = true;
                    // 扫码解锁骑行
                    uni.scanCode({
                      success: function () {
                        var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(result) {
                          var text, res, num, timer;
                          return _regenerator.default.wrap(function _callee7$(_context7) {
                            while (1) {
                              switch (_context7.prev = _context7.next) {
                                case 0:
                                  text = decodeURIComponent(result.path);
                                  text = text.substring(text.lastIndexOf('?') + 7, text.length);
                                  // 打开开锁弹框
                                  that.show5 = true;
                                  // 调用开锁接口
                                  _context7.next = 5;
                                  return that.$u.api.openLock({
                                    code: text
                                  });
                                case 5:
                                  res = _context7.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 _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 that.$u.api.refreshLock({
                                                id: res.data.id
                                              });
                                            case 3:
                                              res1 = _context6.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 _context6.stop();
                                          }
                                        }
                                      }, _callee6);
                                    })), 1000);
                                  } else {
                                    that.show5 = false;
                                    that.disable = false;
                                  }
                                case 7:
                                case "end":
                                  return _context7.stop();
                              }
                            }
                          }, _callee7);
                        }));
                        function success(_x) {
                          return _success.apply(this, arguments);
                        }
                        return success;
                      }(),
                      fail: function fail() {
                        that.disable = false;
                      }
                    });
                  }
                } else {
                  uni.scanCode({
                    success: function () {
                      var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(result) {
                        var text, res, num, timer;
                        return _regenerator.default.wrap(function _callee6$(_context6) {
                      var _success2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(result) {
                        var res;
                        return _regenerator.default.wrap(function _callee8$(_context8) {
                          while (1) {
                            switch (_context6.prev = _context6.next) {
                            switch (_context8.prev = _context8.next) {
                              case 0:
                                text = decodeURIComponent(result.path);
                                text = text.substring(text.lastIndexOf('?') + 7, text.length);
                                // 打开开锁弹框
                                that.show5 = true;
                                // 调用开锁接口
                                _context6.next = 5;
                                return that.$u.api.openLock({
                                  code: text
                                _context8.next = 2;
                                return that.$u.api.getBikeChargingRule({
                                  code: result.result
                                });
                              case 5:
                                res = _context6.sent;
                              case 2:
                                res = _context8.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 _callee5() {
                                    var res1;
                                    return _regenerator.default.wrap(function _callee5$(_context5) {
                                      while (1) {
                                        switch (_context5.prev = _context5.next) {
                                          case 0:
                                            num += 1;
                                            _context5.next = 3;
                                            return that.$u.api.refreshLock({
                                              id: res.data.id
                                            });
                                          case 3:
                                            res1 = _context5.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 _context5.stop();
                                        }
                                      }
                                    }, _callee5);
                                  })), 1000);
                                } else {
                                  that.show5 = false;
                                  that.disable = false;
                                  that.$refs.d_tram.info = res.data;
                                  that.$refs.d_tram.d_show1 = true;
                                }
                              case 7:
                              case 4:
                              case "end":
                                return _context6.stop();
                                return _context8.stop();
                            }
                          }
                        }, _callee6);
                        }, _callee8);
                      }));
                      function success(_x) {
                        return _success.apply(this, arguments);
                      function success(_x2) {
                        return _success2.apply(this, arguments);
                      }
                      return success;
                    }(),
                    fail: function fail() {
                      that.disable = false;
                    }
                    }()
                  });
                }
              case 12:
              case "end":
                return _context7.stop();
                return _context9.stop();
            }
          }
        }, _callee7);
        }, _callee9);
      }))();
    },
    // 获取经纬度
@@ -977,213 +1103,300 @@
    },
    // 刷新骑行状态
    refreshStatus: function refreshStatus() {
      var _this7 = this;
      this.timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
      var _this8 = this;
      this.timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
        var res;
        return _regenerator.default.wrap(function _callee8$(_context8) {
        return _regenerator.default.wrap(function _callee10$(_context10) {
          while (1) {
            switch (_context8.prev = _context8.next) {
            switch (_context10.prev = _context10.next) {
              case 0:
                _context8.next = 2;
                return _this7.$u.api.home();
                _context10.next = 2;
                return _this8.$u.api.home();
              case 2:
                res = _context8.sent;
                res = _context10.sent;
                if (!(res.code === 200)) {
                  _context8.next = 13;
                  _context10.next = 13;
                  break;
                }
                _this7.info = res.data;
                _this8.info = res.data;
                // 骑行中
                if (!(res.data.rideStatus === 1)) {
                  _context8.next = 7;
                  _context10.next = 7;
                  break;
                }
                return _context8.abrupt("return");
                return _context10.abrupt("return");
              case 7:
                _this7.show2 = false;
                _this8.show2 = false;
                // 已换车
                if (!(res.data.rideStatus === 2)) {
                  _context8.next = 11;
                  _context10.next = 11;
                  break;
                }
                _this7.show6 = true;
                return _context8.abrupt("return");
                _this8.show6 = true;
                return _context10.abrupt("return");
              case 11:
                if (res.data.rideStatus === -1) {
                  _this7.show6 = false;
                  _this8.show6 = false;
                }
                clearInterval(_this7.timer);
                clearInterval(_this8.timer);
              case 13:
              case "end":
                return _context8.stop();
                return _context10.stop();
            }
          }
        }, _callee8);
        }, _callee10);
      })), 10000);
    },
    // 获取首页信息
    getHomeInfo: function getHomeInfo() {
      var _this8 = this;
      this.$u.api.home().then(function (res) {
        if (res.code === 200) {
          _this8.info = res.data;
          // 是否弹出广告图
          if (res.data.adList.length > 0) {
            _this8.show = true;
          }
          // 解锁中
          if (res.data.rideStatus === 0) {
            _this8.show5 = true;
            // 循环次数
            var num = 1;
            // 循环查看解锁结果
            var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
              var res1;
              return _regenerator.default.wrap(function _callee9$(_context9) {
                while (1) {
                  switch (_context9.prev = _context9.next) {
                    case 0:
                      num += 1;
                      _context9.next = 3;
                      return _this8.$u.api.refreshLock({
                        id: res.data.memberRidesResponse.rideId
                      });
                    case 3:
                      res1 = _context9.sent;
                      // 开锁成功
                      if (res1.data.status === 1) {
                        clearInterval(timer);
                        _this8.show5 = false;
                        setTimeout(function () {
                          _this8.show2 = true;
                        }, 500);
                      }
                      // 开锁失败
                      if (res1.data.status === 3) {
                        clearInterval(timer);
                        _this8.show5 = false;
                        uni.showToast({
                          title: '开锁失败',
                          icon: 'error',
                          duration: 2000
                        });
                      }
                      // 开锁超时
                      if (num === 180) {
                        clearInterval(timer);
                        _this8.show5 = false;
                        uni.showToast({
                          title: '开锁超时',
                          icon: 'error',
                          duration: 2000
                        });
                      }
                    case 7:
                    case "end":
                      return _context9.stop();
      var _this9 = this;
      var that = this;
      this.$u.api.home().then( /*#__PURE__*/function () {
        var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(res) {
          var num, timer, arr;
          return _regenerator.default.wrap(function _callee12$(_context12) {
            while (1) {
              switch (_context12.prev = _context12.next) {
                case 0:
                  if (!(res.code === 200)) {
                    _context12.next = 13;
                    break;
                  }
                }
              }, _callee9);
            })), 1000);
          }
          // 骑行中
          if (res.data.rideStatus === 1) {
            _this8.show2 = true;
            _this8.refreshStatus();
          }
          if (res.data.rideStatus === 5) {
            _this8.show5 = true;
          }
          if (res.data.rideStatus === 2) {
            _this8.show6 = true;
            _this8.refreshStatus();
          }
          // 是否营业
          if (res.data.isBusiness === 0) {
            _this8.title = '暂停营业提醒';
            _this8.content = res.data.unBusinessTips;
            _this8.show4 = true;
            return;
          }
          // 是否停止服务
          if (res.data.isStopServe === 1) {
            _this8.title = '暂停服务提醒';
            _this8.content = res.data.stopServeTips;
            _this8.show4 = true;
          }
        }
      });
                  _this9.info = res.data;
                  // 是否弹出广告图
                  if (res.data.adList.length > 0 && !res.data.memberRidesResponse) {
                    _this9.show = true;
                  }
                  // 自行车
                  if (res.data.memberRidesResponse && res.data.memberRidesResponse.ridesType === 0) {
                    _this9.type = 1;
                    // 解锁中
                    if (res.data.rideStatus === 0) {
                      _this9.show5 = true;
                      // 循环次数
                      num = 1; // 循环查看解锁结果
                      timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
                        var res1;
                        return _regenerator.default.wrap(function _callee11$(_context11) {
                          while (1) {
                            switch (_context11.prev = _context11.next) {
                              case 0:
                                num += 1;
                                _context11.next = 3;
                                return _this9.$u.api.refreshLock({
                                  id: res.data.memberRidesResponse.rideId
                                });
                              case 3:
                                res1 = _context11.sent;
                                // 开锁成功
                                if (res1.data.status === 1) {
                                  clearInterval(timer);
                                  _this9.show5 = false;
                                  setTimeout(function () {
                                    _this9.show2 = true;
                                  }, 500);
                                }
                                // 开锁失败
                                if (res1.data.status === 3) {
                                  clearInterval(timer);
                                  _this9.show5 = false;
                                  uni.showToast({
                                    title: '开锁失败',
                                    icon: 'error',
                                    duration: 2000
                                  });
                                }
                                // 开锁超时
                                if (num === 180) {
                                  clearInterval(timer);
                                  _this9.show5 = false;
                                  uni.showToast({
                                    title: '开锁超时',
                                    icon: 'error',
                                    duration: 2000
                                  });
                                }
                              case 7:
                              case "end":
                                return _context11.stop();
                            }
                          }
                        }, _callee11);
                      })), 1000);
                    }
                    // 骑行中
                    if (res.data.rideStatus === 1) {
                      _this9.show2 = true;
                      _this9.refreshStatus();
                    }
                    if (res.data.rideStatus === 5) {
                      _this9.show5 = true;
                    }
                    if (res.data.rideStatus === 2) {
                      _this9.show6 = true;
                      _this9.refreshStatus();
                    }
                  } else if (res.data.memberRidesResponse && res.data.memberRidesResponse.ridesType === 1) {
                    _this9.type = 2;
                    that.$refs.d_tram.info = _objectSpread(_objectSpread(_objectSpread({}, res.data.memberRidesResponse.discountMember), res.data.memberRidesResponse), {}, {
                      deposit: res.data.deposit,
                      goodsOrderId: res.data.goodsOrderId
                    });
                    // 骑行中
                    if (res.data.rideStatus === 1) {
                      that.$refs.d_tram.d_show3 = true;
                    }
                    // 临时锁车
                    if (res.data.rideStatus === 4) {
                      that.$refs.d_tram.d_show4 = true;
                    }
                  }
                  // 是否营业
                  if (!(res.data.isBusiness === 0)) {
                    _context12.next = 9;
                    break;
                  }
                  _this9.title = '暂停营业提醒';
                  _this9.content = res.data.unBusinessTips;
                  _this9.show4 = true;
                  return _context12.abrupt("return");
                case 9:
                  // 是否停止服务
                  if (res.data.isStopServe === 1) {
                    _this9.title = '暂停服务提醒';
                    _this9.content = res.data.stopServeTips;
                    _this9.show4 = true;
                  }
                  _this9.tcList = res.data.discountList;
                  arr = JSON.parse(res.data.eleBusinessArea);
                  _this9.eleBusinessArea[0].points = arr.map(function (item) {
                    return {
                      latitude: item.lat,
                      longitude: item.lng
                    };
                  });
                case 13:
                case "end":
                  return _context12.stop();
              }
            }
          }, _callee12);
        }));
        return function (_x3) {
          return _ref4.apply(this, arguments);
        };
      }());
    },
    // 刷新首页信息
    refresh: function refresh() {
      var _this9 = this;
      var _this10 = this;
      this.$u.api.home().then(function (res) {
        uni.stopPullDownRefresh();
        if (res.code === 200) {
          _this9.info = res.data;
          // 解锁中
          if (res.data.rideStatus === 0) {
            _this9.show5 = true;
            // 循环次数
            var num = 1;
            // 循环查看解锁结果
            var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
              var res1;
              return _regenerator.default.wrap(function _callee10$(_context10) {
                while (1) {
                  switch (_context10.prev = _context10.next) {
                    case 0:
                      num += 1;
                      _context10.next = 3;
                      return _this9.$u.api.refreshLock({
                        id: res.data.memberRidesResponse.rideId
                      });
                    case 3:
                      res1 = _context10.sent;
                      // 开锁成功
                      if (res1.data.status === 1) {
                        clearInterval(timer);
                        _this9.show5 = false;
                        setTimeout(function () {
                          _this9.show2 = true;
                        }, 500);
                      }
                      // 开锁失败
                      if (res1.data.status === 3) {
                        clearInterval(timer);
                        _this9.show5 = false;
                        uni.showToast({
                          title: '开锁失败',
                          icon: 'error',
                          duration: 2000
          _this10.info = res.data;
          // 未查到骑行订单
          if (!res.data.memberRidesResponse && _this10.onPullDownRefresh) {
            _this10.show1 = false;
            _this10.show2 = false;
            _this10.show3 = false;
            _this10.show4 = false;
            _this10.show5 = false;
            _this10.show6 = false;
            _this10.show7 = false;
            that.$refs.d_tram.d_show = false;
            that.$refs.d_tram.d_show1 = false;
            that.$refs.d_tram.d_show2 = false;
            that.$refs.d_tram.d_show3 = false;
            that.$refs.d_tram.d_show4 = false;
            that.$refs.d_tram.d_show5 = false;
            that.$refs.d_tram.d_show6 = false;
            that.$refs.d_tram.d_show7 = false;
            that.$refs.d_tram.d_show8 = false;
            that.$refs.d_tram.d_show9 = false;
            _this10.onPullDownRefresh = false;
            return;
          }
          // 自行车
          if (res.data.memberRidesResponse.ridesType === 0) {
            // 解锁中
            if (res.data.rideStatus === 0) {
              _this10.show5 = true;
              // 循环次数
              var num = 1;
              // 循环查看解锁结果
              var timer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
                var res1;
                return _regenerator.default.wrap(function _callee13$(_context13) {
                  while (1) {
                    switch (_context13.prev = _context13.next) {
                      case 0:
                        num += 1;
                        _context13.next = 3;
                        return _this10.$u.api.refreshLock({
                          id: res.data.memberRidesResponse.rideId
                        });
                      }
                      // 开锁超时
                      if (num === 180) {
                        clearInterval(timer);
                        _this9.show5 = false;
                        uni.showToast({
                          title: '开锁超时',
                          icon: 'error',
                          duration: 2000
                        });
                      }
                    case 7:
                    case "end":
                      return _context10.stop();
                      case 3:
                        res1 = _context13.sent;
                        // 开锁成功
                        if (res1.data.status === 1) {
                          clearInterval(timer);
                          _this10.show5 = false;
                          setTimeout(function () {
                            _this10.show2 = true;
                          }, 500);
                        }
                        // 开锁失败
                        if (res1.data.status === 3) {
                          clearInterval(timer);
                          _this10.show5 = false;
                          uni.showToast({
                            title: '开锁失败',
                            icon: 'error',
                            duration: 2000
                          });
                        }
                        // 开锁超时
                        if (num === 180) {
                          clearInterval(timer);
                          _this10.show5 = false;
                          uni.showToast({
                            title: '开锁超时',
                            icon: 'error',
                            duration: 2000
                          });
                        }
                      case 7:
                      case "end":
                        return _context13.stop();
                    }
                  }
                }
              }, _callee10);
            })), 1000);
          }
          if (res.data.rideStatus === 1) {
            _this9.show2 = true;
            _this9.refreshStatus();
          }
          if (res.data.rideStatus === 5) {
            _this9.show5 = true;
          }
          if (res.data.rideStatus === 2) {
            _this9.show6 = true;
                }, _callee13);
              })), 1000);
            }
            if (res.data.rideStatus === 1) {
              _this10.show2 = true;
              _this10.refreshStatus();
            }
            if (res.data.rideStatus === 5) {
              _this10.show5 = true;
            }
            if (res.data.rideStatus === 2) {
              _this10.show6 = true;
            }
          } else if (res.data.memberRidesResponse.ridesType === 1) {
            _this10.type = 2;
            _this10.$refs.d_tram.info = _objectSpread(_objectSpread(_objectSpread({}, res.data.memberRidesResponse.discountMember), res.data.memberRidesResponse), {}, {
              deposit: res.data.deposit,
              goodsOrderId: res.data.goodsOrderId
            });
            // 骑行中
            if (res.data.rideStatus === 1) {
              _this10.$refs.d_tram.d_show3 = true;
            }
            // 临时锁车
            if (res.data.rideStatus === 4) {
              _this10.$refs.d_tram.d_show4 = true;
            }
          }
        }
      });