|
@@ -2,7 +2,10 @@
|
|
|
import { onMounted, reactive, ref } from 'vue'
|
|
|
import { shopList, deleteShop, getShopDetail, getProductList } from '@/api'
|
|
|
import { message } from 'ant-design-vue';
|
|
|
+import MapContainer from "@/components/MapContainer.vue";
|
|
|
+
|
|
|
let visible = ref<Boolean>(false)
|
|
|
+let showMap = ref<Boolean>(true)
|
|
|
let title = ref<String>('新增门店')
|
|
|
let deliveries = reactive({
|
|
|
arr: [{
|
|
@@ -40,6 +43,12 @@ interface formType {
|
|
|
address: String;
|
|
|
poiAddress: String;
|
|
|
street: String;
|
|
|
+ provinceName: String;
|
|
|
+ cityName: String;
|
|
|
+ cityCode: String;
|
|
|
+ districtName: String;
|
|
|
+ lng?: Number;
|
|
|
+ lat?: Number
|
|
|
}
|
|
|
let form = reactive<formType>({
|
|
|
name: '',
|
|
@@ -49,6 +58,10 @@ let form = reactive<formType>({
|
|
|
address: '',
|
|
|
poiAddress: '',
|
|
|
street: '',
|
|
|
+ provinceName: '',
|
|
|
+ cityName: '',
|
|
|
+ cityCode: '',
|
|
|
+ districtName: '',
|
|
|
})
|
|
|
const columns = reactive([
|
|
|
{
|
|
@@ -187,6 +200,20 @@ const showStatus = (bindStatus: Number, authMsg: String) => {
|
|
|
const confirm = () => {
|
|
|
|
|
|
}
|
|
|
+const getMapData = (v: string) => {
|
|
|
+ let mapData = JSON.parse(v)
|
|
|
+ console.log('地图数据:', mapData);
|
|
|
+ let regeocode = mapData.regeocode
|
|
|
+ let poi = regeocode.pois[0]
|
|
|
+ form.address = poi.name
|
|
|
+ form.poiAddress = poi.address
|
|
|
+ form.provinceName = regeocode.addressComponent.province
|
|
|
+ form.cityName = regeocode.addressComponent.city
|
|
|
+ form.cityCode = regeocode.addressComponent.citycode
|
|
|
+ form.districtName = regeocode.addressComponent.district
|
|
|
+ form.lng = poi.location[0]
|
|
|
+ form.lat = poi.location[1]
|
|
|
+}
|
|
|
onMounted(() => {
|
|
|
|
|
|
})
|
|
@@ -251,14 +278,8 @@ onMounted(() => {
|
|
|
<a-form-item label="详细地址" name="address">
|
|
|
<!-- <a-input v-model:value="form.address" /> -->
|
|
|
<a-input-group compact>
|
|
|
- <a-input v-model:value="address" style="width: calc(100% - 200px)" />
|
|
|
- <a-tooltip title="copy git url">
|
|
|
- <a-button>
|
|
|
- <template #icon>
|
|
|
- <CopyOutlined />
|
|
|
- </template>
|
|
|
- </a-button>
|
|
|
- </a-tooltip>
|
|
|
+ <a-input v-model:value="address" style="width: calc(100% - 32px)" placeholder="请点击右侧图标选择详细地址" />
|
|
|
+ <img src="@/assets/images/23.png" class="cursor-pointer w-32px h-32px" alt="">
|
|
|
</a-input-group>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="门牌号" name="street">
|
|
@@ -289,6 +310,9 @@ onMounted(() => {
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
</a-modal>
|
|
|
+ <a-modal v-model:visible="showMap" title="选择地址" :footer="null" width="1000px" style="top:20px;">
|
|
|
+ <MapContainer @getMapData="getMapData"></MapContainer>
|
|
|
+ </a-modal>
|
|
|
</template>
|
|
|
<style lang='scss' scoped>
|
|
|
.category_box {
|