Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
78462372
authored
Dec 07, 2023
by
owen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
营销:完善装修编辑器预览功能
parent
eec3a218
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
15 deletions
+34
-15
.env.base
+3
-0
.env.dev
+3
-0
src/components/DiyEditor/index.vue
+28
-12
src/views/mall/promotion/diy/page/decorate.vue
+0
-3
No files found.
.env.base
View file @
78462372
...
@@ -17,3 +17,6 @@ VITE_API_URL=/admin-api
...
@@ -17,3 +17,6 @@ VITE_API_URL=/admin-api
# 打包路径
# 打包路径
VITE_BASE_PATH=/
VITE_BASE_PATH=/
# 商城H5会员端域名
VITE_MALL_H5_DOMAIN=http://localhost:3000
.env.dev
View file @
78462372
...
@@ -29,3 +29,6 @@ VITE_SOURCEMAP=false
...
@@ -29,3 +29,6 @@ VITE_SOURCEMAP=false
# 输出路径
# 输出路径
VITE_OUT_DIR=dist
VITE_OUT_DIR=dist
# 商城H5会员端域名
VITE_MALL_H5_DOMAIN=http://localhost:3000
src/components/DiyEditor/index.vue
View file @
78462372
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<Icon
icon=
"system-uicons:reset-alt"
:size=
"24"
/>
<Icon
icon=
"system-uicons:reset-alt"
:size=
"24"
/>
</el-button>
</el-button>
</el-tooltip>
</el-tooltip>
<el-tooltip
content=
"预览"
>
<el-tooltip
content=
"预览"
v-if=
"previewUrl"
>
<el-button
@
click=
"handlePreview"
>
<el-button
@
click=
"handlePreview"
>
<Icon
icon=
"ep:view"
:size=
"24"
/>
<Icon
icon=
"ep:view"
:size=
"24"
/>
</el-button>
</el-button>
...
@@ -119,6 +119,19 @@
...
@@ -119,6 +119,19 @@
</el-aside>
</el-aside>
</el-container>
</el-container>
</el-container>
</el-container>
<!-- 预览弹框 -->
<Dialog
v-model=
"previewDialogVisible"
title=
"预览"
width=
"700"
>
<div
class=
"flex justify-around"
>
<IFrame
class=
"w-375px border-4px border-rounded-8px border-solid p-2px h-667px!"
:src=
"previewUrl"
/>
<div
class=
"flex flex-col"
>
<el-text>
手机扫码预览
</el-text>
<Qrcode
:text=
"previewUrl"
logo=
"/logo.gif"
/>
</div>
</div>
</Dialog>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
// 注册所有的组件
// 注册所有的组件
...
@@ -137,12 +150,12 @@ import { component as TAB_BAR_COMPONENT } from './components/mobile/TabBar/confi
...
@@ -137,12 +150,12 @@ import { component as TAB_BAR_COMPONENT } from './components/mobile/TabBar/confi
import
{
isString
}
from
'@/utils/is'
import
{
isString
}
from
'@/utils/is'
import
{
DiyComponent
,
DiyComponentLibrary
,
PageConfig
}
from
'@/components/DiyEditor/util'
import
{
DiyComponent
,
DiyComponentLibrary
,
PageConfig
}
from
'@/components/DiyEditor/util'
import
{
componentConfigs
}
from
'@/components/DiyEditor/components/mobile'
import
{
componentConfigs
}
from
'@/components/DiyEditor/components/mobile'
import
{
array
,
oneOfType
}
from
'vue-types'
import
{
propTypes
}
from
'@/utils/propTypes'
/** 页面装修详情页 */
/** 页面装修详情页 */
defineOptions
({
name
:
'DiyPageDetail'
})
defineOptions
({
name
:
'DiyPageDetail'
})
// 消息弹窗
const
message
=
useMessage
()
// 左侧组件库
// 左侧组件库
const
componentLibrary
=
ref
()
const
componentLibrary
=
ref
()
// 页面设置组件
// 页面设置组件
...
@@ -159,20 +172,22 @@ const selectedComponentIndex = ref<number>(-1)
...
@@ -159,20 +172,22 @@ const selectedComponentIndex = ref<number>(-1)
// 组件列表
// 组件列表
const
pageComponents
=
ref
<
DiyComponent
<
any
>
[]
>
([])
const
pageComponents
=
ref
<
DiyComponent
<
any
>
[]
>
([])
// 定义属性
// 定义属性
const
props
=
defineProps
<
{
const
props
=
defineProps
(
{
// 页面配置,支持Json字符串
// 页面配置,支持Json字符串
modelValue
:
string
|
PageConfig
modelValue
:
oneOfType
<
string
|
PageConfig
>
([
String
,
Object
]).
isRequired
,
// 标题
// 标题
title
:
string
title
:
propTypes
.
string
.
def
(
''
),
// 组件库
// 组件库
libs
:
DiyComponentLibrary
[]
libs
:
array
<
DiyComponentLibrary
>
(),
// 是否显示顶部导航栏
// 是否显示顶部导航栏
showNavigationBar
:
boolean
showNavigationBar
:
propTypes
.
bool
.
def
(
true
),
// 是否显示底部导航菜单
// 是否显示底部导航菜单
showTabBar
:
boolean
showTabBar
:
propTypes
.
bool
.
def
(
false
),
// 是否显示页面配置
// 是否显示页面配置
showPageConfig
:
boolean
showPageConfig
:
propTypes
.
bool
.
def
(
true
),
}
>
()
// 预览地址:提供了预览地址,才会显示预览按钮
previewUrl
:
propTypes
.
string
.
def
(
''
)
})
// 监听传入的页面配置
// 监听传入的页面配置
watch
(
watch
(
...
@@ -315,8 +330,9 @@ const handleReset = () => {
...
@@ -315,8 +330,9 @@ const handleReset = () => {
emits
(
'reset'
)
emits
(
'reset'
)
}
}
// 预览
// 预览
const
previewDialogVisible
=
ref
(
false
)
const
handlePreview
=
()
=>
{
const
handlePreview
=
()
=>
{
message
.
warning
(
'开发中~'
)
previewDialogVisible
.
value
=
true
emits
(
'preview'
)
emits
(
'preview'
)
}
}
...
...
src/views/mall/promotion/diy/page/decorate.vue
View file @
78462372
...
@@ -4,9 +4,6 @@
...
@@ -4,9 +4,6 @@
v-model=
"formData.property"
v-model=
"formData.property"
:title=
"formData.name"
:title=
"formData.name"
:libs=
"PAGE_LIBS"
:libs=
"PAGE_LIBS"
:show-page-config=
"true"
:show-navigation-bar=
"true"
:show-tab-bar=
"false"
@
save=
"submitForm"
@
save=
"submitForm"
/>
/>
</
template
>
</
template
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment