From 9e6b0d57c26f98aa70aa1dc1903375b1f556648f Mon Sep 17 00:00:00 2001
From: shinnosuke <tantao@1hoper.com>
Date: 星期一, 24 八月 2026 17:44:53 +0800
Subject: [PATCH] 又又更新

---
 talent-card-admin/src/views/MerchantCreateView.vue |  105 +++++++++++++++++++++++++++++++++-------------------
 1 files changed, 67 insertions(+), 38 deletions(-)

diff --git a/talent-card-admin/src/views/MerchantCreateView.vue b/talent-card-admin/src/views/MerchantCreateView.vue
index 0376b43..4431ecf 100644
--- a/talent-card-admin/src/views/MerchantCreateView.vue
+++ b/talent-card-admin/src/views/MerchantCreateView.vue
@@ -80,35 +80,61 @@
 const isEditMode = computed(() => route.query.mode === 'edit' && hasValidMerchantId.value)
 const hasExistingMerchant = computed(() => isEditMode.value)
 const normalizedMerchantType = computed(() => String(form.merchantType || '').trim())
-const isFoodMerchant = computed(() => normalizedMerchantType.value === '餐饮服务')
-const isApartmentMerchant = computed(() => normalizedMerchantType.value === '公寓租赁')
-const isHotelMerchant = computed(() => normalizedMerchantType.value === '酒店服务')
-const isCarWashMerchant = computed(() => normalizedMerchantType.value === '自助洗车')
-const isHealthCheckMerchant = computed(() => normalizedMerchantType.value === '免费体检')
-const isParkingMerchant = computed(() => normalizedMerchantType.value === '停车服务')
-const isFuelMerchant = computed(() => normalizedMerchantType.value === '加油服务')
-const isChildcareMerchant = computed(() => normalizedMerchantType.value === '子女托管')
-const isFinancialMerchant = computed(() => normalizedMerchantType.value === '金融服务')
+const merchantTypeAliases: Record<string, string> = {
+  '餐饮服务': 'food', food: 'food',
+  '景区服务': 'scenic', scenic: 'scenic',
+  '酒店服务': 'hotel', hotel: 'hotel',
+  '公寓租赁': 'apartment', apartment: 'apartment',
+  '自助洗车': 'carWash', '自助洗车服务': 'carWash', carWash: 'carWash',
+  '免费体检': 'medical', medical: 'medical',
+  '停车服务': 'parking', parking: 'parking',
+  '加油服务': 'fuel', fuel: 'fuel',
+  '子女托管': 'children', children: 'children',
+  '金融服务': 'finance', finance: 'finance',
+  '配偶推荐就业': 'employment', employment: 'employment',
+  '行政审批': 'approval', approval: 'approval',
+  '观影服务': 'cinema', cinema: 'cinema', theatre: 'cinema', '电影院': 'cinema', '影院': 'cinema', '影城': 'cinema', '剧院': 'cinema',
+  '购房优惠': 'housing', housing: 'housing',
+  '购车服务': 'car', car: 'car',
+  '家电服务': 'appliance', appliance: 'appliance',
+  '数码服务': 'digital', digital: 'digital',
+  '文化服务': 'culture', culture: 'culture', book: 'culture',
+  '电信服务': 'telecom', telecom: 'telecom',
+  '口腔治疗保健': 'dental', dental: 'dental',
+}
+const merchantTypeCode = computed(() => {
+  const raw = String(form.merchantTypeCode || normalizedMerchantType.value).trim()
+  return merchantTypeAliases[raw] || raw
+})
+const isFoodMerchant = computed(() => merchantTypeCode.value === 'food')
+const isApartmentMerchant = computed(() => merchantTypeCode.value === 'apartment')
+const isHotelMerchant = computed(() => merchantTypeCode.value === 'hotel')
+const isCarWashMerchant = computed(() => merchantTypeCode.value === 'carWash')
+const isHealthCheckMerchant = computed(() => merchantTypeCode.value === 'medical')
+const isParkingMerchant = computed(() => merchantTypeCode.value === 'parking')
+const isFuelMerchant = computed(() => merchantTypeCode.value === 'fuel')
+const isChildcareMerchant = computed(() => merchantTypeCode.value === 'children')
+const isFinancialMerchant = computed(() => merchantTypeCode.value === 'finance')
 const isMovieMerchant = computed(() => [
-  '观影服务', 'cinema', 'theatre', '电影院', '影院', '影城', '剧院',
-].includes(normalizedMerchantType.value))
-const isSpouseEmploymentMerchant = computed(() => normalizedMerchantType.value === '配偶推荐就业')
-const isApprovalMerchant = computed(() => normalizedMerchantType.value === '行政审批')
-const isServiceMerchant = computed(() => isFoodMerchant.value || normalizedMerchantType.value === '景区服务')
+  'cinema',
+].includes(merchantTypeCode.value))
+const isSpouseEmploymentMerchant = computed(() => merchantTypeCode.value === 'employment')
+const isApprovalMerchant = computed(() => merchantTypeCode.value === 'approval')
+const isServiceMerchant = computed(() => isFoodMerchant.value || merchantTypeCode.value === 'scenic')
 const supportsStoreConsumption = computed(() => [
-  '酒店服务', '景区服务', '餐饮服务', '口腔治疗保健', '免费体检',
-].includes(normalizedMerchantType.value) || (isCarWashMerchant.value && form.miniProgramJumpType === 'normal'))
+  'hotel', 'scenic', 'food', 'dental', 'medical',
+].includes(merchantTypeCode.value) || (isCarWashMerchant.value && form.miniProgramJumpType === 'normal'))
 const merchantAppLoginOptionalTypes = [
-  '购房优惠', '购车服务', '家电服务', '数码服务', '文化服务', '电信服务', '口腔治疗保健', '加油服务',
+  'housing', 'car', 'appliance', 'digital', 'culture', 'telecom', 'dental', 'fuel',
 ]
 const simplifiedMerchantSettingsTypes = [
-  '购房优惠', '购车服务', '家电服务', '数码服务', '文化服务', '电信服务', '口腔治疗保健', '加油服务',
+  'housing', 'car', 'appliance', 'digital', 'culture', 'telecom', 'dental', 'fuel',
 ]
