添加:提货站点添加定位

This commit is contained in:
wuhui_zzw 2024-01-16 14:56:26 +08:00
parent 4ad4f8468c
commit 4ca97d72e9
3 changed files with 81 additions and 10 deletions

View File

@ -3,14 +3,12 @@ ENV = 'development'
# http://192.168.1.43:8324/admin
# http://mer.crmeb.net/admin
# base api
# VUE_APP_BASE_API = 'http://192.168.31.106:8324'
#VUE_APP_BASE_API = 'https://mer1.crmeb.net'
VUE_APP_BASE_API = 'https://bt.test.cdlfjy.com'
#VUE_APP_BASE_API = 'https://mp.scwmbh.cn'
# socket 连接地址
#VUE_APP_WS_URL = 'ws://0.0.0.0:8324'
#VUE_APP_WS_URL = 'ws://mer1.crmeb.net'
VUE_APP_WS_URL = 'ws://bt.test.cdlfjy.com'
#VUE_APP_WS_URL = 'ws://mp.scwmbh.cn'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.

View File

@ -125,7 +125,14 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="地址:" prop="address">
<el-form-item label="经纬度:" prop="lat">
<el-input :value="(editInfo.lat || '') + ',' + (editInfo.lng || '')" readonly enter-button="查找位置" style="width: 100%;" placeholder="请点击查找位置选择位置">
<el-button slot="append" style="background: #46a6ff; color: #fff; border-radius: 0 4px 4px 0;" @click="onSearchs" >查找位置</el-button>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="详细地址:" prop="address">
<el-input v-model="editInfo.address" placeholder="请填写取货点详细地址" />
</el-form-item>
</el-col>
@ -212,12 +219,30 @@
<el-button @click="userSelectVisible = false"> </el-button>
</span>
</el-dialog>
<!--地图定位-->
<el-dialog
v-if="modalMap"
v-model="modalMap"
:visible.sync="modalMap"
title="选择位置"
close-on-click-modal
class="mapBox"
custom-class="dialog-scustom"
:append-to-body='true'
width="80%"
top="20px"
>
<iframe id="mapPage" width="100%" height="700px" frameborder="0" :src="keyUrl" />
</el-dialog>
</div>
</template>
<script>
import {pickupPointList, pickupPointEdit, pickupPointInfo} from '@/api/marketing'
import {userLstApi} from "@/api/user";
import {configApi} from "@/api/system";
export default {
name: "preSaleProductList",
components: { },
@ -236,6 +261,7 @@ export default {
activeName: 'list',
ruleValidate: {
title: [{ required: true, message: '请填写取货点名称', trigger: 'blur' }],
lat: [{ required: true, message: '请选择取货点经纬度', trigger: 'blur' }],
address: [{ required: true, message: '请填写取货点详细地址', trigger: 'blur' }],
},
//
@ -267,11 +293,32 @@ export default {
},
loading: false,
cardLists: [],
//
modalMap: false,
mapKey: '',
keyUrl: '',
delivery_type: '',
};
},
watch: {},
mounted() {
window.addEventListener(
'message',
function(event) {
//
var loc = event.data
console.log(loc)
if (loc && loc.module === 'locationPicker') {
// postmodule'locationPicker'
window.parent.selectAddress(loc)
}
},
false
)
window.selectAddress = this.selectAddress
this.getList('');
this.getMapKey();
},
methods: {
// -
@ -393,7 +440,34 @@ export default {
this.tableFrom = this.$options.data().tableFrom;
this.getList(1);
}
},
// - key
getMapKey() {
configApi().then(res => {
console.log(res);
this.mapKey = res.data.tx_map_key
const keys = res.data.tx_map_key
this.keyUrl = `https://apis.map.qq.com/tools/locpicker?type=1&key=${keys}&referer=myapp`
this.delivery_type = res.data.delivery_type
})
.catch(res => {
this.$message.error(res.message)
})
},
//
onSearchs() {
if (!this.mapKey || this.mapKey == '') this.$message.error('平台未配置腾讯地图KEY')
else this.modalMap = true
},
//
selectAddress(data) {
this.editInfo.lat = data.latlng.lat
this.editInfo.lng = data.latlng.lng
this.editInfo.address = data.poiaddress || ''
this.modalMap = false
this.$forceUpdate();
},
},
@ -558,4 +632,7 @@ export default {
margin-right: 0px!important;
}
}
#mapPage{
height: calc(100vh - 100px) !important;
}
</style>

View File

@ -103,10 +103,6 @@ export default {
supplier_name: [{ required: true, message: '请输入供应商名称', trigger: 'blur' }],
supplier_account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
supplier_password: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
},
};
},