yb hai 10 meses
pai
achega
156b41f9b4
Modificáronse 2 ficheiros con 24 adicións e 8 borrados
  1. 4 4
      .env.local
  2. 20 4
      src/views/mall/product/storeProduct/StoreProductForm.vue

+ 4 - 4
.env.local

@@ -4,16 +4,16 @@ NODE_ENV=development
 VITE_DEV=true
 
 # 请求路径  远端, 本地
-VITE_BASE_URL='https://api.ifoodme.com'
-# VITE_BASE_URL='http://localhost:48081'
+# VITE_BASE_URL='https://api.ifoodme.com'
+VITE_BASE_URL='http://localhost:48081'
 
 # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
 VITE_UPLOAD_TYPE=server
 # 上传路径
 
 # 远端, 本地
-VITE_UPLOAD_URL='https://api.ifoodme.com/admin-api/infra/file/upload'
-# VITE_UPLOAD_URL='http://localhost:48081/admin-api/infra/file/upload'
+# VITE_UPLOAD_URL='https://api.ifoodme.com/admin-api/infra/file/upload'
+VITE_UPLOAD_URL='http://localhost:48081/admin-api/infra/file/upload'
 
 
 # 接口地址

+ 20 - 4
src/views/mall/product/storeProduct/StoreProductForm.vue

@@ -182,22 +182,22 @@
 
                 <el-table-column label="税后堂食价格" prop="priceAfterTax" align="center">
                   <template #default="scope">
-                    <el-input type="text" v-model="scope.row.priceAfterTax" />
+                    <el-input type="text" v-model="scope.row.pink_after_tax" />
                   </template>
                 </el-table-column>
                 <el-table-column label="税后外卖价格" prop="priceAfterTaxTakeout" align="center">
                   <template #default="scope">
-                    <el-input type="text" v-model="scope.row.priceAfterTaxTakeout" />
+                    <el-input type="text" v-model="scope.row.pink_after_tax_takeout" />
                   </template>
                 </el-table-column>
                 <el-table-column label="外卖税率" prop="takeoutTaxRate" align="center">
                   <template #default="scope">
-                    <el-input type="text" v-model="scope.row.takeoutTaxRate" />
+                    <el-input type="text" v-model="scope.row.takeout_tax_rate" />
                   </template>
                 </el-table-column>
                 <el-table-column label="堂食税率" prop="dineInTaxRate" align="center">
                   <template #default="scope">
-                    <el-input type="text" v-model="scope.row.dineInTaxRate" />
+                    <el-input type="text" v-model="scope.row.dine_in_tax_rate" />
                   </template>
                 </el-table-column>
 
@@ -589,6 +589,22 @@ const submitForm = async () => {
     if (formValidate.value.spec_type === 1 && manyFormValidate.value.length === 0) {
       message.warning(t('common.addSpec'))
     }
+    // 去掉url 前置路径
+    if (formValidate?.value?.image?.includes('https://api.ifoodme.com')) {
+      formValidate.value.image = formValidate.value.image.split('https://api.ifoodme.com')[1]
+    }
+
+    if (formValidate?.value?.slider_image?.length > 0) {
+      formValidate.value.slider_image = formValidate?.value?.slider_image?.map((item) => {
+        if (item?.includes('https://api.ifoodme.com')) {
+          item = item.split('https://api.ifoodme.com')[1]
+        }
+        return item
+      })
+    }
+
+    // formValidate.value.image
+
     await StoreProductApi.createStoreProduct(formValidate.value)
     dialogVisible.value = false
     // 发送操作成功的事件