Explorar el Código

提交window代码

RuHu.Xu hace 4 meses
padre
commit
89862b8539

+ 2 - 2
.env.dev

@@ -4,10 +4,10 @@ NODE_ENV=development
 VITE_DEV=true
 
 # 请求路径
-VITE_BASE_URL='https://zxsh.newfeifan.cn'
+VITE_BASE_URL='http://192.168.3.41:8001'
 
 # 上传路径
-VITE_UPLOAD_URL='https://zxsh.newfeifan.cn/admin-api/infra/file/upload'
+VITE_UPLOAD_URL='http://192.168.3.41:8001/admin-api/infra/file/upload'
 
 # 接口前缀
 VITE_API_BASEPATH=/dev-api

+ 0 - 1
package.json

@@ -136,7 +136,6 @@
     "url": "https://gitee.com/yudaocode/yudao-ui-admin-vue3/issues"
   },
   "homepage": "https://gitee.com/yudaocode/yudao-ui-admin-vue3",
-  "packageManager": "pnpm@8.6.0",
   "engines": {
     "node": ">= 16.0.0",
     "pnpm": ">=8.6.0"

+ 3 - 3
src/components/DiyEditor/components/mobile/ProductCard/index.vue

@@ -67,14 +67,14 @@
             class="text-16px"
             :style="{ color: property.fields.price.color }"
           >
-            ¥{{ spu.price }}
+            ¥{{ fenToYuan(spu.price) }}
           </span>
           <!-- 市场价 -->
           <span
             v-if="property.fields.marketPrice.show && spu.marketPrice"
             class="ml-4px text-10px line-through"
             :style="{ color: property.fields.marketPrice.color }"
-            >¥{{ spu.marketPrice }}</span
+            >¥{{ fenToYuan(spu.marketPrice) }}</span
           >
         </div>
         <div class="text-12px">
@@ -117,7 +117,7 @@
 <script setup lang="ts">
 import { ProductCardProperty } from './config'
 import * as ProductSpuApi from '@/api/mall/product/spu'
-
+import { fenToYuan } from '@/utils'
 /** 商品卡片 */
 defineOptions({ name: 'ProductCard' })
 // 定义属性

+ 2 - 2
src/components/DiyEditor/components/mobile/ProductList/index.vue

@@ -54,7 +54,7 @@
               class="text-12px"
               :style="{ color: property.fields.price.color }"
             >
-              ¥{{ spu.price }}
+              ¥{{ fenToYuan(spu.price) }}
             </span>
           </div>
         </div>
@@ -65,7 +65,7 @@
 <script setup lang="ts">
 import { ProductListProperty } from './config'
 import * as ProductSpuApi from '@/api/mall/product/spu'
-
+import { fenToYuan } from '@/utils'
 /** 商品栏 */
 defineOptions({ name: 'ProductList' })
 // 定义属性

+ 6 - 3
src/components/DiyEditor/index.vue

@@ -15,11 +15,11 @@
             <Icon icon="system-uicons:reset-alt" :size="24" />
           </el-button>
         </el-tooltip>
-        <el-tooltip content="预览" v-if="previewUrl">
+        <!-- <el-tooltip content="预览" v-if="previewUrl">
           <el-button @click="handlePreview">
             <Icon icon="ep:view" :size="24" />
           </el-button>
-        </el-tooltip>
+        </el-tooltip> -->
         <el-tooltip content="保存">
           <el-button @click="handleSave">
             <Icon icon="ep:check" :size="24" />
@@ -266,9 +266,11 @@ const handleSave = () => {
       return { id: component.id, property: component.property }
     })
   } as PageConfig
+  console.log(props.showTabBar)
   if (!props.showTabBar) {
     delete pageConfig.tabBar
   }
+  
   // 发送数据更新通知
   const modelValue = isString(props.modelValue) ? JSON.stringify(pageConfig) : pageConfig
   emits('update:modelValue', modelValue)
