feat(safety): support full CRUD for approved commercial places and dynamic sync to uniapp
这个提交包含在:
@@ -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;
|
||||
|
||||
在新工单中引用
屏蔽一个用户