Skip to content

Commit 605f906

Browse files
YunaiVgitee-org
authored andcommitted
!344 商城装修
Merge pull request !344 from 疯狂的世界/dev
2 parents ce79dd6 + 59ff6b1 commit 605f906

File tree

25 files changed

+492
-560
lines changed

25 files changed

+492
-560
lines changed

.env.base

Lines changed: 0 additions & 19 deletions
This file was deleted.

.env.dev

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
1-
# 开发环境
1+
# 开发环境:本地只启动前端项目,依赖开发环境(后端、APP)
22
NODE_ENV=development
33

4-
VITE_DEV=false
4+
VITE_DEV=true
55

66
# 请求路径
7-
VITE_BASE_URL='http://localhost:48080'
7+
VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
88

99
# 上传路径
10-
VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload'
10+
VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload'
1111

1212
# 接口前缀
1313
VITE_API_BASEPATH=/dev-api
1414

1515
# 接口地址
1616
VITE_API_URL=/admin-api
1717

18-
# 打包路径
19-
VITE_BASE_PATH=/
20-
2118
# 是否删除debugger
22-
VITE_DROP_DEBUGGER=true
19+
VITE_DROP_DEBUGGER=false
2320

2421
# 是否删除console.log
2522
VITE_DROP_CONSOLE=false
2623

2724
# 是否sourcemap
28-
VITE_SOURCEMAP=false
25+
VITE_SOURCEMAP=true
26+
27+
# 打包路径
28+
VITE_BASE_PATH=/
2929

3030
# 输出路径
3131
VITE_OUT_DIR=dist
32+
33+
# 商城H5会员端域名
34+
VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn'
35+
36+
# 验证码的开关
37+
VITE_APP_CAPTCHA_ENABLE=false
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
# 本地开发环境
1+
# 本地开发环境:本地启动所有项目(前端、后端、APP)时使用,不依赖外部环境
22
NODE_ENV=development
33

44
VITE_DEV=true
55

66
# 请求路径
7-
VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
7+
VITE_BASE_URL='http://localhost:48080'
88

99
# 上传路径
10-
VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload'
10+
VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload'
1111

1212
# 接口前缀
1313
VITE_API_BASEPATH=/dev-api
1414

1515
# 接口地址
1616
VITE_API_URL=/admin-api
1717

18-
# 打包路径
19-
VITE_BASE_PATH=/
20-
21-
# 项目本地运行端口号, 与.vscode/launch.json配合
22-
VITE_PORT=80
23-
2418
# 是否删除debugger
2519
VITE_DROP_DEBUGGER=false
2620

2721
# 是否删除console.log
2822
VITE_DROP_CONSOLE=false
2923

3024
# 是否sourcemap
31-
VITE_SOURCEMAP=true
25+
VITE_SOURCEMAP=false
26+
27+
# 打包路径
28+
VITE_BASE_PATH=/
29+
30+
# 商城H5会员端域名
31+
VITE_MALL_H5_DOMAIN='http://localhost:3000'
3232

3333
# 验证码的开关
3434
VITE_APP_CAPTCHA_ENABLE=false

.env.pro renamed to .env.prod

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 生产环境
1+
# 生产环境:只在打包时使用
22
NODE_ENV=production
33

44
VITE_DEV=false
@@ -28,4 +28,7 @@ VITE_SOURCEMAP=false
2828
VITE_BASE_PATH=/
2929

3030
# 输出路径
31-
VITE_OUT_DIR=dist-pro
31+
VITE_OUT_DIR=dist-prod
32+
33+
# 商城H5会员端域名
34+
VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn'

.env.stage

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 生产环境
1+
# 预发布环境:只在打包时使用
22
NODE_ENV=production
33

44
VITE_DEV=false
@@ -29,3 +29,6 @@ VITE_BASE_PATH='http://static-vue3.yudao.iocoder.cn/'
2929

3030
# 输出路径
3131
VITE_OUT_DIR=dist-stage
32+
33+
# 商城H5会员端域名
34+
VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn'

.env.static renamed to .env.test

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 开发环境
1+
# 测试环境:只在打包时使用
22
NODE_ENV=production
33

44
VITE_DEV=false
@@ -28,4 +28,7 @@ VITE_SOURCEMAP=false
2828
VITE_BASE_PATH=/admin-ui-vue3/
2929