-const usesSimplifiedMerchantSettings = computed(() => simplifiedMerchantSettingsTypes.includes(normalizedMerchantType.value))
+const usesSimplifiedMerchantSettings = computed(() => simplifiedMerchantSettingsTypes.includes(merchantTypeCode.value))
 const settingsAndRightsOnlyMerchantTypes = [
-  '加油服务', '购房优惠', '购车服务', '家电服务', '数码服务', '文化服务', '电信服务',
+  'fuel', 'housing', 'car', 'appliance', 'digital', 'culture', 'telecom',
 ]
-const usesSettingsAndRightsOnlyTabs = computed(() => settingsAndRightsOnlyMerchantTypes.includes(normalizedMerchantType.value))
+const usesSettingsAndRightsOnlyTabs = computed(() => settingsAndRightsOnlyMerchantTypes.includes(merchantTypeCode.value))
 const supportsMerchantAppLogin = computed(() => (
   isServiceMerchant.value
   || isApartmentMerchant.value
@@ -121,10 +147,10 @@
   || isMovieMerchant.value
   || isSpouseEmploymentMerchant.value
   || isApprovalMerchant.value
-  || merchantAppLoginOptionalTypes.includes(normalizedMerchantType.value)
+  || merchantAppLoginOptionalTypes.includes(merchantTypeCode.value)
 ))
 const requiresMerchantOperator = computed(() => (!isEditMode.value || !merchantHasLoginAccount.value) && (
-  normalizedMerchantType.value === '景区服务'
+  merchantTypeCode.value === 'scenic'
   || (supportsMerchantAppLogin.value && Number(form.canLoginMerchantApp) === 1)
 ))
 function carWashJumpMeta() {
@@ -167,7 +193,8 @@
 
 function defaultMerchantRecommend() {
   const merchantType = queryString('merchantType')
-  return merchantType === '餐饮服务' || merchantType === '景区服务' ? 1 : 0
+  const merchantTypeCode = merchantTypeAliases[merchantType] || merchantType
+  return merchantTypeCode === 'food' || merchantTypeCode === 'scenic' ? 1 : 0
 }
 
 function applyNewMerchantDefaults() {
@@ -175,7 +202,9 @@
 
   const merchantType = queryString('merchantType')
   form.merchantType = merchantType
-  form.recommend = merchantType === '餐饮服务' || merchantType === '景区服务' ? 1 : 0
+  form.merchantTypeCode = ''
+  const merchantTypeCode = merchantTypeAliases[merchantType] || merchantType
+  form.recommend = merchantTypeCode === 'food' || merchantTypeCode === 'scenic' ? 1 : 0
   form.sortNo = undefined
 }
 
@@ -227,7 +256,7 @@
   ]
 })
 
-const form = reactive<MerchantPayload & { createdAt: string }>({
+const form = reactive<MerchantPayload & { createdAt: string; merchantTypeCode?: string }>({
   merchantName: '',
   merchantType: queryString('merchantType', ''),
   contactMobile: '',
@@ -548,18 +577,18 @@
 const businessHours = reactive<BusinessHour[]>([{ id: 1, value: [] }])
 
 function defaultMerchantRights(): MerchantRightConfig[] {
-  const currentType = queryString('merchantType', '') || normalizedMerchantType.value
-  const supportsDefaultStoreConsumption = ['餐饮服务', '景区服务', '口腔治疗保健', '免费体检'].includes(currentType)
-    || (currentType === '自助洗车' && form.miniProgramJumpType === 'normal')
-  const isHotel = currentType === '酒店服务'
-  const isCarWash = currentType === '自助洗车'
-  const isHealthCheck = currentType === '免费体检'
-  const isParking = currentType === '停车服务'
-  const isChildcare = currentType === '子女托管'
-  const isFinancial = currentType === '金融服务'
-  const isMovie = currentType === '观影服务'
-  const isSpouseEmployment = currentType === '配偶推荐就业'
-  const isApproval = currentType === '行政审批'
+  const currentType = merchantTypeCode.value
+  const supportsDefaultStoreConsumption = ['food', 'scenic', 'dental', 'medical'].includes(currentType)
+    || (currentType === 'carWash' && form.miniProgramJumpType === 'normal')
+  const isHotel = currentType === 'hotel'
+  const isCarWash = currentType === 'carWash'
+  const isHealthCheck = currentType === 'medical'
+  const isParking = currentType === 'parking'
+  const isChildcare = currentType === 'children'
+  const isFinancial = currentType === 'finance'
+  const isMovie = currentType === 'cinema'
+  const isSpouseEmployment = currentType === 'employment'
+  const isApproval = currentType === 'approval'
 
   if (isHealthCheck) {
     return [

--
Gitblit v1.7.1