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
81132273
Commit
81132273
authored
Nov 10, 2025
by
spc
Browse files
Options
Browse Files
Download
Plain Diff
fixed
parents
a22c624c
90fb9427
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
692 additions
and
361 deletions
+692
-361
home.js
api/home.js
+2
-0
ActivitySelectedPopup.vue
components/ActivitySelectedPopup.vue
+269
-0
index.vue
pages/index/index.vue
+418
-354
My.vue
views/My.vue
+3
-7
No files found.
api/home.js
View file @
81132273
...
...
@@ -13,3 +13,5 @@ export const fetchCanEatJoin = (data) => api.post('/c/eat/join', data);
export
const
fetchHomeJSON
=
(
type
=
'home_V1'
)
=>
api
.
get
(
'/c/front/content'
,
{
type
});
export
const
fetchGameActConfigJSON
=
()
=>
api
.
get
(
'/c/front/content'
,
{
type
:
'gameActConfig'
});
export
const
fetchUserClickActivity
=
(
data
)
=>
api
.
post
(
'/c/user/clickActivity'
,
data
);
components/ActivitySelectedPopup.vue
0 → 100644
View file @
81132273
<
template
>
<view
v-if=
"visible"
class=
"activity-selected-popup"
@
tap=
"handleMaskClick"
>
<!-- 背景遮罩 -->
<view
class=
"popup-mask"
></view>
<!-- 弹窗容器 -->
<view
class=
"popup-wrapper"
:style=
"popupStyle"
>
<!-- 背景底 -->
<view
class=
"popup-background"
></view>
<!-- 弹窗内容 -->
<view
class=
"popup-content"
@
tap
.
stop
>
<!-- 标题 -->
<view
class=
"popup-title"
>
恭喜你入选啦!
</view>
<!-- 活动列表 -->
<scroll-view
v-if=
"activityList.length > 3"
class=
"activity-scroll"
scroll-y
:scroll-top=
"scrollTop"
>
<view
v-for=
"(activity, index) in activityList"
:key=
"index"
class=
"activity-item"
>
<text
class=
"activity-text"
>
已入选
{{
activity
.
name
||
''
}}
</text>
<view
class=
"activity-btn"
:class=
"
{ disabled: activity.disabled }"
@tap="handleViewActivity(activity, index)"
>
查看活动
</view>
</view>
</scroll-view>
<view
v-else
class=
"activity-list"
>
<view
v-for=
"(activity, index) in activityList"
:key=
"index"
class=
"activity-item"
>
<text
class=
"activity-text"
>
已入选
{{
activity
.
name
||
''
}}
</text>
<view
class=
"activity-btn"
:class=
"
{ disabled: activity.disabled }"
@tap="handleViewActivity(activity, index)"
>
查看活动
</view>
</view>
</view>
</view>
</view>
<!-- 关闭按钮 -->
<view
class=
"close-btn"
@
tap=
"handleClose"
>
<text
class=
"close-icon"
>
×
</text>
</view>
</view>
</
template
>
<
script
setup
>
import
{
computed
,
ref
}
from
'vue'
import
{
fetchUserClickActivity
}
from
'../api/home'
const
props
=
defineProps
({
visible
:
{
type
:
Boolean
,
default
:
false
},
activityList
:
{
type
:
Array
,
default
:
()
=>
[]
}
})
const
emit
=
defineEmits
([
'close'
,
'viewActivity'
])
const
scrollTop
=
ref
(
0
)
// 根据活动数量动态计算弹窗高度
const
popupStyle
=
computed
(()
=>
{
const
count
=
props
.
activityList
.
length
let
height
=
320
// 默认高度(1个活动)160px * 2
if
(
count
===
2
)
{
height
=
420
// 210px * 2
}
else
if
(
count
>=
3
)
{
height
=
520
// 260px * 2,超过3个时内容区域可滚动
}
return
{
height
:
height
+
'rpx'
}
})
// 查看活动
const
handleViewActivity
=
async
(
activity
,
index
)
=>
{
if
(
activity
.
disabled
)
{
return
}
// 调用接口,传单个 activityId
if
(
activity
.
id
)
{
try
{
await
fetchUserClickActivity
({
activityIds
:
[
activity
.
id
]
})
console
.
log
(
'点击活动接口调用成功:'
,
activity
.
id
)
}
catch
(
error
)
{
console
.
error
(
'点击活动接口调用失败:'
,
error
)
}
}
emit
(
'viewActivity'
,
activity
,
index
)
}
// 关闭弹窗
const
handleClose
=
async
()
=>
{
// 调用接口,传所有 activityIds
const
activityIds
=
props
.
activityList
.
filter
(
activity
=>
activity
.
id
)
.
map
(
activity
=>
activity
.
id
)
if
(
activityIds
.
length
>
0
)
{
try
{
await
fetchUserClickActivity
({
activityIds
:
activityIds
})
console
.
log
(
'关闭弹窗接口调用成功:'
,
activityIds
)
}
catch
(
error
)
{
console
.
error
(
'关闭弹窗接口调用失败:'
,
error
)
}
}
emit
(
'close'
)
}
// 点击遮罩层
const
handleMaskClick
=
(
e
)
=>
{
if
(
e
.
target
===
e
.
currentTarget
)
{
handleClose
()
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.activity-selected-popup {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
}
.popup-mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}
.popup-wrapper {
position: relative;
width: 546rpx;
flex-shrink: 0;
border-radius: 38rpx;
z-index: 1;
}
/* 背景底 */
.popup-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 38rpx;
background: linear-gradient(180deg, #FFE9C5 0%, #FFF 52.87%);
z-index: 0;
}
.popup-content {
position: relative;
width: 100%;
height: 100%;
padding: 60rpx 40rpx 40rpx 40rpx;
box-sizing: border-box;
z-index: 1;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
color: #FFA500;
text-align: center;
margin-bottom: 40rpx;
}
.activity-scroll {
max-height: 360rpx;
height: 360rpx;
}
.activity-list {
display: flex;
flex-direction: column;
gap: 30rpx;
}
.activity-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 0;
}
.activity-text {
font-size: 28rpx;
color: #333333;
flex: 1;
}
.activity-btn {
padding: 12rpx 32rpx;
background: linear-gradient(180deg, #FFA500 0%, #FF8C00 100%);
border-radius: 30rpx;
color: #FFFFFF;
font-size: 24rpx;
text-align: center;
min-width: 140rpx;
}
.activity-btn.disabled {
background: #E0E0E0;
color: #999999;
}
.close-btn {
position: absolute;
bottom: -80rpx;
left: 50%;
transform: translateX(-50%);
width: 60rpx;
height: 60rpx;
background-color: #FFFFFF;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
}
.close-icon {
font-size: 40rpx;
color: #666666;
line-height: 1;
}
</
style
>
pages/index/index.vue
View file @
81132273
This diff is collapsed.
Click to expand it.
views/My.vue
View file @
81132273
...
...
@@ -205,13 +205,9 @@
mode=
"aspectFit"
/>
<!-- || item.title == '产检提醒' || item.title == '喂养记录' || item.title == '生长测评' -->
<button
v-if=
"item.title == '医生问诊' && !cfgStatus.isRegister"
class=
"tool-btn-register"
type=
"primary"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getRealtimePhoneNumber"
/>
<button
v-if=
"(item.title == '医生问诊' || item.title == '会员活动') && !cfgStatus.isRegister"
class=
"tool-btn-register"
type=
"primary"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getRealtimePhoneNumber"
/>
</view>
</
template
>
</view>
...
...
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