3030
# 输出路径
31-
VITE_OUT_DIR=dist-dev
31+
VITE_OUT_DIR=dist-test
32+
33+
# 商城H5会员端域名
34+
VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn'

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@
66
"private": false,
77
"scripts": {
88
"i": "pnpm install",
9-
"dev": "vite --mode base",
10-
"front": "vite --mode front",
9+
"local-dev": "vite --mode local-dev",
10+
"dev": "vite --mode dev",
1111
"ts:check": "vue-tsc --noEmit",
12-
"build:pro": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode pro",
12+
"build:local-dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode local-dev",
1313
"build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode dev",
14-
"build:base": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode base",
14+
"build:test": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode test",
1515
"build:stage": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode stage",
16-
"build:static": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode static",
17-
"build:front": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode front",
18-
"serve:pro": "vite preview --mode pro",
16+
"build:prod": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode prod",
1917
"serve:dev": "vite preview --mode dev",
20-
"preview": "pnpm build:base && vite preview",
18+
"serve:prod": "vite preview --mode prod",
19+
"preview": "pnpm build:local-dev && vite preview",
2120
"clean": "npx rimraf node_modules",
2221
"clean:cache": "npx rimraf node_modules/.cache",
2322
"lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",

src/components/DiyEditor/components/ComponentLibrary.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ watch(
8282
8383
// 克隆组件
8484
const handleCloneComponent = (component: DiyComponent<any>) => {
85-
return cloneDeep(component)
85+
const instance = cloneDeep(component)
86+
instance.uid = new Date().getTime()
87+
return instance
8688
}
8789
</script>
8890

src/components/DiyEditor/components/mobile/Carousel/property.vue

Lines changed: 47 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -39,87 +39,60 @@
3939
</el-form-item>
4040
</el-card>
4141
<el-card header="内容设置" class="property-group" shadow="never">
42-
<el-text type="info" size="small"> 拖动左上角的小圆点可对其排序 </el-text>
43-
<template v-if="formData.items[0]">
44-
<draggable
45-
:list="formData.items"
46-
:force-fallback="true"
47-
:animation="200"
48-
handle=".drag-icon"
49-
class="m-t-8px"
50-
item-key="index"
51-
>
52-
<template #item="{ element, index }">
53-
<div class="content mb-4px flex flex-col gap-4px rounded bg-gray-50 p-8px">
54-
<div
55-
class="m--8px m-b-8px flex flex-row items-center justify-between bg-gray-100 p-8px"
56-
>
57-
<Icon icon="ic:round-drag-indicator" class="drag-icon cursor-move" />
58-
<Icon
59-
icon="ep:delete"
60-
class="cursor-pointer text-red-5"
61-
@click="handleDeleteImage(index)"
62-
v-if="formData.items.length > 1"
63-
/>
64-
</div>
65-
<el-form-item label="类型" prop="type" class="m-b-8px!" label-width="50px">
66-
<el-radio-group v-model="element.type">
67-
<el-radio label="img">图片</el-radio>
68-
<el-radio label="video">视频</el-radio>
69-
</el-radio-group>
70-
</el-form-item>
71-
<el-form-item
72-
label="图片"
73-
class="m-b-8px!"
74-
label-width="50px"
75-
v-if="element.type === 'img'"
76-
>
77-
<UploadImg
78-
v-model="element.imgUrl"
79-
draggable="false"
80-
height="80px"
81-
width="100%"
82-
class="min-w-80px"
83-
/>
84-
</el-form-item>
85-
<template v-else>
86-
<el-form-item label="封面" class="m-b-8px!" label-width="50px">
87-
<UploadImg
88-
v-model="element.imgUrl"
89-
draggable="false"
90-
height="80px"
91-
width="100%"
92-
class="min-w-80px"
93-
/>
94-
</el-form-item>
95-
<el-form-item label="视频" class="m-b-8px!" label-width="50px">
96-
<UploadFile
97-
v-model="element.videoUrl"
98-
:file-type="['mp4']"
99-
:limit="1"
100-
:file-size="100"
101-
class="min-w-80px"
102-
/>
103-
</el-form-item>
104-
</template>
105-
<el-form-item label="链接" class="m-b-8px!" label-width="50px">
106-
<AppLinkInput v-model="element.url" />
107-
</el-form-item>
108-
</div>
42+
<Draggable v-model="formData.items" :empty-item="{ type: 'img' }">
43+
<template #default="{ element }">
44+
<el-form-item label="类型" prop="type" class="m-b-8px!" label-width="40px">
45+
<el-radio-group v-model="element.type">
46+
<el-radio label="img">图片</el-radio>
47+
<el-radio label="video">视频</el-radio>
48+
</el-radio-group>
49+
</el-form-item>
50+
<el-form-item
51+
label="图片"
52+
class="m-b-8px!"
53+
label-width="40px"
54+
v-if="element.type === 'img'"
55+
>
56+
<UploadImg
57+
v-model="element.imgUrl"
58+
draggable="false"
59+
height="80px"
60+
width="100%"
61+
class="min-w-80px"
62+
/>
63+
</el-form-item>
64+
<template v-else>
65+
<el-form-item label="封面" class="m-b-8px!" label-width="40px">
66+
<UploadImg
67+
v-model="element.imgUrl"
68+
draggable="false"
69+
height="80px"
70+
width="100%"
71+
class="min-w-80px"
72+
/>
73+
</el-form-item>
74+
<el-form-item label="视频" class="m-b-8px!" label-width="40px">
75+
<UploadFile
76+
v-model="element.videoUrl"
77+
:file-type="['mp4']"
78+
:limit="1"
79+
:file-size="100"
80+
class="min-w-80px"
81+
/>
82+
</el-form-item>
10983
</template>
110-
</draggable>
111-
</template>
112-
<el-button @click="handleAddImage" type="primary" plain class="w-full">
113-
添加图片
114-
</el-button>
84+
<el-form-item label="链接" class="m-b-8px!" label-width="40px">
85+
<AppLinkInput v-model="element.url" />
86+
</el-form-item>
87+
</template>
88+
</Draggable>
11589
</el-card>
11690
</el-form>
11791
</ComponentContainerProperty>
11892
</template>
11993

12094
<script setup lang="ts">
121-
import draggable from 'vuedraggable' //拖拽组件
122-
import { CarouselItemProperty, CarouselProperty } from './config'
95+
import { CarouselProperty } from './config'
12396
import { usePropertyForm } from '@/components/DiyEditor/util'
12497
12598
// 轮播图属性面板
@@ -128,15 +101,6 @@ defineOptions({ name: 'CarouselProperty' })
128101
const props = defineProps<{ modelValue: CarouselProperty }>()
129102
const emit = defineEmits(['update:modelValue'])
130103
const { formData } = usePropertyForm(props.modelValue, emit)
131-
132-
// 添加图片
133-
const handleAddImage = () => {
134-
formData.value.items.push({} as CarouselItemProperty)
135-
}
136-
// 删除图片
137-
const handleDeleteImage = (index: number) => {
138-
formData.value.items.splice(index, 1)
139-
}
140104
</script>
141105

142106
<style scoped lang="scss"></style>

0 commit comments

Comments
 (0)