|
@@ -101,10 +101,10 @@ var components
|
|
|
try {
|
|
|
components = {
|
|
|
axBody: function () {
|
|
|
- return __webpack_require__.e(/*! import() | components/ax-body/ax-body */ "components/ax-body/ax-body").then(__webpack_require__.bind(null, /*! @/components/ax-body/ax-body.vue */ 178))
|
|
|
+ return __webpack_require__.e(/*! import() | components/ax-body/ax-body */ "components/ax-body/ax-body").then(__webpack_require__.bind(null, /*! @/components/ax-body/ax-body.vue */ 186))
|
|
|
},
|
|
|
appNavigation: function () {
|
|
|
- return Promise.all(/*! import() | components/app-navigation/app-navigation */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/app-navigation/app-navigation")]).then(__webpack_require__.bind(null, /*! @/components/app-navigation/app-navigation.vue */ 185))
|
|
|
+ return Promise.all(/*! import() | components/app-navigation/app-navigation */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/app-navigation/app-navigation")]).then(__webpack_require__.bind(null, /*! @/components/app-navigation/app-navigation.vue */ 193))
|
|
|
},
|
|
|
}
|
|
|
} catch (e) {
|
|
@@ -143,18 +143,10 @@ var render = function () {
|
|
|
: null
|
|
|
var l1 = _vm.__map(_vm.list.data, function (item, index) {
|
|
|
var $orig = _vm.__get_orig(item)
|
|
|
- var g1 =
|
|
|
- !_vm.isOperation && item.params.nowPrice
|
|
|
- ? item.params.nowPrice.toFixed(4)
|
|
|
- : null
|
|
|
- var g2 =
|
|
|
- !!_vm.isOperation && item.params.nowPrice
|
|
|
- ? item.params.nowPrice.toFixed(4)
|
|
|
- : null
|
|
|
+ var g1 = item.params.nowPrice ? item.params.nowPrice.toFixed(4) : null
|
|
|
return {
|
|
|
$orig: $orig,
|
|
|
g1: g1,
|
|
|
- g2: g2,
|
|
|
}
|
|
|
})
|
|
|
if (!_vm._isMounted) {
|
|
@@ -364,6 +356,7 @@ var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/r
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
+//
|
|
|
|
|
|
var bmap = __webpack_require__(/*! static/js/bmap-wx.js */ 49);
|
|
|
var _default = {
|
|
@@ -406,6 +399,7 @@ var _default = {
|
|
|
_this.getDeviceInfo(device_no);
|
|
|
}
|
|
|
}
|
|
|
+ // this.user_info=this.$app.storage.get('USER_INFO')
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
@@ -417,10 +411,12 @@ var _default = {
|
|
|
mounted: function mounted() {
|
|
|
this.setListHeight();
|
|
|
this.setAppNavigationHeight();
|
|
|
+ this.get_frimid();
|
|
|
+ this.get_userinfo();
|
|
|
},
|
|
|
data: function data() {
|
|
|
return {
|
|
|
- isOperation: false,
|
|
|
+ user_info: {},
|
|
|
// 导航栏高度
|
|
|
appNavigationHeight: 0,
|
|
|
// 页面滚动锁
|
|
@@ -521,18 +517,59 @@ var _default = {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- getDeviceInfo: function getDeviceInfo(sn) {
|
|
|
+ get_userinfo: function get_userinfo() {
|
|
|
var _this2 = this;
|
|
|
+ this.$api.base("post", "/userApi/getUserAccount", {}, {}).then(function (res) {
|
|
|
+ _this2.user_info = res.accountInfo;
|
|
|
+ _this2.$app.storage.set('USER_INFO', res.accountInfo);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 企业用户扫码进入
|
|
|
+ get_frimid: function get_frimid() {
|
|
|
+ var _this3 = this;
|
|
|
+ if (this.$app.storage.get('FRIM_ID')) {
|
|
|
+ if (this.$app.storage.get('USER_TOKEN')) {
|
|
|
+ this.$api.base("post", "/userApi/add-firm-user?firmId=" + parseInt(this.$app.storage.get('FRIM_ID')), {}, {
|
|
|
+ error: false
|
|
|
+ }).then(function (res) {
|
|
|
+ _this3.$app.popup.alert(res.msg);
|
|
|
+ _this3.get_userinfo();
|
|
|
+ setTimeout(function () {
|
|
|
+ _this3.$app.storage.remove('FRIM_ID');
|
|
|
+ }, 500);
|
|
|
+ }).catch(function (err) {
|
|
|
+ _this3.$app.popup.alert(err.msg);
|
|
|
+ setTimeout(function () {
|
|
|
+ _this3.$app.storage.remove('FRIM_ID');
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ title: '未登录',
|
|
|
+ content: '你还未进行登录,请去登录',
|
|
|
+ showCancel: false,
|
|
|
+ success: function success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/login/login'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getDeviceInfo: function getDeviceInfo(sn) {
|
|
|
+ var _this4 = this;
|
|
|
this.$api.base("post", "/chargeApi/checkDevicesBySn", {
|
|
|
"sn": sn
|
|
|
}, {}).then(function (res) {
|
|
|
- console.log("设备信息:", res);
|
|
|
var item = res.device;
|
|
|
//设备状态 0:离网1:空闲2:占用(未充电)3:占用(充电中)4:占用(预约锁定)255:故障
|
|
|
if (item.deviceStatus == 0 || item.deviceStatus == 255) {
|
|
|
return;
|
|
|
}
|
|
|
- _this2.$app.url.goto('/pages/terminal/terminal?deviceId=' + item.id + "&deviceStatus=" + item.deviceStatus);
|
|
|
+ _this4.$app.url.goto('/pages/terminal/terminal?deviceId=' + item.id + "&deviceStatus=" + item.deviceStatus);
|
|
|
});
|
|
|
},
|
|
|
getQueryParams: function getQueryParams(url, key) {
|
|
@@ -553,11 +590,11 @@ var _default = {
|
|
|
},
|
|
|
// 打开客服
|
|
|
customerService: function customerService() {
|
|
|
- var _this3 = this;
|
|
|
+ var _this5 = this;
|
|
|
var cs = this.$config.customerService;
|
|
|
this.$app.act.customerService(cs.id, cs.url).catch(function (err) {
|
|
|
console.log(err);
|
|
|
- _this3.$app.popup.alert('客服中心失联啦,请联系管理员!');
|
|
|
+ _this5.$app.popup.alert('客服中心失联啦,请联系管理员!');
|
|
|
});
|
|
|
},
|
|
|
// 查询许可
|
|
@@ -593,17 +630,17 @@ var _default = {
|
|
|
},
|
|
|
// 更新位置
|
|
|
updateLocation: function updateLocation() {
|
|
|
- var _this4 = this;
|
|
|
+ var _this6 = this;
|
|
|
this.getLocation().then(function (res) {
|
|
|
- _this4.location.value = [res.longitude, res.latitude].join(',');
|
|
|
- _this4.getStations(res.longitude, res.latitude);
|
|
|
- _this4.$app.storage.set('USER_LOCATION', _this4.location.value);
|
|
|
- return _this4.reverseGeocoder([res.latitude, res.longitude].join(','));
|
|
|
+ _this6.location.value = [res.longitude, res.latitude].join(',');
|
|
|
+ _this6.getStations(res.longitude, res.latitude);
|
|
|
+ _this6.$app.storage.set('USER_LOCATION', _this6.location.value);
|
|
|
+ return _this6.reverseGeocoder([res.latitude, res.longitude].join(','));
|
|
|
});
|
|
|
},
|
|
|
// 获取定位
|
|
|
getLocation: function getLocation() {
|
|
|
- var _this5 = this;
|
|
|
+ var _this7 = this;
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
// this.loading.visible = true;
|
|
|
if (uni.getLocation) {
|
|
@@ -615,7 +652,7 @@ var _default = {
|
|
|
console.log(err);
|
|
|
console.log('定位失败');
|
|
|
// this.location.visible = true;
|
|
|
- _this5.getStations("", "");
|
|
|
+ _this7.getStations("", "");
|
|
|
},
|
|
|
complete: function complete() {}
|
|
|
});
|
|
@@ -629,7 +666,7 @@ var _default = {
|
|
|
});
|
|
|
},
|
|
|
reverseGeocoder: function reverseGeocoder(latlon) {
|
|
|
- var _this6 = this;
|
|
|
+ var _this8 = this;
|
|
|
console.log(latlon);
|
|
|
var lat = latlon.split(",")[0];
|
|
|
var lng = latlon.split(",")[1];
|
|
@@ -644,9 +681,9 @@ var _default = {
|
|
|
location: latlon,
|
|
|
success: function success(res) {
|
|
|
var code = res.originalData.result.addressComponent.adcode.substr(0, 4);
|
|
|
- for (var i = 0; i < _this6.city.data.length; i++) {
|
|
|
- if (_this6.city.data[i].areaCode == code) {
|
|
|
- _this6.city.index = i;
|
|
|
+ for (var i = 0; i < _this8.city.data.length; i++) {
|
|
|
+ if (_this8.city.data[i].areaCode == code) {
|
|
|
+ _this8.city.index = i;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -659,9 +696,9 @@ var _default = {
|
|
|
});
|
|
|
},
|
|
|
getBanners: function getBanners() {
|
|
|
- var _this7 = this;
|
|
|
+ var _this9 = this;
|
|
|
this.$api.base("post", "/userApi/getBanners", {}, {}).then(function (res) {
|
|
|
- _this7.banners = res.banners;
|
|
|
+ _this9.banners = res.banners;
|
|
|
});
|
|
|
},
|
|
|
convertBdToTx: function convertBdToTx(lng, lat) {
|
|
@@ -680,35 +717,35 @@ var _default = {
|
|
|
};
|
|
|
},
|
|
|
getStations: function getStations(lng, lat) {
|
|
|
- var _this8 = this;
|
|
|
+ var _this10 = this;
|
|
|
this.$api.base("post", "/chargeApi/getStations", {
|
|
|
order: this.sorts.index,
|
|
|
lat: lat,
|
|
|
lng: lng
|
|
|
}, {}).then(function (res) {
|
|
|
res.stationList.forEach(function (i) {
|
|
|
- var txPoint = _this8.convertBdToTx(i.lng, i.lat);
|
|
|
+ var txPoint = _this10.convertBdToTx(i.lng, i.lat);
|
|
|
i.lng = txPoint.lng;
|
|
|
i.lat = txPoint.lat;
|
|
|
});
|
|
|
- _this8.list.data = res.stationList;
|
|
|
+ _this10.list.data = res.stationList;
|
|
|
if (res.discountInfo) {
|
|
|
- _this8.discountInfo = res.discountInfo;
|
|
|
+ _this10.discountInfo = res.discountInfo;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 设定导航栏高度
|
|
|
setAppNavigationHeight: function setAppNavigationHeight() {
|
|
|
- var _this9 = this;
|
|
|
+ var _this11 = this;
|
|
|
this.$nextTick(function () {
|
|
|
- uni.createSelectorQuery().in(_this9).select("#app-navigation").boundingClientRect(function (data) {
|
|
|
- _this9.appNavigationHeight = data.height;
|
|
|
+ uni.createSelectorQuery().in(_this11).select("#app-navigation").boundingClientRect(function (data) {
|
|
|
+ _this11.appNavigationHeight = data.height;
|
|
|
}).exec();
|
|
|
});
|
|
|
},
|
|
|
// 设置列表高度
|
|
|
setListHeight: function setListHeight() {
|
|
|
- var _this10 = this;
|
|
|
+ var _this12 = this;
|
|
|
this.$app.act.selectorQuery(this, "#list-box,#roller", true).then(function (res) {
|
|
|
var win = uni.getWindowInfo();
|
|
|
var roller = res.find(function (i) {
|
|
@@ -717,7 +754,7 @@ var _default = {
|
|
|
var list = res.find(function (i) {
|
|
|
return i.id == 'list-box';
|
|
|
});
|
|
|
- _this10.list.height = win.windowHeight - list.top - _this10.appNavigationHeight + roller.height;
|
|
|
+ _this12.list.height = win.windowHeight - list.top - _this12.appNavigationHeight + roller.height;
|
|
|
});
|
|
|
},
|
|
|
// 版头加载完成
|