acdr-ui/dist/dev/mp-weixin/components/AddressCell.js

51 lines
1.7 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"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_platform = require("../utils/platform.js");
const _sfc_main = {
__name: "AddressCell",
setup(__props) {
const addressDetail = common_vendor.ref({});
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;
} catch (e) {
console.log(e);
}
});
common_vendor.onLoad(() => __async(this, null, function* () {
yield getLocationDetail();
}));
return (_ctx, _cache) => {
return {
a: common_vendor.t(!common_vendor.unref(addressDetail).addressComponent ? "正在加载..." : `${common_vendor.unref(addressDetail).addressComponent.city} ${common_vendor.unref(addressDetail).addressComponent.district}`),
b: common_vendor.n(common_vendor.unref(utils_platform.isH5) ? "top-_a_3vw_a_" : "top-_a_6vw_a_")
};
};
}
};
wx.createComponent(_sfc_main);
//# sourceMappingURL=AddressCell.js.map