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

2 lines
997 B
JavaScript
Raw Normal View History

2024-10-01 09:15:35 +08:00
"use strict";var e=(e,t,r)=>new Promise(((n,s)=>{var a=e=>{try{i(r.next(e))}catch(t){s(t)}},o=e=>{try{i(r.throw(e))}catch(t){s(t)}},i=e=>e.done?n(e.value):Promise.resolve(e.value).then(a,o);i((r=r.apply(e,t)).next())}));const t=require("../common/vendor.js"),r=require("../service/mapService.js"),n=require("../utils/commUtils.js"),s=require("../utils/platform.js"),a={__name:"AddressCell",setup(a){const o=t.ref({}),i=t.ref(!0),l=()=>e(this,null,(function*(){try{const e=yield r.getLocation(),t=yield r.getMapDetailAddress(e.longitude,e.latitude);o.value=t,o.value.addressComponent||(i.value=!1)}catch(e){i.value=!1}}));return t.onLoad((()=>e(this,null,(function*(){yield l()})))),(e,r)=>t.e({a:t.unref(n.imgUrl)("@/static/addresscell/location.png"),b:t.unref(i)},t.unref(i)?{c:t.t(t.unref(o).addressComponent?`${t.unref(o).addressComponent.city} ${t.unref(o).addressComponent.district}`:"正在加载...")}:{},{d:t.n(t.unref(s.isH5)?"top-_a_2_a__a_":"top-_a_6_a__a_")})}};wx.createComponent(a);