Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporate-culture-qd
Commits
3022ff4f
Commit
3022ff4f
authored
Mar 12, 2026
by
王立鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '线上优化/一些线上优化' into 'master'
线上优化/一些线上优化 See merge request
!5
parents
d9ca3115
12f818f9
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
137 additions
and
56 deletions
+137
-56
index.vue
src/components/common/CgGuide/index.vue
+4
-2
index.vue
src/components/common/PublishBox/index.vue
+54
-8
index.vue
src/components/common/RewardButton/index.vue
+0
-1
config.ts
src/config.ts
+2
-2
index.ts
src/stores/index.ts
+1
-0
tour.ts
src/stores/tour.ts
+23
-0
index.vue
src/views/homePage/askTab/index.vue
+7
-27
index.vue
src/views/homePage/index.vue
+15
-10
index.vue
src/views/publishLongArticle/index.vue
+13
-3
index.vue
src/views/questionDetail/index.vue
+1
-1
selfAnswer.vue
src/views/userPage/components/selfAnswer.vue
+17
-2
No files found.
src/components/common/CgGuide/index.vue
View file @
3022ff4f
...
...
@@ -163,7 +163,8 @@
<
script
setup
lang=
"ts"
>
import
{
useActivityStore
}
from
'@/stores'
import
{
useYaBiStore
}
from
'@/stores/yabi'
const
yabiStore
=
useYaBiStore
()
const
activityStore
=
useActivityStore
()
const
router
=
useRouter
()
type
Phase
=
'video'
|
'reward'
|
'guide'
...
...
@@ -234,7 +235,8 @@ const transitionToReward = async () => {
phase
.
value
=
'reward'
// 标记用户已经观看过cg动画
await
activityStore
.
markUserGuideWatched
(
'isView'
)
// 并且需要加YA币
yabiStore
.
fetchYaBiData
()
setTimeout
(()
=>
{
// 第二天上线打开这个 去掉下一行注释
// phase.value = 'guide'
...
...
src/components/common/PublishBox/index.vue
View file @
3022ff4f
<
template
>
<div
class=
"bg-white p-6 mb-6 rounded-lg shadow-sm"
>
<div
class=
"bg-white p-6 mb-6 rounded-lg shadow-sm relative"
>
<!-- 自实现的导览提示:UnoCSS 显眼样式 + 进入/离开过渡 -->
<Transition
name=
"tour-hint"
>
<div
v-show=
"showAskTabTour"
role=
"alert"
class=
"absolute top-0 right-0 z-10 min-w-52 max-w-72 rounded-xl border-l-4 border-blue-500 bg-gradient-to-br from-blue-50 to-indigo-50 px-4 py-4 pr-10 shadow-xl shadow-blue-200/40 ring-2 ring-blue-200/80"
>
<button
type=
"button"
aria-label=
"关闭导览"
class=
"cursor-pointer absolute top-2 right-2 flex size-6 items-center justify-center rounded-lg text-slate-400 outline-none transition-colors hover:bg-slate-200/80 hover:text-slate-600"
@
click=
"closeAskTabTour"
>
<el-icon
:size=
"16"
><IEpClose
/></el-icon>
</button>
<p
class=
"mb-3 text-base font-semibold leading-snug text-slate-800"
>
在这里发布你的问题
</p>
<span
class=
"mb-3 block text-xs text-slate-500"
>
操作指引
</span>
<el-button
type=
"primary"
size=
"small"
class=
"rounded-lg font-medium shadow-sm"
@
click=
"closeAskTabTour"
>
结束导览
</el-button>
</div>
</Transition>
<div
class=
"flex-1 bg-white rounded-lg border border-gray-200"
>
<!-- 主输入区域 -->
...
...
@@ -117,10 +144,6 @@
v-model:tagList=
"form.tagList"
ref=
"selectTagsDialogRef"
/>
<el-tour
v-model=
"openTour"
:mask=
"false"
placement=
"left-start"
type=
"primary"
>
<el-tour-step
:target=
"tagButtonRef?.$el"
description=
"在这里选择标签"
placement=
"top"
/>
</el-tour>
</div>
</
template
>
<!-- 发布实践 或者 问吧 的 发布框 -->
...
...
@@ -138,7 +161,10 @@ import { useAnimate } from '@vueuse/core'
import
RichTextarea
from
'../RichTextarea/index.vue'
import
UploadImgIcon
from
'../UploadImgIcon/index.vue'
import
{
push
}
from
'notivue'
import
{
useTourStore
}
from
'@/stores'
const
tourStore
=
useTourStore
()
const
{
showAskTabTour
}
=
storeToRefs
(
tourStore
)
// 暂时只有 问吧 和 实践 需要发布框 这俩都需要实名
type
ArticleType
=
ArticleTypeEnum
.
QUESTION
|
ArticleTypeEnum
.
PRACTICE
...
...
@@ -184,8 +210,6 @@ const selectTagsDialogRef =
// const fileInputRef = useTemplateRef
<
HTMLInputElement
>
(
'fileInputRef'
)
const
openTour
=
ref
(
false
)
const
disabledSubmit
=
computed
(()
=>
{
return
!
form
.
value
.
title
||
!
form
.
value
.
content
})
...
...
@@ -236,6 +260,10 @@ const handleAddTag = () => {
selectTagsDialogRef
.
value
?.
open
()
}
const
closeAskTabTour
=
()
=>
{
showAskTabTour
.
value
=
false
}
const
validateForm
=
()
=>
{
if
(
!
form
.
value
.
mainTagId
)
{
push
.
warning
(
'请选择主标签'
)
...
...
@@ -277,4 +305,22 @@ const handlePublish = async (releaseStatus: ReleaseStatusTypeEnum) => {
}
</
script
>
<
style
scoped
></
style
>
<
style
scoped
>
/* 导览提示进入/离开过渡 */
.tour-hint-enter-active
,
.tour-hint-leave-active
{
transition
:
opacity
0.25s
ease
,
transform
0.25s
ease
;
}
.tour-hint-enter-from
,
.tour-hint-leave-to
{
opacity
:
0
;
transform
:
translateX
(
8px
)
scale
(
0.96
);
}
.tour-hint-enter-to
,
.tour-hint-leave-from
{
opacity
:
1
;
transform
:
translateX
(
0
)
scale
(
1
);
}
</
style
>
src/components/common/RewardButton/index.vue
View file @
3022ff4f
...
...
@@ -13,7 +13,6 @@ const { pageKey } = defineProps<{
const
activityStore
=
useActivityStore
()
// 调用接口让他跳出动画
const
handleClick
=
()
=>
{
console
.
log
(
'点击了'
)
activityStore
.
triggerPageReward
(
pageKey
)
}
</
script
>
src/config.ts
View file @
3022ff4f
...
...
@@ -24,9 +24,9 @@ export const app_config: { [key: string]: IConfig } = {
// 开发环境
development
:
{
baseUrl
:
'http://culture.yswg.com.cn:8089'
,
// 线上测试机
//
baseUrl: 'http://culture.yswg.com.cn:8089', // 线上测试机
// baseUrl: 'http://192.168.2.168:8089', // 立鹏本地/
//
baseUrl: 'http://192.168.2.55:8089', // 首拥本地
baseUrl
:
'http://192.168.2.55:8089'
,
// 首拥本地
loginType
:
1
,
wxRedirect
:
''
,
},
...
...
src/stores/index.ts
View file @
3022ff4f
...
...
@@ -7,3 +7,4 @@ export * from './question'
export
*
from
'./yabi'
export
*
from
'./onlineTime'
export
*
from
'./activity'
export
*
from
'./tour'
src/stores/tour.ts
0 → 100644
View file @
3022ff4f
import
{
defineStore
}
from
'pinia'
export
const
useTourStore
=
defineStore
(
'tour'
,
()
=>
{
const
showAskTabTour
=
ref
(
false
)
const
shouldShowAskTabTour
=
ref
(
false
)
let
hasHitTimes
=
Number
(
localStorage
.
getItem
(
'hasHitAskTabTourTimes'
))
||
0
const
MAX_HIT_TIMES
=
3
const
hitAskTabTour
=
async
()
=>
{
if
(
hasHitTimes
>=
MAX_HIT_TIMES
)
return
hasHitTimes
++
localStorage
.
setItem
(
'hasHitAskTabTourTimes'
,
String
(
hasHitTimes
))
showAskTabTour
.
value
=
true
}
return
{
showAskTabTour
,
shouldShowAskTabTour
,
hitAskTabTour
,
}
})
src/views/homePage/askTab/index.vue
View file @
3022ff4f
...
...
@@ -185,13 +185,6 @@
</div>
</
template
>
</div>
<el-tour
v-model=
"open"
>
<el-tour-step
:target=
"publishBoxRef?.$el"
placement=
"right"
>
<div>
在这里发布你的问题
</div>
</el-tour-step>
<
template
#
indicators
></
template
>
</el-tour>
<CommentDialog
ref=
"commentDialogRef"
@
commentSuccess=
"search"
/>
</div>
</template>
...
...
@@ -211,11 +204,13 @@ import ActionMore from '@/components/common/ActionMore/index.vue'
import
CommentDialog
from
'@/components/common/CommentDialog/index.vue'
import
{
parseEmoji
}
from
'@/utils/emoji'
import
{
push
}
from
'notivue'
const
{
fetchUserQestionNum
}
=
useQuestionStore
()
import
{
useTourStore
}
from
'@/stores'
import
{
storeToRefs
}
from
'pinia'
const
route
=
useRoute
()
const
{
fetchUserQestionNum
}
=
useQuestionStore
()
const
tourStore
=
useTourStore
()
const
{
shouldShowAskTabTour
}
=
storeToRefs
(
tourStore
)
const
router
=
useRouter
()
const
open
=
ref
(
false
)
const
publishBoxRef
=
useTemplateRef
(
'publishBoxRef'
)
const
commentDialogRef
=
useTemplateRef
<
typeof
CommentDialog
>
(
'commentDialogRef'
)
...
...
@@ -324,28 +319,13 @@ const openNewPage = (path: string) => {
router
.
push
(
path
)
}
// 是否打开漫游
watch
(
()
=>
route
.
fullPath
,
async
(
newVal
)
=>
{
// 处理在当前页面跳转到当前页面的情况 onActivated 不会触发
if
(
newVal
.
includes
(
'#tabsRef'
)
&&
newVal
.
includes
(
'?t'
))
{
await
handleBackTop
()
open
.
value
=
true
}
},
)
onActivated
(
async
()
=>
{
if
(
route
.
fullPath
.
includes
(
'#tabsRef'
)
)
{
if
(
shouldShowAskTabTour
.
value
)
{
await
handleBackTop
()
open
.
value
=
true
tourStore
.
hitAskTabTour
()
}
refresh
()
})
onMounted
(()
=>
{
console
.
log
(
'父组件onmounted'
)
})
</
script
>
<
style
lang=
"scss"
scoped
>
.fadeCommentBox-enter-from
{
...
...
src/views/homePage/index.vue
View file @
3022ff4f
...
...
@@ -402,7 +402,10 @@ import { useBreakpoints, breakpointsTailwind } from '@vueuse/core'
// import LuckyWheel from '@/components/common/LuckyWheel/index.vue'
import
{
RewardButtonEnum
}
from
'@/constants'
import
RewardButton
from
'@/components/common/RewardButton/index.vue'
import
{
useTourStore
}
from
'@/stores'
const
tourStore
=
useTourStore
()
const
{
shouldShowAskTabTour
}
=
storeToRefs
(
tourStore
)
const
breakpoints
=
useBreakpoints
(
breakpointsTailwind
)
const
isSmallerThanXl
=
breakpoints
.
smaller
(
'xl'
)
const
route
=
useRoute
()
...
...
@@ -420,7 +423,7 @@ const yabiStore = useYaBiStore()
const
{
yabiData
}
=
storeToRefs
(
yabiStore
)
const
getThirdLevelKey
=
(
route
:
RouteLocationNormalizedLoadedGeneric
)
=>
{
// console.log(route.fullPath, '三级路由首页')
//
console.log(route.path, 11111111111111)
console
.
log
(
route
.
path
,
11111111111111
)
// return route.fullPath // fullpath带有query参数
return
route
.
path
}
...
...
@@ -543,11 +546,12 @@ const handleTask = async (item: TaskItemDto) => {
// 发布评论
push.info('快去文章评论区去发表评论吧~')
} else if (item.svgName === 'topic_publish') {
if (route.
p
ath.includes('/homePage/askTab')) {
// 同一个页面 需要加事件触发 watch
router.push(`
/
homePage
/
askTab
#
tabsRef
?
t
=
$
{
Date
.
now
()}
`
)
if (route.
fullP
ath.includes('/homePage/askTab')) {
await handleBackTop()
tourStore.hitAskTabTour(
)
} else {
router.push(`
/
homePage
/
askTab
#
tabsRef
`)
shouldShowAskTabTour.value = true
router.push(`
/
homePage
/
askTab
`)
}
} else if (item.svgName === 'answer_ask') {
// 回答问题
...
...
@@ -561,12 +565,13 @@ const handleTask = async (item: TaskItemDto) => {
}
}
const publishTopic = () => {
if (route.
p
ath.includes('/homePage/askTab')) {
// 同一个页面 需要加事件触发 watch
router.push(`
/
homePage
/
askTab
#
tabsRef
?
t
=
$
{
Date
.
now
()}
`
)
const publishTopic =
async
() => {
if (route.
fullP
ath.includes('/homePage/askTab')) {
await handleBackTop()
tourStore.hitAskTabTour(
)
} else {
router.push(`
/
homePage
/
askTab
#
tabsRef
`)
shouldShowAskTabTour.value = true
router.push(`
/
homePage
/
askTab
`)
}
}
...
...
src/views/publishLongArticle/index.vue
View file @
3022ff4f
...
...
@@ -91,9 +91,19 @@
</el-form-item>
</
template
>
<!-- 帖子 专栏专访 是富文本 需要上传封面图 封面图 -->
<!-- 帖子 专栏专访 是富文本 需要上传封面图 封面图
帖子的封面不必填
-->
<
template
v-else
>
<el-form-item
label=
"封面图"
prop=
"faceUrl"
>
<el-form-item
label=
"封面图"
prop=
"faceUrl"
:rules=
"
form.type === ArticleTypeEnum.POST &&
!userInfo.isOfficialAccount &&
!userInfo.isAdmin
? []
: [
{ required: true, message: '请上传封面图', trigger: 'blur' }]
"
>
<UploadFile
class=
"w-fit"
v-model=
"form.faceUrl"
:limit=
"1"
/>
</el-form-item>
</
template
>
...
...
@@ -365,7 +375,7 @@ const rules: Record<string, FormItemRule[]> = {
title
:
[{
required
:
true
,
message
:
'请输入文章标题'
,
trigger
:
'blur'
}],
content
:
[{
required
:
true
,
message
:
'请输入文章内容'
,
trigger
:
'blur'
}],
type
:
[{
required
:
true
,
message
:
'请选择文章类型'
,
trigger
:
'blur'
}],
faceUrl
:
[{
required
:
true
,
message
:
'请上传封面图'
,
trigger
:
'blur'
}],
//
faceUrl: [{ required: true, message: '请上传封面图', trigger: 'blur' }],
imgUrl
:
[{
required
:
true
,
message
:
'请上传内容图片'
,
trigger
:
'blur'
}],
sendType
:
[{
required
:
true
,
message
:
'请选择发布类型'
,
trigger
:
'blur'
}],
sendTime
:
[
...
...
src/views/questionDetail/index.vue
View file @
3022ff4f
...
...
@@ -264,7 +264,7 @@
/>
<div>
<div
class=
"text-slate-900 text-sm flex items-center gap-2"
>
{{ answer.
hiddenName
}}
{{ answer.
replyUser
}}
<!-- 徽章示例 -->
<!-- <span
v-if="index === 0"
...
...
src/views/userPage/components/selfAnswer.vue
View file @
3022ff4f
...
...
@@ -44,6 +44,9 @@
@
click=
"jumpToArticleDetailPage(
{ type: ArticleTypeEnum.QUESTION, id: item.id })"
>去回复
</el-button
>
<el-button
type=
"warning"
link
@
click=
"handleCancelFollow(item.id)"
>
取消关注
</el-button>
</div>
</div>
</div>
...
...
@@ -70,12 +73,15 @@
</
template
>
<
script
lang=
"ts"
setup
>
import
{
answerQuestionPage
}
from
'@/api'
import
{
answerQuestionPage
,
addOrCancelToAnswerList
}
from
'@/api'
import
{
usePageSearch
}
from
'@/hooks'
import
dayjs
from
'dayjs'
import
{
useNavigation
}
from
'@/hooks'
import
{
ArticleTypeEnum
}
from
'@/constants'
import
{
push
}
from
'notivue'
import
{
useMessageBox
}
from
'@/hooks'
const
{
confirm
}
=
useMessageBox
()
const
{
list
,
loading
,
searchParams
,
total
,
refresh
,
goToPage
,
changePageSize
}
=
usePageSearch
(
answerQuestionPage
,
{
...
...
@@ -83,7 +89,16 @@ const { list, loading, searchParams, total, refresh, goToPage, changePageSize }
},
)
const
{
jumpToArticleDetailPage
}
=
useNavigation
()
const
handleCancelFollow
=
async
(
id
:
number
)
=>
{
await
confirm
({
title
:
'提示'
,
message
:
'确定取消关注该问题吗?'
,
type
:
'warning'
,
})
await
addOrCancelToAnswerList
({
articleId
:
id
})
push
.
success
(
'取消关注成功'
)
refresh
()
}
onActivated
(()
=>
{
refresh
()
})
...
...
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