快速入驻

zsk_admin
zsk 10 months ago
parent 594641bcf3
commit 67f9c8fb52

@ -17,7 +17,8 @@ export function getBusinessCoopList(data) {
// Add agency
export function addAgency(data) {
return request({
url: "/admin/v4/agency/addAgency",
url: "/business/coop/approve",
// url: "/admin/v4/agency/addAgency",
method: "post",
data: setqs(data),
});

@ -8,7 +8,8 @@ import {
} from 'ant-design-vue';
import commonJS from './common.js';
const router = useRouter()
const baseURL = "https://admin.ibocai.com.cn/api_prod"; // 正式环境线上
// const baseURL = "https://admin.ibocai.com.cn/api_prod"; // 正式环境线上
const baseURL = "http://192.168.3.83:8003"; // 正式环境线上
// const baseURL2 = "https://a.matripe.com.cn/api_stock"; // 正式环境线上
let protocol = location.protocol
let trueUrl = protocol == 'http:' ? baseURL : baseURL2

@ -0,0 +1,309 @@
<template>
<div class="p-components-map-poi">
<div id="container"></div>
<div id="myPageTop">
<div class="g_flex_row_center" style="position: relative">
<div>
<input id="tipinput" placeholder="请输入关键词搜索" autocomplete="off" v-model="keyword" />
</div>
<div class="btn g_flex_c">
<svg focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg>
</div>
</div>
</div>
<div class="g_pt_10 g_flex_row_between">
<div>
<div class="g_fw_700 g_fs_14">{{ mapInfo.name }}</div>
<div class="g_fs_14">{{ mapInfo.address }}</div>
</div>
<div class="g_flex_column_center" v-if="mapInfo.name">
<a-button type="primary" @click="submitForm"></a-button>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, getCurrentInstance, watch, defineEmits, defineProps } from "vue";
import { Modal, message } from "ant-design-vue";
import AMapLoader from "@amap/amap-jsapi-loader";
import { mapConfig } from "../../utils/config.js";
/* #################### 初始化事件 #################### */
const emits = defineEmits(["submitEvent"]);
const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G;
const mapInfo = ref({
name: "",
address: "",
lat: "",
lng: "",
});
const keyword = ref("");
const selectInfo = ref({});
const props = defineProps({
info: {
type: Object,
default: () => {
return {
name: "",
address: "",
lat: "",
lng: "",
};
},
},
});
const defaultInfo = ref({
mdistrict: "",
});
onMounted(() => {
console.log("地图组件:", props.info);
mapInfo.value = props.info;
keyword.value = mapInfo.value.name;
});
/* ############################## 地图配置 ############################## */
window._AMapSecurityConfig = {
securityJsCode: mapConfig.secret,
};
AMapLoader.load({
key: mapConfig.key,
version: "2.0",
plugins: ["AMap.Scale", "AMap.HawkEye", "AMap.ToolBar", "AMap.ControlBar", "AMap.Geocoder"],
})
.then((AMap) => {
/* ################################# 初始化 ################################# */
let mapPraams = {
zoom: 13,
resizeEnable: true,
};
console.log(mapPraams);
if (mapInfo.value.lat && mapInfo.value.lng) {
console.log("getLng");
mapPraams.center = [mapInfo.value.lng, mapInfo.value.lat];
} else {
mapPraams.center = [116.397429, 39.909183];
}
var initMarker,
map = new AMap.Map("container", mapPraams); //"container" <div> id
/* ################################# 实例化事件 ################################# */
const addMarker = () => {
if (!initMarker && mapInfo.value.lat && mapInfo.value.lng) {
console.log("getLng");
initMarker = new AMap.Marker({
icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png",
position: [Number(mapInfo.value.lng), Number(mapInfo.value.lat)],
offset: new AMap.Pixel(-13, -30),
});
initMarker.setMap(map);
}
};
addMarker();
/* ################################# 点击事件 ################################# */
var geocoder = new AMap.Geocoder();
var marker,
lnglat = [];
map.on("click", function (ev) {
mapInfo.value = {
name: "",
address: "",
lat: ev.lnglat.lat,
lng: ev.lnglat.lng,
};
keyword.value = mapInfo.value.name;
lnglat = [ev.lnglat.lng, ev.lnglat.lat];
geocoder.getAddress(lnglat, function (status, result) {
if (marker) {
marker.setMap(null);
marker = null;
}
setTimeout(() => {
console.log("点击点返回结果:", result);
if (status === "complete" && result.info === "OK") {
let _address = "",
_district = result.regeocode.addressComponent.province + result.regeocode.addressComponent.city + result.regeocode.addressComponent.district;
if (result.regeocode.addressComponent.neighborhood) {
_address = result.regeocode.addressComponent.neighborhood;
} else {
_address = result.regeocode.formattedAddress.replace(_district + result.regeocode.addressComponent.township, () => "");
}
mapInfo.value.name = _address;
keyword.value = mapInfo.value.name;
mapInfo.value.address = result.regeocode.formattedAddress;
selectInfo.value = {
address: result.regeocode.formattedAddress,
district: _district,
lat: mapInfo.value.lat,
lng: mapInfo.value.lng,
name: mapInfo.value.name,
};
defaultInfo.value = {
mdistrict: _district,
};
if (initMarker) {
initMarker.setMap(null);
initMarker = null;
}
marker = new AMap.Marker({
icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png",
position: [mapInfo.value.lng, mapInfo.value.lat],
offset: new AMap.Pixel(-13, -30),
});
marker.setMap(map);
}
}, 10);
});
});
/* ################################# 工具条 ################################# */
var scale = new AMap.Scale({
visible: true,
}),
toolBar = new AMap.ToolBar({
visible: true,
position: {
top: "110px",
right: "40px",
},
}),
controlBar = new AMap.ControlBar({
visible: true,
position: {
top: "10px",
right: "10px",
},
}),
overView = new AMap.HawkEye({
visible: true,
});
map.addControl(scale);
map.addControl(toolBar);
map.addControl(controlBar);
map.addControl(overView);
/* ################################# POI搜索与选择 ################################# */
//
var autoOptions = {
input: "tipinput",
};
AMap.plugin(["AMap.PlaceSearch", "AMap.AutoComplete"], function () {
var auto = new AMap.AutoComplete(autoOptions);
var placeSearch = new AMap.PlaceSearch({
map: map,
}); //
auto.on("select", select); //
function select(e) {
console.log("map 获取下拉选择地址信息:", e);
placeSearch.setCity(e.poi.adcode);
placeSearch.search(e.poi.name); //
selectInfo.value = e.poi;
if (e.poi.location) {
mapInfo.value = {
name: e.poi.name,
address: e.poi.district + e.poi.address,
lat: e.poi.location.lat,
lng: e.poi.location.lng,
};
} else {
mapInfo.value = {
name: e.poi.name,
address: e.poi.district + e.poi.address,
lat: "",
lng: "",
};
}
keyword.value = mapInfo.value.name;
defaultInfo.value = {
mdistrict: e.poi.district,
};
}
});
})
.catch((e) => {
console.log("地图异常状态数据:", e);
});
const submitForm = () => {
if (mapInfo.value.lat == "") {
console.log("经纬度:", mapInfo.value);
message.error("请重新选择");
return false;
}
emits("submitEvent", {
pointInfo: Object.assign(defaultInfo.value, mapInfo.value),
initInfo: Object.assign(defaultInfo.value, selectInfo.value),
});
};
</script>
<style lang="less">
.p-components-map-poi {
#container {
width: 100%;
height: calc(100vh - 254px);
}
#myPageTop {
position: absolute;
top: 106px;
width: 280px;
border: none;
right: 236px;
padding: 0;
}
#myPageTop input {
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
font-variant: tabular-nums;
list-style: none;
-webkit-font-feature-settings: "tnum";
font-feature-settings: "tnum";
position: relative;
display: inline-block;
width: 100%;
height: 32px;
padding: 4px 11px;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
line-height: 1.5;
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
-webkit-transition: all 0.3s;
transition: all 0.3s;
width: 280px;
outline: #1677ff;
}
#myPageTop input:focus {
border-color: #40a9ff;
border-right-width: 1px !important;
}
#myPageTop .btn {
cursor: pointer;
width: 32px;
height: 32px;
background-color: #1677ff;
color: #fff;
position: absolute;
right: 0;
top: 0;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.amap-icon img {
width: 25px;
height: 34px;
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -1,8 +1,18 @@
<template>
<div class="business-coop-management">
<!-- Search input -->
<div class="search-container">
<!-- <div class="search-container">
<a-input-search v-model:value="searchKeyword" placeholder="请输入关键字" style="width: 320px" @search="getTable" @change="handleChangeSearch" allowClear />
</div> -->
<div class="header-container">
<div class="left-container">
<a-input-search v-model:value="searchKeyword" placeholder="请输入关键字" style="width: 320px" @search="getTable" @change="handleChangeSearch" allowClear />
</div>
<a-radio-group v-model:value="activeTab" style="margin-left: 16px">
<a-radio-button value="all" style="width: 80px; text-align: center">全部</a-radio-button>
<a-radio-button value="pending" style="width: 80px; text-align: center">待审核</a-radio-button>
<a-radio-button value="approved" style="width: 80px; text-align: center">已审核</a-radio-button>
</a-radio-group>
</div>
<!-- Business coop table -->
@ -55,9 +65,13 @@
</template>
<!-- Operation column -->
<template v-if="column.dataIndex === 'operate'">
<!-- <template v-if="column.dataIndex === 'operate'">
<a href="javascript:" @click="showExamineModal(record)"></a>
</template>
</template> -->
<template v-if="column.dataIndex === 'operate'">
<span v-if="record.finished === 1" style="color: #999; cursor: not-allowed;"></span>
<a v-else href="javascript:" @click="showExamineModal(record)"></a>
</template>
</template>
</a-table>
@ -92,9 +106,9 @@
<div class="display-flex">
<span style="max-width: 475px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ formState.address }}</span>
<span class="iconfont icon-dizhi f14" style="color: #999; line-height: 32px; margin-left: 6px; cursor: pointer" v-if="!formState.address" @click="showMapModal()"></span>
<span class="iconfont icon-dizhi f14" style="color: #999; line-height: 32px; margin-left: 6px; cursor: pointer" v-if="!formState.address" @click="handleOpenMap('address')"></span>
<span class="iconfont icon-dizhi f14" v-if="formState.address" style="color: #1890ff; line-height: 32px; margin-left: 6px; cursor: pointer" @click="showMapModal()"></span>
<span class="iconfont icon-dizhi f14" v-if="formState.address" style="color: #1890ff; line-height: 32px; margin-left: 6px; cursor: pointer" @click="handleOpenMap('address')"></span>
</div>
</a-form-item>
@ -135,12 +149,20 @@
<a-modal :visible="imageModalVisible" title="查看图片" @ok="imageModalVisible = false" @cancel="imageModalVisible = false">
<img :src="currentImage" alt="Image" style="max-width: 100%; max-height: 80vh" />
</a-modal>
<!-- 高德POI搜索 -->
<a-modal v-model:open="poiModal.isShow" title="位置" width="800px" :zIndex="1001" centered :footer="false" :destroyOnClose="true" :forceRender="true">
<div class style="height: calc(100vh - 200px); overflow-y: auto">
<mapPOIpanel :info="poiModal" @submitEvent="getPoiInfo" />
</div>
</a-modal>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, watch, getCurrentInstance } from "vue";
import { message } from "ant-design-vue";
import mapPOIpanel from "../components/poi.vue"; //
import { getBusinessCoopList, addAgency, getTemplateList, getChannelUserList } from "@/api/bussinessCoop";
const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G;
// State
@ -160,6 +182,7 @@ const searchForm = reactive({
pageNum: 1,
pageSize: 10,
keyword: "",
status: "", //
});
const coopTypesArray = [
@ -204,6 +227,7 @@ const formState = reactive({
lngLatStr: "",
updateContactTime: 0,
desp: "",
businessCooperationId:'',
});
// Form item layout
@ -289,17 +313,6 @@ window.addEventListener("resize", () => {
tableHeight.value = window.innerHeight - 381;
});
// Methods
const getTable = async () => {
searchForm.keyword = searchKeyword.value;
searchForm.pageNum = 1;
pagination.current = 1;
await fetchBusinessCoopList();
};
const handleChangeSearch = () => {
searchForm.keyword = searchKeyword.value;
};
const fetchBusinessCoopList = async () => {
loading.value = true;
@ -324,6 +337,50 @@ const fetchBusinessCoopList = async () => {
}
};
// Methods
const getTable = async () => {
searchForm.keyword = searchKeyword.value;
searchForm.pageNum = 1;
pagination.current = 1;
// activeTab status
if (activeTab.value === "all") {
searchForm.status = "";
} else if (activeTab.value === "pending") {
searchForm.status = 2;
} else if (activeTab.value === "approved") {
searchForm.status = 1;
}
await fetchBusinessCoopList();
};
const handleChangeSearch = () => {
searchForm.keyword = searchKeyword.value;
};
const activeTab = ref("all");
// activeTab status
watch(
() => activeTab.value,
(newVal) => {
if (newVal === "all") {
searchForm.status = ""; //
} else if (newVal === "pending") {
searchForm.status = 2;
} else if (newVal === "approved") {
searchForm.status = 1;
}
fetchBusinessCoopList(); //
},
{ immediate: true }
);
const handleTableChange = (pag) => {
pagination.current = pag.current;
searchForm.pageNum = pag.current;
@ -337,11 +394,13 @@ const handlePageChange = (page) => {
};
const showExamineModal = (record) => {
console.log(record);
// Pre-fill form data if needed
formState.agencyName = record.companyName || "";
formState.userName = record.userName || "";
formState.tel = record.tel || "";
formState.address = record.address || "";
formState.businessCooperationId = record.id || "";
entryShowExamine.value = true;
};
@ -373,9 +432,48 @@ const showImageModal = (imageUrl) => {
currentImage.value = imageUrl;
imageModalVisible.value = true;
};
/* #################### 高德POI弹窗模块 #################### */
const poiModal = ref({
isShow: false,
name: "",
address: "",
lat: "",
lng: "",
type: "",
});
const submitForm = ref({});
const handleOpenMap = ($type) => {
//
poiModal.value = {
isShow: true,
// name: submitForm.value.aliasName,
address: submitForm.value.address,
lat: commonJS.isNotEmptyCheck(submitForm.value.lat) ? submitForm.value.lat : 0,
lng: commonJS.isNotEmptyCheck(submitForm.value.lng) ? submitForm.value.lng : 0,
type: $type,
};
console.log("poiModal.value", poiModal.value);
};
const getPoiInfo = (e) => {
console.log("获取地图选择信息:", e, " -- 类型:", poiModal.value.type);
//
poiModal.value.isShow = false;
//
var reg = /.+?(省|市|自治区|自治州|县|区)/g; //
if (poiModal.value.type == "address") {
submitForm.value.address = e.pointInfo.address;
submitForm.value.district = e.initInfo.district
.match(reg)
.filter((item, index) => item)
.join(",");
submitForm.value.lat = e.initInfo.lat;
submitForm.value.lng = e.initInfo.lng;
submitForm.value.mdistrict = e.initInfo.mdistrict;
formState.address = e.pointInfo.address;
formState.lngLatStr = e.initInfo.lng+','+e.initInfo.lat;
const showMapModal = () => {
// Implement map modal logic here
}
console.log(submitForm.value);
};
const handleChange = () => {
@ -426,4 +524,16 @@ onMounted(async () => {
border-radius: 4px;
cursor: pointer;
}
.header-container {
display: flex;
/* justify-content: space-between; */
align-items: center;
margin-bottom: 16px;
}
.left-container {
display: flex;
align-items: center;
}
</style>

@ -11,7 +11,7 @@
</div>
<!-- Banner table -->
<a-table :columns="columns" :data-source="bannerList" :scroll="{ x: 900, y: tableHeight }" :pagination="false" :loading="loading" @change="handleTableChange" rowKey="id">
<a-table :columns="columns" :data-source="bannerList" :scroll="{ x: 1300, y: tableHeight }" :pagination="false" :loading="loading" @change="handleTableChange" rowKey="id">
<!-- Sort column -->
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'sort'">

Loading…
Cancel
Save