59 lines
2.1 KiB
JavaScript
59 lines
2.1 KiB
JavaScript
"use strict";
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
const common_vendor = require("../common/vendor.js");
|
|
const service_mapService = require("../service/mapService.js");
|
|
const utils_commUtils = require("../utils/commUtils.js");
|
|
const utils_platform = require("../utils/platform.js");
|
|
const _sfc_main = {
|
|
__name: "AddressCell",
|
|
setup(__props) {
|
|
const addressDetail = common_vendor.ref({});
|
|
const loading = common_vendor.ref(true);
|
|
const getLocationDetail = () => __async(this, null, function* () {
|
|
try {
|
|
const loction = yield service_mapService.getLocation();
|
|
const res = yield service_mapService.getMapDetailAddress(loction.longitude, loction.latitude);
|
|
addressDetail.value = res;
|
|
if (!addressDetail.value.addressComponent)
|
|
loading.value = false;
|
|
} catch (e) {
|
|
console.log(e);
|
|
loading.value = false;
|
|
}
|
|
});
|
|
common_vendor.onLoad(() => __async(this, null, function* () {
|
|
yield getLocationDetail();
|
|
}));
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.unref(utils_commUtils.imgUrl)("@/static/addresscell/location.png"),
|
|
b: common_vendor.unref(loading)
|
|
}, common_vendor.unref(loading) ? {
|
|
c: common_vendor.t(!common_vendor.unref(addressDetail).addressComponent ? "正在加载..." : `${common_vendor.unref(addressDetail).addressComponent.city} ${common_vendor.unref(addressDetail).addressComponent.district}`)
|
|
} : {}, {
|
|
d: common_vendor.n(common_vendor.unref(utils_platform.isH5) ? "top-_a_2_a__a_" : "top-_a_6_a__a_")
|
|
});
|
|
};
|
|
}
|
|
};
|
|
wx.createComponent(_sfc_main);
|