feat: 管理端使用最新地址选择器,默认在config关闭高德地图功能,开启后可继续使用

master
Yer 2023-08-03 10:37:53 +08:00
parent 8a43335b75
commit 8b33dbe8d7
18 changed files with 246 additions and 239 deletions

View File

@ -1,55 +0,0 @@
<template>
<div>
<Button @click="enable = true">语言设定</Button>
<Modal v-model="enable" draggable sticky scrollable :mask="false" :title="title">
<Tabs closable type="card" @on-tab-remove="handleTabRemove" :value="language[0].title">
<TabPane v-for="(item,index) in language" :key="index" :label="item.title" :name="item.title">
<Input v-model="item.___i18n" />
</TabPane>
</Tabs>
</Modal>
</div>
</template>
<script>
import {language} from "./languages";
export default {
/**
* tabs 循环的语言内容格式 [{'title':'test','value':'val'}]
*/
props: {
value: {
type: null,
default: "",
},
},
watch: {
language: {
handler(val) {
this.$emit("language", { language: [...val], val: this.value });
},
deep: true,
},
},
data() {
return {
language,
tabVal: "",
enable: false, //modal
title: "转换语言",
};
},
methods: {
// tab
handleTabRemove(tab) {
this.language = this.language.filter((item) => {
return item.value != tab;
});
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1 +0,0 @@
export const language = [{ title: "中文",value:1 }, { title: "英文" ,value:2}];

View File

@ -1,31 +1,23 @@
<template> <template>
<div class="map"> <div class="map">
<Modal v-model="showMap" title="选择地址" width="800">
<div class="address">{{ addrContent.address }}</div> <div class="address">{{ addrContent.address }}</div>
<div id="map-container"></div> <div id="map-container"></div>
<div class="search-con"> <div class="search-con">
<Input <Input placeholder="输入关键字搜索" id="input-map" v-model="mapSearch" />
placeholder="输入关键字搜索"
id="input-map"
v-model="mapSearch"
/>
<ul> <ul>
<li <li v-for="(tip, index) in tips" :key="index" @click="selectAddr(tip.location)">
v-for="(tip, index) in tips"
:key="index"
@click="selectAddr(tip.location)"
>
<p>{{ tip.name }}</p> <p>{{ tip.name }}</p>
<p>{{ tip.district + tip.address }}</p> <p>{{ tip.district + tip.address }}</p>
</li> </li>
</ul> </ul>
</div> </div>
<div slot="footer"> <div slot="footer" class="footer">
<Button type="default" @click="showMap = false">取消</Button>
<Button type="primary" :loading="loading" @click="ok"></Button> <Button type="primary" :loading="loading" @click="ok"></Button>
</div> </div>
</Modal>
</div> </div>
</template> </template>
<script> <script>
@ -34,10 +26,11 @@ import { getRegion } from "@/api/common.js";
const config = require('@/config/index') const config = require('@/config/index')
export default { export default {
name: "map",
data() { data() {
return { return {
config, config,
showMap: false, // modal showMap: false, //
mapSearch: "", // mapSearch: "", //
map: null, // map: null, //
autoComplete: null, // autoComplete: null, //
@ -55,8 +48,8 @@ export default {
}, },
methods: { methods: {
ok() { ok() {
//
this.loading = true; if (this.addrContent && this.addrContent.regeocode) {
const params = { const params = {
cityCode: this.addrContent.regeocode.addressComponent.citycode, cityCode: this.addrContent.regeocode.addressComponent.citycode,
townName: this.addrContent.regeocode.addressComponent.township, townName: this.addrContent.regeocode.addressComponent.township,
@ -66,12 +59,15 @@ export default {
this.addrContent.addr = res.result.name.replace(/,/g, " "); this.addrContent.addr = res.result.name.replace(/,/g, " ");
this.addrContent.addrId = res.result.id; this.addrContent.addrId = res.result.id;
this.loading = false; this.loading = false;
this.showMap = false;
this.$emit("getAddress", this.addrContent); this.$emit("getAddress", this.addrContent);
} }
}); });
} else {
this.$Message.error('未获取到坐标信息请查看高德API配置是否正确')
}
}, },
//
init() { init() {
AMapLoader.load({ AMapLoader.load({
key: this.config.aMapKey, // WebKey load key: this.config.aMapKey, // WebKey load
@ -88,7 +84,8 @@ export default {
version: "1.1", // AMapUI 1.1 version: "1.1", // AMapUI 1.1
plugins: ["misc/PositionPicker"], // AMapUI ui plugins: ["misc/PositionPicker"], // AMapUI ui
}, },
}).then((AMap) => { })
.then((AMap) => {
let that = this; let that = this;
this.map = new AMap.Map("map-container", { this.map = new AMap.Map("map-container", {
zoom: 12, zoom: 12,
@ -120,7 +117,8 @@ export default {
that.positionPicker.on("success", function (positionResult) { that.positionPicker.on("success", function (positionResult) {
that.addrContent = positionResult; that.addrContent = positionResult;
}); });
}).catch((e) => {}); })
.catch((e) => { });
}, },
searchOfMap(val) { searchOfMap(val) {
// //
@ -160,16 +158,20 @@ export default {
right: 20px; right: 20px;
top: 64px; top: 64px;
width: 260px; width: 260px;
ul { ul {
width: 260px; width: 260px;
height: 400px; height: 360px;
overflow: scroll; overflow: scroll;
li { li {
padding: 5px; padding: 5px;
p:nth-child(2) { p:nth-child(2) {
color: #999; color: #999;
font-size: 12px; font-size: 12px;
} }
&:hover { &:hover {
background-color: #eee; background-color: #eee;
cursor: pointer; cursor: pointer;
@ -183,4 +185,9 @@ export default {
// color: $theme_color; // color: $theme_color;
font-weight: bold; font-weight: bold;
} }
.footer {
text-align: right;
margin: 10px 0;
}
</style> </style>

View File

@ -8,6 +8,7 @@ module.exports = {
//FIXME 请检查当前高德key创建的日期如果2021年12月02日之前申请的 无需填写安全密钥 //FIXME 请检查当前高德key创建的日期如果2021年12月02日之前申请的 无需填写安全密钥
aMapSecurityJsCode:"2bd0fbf621881f4c77be74f0e76495f3", // 高德web端js申请的安全密钥 aMapSecurityJsCode:"2bd0fbf621881f4c77be74f0e76495f3", // 高德web端js申请的安全密钥
aMapKey: "7f11113750315d8543daaf5c3ba353ca", //高德web端js申请的api key aMapKey: "7f11113750315d8543daaf5c3ba353ca", //高德web端js申请的api key
aMapSwitch:false, //是否开启高德定位
website: "https://www.pickmall.cn", //官网地址 website: "https://www.pickmall.cn", //官网地址
enableCDN: true, //生产环境 是否启用cdn加载 vue等js enableCDN: true, //生产环境 是否启用cdn加载 vue等js
port: 10003, //端口 port: 10003, //端口

View File

@ -18,7 +18,7 @@ import util from '@/libs/util'
import * as filters from '@/utils/filters' // global filter import * as filters from '@/utils/filters' // global filter
import liliDialog from '@/components/lili-dialog' import liliDialog from '@/components/lili-dialog'
import i18nBox from '@/components/i18n-translate'
import {md5} from '@/utils/md5.js'; import {md5} from '@/utils/md5.js';
// 打印 // 打印
@ -56,7 +56,7 @@ Vue.use(copyViewUi, {
}); });
Vue.component('liliDialog', liliDialog) Vue.component('liliDialog', liliDialog)
Vue.component('i18nBox', i18nBox)
// 挂载全局使用的方法 // 挂载全局使用的方法

View File

@ -55,12 +55,6 @@ export const otherRouter = {
name: "shop", name: "shop",
component: () => import("@/views/seller/shop/shopList.vue") component: () => import("@/views/seller/shop/shopList.vue")
}, },
{
path: "shop-operation",
title: "店铺操作",
name: "shop-operation",
component: () => import("@/views/seller/shop/shopOperation.vue")
},
{ {
path: "shop-detail", path: "shop-detail",
title: "店铺详细", title: "店铺详细",

View File

@ -200,12 +200,10 @@ import { homeStatistics, hotGoods, hotShops, getNoticePage } from "@/api/index";
import * as API_Goods from "@/api/goods"; import * as API_Goods from "@/api/goods";
import { Chart } from "@antv/g2"; import { Chart } from "@antv/g2";
import * as API_Member from "@/api/member"; import * as API_Member from "@/api/member";
// import i18nBox from '@/components/i18n-translate'
export default { export default {
name: "home", name: "home",
// components:{
// i18nBox
// },
data() { data() {
return { return {
// //

View File

@ -85,26 +85,23 @@
<DatePicker type="date" format="yyyy-MM-dd" v-model="form.birthday" style="width: 220px"></DatePicker> <DatePicker type="date" format="yyyy-MM-dd" v-model="form.birthday" style="width: 220px"></DatePicker>
</FormItem> </FormItem>
<FormItem label="所在地" prop="mail"> <FormItem label="所在地" prop="mail">
<div class="form-item" v-if="!updateRegion"> {{ form.region || '暂无地址' }}
<Input disabled style="width: 250px" :value="form.region" />
<Button type="text" @click="() => {
this.updateRegion = !this.updateRegion; <Button style="margin-left: 10px;" @click="$refs.map.open()"></Button>
}">修改</Button>
</div>
<div class="form-item" v-else>
<region style="width: 250px" @selected="selectedRegion" />
</div>
</FormItem> </FormItem>
</Form> </Form>
</Modal> </Modal>
<Modal width="1200px" v-model="picModelFlag"> <Modal width="1200px" v-model="picModelFlag">
<ossManage @callback="callbackSelected" ref="ossManage" /> <ossManage @callback="callbackSelected" ref="ossManage" />
</Modal> </Modal>
<multipleMap ref="map" @callback="selectedRegion"/>
</div> </div>
</template> </template>
<script> <script>
import region from "@/components/region"; import multipleMap from "@/components/map/multiple-map";
import * as API_Member from "@/api/member.js"; import * as API_Member from "@/api/member.js";
import ossManage from "@/views/sys/oss-manage/ossManage"; import ossManage from "@/views/sys/oss-manage/ossManage";
import * as RegExp from "@/libs/RegExp.js"; import * as RegExp from "@/libs/RegExp.js";
@ -112,7 +109,7 @@ import * as RegExp from "@/libs/RegExp.js";
export default { export default {
name: "member", name: "member",
components: { components: {
region, multipleMap,
ossManage, ossManage,
}, },
data() { data() {
@ -121,7 +118,7 @@ export default {
descFlag: false, // descFlag: false, //
loading: true, // loading: true, //
addFlag: false, // modal addFlag: false, // modal
updateRegion: false, //
addMemberForm: { addMemberForm: {
// //
mobile: "", mobile: "",
@ -382,7 +379,7 @@ export default {
editPerm(val) { editPerm(val) {
this.descTitle = `查看用户 ${val.username}`; this.descTitle = `查看用户 ${val.username}`;
this.descFlag = true; this.descFlag = true;
this.updateRegion = false;
this.getMemberInfo(val.id); this.getMemberInfo(val.id);
}, },
addMember() { addMember() {
@ -434,8 +431,18 @@ export default {
// //
selectedRegion(val) { selectedRegion(val) {
this.region = val[1]; if(val.type === 'select'){
this.regionId = val[0]; const paths = val.data.map(item => item.name).join(',')
const ids = val.data.map(item => item.id).join(',')
this.$set(this.form,'region',paths)
this.$set(this.form,'regionId',ids)
}
else{
this.$set(this.form,'region',val.data.addr)
this.$set(this.form,'regionId',val.data.addrId)
}
}, },
// //
detail(row) { detail(row) {
@ -466,13 +473,13 @@ export default {
// //
handleSubmitModal() { handleSubmitModal() {
const { nickName, sex, username, face, newPassword,id } = this.form; const { nickName, sex, username, face, newPassword,id,regionId,region } = this.form;
let time = new Date(this.form.birthday); let time = new Date(this.form.birthday);
let birthday = this.form.birthday=== undefined?'': let birthday = this.form.birthday=== undefined?'':
time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate(); time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
let submit = { let submit = {
regionId: this.form.regionId, regionId,
region: this.form.region, region,
nickName, nickName,
username, username,
sex, sex,
@ -480,10 +487,7 @@ export default {
face, face,
id id
}; };
if (this.region != "undefined") {
submit.regionId = this.regionId;
submit.region = this.region;
}
if (newPassword) { if (newPassword) {
submit.password = this.md5(newPassword); submit.password = this.md5(newPassword);
} }

View File

@ -331,8 +331,8 @@
<Input v-model="addressForm.mobile" clearable style="width: 80%" maxlength="11"/> <Input v-model="addressForm.mobile" clearable style="width: 80%" maxlength="11"/>
</FormItem> </FormItem>
<FormItem label="收货人地址" prop="consigneeAddressPath"> <FormItem label="收货人地址" prop="consigneeAddressPath">
<Input v-model="addressForm.consigneeAddressPath" @on-focus="$refs.liliMap.showMap = true" clearable <span>{{ addressForm.consigneeAddressPath || '暂无地址' }}</span>
style="width: 80%"/> <Button @click="$refs.map.open()" style="margin-left: 10px;">选择</Button>
</FormItem> </FormItem>
<FormItem label="详细地址" prop="detail"> <FormItem label="详细地址" prop="detail">
<Input v-model="addressForm.detail" maxlength="35" clearable style="width: 80%"/> <Input v-model="addressForm.detail" maxlength="35" clearable style="width: 80%"/>
@ -352,24 +352,23 @@
<Button type="primary" :loading="submitLoading" @click="addressSubmit"></Button> <Button type="primary" :loading="submitLoading" @click="addressSubmit"></Button>
</div> </div>
</Modal> </Modal>
<liliMap ref="liliMap" @getAddress="getAddress"></liliMap> <multipleMap ref="map" @callback="getAddress"></multipleMap>
</div> </div>
</template> </template>
<script> <script>
import region from "@/components/region";
import * as API_Member from "@/api/member.js"; import * as API_Member from "@/api/member.js";
import ossManage from "@/views/sys/oss-manage/ossManage"; import ossManage from "@/views/sys/oss-manage/ossManage";
import liliMap from "@/components/map/index"; import multipleMap from "@/components/map/multiple-map";
import * as RegExp from '@/libs/RegExp.js'; import * as RegExp from '@/libs/RegExp.js';
import * as API_Order from "@/api/order.js"; import * as API_Order from "@/api/order.js";
export default { export default {
name: "memberDetail", name: "memberDetail",
components: { components: {
region,
ossManage, ossManage,
liliMap multipleMap
}, },
data() { data() {
return { return {
@ -381,7 +380,9 @@
addressModalVisible: false, // addressModalVisible: false, //
addressForm: { addressForm: {
id: "", id: "",
isDefault: "0" isDefault: "0",
consigneeAddressPath:"",
consigneeAddressIdPath:""
},//form },//form
selectDate: null, // selectDate: null, //
@ -1004,12 +1005,24 @@
}, },
// //
getAddress(item) { getAddress(val) {
this.$set(this.addressForm, 'consigneeAddressPath', item.addr) if (val.type === 'select') {
this.$set(this.addressForm, 'consigneeAddressIdPath', item.addrId) const paths = val.data.map(item => item.name).join(',')
this.addressForm.address = item.address const ids = val.data.map(item => item.id).join(',')
this.addressForm.lat = item.position.lat
this.addressForm.lon = item.position.lng this.$set(this.addressForm,'consigneeAddressPath',paths)
this.$set(this.addressForm,'consigneeAddressIdPath',ids)
// center
const coord = val.data[val.data.length - 1].center.split(',')
this.addressForm.lat = coord[1]
this.addressForm.lon = coord[0]
}else{
this.$set(this.addressForm,'consigneeAddressPath', val.data.addr)
this.$set(this.addressForm,'consigneeAddressIdPath',val.data.addrId)
this.addressForm.lat = val.data.position.lat
this.addressForm.lon = val.data.position.lng
}
}, },
// //
memberAddressRemove(v) { memberAddressRemove(v) {

View File

@ -134,40 +134,29 @@
></DatePicker> ></DatePicker>
</FormItem> </FormItem>
<FormItem label="所在地" prop="mail"> <FormItem label="所在地" prop="mail">
<div class="form-item" v-if="!updateRegion"> {{ formValidate.region || '暂无地址' }}
<Input disabled style="width: 250px" :value="formValidate.region" /> <Button style="margin-left: 10px;" @click="$refs.map.open()"></Button>
<Button
type="text"
@click="
() => {
this.updateRegion = !this.updateRegion;
}
"
>修改
</Button>
</div>
<div class="form-item" v-else>
<region style="width: 250px" @selected="selectedRegion" />
</div>
</FormItem> </FormItem>
</Form> </Form>
</Modal> </Modal>
<Modal width="1200px" v-model="picModelFlag"> <Modal width="1200px" v-model="picModelFlag">
<ossManage @callback="callbackSelected" ref="ossManage" /> <ossManage @callback="callbackSelected" ref="ossManage" />
</Modal> </Modal>
<multipleMap ref="map" @callback="selectedRegion" />
</div> </div>
</template> </template>
<script> <script>
import region from "@/components/region";
import * as API_Member from "@/api/member.js"; import * as API_Member from "@/api/member.js";
import ossManage from "@/views/sys/oss-manage/ossManage"; import ossManage from "@/views/sys/oss-manage/ossManage";
import multipleMap from "@/components/map/multiple-map";
export default { export default {
name: "memberRecycle", name: "memberRecycle",
components: { components: {
region,
ossManage, ossManage,
multipleMap
}, },
data() { data() {
return { return {
@ -176,7 +165,7 @@ export default {
descFlag: false, // descFlag: false, //
openSearch: true, // openSearch: true, //
loading: true, // loading: true, //
updateRegion: false, //
searchForm: { searchForm: {
// //
pageNumber: 1, pageNumber: 1,
@ -363,7 +352,7 @@ export default {
editPerm(val) { editPerm(val) {
this.descTitle = `查看用户 ${val.username}`; this.descTitle = `查看用户 ${val.username}`;
this.descFlag = true; this.descFlag = true;
this.updateRegion = false;
this.getMemberInfo(val.id); this.getMemberInfo(val.id);
}, },
/** /**
@ -394,8 +383,18 @@ export default {
// //
selectedRegion(val) { selectedRegion(val) {
this.region = val[1]; if(val.type === 'select'){
this.regionId = val[0]; const paths = val.data.map(item => item.name).join(',')
const ids = val.data.map(item => item.id).join(',')
this.$set(this.formValidate,'region',paths)
this.$set(this.formValidate,'regionId',ids)
}
else{
this.$set(this.formValidate,'region',val.data.addr)
this.$set(this.formValidate,'regionId',val.data.addrId)
}
}, },
// //
@ -427,14 +426,14 @@ export default {
// //
handleSubmitModal() { handleSubmitModal() {
const { nickName, sex, username, face, newPassword, id } = const { nickName, sex, username, face, newPassword, id ,regionId,region} =
this.formValidate; this.formValidate;
let time = new Date(this.formValidate.birthday); let time = new Date(this.formValidate.birthday);
let birthday = let birthday =
time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate(); time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
let submit = { let submit = {
regionId: this.regionId || "", regionId:regionId,
region: this.region || "", region: region,
nickName, nickName,
username, username,
sex, sex,

View File

@ -49,7 +49,7 @@
</template> </template>
<script> <script>
import region from "@/components/region";
import * as API_Member from "@/api/member.js"; import * as API_Member from "@/api/member.js";
import ossManage from "@/views/sys/oss-manage/ossManage"; import ossManage from "@/views/sys/oss-manage/ossManage";
@ -57,7 +57,7 @@
// //
name: "point", name: "point",
components: { components: {
region,
ossManage, ossManage,
}, },
data() { data() {

View File

@ -345,11 +345,8 @@
<Input v-model="addressForm.consigneeMobile" size="large" maxlength="11"></Input> <Input v-model="addressForm.consigneeMobile" size="large" maxlength="11"></Input>
</FormItem> </FormItem>
<FormItem label="地址信息" prop="consigneeAddressPath"> <FormItem label="地址信息" prop="consigneeAddressPath">
<Input v-model="addr" disabled style="width: 305px" v-if="showRegion == false" /> {{ addr }}
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary" <Button type="default" @click="$refs.map.open()"></Button>
icon="ios-create-outline" style="margin-left: 8px">修改
</Button>
<region style="width: 400px" @selected="selectedRegion" v-if="showRegion == true" />
</FormItem> </FormItem>
<FormItem label="详细地址" prop="consigneeDetail"> <FormItem label="详细地址" prop="consigneeDetail">
<Input v-model="addressForm.consigneeDetail" size="large" maxlength="50"></Input> <Input v-model="addressForm.consigneeDetail" size="large" maxlength="50"></Input>
@ -433,18 +430,23 @@
<Button type="primary" v-print="printInfoObj"></Button> <Button type="primary" v-print="printInfoObj"></Button>
</div> </div>
</Modal> </Modal>
<multipleMap ref="map" @callback="selectedRegion" />
</div> </div>
</template> </template>
<script> <script>
import * as API_Order from "@/api/order"; import * as API_Order from "@/api/order";
import * as RegExp from "@/libs/RegExp.js"; import * as RegExp from "@/libs/RegExp.js";
import region from "@/components/region";
import multipleMap from "@/components/map/multiple-map";
import vueQr from "vue-qr"; import vueQr from "vue-qr";
export default { export default {
name: "orderList", name: "orderList",
components: { components: {
region,
multipleMap,
"vue-qr": vueQr, "vue-qr": vueQr,
}, },
data () { data () {
@ -458,10 +460,10 @@ export default {
extraHead: '',// extraHead: '',//
}, },
loading: false, // loading: false, //
submitLoading: false, //
addr: "", // addr: "", //
regionId: [], //id
showRegion: false, //
orderLogInfo: [], // orderLogInfo: [], //
orderLogModal: false, // orderLogModal: false, //
checkedLogistics: [], // checkedLogistics: [], //
@ -638,11 +640,7 @@ export default {
gotoHomes () { gotoHomes () {
return false return false
}, },
//
regionClick () {
this.showRegion = true;
this.regionId = "";
},
// //
confirmPrice () { confirmPrice () {
this.$Modal.confirm({ this.$Modal.confirm({
@ -719,8 +717,17 @@ export default {
}, },
// //
selectedRegion (val) { selectedRegion (val) {
this.addr = val[1]; if(val.type === 'select'){
this.regionId = val[0]; const paths = val.data.map(item => item.name).join(',')
const ids = val.data.map(item => item.id).join(',')
this.$set(this,'addr',paths)
this.$set(this,'regionId',ids)
}
else{
this.$set(this,'addr',val.data.addr)
this.$set(this,'regionId',val.data.addrId)
}
}, },
// //
orderCancel () { orderCancel () {
@ -761,7 +768,6 @@ export default {
// //
editAddress () { editAddress () {
this.addressModal = true; this.addressModal = true;
this.showRegion = false;
this.addr = this.orderInfo.order.consigneeAddressPath; this.addr = this.orderInfo.order.consigneeAddressPath;
this.regionId = this.orderInfo.order.consigneeAddressIdPath; this.regionId = this.orderInfo.order.consigneeAddressIdPath;
this.addressForm.consigneeName = this.orderInfo.order.consigneeName; this.addressForm.consigneeName = this.orderInfo.order.consigneeName;

View File

@ -37,14 +37,9 @@
<script> <script>
import { import {
getShopListData, getShopListData,
shopAudit
} from "@/api/shops"; } from "@/api/shops";
import shopOperation from "./shopOperation";
export default { export default {
name: "shop", name: "shop",
components: {
shopOperation,
},
data() { data() {
return { return {
loading: true, // loading: true, //

View File

@ -566,7 +566,7 @@
</template> </template>
<script> <script>
import region from "@/components/region";
import ossManage from "@/views/sys/oss-manage/ossManage"; import ossManage from "@/views/sys/oss-manage/ossManage";
import * as RegExp from '@/libs/RegExp.js'; import * as RegExp from '@/libs/RegExp.js';
import {getCategoryTree} from "@/api/goods"; import {getCategoryTree} from "@/api/goods";
@ -577,7 +577,7 @@
export default { export default {
name: "member", name: "member",
components: { components: {
region,
ossManage, ossManage,
}, },
data() { data() {

View File

@ -232,6 +232,7 @@ export default {
"Button", "Button",
{ {
props: { props: {
type:"default",
size: "small", size: "small",
}, },
style: { style: {

View File

@ -19,7 +19,7 @@
<FormItem label="会员名称" prop="memberName"> <FormItem label="会员名称" prop="memberName">
<div class="item"> <div class="item">
<Input disabled v-model="shopForm.memberName" /> <Input disabled v-model="shopForm.memberName" />
<Button @click="selectMember()" v-if="!$route.query.shopId" <Button type="default" @click="selectMember()" v-if="!$route.query.shopId"
>选择会员</Button >选择会员</Button
> >
</div> </div>
@ -39,8 +39,20 @@
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="店铺定位" prop="shopCenter"> <FormItem label="店铺所在地" prop="storeAddressPath">
<!-- <Input v-model="shopForm.storeCenter" @on-focus="$refs.liliMap.showMap = true" clearable style="width: 350px" /> --> <span>{{shopForm.storeAddressPath || '暂无地址'}}</span>
<Button style="margin-left: 10px;" type="default" @click="handleClickAddress('storeAddressPath')"></Button>
</FormItem>
<FormItem label="店铺详细地址" prop="storeAddressDetail">
<Input
v-model="shopForm.storeAddressDetail"
clearable
style="width: 350px"
/>
</FormItem>
<!-- <FormItem label="店铺定位" prop="shopCenter">
<Button <Button
type="info" type="info"
v-if="!shopForm.storeCenter" v-if="!shopForm.storeCenter"
@ -50,22 +62,9 @@
<Button type="success" v-else @click="$refs.liliMap.showMap = true" <Button type="success" v-else @click="$refs.liliMap.showMap = true"
>已定位</Button >已定位</Button
> >
</FormItem> </FormItem> -->
<FormItem label="店铺所在地" prop="storeAddressPath">
<Input
disabled
v-model="shopForm.storeAddressPath"
style="width: 350px"
/>
</FormItem>
<FormItem label="店铺详细地址" prop="storeAddressDetail">
<Input
v-model="shopForm.storeAddressDetail"
clearable
style="width: 350px"
/>
</FormItem>
<FormItem label="店铺logo" class="storeLogo"> <FormItem label="店铺logo" class="storeLogo">
<Avatar <Avatar
@ -112,11 +111,8 @@
/> />
</FormItem> </FormItem>
<FormItem label="地址信息"> <FormItem label="地址信息">
<region {{ shopForm.salesConsigneeAddressPath || '暂无地址' }}
style="width: 350px" <Button style="margin-left: 10px;" type="default" @click="handleClickAddress('salesConsigneeAddressPath')"></Button>
@selected="selectedConsigneeRegion"
:addressId="returnAddress"
/>
</FormItem> </FormItem>
<FormItem label="详细地址"> <FormItem label="详细地址">
<Input <Input
@ -150,11 +146,13 @@
<Input v-model="shopForm.companyPhone" clearable style="width: 350px" /> <Input v-model="shopForm.companyPhone" clearable style="width: 350px" />
</FormItem> </FormItem>
<FormItem label="公司所在地" prop="companyAddressIdPath"> <FormItem label="公司所在地" prop="companyAddressIdPath">
<region <span>{{ shopForm.companyAddressPath }}</span>
<Button style="margin-left: 10px;" @click="handleClickAddress('companyAddressPath')"></Button>
<!-- <region
style="width: 350px" style="width: 350px"
@selected="selectedRegion" @selected="selectedRegion"
:addressId="address" :addressId="address"
/> /> -->
</FormItem> </FormItem>
<FormItem label="公司详细地址" prop="companyAddress"> <FormItem label="公司详细地址" prop="companyAddress">
<Input v-model="shopForm.companyAddress" clearable style="width: 350px" /> <Input v-model="shopForm.companyAddress" clearable style="width: 350px" />
@ -374,7 +372,7 @@
</Button> </Button>
</div> </div>
</Card> </Card>
<liliMap ref="liliMap" @getAddress="getAddress"></liliMap>
<Modal width="1200px" v-model="picModalFlag"> <Modal width="1200px" v-model="picModalFlag">
<ossManage @callback="callbackSelected" ref="ossManage" /> <ossManage @callback="callbackSelected" ref="ossManage" />
@ -405,6 +403,8 @@
> >
</div> </div>
</Modal> </Modal>
<multipleMap ref="map" @callback="getAddress" />
</div> </div>
</template> </template>
@ -414,17 +414,15 @@ import ossManage from "@/views/sys/oss-manage/ossManage";
import { getCategoryTree } from "@/api/goods"; import { getCategoryTree } from "@/api/goods";
import { shopDetail, shopAdd, shopEdit, getShopByMemberId, shopAudit } from "@/api/shops"; import { shopDetail, shopAdd, shopEdit, getShopByMemberId, shopAudit } from "@/api/shops";
import uploadPicInput from "@/components/lili/upload-pic-input"; import uploadPicInput from "@/components/lili/upload-pic-input";
import region from "@/components/region"; import multipleMap from "@/components/map/multiple-map";
import liliMap from "@/components/map/index";
export default { export default {
name: "shop-operation", name: "shop-operation",
components: { components: {
uploadPicInput, uploadPicInput,
ossManage, ossManage,
region,
memberLayout, memberLayout,
liliMap, multipleMap,
}, },
data() { data() {
@ -448,6 +446,7 @@ export default {
shopValidate: { shopValidate: {
// //
memberName: [{ required: true, message: "会员不能为空" }], memberName: [{ required: true, message: "会员不能为空" }],
storeAddressPath: [{ required: true, message: "店铺地址不能为空" }],
storeName: [{ required: true, message: "店铺名称不能为空" }], storeName: [{ required: true, message: "店铺名称不能为空" }],
companyAddress: [{ required: true, message: "公司地址不能为空" }], companyAddress: [{ required: true, message: "公司地址不能为空" }],
storeAddressDetail: [{ required: true, message: "店铺详细地址不能为空" }], storeAddressDetail: [{ required: true, message: "店铺详细地址不能为空" }],
@ -511,6 +510,8 @@ export default {
settlementCycle: [], // settlementCycle: [], //
shopForm: { shopForm: {
// //
storeAddressPath:"",
settlementCycle: "", settlementCycle: "",
selfOperated: "false", selfOperated: "false",
memberName: "", memberName: "",
@ -546,9 +547,16 @@ export default {
infoResult: {}, // infoResult: {}, //
picIndex: "", // 便 picIndex: "", // 便
currentAddress:"", //
}; };
}, },
methods: { methods: {
//
handleClickAddress(val){
this.currentAddress = val;
this.$refs.map.open();
},
// //
callbackMember(val) { callbackMember(val) {
if (val) { if (val) {
@ -723,10 +731,43 @@ export default {
}); });
}, },
// //
getAddress(item) { getAddress(val) {
this.shopForm.storeCenter = item.position.lng + "," + item.position.lat; if (val.type === 'select') {
this.$set(this.shopForm, "storeAddressPath", item.addr); const paths = val.data.map(item => item.name).join(',')
this.$set(this.shopForm, "storeAddressIdPath", item.addrId);
const ids = val.data.map(item => item.id).join(',')
if(this.currentAddress === 'storeAddressPath'){
this.$set(this.shopForm, "storeAddressPath", paths);
this.$set(this.shopForm, "storeAddressIdPath", ids);
this.shopForm.center = val.data[val.data.length - 1].center
}else if(this.currentAddress === 'salesConsigneeAddressPath'){
this.$set(this.shopForm, "salesConsigneeAddressPath", paths);
this.$set(this.shopForm, "salesConsigneeAddressId", ids);
}else if(this.currentAddress === 'companyAddressPath'){
this.$set(this.shopForm, "companyAddressPath", paths);
this.$set(this.shopForm, "companyAddressIdPath", ids);
}
}
else{
if(this.currentAddress === 'storeAddressPath'){
this.shopForm.storeCenter = val.data.position.lng + "," + val.data.position.lat;
this.$set(this.shopForm, "storeAddressPath", val.data.addr);
this.$set(this.shopForm, "storeAddressIdPath", val.data.addrId);
}else if(this.currentAddress === 'salesConsigneeAddressPath'){
this.$set(this.shopForm, "salesConsigneeAddressPath", val.data.addr);
this.$set(this.shopForm, "salesConsigneeAddressId", val.data.addrId);
}else if(this.currentAddress === 'companyAddressPath'){
this.$set(this.shopForm, "companyAddressPath", val.data.addr);
this.$set(this.shopForm, "companyAddressIdPath", val.data.addrId);
}
console.log(this.shopForm.storeAddressPath)
}
}, },
// //
handleCheckAll() { handleCheckAll() {

View File

@ -95,7 +95,11 @@ export default {
}, },
// //
finished() { finished() {
const params = this.chiosend.filter((item) => item.value !== ""); if(!this.chiosend[0]){
this.$Message.error("请选择地址")
return
}
const params = this.chiosend.filter((item) => item!=="" && item.value !== "");
this.enableMap = false; this.enableMap = false;
this.$emit('callback', { this.$emit('callback', {
type: this.mapDefault, type: this.mapDefault,

View File

@ -14,7 +14,7 @@
<FormItem label="详细地址" prop="shopAddressDetail"> <FormItem label="详细地址" prop="shopAddressDetail">
<Input v-model="form.storeAddressDetail" clearable style="width: 20%" maxlength="50" /> <Input v-model="form.storeAddressDetail" clearable style="width: 20%" maxlength="50" />
</FormItem> </FormItem>
<FormItem label="店铺LOGO"> <FormItem label="店铺LOGO">
<upload-pic-thumb v-model="form.storeLogo" :multiple="false"></upload-pic-thumb> <upload-pic-thumb v-model="form.storeLogo" :multiple="false"></upload-pic-thumb>
</FormItem> </FormItem>
<FormItem label="店铺简介" prop="content" class="wangEditor"> <FormItem label="店铺简介" prop="content" class="wangEditor">