Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
1e7f1e03
Commit
1e7f1e03
authored
Oct 13, 2025
by
劳琪峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 未登录处理
parent
69f84a38
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
16 deletions
+43
-16
ClickArea.vue
activities/1015/components/ClickArea.vue
+5
-2
InviteTask.vue
activities/1015/components/InviteTask.vue
+9
-6
home.vue
activities/1015/home.vue
+22
-7
mock-configs.js
activities/1015/mock-configs.js
+2
-1
user.js
stores/user.js
+5
-0
No files found.
activities/1015/components/ClickArea.vue
View file @
1e7f1e03
...
...
@@ -9,8 +9,10 @@ const props = defineProps<{
area
?:
{
x
:
number
,
y
:
number
,
width
:
number
,
height
:
number
}
link
?:
{
type
:
number
,
url
:
string
,
extra
:
any
}
mdConfig
?:
MdConfig
needLogin
?:
boolean
}
openType
?:
string
isLogin
?:
boolean
debugMode
?:
boolean
}
>
()
...
...
@@ -36,7 +38,7 @@ const emit = defineEmits<{
function
onClick
(
e
)
{
emit
(
'click'
,
e
)
if
(
props
.
properties
.
link
)
{
if
(
(
!
props
.
properties
.
needLogin
||
props
.
isLogin
)
&&
props
.
properties
.
link
)
{
jump
(
props
.
properties
.
link
)
}
logClick
()
...
...
@@ -46,7 +48,7 @@ function onClick(e) {
<
template
>
<button
class=
"click-area"
:class=
"
{'debug-mode': debugMode}" :style="style"
:open-type="openType"
:open-type="openType
?? (properties.needLogin
&&
!isLogin ? 'getPhoneNumber' : undefined)
"
@click="onClick"
@getphonenumber="(e) => emit('getphonenumber', e)"
/>
...
...
@@ -57,6 +59,7 @@ function onClick(e) {
position: absolute;
border: none;
border-radius: 0;
background-color: transparent;
&.debug-mode {
background-color: rgba(255, 0, 0, 0.3);
...
...
activities/1015/components/InviteTask.vue
View file @
1e7f1e03
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
,
inject
,
onMounted
}
from
'vue'
import
{
ref
,
computed
,
inject
,
onMounted
,
watch
}
from
'vue'
import
ClickArea
from
"./ClickArea.vue"
;
import
{
InvitationInfo
}
from
"../types"
import
{
getCdnUrl
}
from
"../utils"
...
...
@@ -18,13 +18,10 @@ const props = defineProps<{
area
?:
{
x
:
number
,
y
:
number
,
width
:
number
,
height
:
number
}
mdConfig
?:
MdConfig
}
isLogin
?:
boolean
debugMode
?:
boolean
}
>
()
const
isLogin
=
computed
(()
=>
{
return
!
invitationInfo
.
value
?.
notLogin
})
const
style
=
computed
(()
=>
{
const
area
=
props
.
properties
.
area
return
{
...
...
@@ -54,7 +51,7 @@ async function tryAssist() {
const
options
=
currentPage
.
options
;
const
invitationCode
=
options
.
invitationCode
;
if
(
invitationCode
&&
!
isAssist
.
value
&&
isLogin
.
value
)
{
if
(
invitationCode
&&
!
isAssist
.
value
&&
props
.
isLogin
)
{
console
.
log
(
'处理助力邀请码:'
,
invitationCode
)
try
{
...
...
@@ -92,6 +89,12 @@ async function tryAssist() {
}
}
watch
(()
=>
props
.
isLogin
,
async
(
newVal
)
=>
{
if
(
newVal
)
{
await
updateInvitationInfo
()
}
})
onMounted
(
async
()
=>
{
await
updateInvitationInfo
()
...
...
activities/1015/home.vue
View file @
1e7f1e03
...
...
@@ -10,16 +10,21 @@
<ImageSwiper
v-if=
"component.type === 'image-swiper'"
v-bind=
"component"
:is-login=
"isLogin"
:debug-mode=
"DEBUG_MODE"
/>
<ClickArea
v-else-if=
"component.type === 'click-area'"
v-bind=
"component"
debug-mode
:is-login=
"isLogin"
@
getphonenumber=
"onGetPhoneNumber"
:debug-mode=
"DEBUG_MODE"
/>
<InviteTask
v-else-if=
"component.type === 'invite-task'"
v-bind=
"component"
:debug-mode=
"true"
:is-login=
"isLogin"
:debug-mode=
"DEBUG_MODE"
/>
</
template
>
</view>
...
...
@@ -29,12 +34,13 @@
<
script
setup
lang=
"ts"
>
import
{
ref
,
onMounted
,
computed
,
getCurrentInstance
,
provide
}
from
'vue'
import
{
fetchPageConfig
}
from
'./api.ts'
import
{
useHomeStore
}
from
'@/stores/home'
;
// Assuming homeStore path
import
{
useUserStore
}
from
'@/stores/user'
;
// Import userStore
import
{
useUserStore
}
from
'@/stores/user'
;
import
ClickArea
from
"./components/ClickArea.vue"
;
import
ImageSwiper
from
"./components/ImageSwiper.vue"
;
import
InviteTask
from
"./components/InviteTask.vue"
;
const
DEBUG_MODE
=
false
// 响应式数据
const
pageConfig
=
ref
({})
// 配置对象
const
loading
=
ref
(
true
)
// 加载状态
...
...
@@ -47,9 +53,13 @@ const shareData = ref({
})
// 获取store实例
const
homeStore
=
useHomeStore
();
const
userStore
=
useUserStore
();
const
isLogin
=
computed
(()
=>
{
//return false
return
userStore
.
isLogin
})
function
updateShareData
(
data
)
{
Object
.
assign
(
shareData
.
value
,
data
)
}
...
...
@@ -137,6 +147,9 @@ const updatePageConfig = async () => {
const initPage = async () => {
console.log('开始初始化页面...')
await Promise.all([
userStore.loadUserInfo(),
])
// 获取页面配置
await updatePageConfig()
...
...
@@ -184,8 +197,10 @@ const onGetPhoneNumber = async (e) => {
// 隐藏授权弹窗
userStore.phoneCallback(e.detail, null, null, async () => {
// 重新获取用户信息(登录后)
// todo 更新组件状态
await new Promise.all([
userStore.loadUserInfo(),
userStore.loadMemberInfo(),
])
console.warn('授权后重新获取用户信息')
}, {
wxLoginBusinessDTO: {
...
...
activities/1015/mock-configs.js
View file @
1e7f1e03
...
...
@@ -12,7 +12,7 @@ export function homeConfig(){
}
},
shareConfig
:
{
title
:
'星妈会超级品牌周来啦!'
,
title
:
'星妈会超级品牌周来啦!
北纬47°六水香大米上新!
'
,
path
:
'/activities/1015/home'
,
imageUrl
:
'https://course.feihe.com/momclub-picture/Act915Page/v2/act915ShareImg.png'
,
},
...
...
@@ -170,6 +170,7 @@ export function homeConfig(){
"type"
:
1
,
"url"
:
"/activities/1015/lottery/index"
},
"needLogin"
:
true
,
},
},
{
...
...
stores/user.js
View file @
1e7f1e03
...
...
@@ -29,6 +29,11 @@ export const useUserStore = defineStore("userInfo", {
babyNickCache
:
[],
cepingjieguoInfo
:
null
,
};
},
getters
:
{
isLogin
:
(
state
)
=>
{
return
state
.
userInfo
?.
memberId
!==
"not_login"
}
},
actions
:
{
/**
...
...
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