@@ -323,7 +325,7 @@ const handleComponentChange = (dragEvent: any) => {
 
 // 交换组件
 const swapComponent = (oldIndex: number, newIndex: number) => {
-  ;[pageComponents.value[oldIndex], pageComponents.value[newIndex]] = [
+  [pageComponents.value[oldIndex], pageComponents.value[newIndex]] = [
     pageComponents.value[newIndex],
     pageComponents.value[oldIndex]
   ]
@@ -387,6 +389,7 @@ const handlePreview = () => {
 
 // 设置默认选中的组件
 const setDefaultSelectedComponent = () => {
+  console.log(props.showTabBar)
   if (props.showPageConfig) {
     selectedComponent.value = unref(pageConfigComponent)
   } else if (props.showNavigationBar) {

+ 18 - 18
src/components/DiyEditor/util.ts

@@ -118,7 +118,7 @@ export const PAGE_LIBS = [
       'MenuGrid',
       'MenuList',
       'Popover',
-      'FloatingActionButton'
+      // 'FloatingActionButton'
     ]
   },
   {
@@ -131,24 +131,24 @@ export const PAGE_LIBS = [
       'VideoPlayer',
       'Divider',
       'MagicCube',
-      'HotZone'
+      // 'HotZone'
     ]
   },
   { name: '商品组件', extended: true, components: ['ProductCard', 'ProductList'] },
-  {
-    name: '用户组件',
-    extended: true,
-    components: ['UserCard', 'UserOrder', 'UserWallet', 'UserCoupon']
-  },
-  {
-    name: '营销组件',
-    extended: true,
-    components: [
-      'PromotionCombination',
-      'PromotionSeckill',
-      'PromotionPoint',
-      'CouponCard',
-      'PromotionArticle'
-    ]
-  }
+  // {
+  //   name: '用户组件',
+  //   extended: true,
+  //   components: ['UserCard', 'UserOrder', 'UserWallet', 'UserCoupon']
+  // },
+  // {
+  //   name: '营销组件',
+  //   extended: true,
+  //   components: [
+  //     'PromotionCombination',
+  //     'PromotionSeckill',
+  //     'PromotionPoint',
+  //     'CouponCard',
+  //     'PromotionArticle'
+  //   ]
+  // }
 ] as DiyComponentLibrary[]

+ 2 - 0
src/main.ts

@@ -47,6 +47,8 @@ import Logger from '@/utils/Logger'
 
 import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患
 
+
+
 // 创建实例
 const setupAll = async () => {
   const app = createApp(App)

+ 4 - 1
src/views/mall/product/spu/components/SpuTableSelect.vue

@@ -1,6 +1,6 @@
 <template>
   <Dialog v-model="dialogVisible" :appendToBody="true" title="选择商品" width="70%">
-    <ContentWrap>
+    <ContentWrap style="border:none;">
       <el-form
         ref="queryFormRef"
         :inline="true"
@@ -149,6 +149,7 @@ const dialogVisible = ref(false)
 const queryParams = ref({
   pageNo: 1,
   pageSize: 10,
+  checkStatus:1,
   // 默认获取上架的商品
   tabType: 0,
   name: '',
@@ -179,6 +180,7 @@ defineExpose({ open })
 /** 查询列表 */
 const getList = async () => {
   loading.value = true
+  console.log(queryParams.value)
   try {
     const data = await ProductSpuApi.getSpuPage(queryParams.value)
     list.value = data.list
@@ -205,6 +207,7 @@ const resetQuery = () => {
   queryParams.value = {
     pageNo: 1,
     pageSize: 10,
+    checkStatus:1,
     // 默认获取上架的商品
     tabType: 0,
     name: '',

+ 6 - 2
src/views/mall/product/spu/form/index.vue

@@ -370,12 +370,14 @@ const submitForm = async () => {
 			item.name = deepCopyFormData.name
 			// sku相关价元转分
 			item.price = convertToInteger(item.price)
-			item.highPrecisionPrice = (item.highPrecisionPrice * 100).toFixed(6)
 			item.marketPrice = convertToInteger(item.marketPrice)
 			item.promotionFee = convertToInteger(item.promotionFee)
 			item.costPrice = convertToInteger(item.costPrice)
 			item.settlementPrice = convertToInteger(item.settlementPrice)
-			item.highPrecisionSettlementPrice =(item.highPrecisionSettlementPrice * 100).toFixed(6)
+			
+			item.highPrecisionPrice = item.highPrecisionPrice ? (item.highPrecisionPrice * 100).toFixed(6) : 0
+			item.highPrecisionSettlementPrice = item.highPrecisionSettlementPrice ? (item.highPrecisionSettlementPrice * 100).toFixed(6) : 0
+			console.log(item.highPrecisionPrice,item.highPrecisionSettlementPrice)
 			item.firstBrokeragePrice = convertToInteger(item.firstBrokeragePrice)
 			item.secondBrokeragePrice = convertToInteger(item.secondBrokeragePrice)
 		})
@@ -386,6 +388,8 @@ const submitForm = async () => {
 			typeof item === 'object' ? newSliderPicUrls.push(item.url) : newSliderPicUrls.push(item)
 		})
 		deepCopyFormData.sliderPicUrls = newSliderPicUrls
+		console.log(deepCopyFormData)
+
 		// 校验都通过后提交表单
 		const data = deepCopyFormData as ProductSpuApi.Spu
 		const id = productId.value as any as number

+ 1 - 1
src/views/mall/product/spu/index.vue

@@ -198,7 +198,7 @@ const queryParams = ref({
 	pageNo: 1,
 	pageSize: 10,
 	tabType: '',
-	checkStatus: 1,
+
 	merchantId:0,
 	name: '',
 	categoryId: undefined,

+ 1 - 0
src/views/mall/promotion/components/SpuSelect.vue

@@ -140,6 +140,7 @@ const dialogTitle = ref('') // 弹窗的标题
 const queryParams = ref({
   pageNo: 1,
   pageSize: 10,
+  checkStatus:1,
   tabType: 0, // 默认获取上架的商品
   name: '',
   categoryId: null,

+ 15 - 16
src/views/mall/promotion/diy/template/decorate.vue

@@ -5,8 +5,8 @@
     v-model="currentFormData!.property"
     :title="templateItems[selectedTemplateItem].name"
     :libs="libs"
-    :show-page-config="selectedTemplateItem !== 0"
-    :show-tab-bar="selectedTemplateItem === 0"
+    :show-page-config="selectedTemplateItem === 0"
+    :show-tab-bar="selectedTemplateItem !== 0"
     :show-navigation-bar="selectedTemplateItem !== 0"
     :preview-url="previewUrl"
     @save="submitForm"
@@ -41,9 +41,9 @@ defineOptions({ name: 'DiyTemplateDecorate' })
 // 左上角工具栏操作按钮
 const selectedTemplateItem = ref(0)
 const templateItems = reactive([
-  { name: '基础设置', icon: 'ep:iphone' },
+  // { name: '基础设置', icon: 'ep:iphone' },
   { name: '首页', icon: 'ep:home-filled' },
-  { name: '我的', icon: 'ep:user-filled' }
+  // { name: '我的', icon: 'ep:user-filled' }
 ])
 
 const message = useMessage() // 消息弹窗
@@ -78,12 +78,11 @@ const libs = ref<DiyComponentLibrary[]>(templateLibs)
 // 模板选项切换
 const handleTemplateItemChange = () => {
   // 编辑模板
-  if (selectedTemplateItem.value === 0) {
-    libs.value = templateLibs
-    currentFormData.value = formData.value
-    return
-  }
-
+  // if (selectedTemplateItem.value === 0) {
+  //   libs.value = templateLibs
+  //   currentFormData.value = formData.value
+  //   return
+  // }
   // 编辑页面
   libs.value = PAGE_LIBS
   currentFormData.value = formData.value!.pages.find(
@@ -98,13 +97,13 @@ const submitForm = async () => {
   // 提交请求
   formLoading.value = true
   try {
-    if (selectedTemplateItem.value === 0) {
-      // 提交模板属性
-      await DiyTemplateApi.updateDiyTemplateProperty(unref(formData)!)
-    } else {
+    // if (selectedTemplateItem.value === 0) {
+    //   // 提交模板属性
+    //   await DiyTemplateApi.updateDiyTemplateProperty(unref(formData)!)
+    // } else {
       // 提交页面属性
       await DiyPageApi.updateDiyPageProperty(unref(currentFormData)!)
-    }
+    // }
     message.success('保存成功')
   } finally {
     formLoading.value = false
@@ -144,8 +143,8 @@ const recoverPageIndex = () => {
   // 切换页面
   if (pageIndex !== selectedTemplateItem.value) {
     selectedTemplateItem.value = pageIndex
-    handleTemplateItemChange()
   }
+  handleTemplateItemChange()
 }
 //#endregion
 

+ 7 - 6
src/views/mall/promotion/diy/template/index.vue

@@ -1,6 +1,7 @@
 <template>
-  <ContentWrap>
-    <!-- 搜索工作栏 -->
+  <!-- 搜索工作栏 -->
+  <!-- <ContentWrap>
+    
     <el-form
       class="-mb-15px"
       :model="queryParams"
@@ -41,12 +42,12 @@
         </el-button>
       </el-form-item>
     </el-form>
-  </ContentWrap>
+  </ContentWrap> -->
 
   <!-- 列表 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
-      <el-table-column label="编号" align="center" prop="id" />
+      <!-- <el-table-column label="编号" align="center" prop="id" /> -->
       <el-table-column label="预览图" align="center" prop="previewPicUrls">
         <template #default="scope">
           <el-image
@@ -61,11 +62,11 @@
         </template>
       </el-table-column>
       <el-table-column label="模板名称" align="center" prop="name" />
-      <el-table-column label="是否使用" align="center" prop="used">
+      <!-- <el-table-column label="是否使用" align="center" prop="used">
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.used" />
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column
         label="使用时间"
         align="center"

+ 5 - 1
vite.config.ts

@@ -2,6 +2,7 @@ import { resolve } from 'path'
 import { loadEnv } from 'vite'
 import type { UserConfig, ConfigEnv } from 'vite'
 import { createVitePlugins } from './build/vite'
+
 import { include, exclude } from "./build/vite/optimize"
 // 当前执行node命令时文件夹的地址(工作目录)
 const root = process.cwd()
@@ -11,6 +12,7 @@ function pathResolve(dir: string) {
   return resolve(root, '.', dir)
 }
 
+
 // https://vitejs.dev/config/
 export default ({ command, mode }: ConfigEnv): UserConfig => {
   let env = {} as any
@@ -42,7 +44,9 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
       // },
     },
     // 项目使用的vite插件。 单独提取到build/vite/plugin中管理
-    plugins: createVitePlugins(),
+    plugins:[
+      createVitePlugins(),
+    ],
     css: {
       preprocessorOptions: {
         scss: {