mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:13:26 +08:00
【新增】(地址模块):根据后台开关按钮,是否需要定位功能
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
// 不同的环境变量配置
|
||||
const development = {
|
||||
requestBaseUrl: 'https://api.pro.demo.corecms.cn',
|
||||
requestBaseUrl: 'https://api.test.pro.coreshop.cn',
|
||||
appid: '',
|
||||
}
|
||||
|
||||
const test = {
|
||||
requestBaseUrl: 'https://api.pro.demo.corecms.cn',
|
||||
requestBaseUrl: 'https://api.test.pro.coreshop.cn',
|
||||
appid: '',
|
||||
}
|
||||
|
||||
const production = {
|
||||
requestBaseUrl: 'https://api.pro.demo.corecms.cn',
|
||||
requestBaseUrl: 'https://api.test.pro.coreshop.cn',
|
||||
appid: '',
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx6a73f5a508da7af2",
|
||||
"appid" : "wx3f290252193d7627",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"checkSiteMap" : false,
|
||||
|
||||
@@ -19,15 +19,17 @@
|
||||
<view class="item">
|
||||
<view class="lab">省市县</view>
|
||||
<view class="val" @click="handleShowCityPicker">
|
||||
<uv-input placeholder="请选择省市县" border="surround" v-model="state.city"
|
||||
:readonly="true" suffixIcon="arrow-down" suffixIconStyle="color: #909399"></uv-input>
|
||||
<uv-input placeholder="请选择省市县" border="surround" v-model="state.city" :readonly="true"
|
||||
suffixIcon="arrow-down" suffixIconStyle="color: #909399"></uv-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="lab">街道社区</view>
|
||||
<view class="val" @click="handleGoToMap">
|
||||
<uv-input placeholder="请选择街道社区" border="surround" v-model="state.form.street"
|
||||
:readonly="shopConfigStore.config?.allowAddressToUseMap == ShowAllowAddressToUseMap.yes" suffixIcon="map-fill" suffixIconStyle="color: #5ac725"></uv-input>
|
||||
<uv-input v-if="shopConfigStore.config?.allowAddressToUseMap == ShowAllowAddressToUseMap.yes"
|
||||
placeholder="请选择街道社区" border="surround" v-model="state.form.street" :readonly="true"
|
||||
suffixIcon="map-fill" suffixIconStyle="color: #5ac725"></uv-input>
|
||||
<uv-input v-else placeholder="请选择街道社区" border="surround" v-model="state.form.street"></uv-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
@@ -56,7 +58,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive } from 'vue';
|
||||
import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import { AddressPageTitltEnum ,ShowAllowAddressToUseMap} from '@/core/enum';
|
||||
import { AddressPageTitltEnum, ShowAllowAddressToUseMap } from '@/core/enum';
|
||||
import { queryAreaId, querySaveUserShip, queryShipDetail } from '@/core/api';
|
||||
import type { Response, ShopConfigStoreType, AddressType } from '@/core/models';
|
||||
import { useShopConfigStore } from '@/core/store';
|
||||
@@ -142,7 +144,7 @@
|
||||
getShipInfo();
|
||||
}
|
||||
/** 开启定位 */
|
||||
if(shopConfigStore.config?.allowAddressToUseMap == ShowAllowAddressToUseMap.yes){
|
||||
if (shopConfigStore.config?.allowAddressToUseMap == ShowAllowAddressToUseMap.yes) {
|
||||
getMyLocation();
|
||||
}
|
||||
});
|
||||
@@ -236,7 +238,7 @@
|
||||
|
||||
/** 去定位 */
|
||||
const handleGoToMap = () => {
|
||||
if(shopConfigStore.config?.allowAddressToUseMap != ShowAllowAddressToUseMap.yes){
|
||||
if (shopConfigStore.config?.allowAddressToUseMap != ShowAllowAddressToUseMap.yes) {
|
||||
return;
|
||||
}
|
||||
// #ifdef MP-WEIXIN
|
||||
@@ -295,7 +297,7 @@
|
||||
if (!state.form.street) {
|
||||
handleShowToast('请选择街道'); return;
|
||||
}
|
||||
if (!state.form.latitude || !state.form.longitude) {
|
||||
if (shopConfigStore.config?.allowAddressToUseMap == ShowAllowAddressToUseMap.yes && (!state.form.latitude || !state.form.longitude)) {
|
||||
handleShowToast('请选择街道获取经纬度'); return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user