feat(safety): support full CRUD for approved commercial places and dynamic sync to uniapp

这个提交包含在:
xcbyy
2026-10-10 09:52:42 +08:00
父节点 dc19189bc6
当前提交 e36e80c399
共有 6 个文件被更改,包括 266 次插入 和 6 次删除

查看文件

@@ -750,3 +750,16 @@ export async function getPlatformConfigs() {
}
}
/**
* 获取平台合规商圈场所白名单库
*/
export async function getSafetyPlaces() {
try {
const res = await http.get('/safety/places');
return res;
} catch (err) {
console.warn('[API] 获取合规商圈场所降级:', err.message);
return [];
}
}

查看文件

@@ -288,7 +288,7 @@
import { ref, computed, onMounted, onUnmounted } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { ICONS } from '@/common/icons.js';
import { createActivity } from '@/common/api.js';
import { createActivity, getSafetyPlaces } from '@/common/api.js';
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
const games = ['美食陪吃', '同城陪唱', '下午茶陪喝', '同城微醺', '同城桌游', '热门电竞'];
@@ -303,11 +303,13 @@ onMounted(() => {
currentThemeKey.value = getCurrentThemeKey();
applyThemeToNativeUI(currentThemeKey.value);
uni.$on('theme-change', onThemeChanged);
loadLivePlaces();
});
onShow(() => {
currentThemeKey.value = getCurrentThemeKey();
applyThemeToNativeUI(currentThemeKey.value);
loadLivePlaces();
});
onUnmounted(() => {
@@ -340,12 +342,25 @@ const calcTotalFee = computed(() => {
});
const riskModalVisible = ref(false);
const recommendPublicZones = [
const recommendPublicZones = ref([
'北京市朝阳区三里屯太古里 (AAA公开商圈)',
'北京市朝阳区工体纯K量贩KTV (正规量贩)',
'北京市朝阳区国贸CBD商业街 (阳光示范商圈)',
'北京市海淀区五道口购物中心 (高校商圈)'
];
]);
const loadLivePlaces = async () => {
try {
const list = await getSafetyPlaces();
if (Array.isArray(list) && list.length > 0) {
recommendPublicZones.value = list
.filter((p) => p.status === '正常营业')
.map((p) => `${p.area} · ${p.name}`);
}
} catch (e) {
console.warn('[ActivityCreate] 加载合规场所异常降级:', e);
}
};
const applyRecommendZone = (zone) => {
form.value.location = zone;