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
67ae9b57
Commit
67ae9b57
authored
Sep 08, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rule;
parent
0c30393d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
117 deletions
+103
-117
act0915.vue
activity0915/act0915/act0915.vue
+2
-1
ruleModal.vue
activity0915/lottery/components/ruleModal/ruleModal.vue
+38
-3
rulemodal.less
activity0915/lottery/components/ruleModal/rulemodal.less
+36
-4
lottery.vue
activity0915/lottery/lottery.vue
+22
-2
index.js
api/activity0915/index.js
+3
-1
act915Lottery.json
mock/act915Lottery.json
+2
-106
No files found.
activity0915/act0915/act0915.vue
View file @
67ae9b57
...
...
@@ -487,7 +487,8 @@ const handleBannerClick = (index) => {
const handleInvitationAssist = async (incomingCode) => {
try {
console.log('处理助力邀请码:', incomingCode)
const res = await invitationAssist(incomingCode);
const unionId = uni.getStorageSync('unionId');
const res = await invitationAssist(incomingCode,unionId);
if (res && res.success) {
uni.showToast({
title: '助力成功',
...
...
activity0915/lottery/components/ruleModal/ruleModal.vue
View file @
67ae9b57
...
...
@@ -7,8 +7,16 @@
<view
class=
"rulemodal-content"
>
<span
class=
"rulemodalbg"
:style=
"
{ backgroundImage: `url(${$baseUrl}${getImageUrl(config.images.background)})` }">
</span>
<span
class=
"rulemodaltextimg"
:style=
"
{ backgroundImage: `url(${$baseUrl}${getImageUrl(config.images.textImg)})` }">
</span>
<!-- 规则内容区域 - 支持滚动 -->
<view
class=
"rulemodal-text-container"
>
<image
class=
"rulemodaltextimg"
:src=
"`$
{$baseUrl}${getRuleImgUrl()}`"
mode="widthFix"
@load="console.log('规则图片加载成功')"
@error="console.log('规则图片加载失败')">
</image>
</view>
<span
class=
"rulemodalclosebtn"
:style=
"
{ backgroundImage: `url(${$baseUrl}${getImageUrl(config.images.closeBtn)})` }"
@click="handleCloseClick">
</span>
...
...
@@ -18,17 +26,30 @@
<
script
setup
>
import
{
act915RuleModalConfig
,
getImageUrl
}
from
'./config.js'
import
{
getCurrentInstance
}
from
'vue'
// 组件名称
defineOptions
({
name
:
'RuleModal'
})
// 获取全局属性
const
{
proxy
}
=
getCurrentInstance
()
const
$baseUrl
=
proxy
.
$baseUrl
// Props
defineProps
({
const
props
=
defineProps
({
visible
:
{
type
:
Boolean
,
default
:
false
},
rules
:
{
type
:
String
,
default
:
''
},
config
:
{
type
:
Object
,
default
:
()
=>
({})
}
})
...
...
@@ -38,6 +59,20 @@ const emit = defineEmits(['close'])
// 配置对象
const
config
=
act915RuleModalConfig
// 获取规则图片URL
const
getRuleImgUrl
=
()
=>
{
// 优先使用接口返回的 ruleImg
if
(
props
.
config
&&
props
.
config
.
ruleImg
)
{
console
.
log
(
'使用接口返回的 ruleImg:'
,
props
.
config
.
ruleImg
)
return
props
.
config
.
ruleImg
}
// 回退到默认配置
console
.
log
(
'使用默认配置的 textImg:'
,
config
.
images
.
textImg
)
const
defaultUrl
=
getImageUrl
(
config
.
images
.
textImg
)
console
.
log
(
'默认图片URL:'
,
defaultUrl
)
return
defaultUrl
}
// 关闭按钮点击处理
const
handleCloseClick
=
()
=>
{
console
.
log
(
'关闭规则弹窗'
)
...
...
activity0915/lottery/components/ruleModal/rulemodal.less
View file @
67ae9b57
...
...
@@ -10,6 +10,7 @@
display: flex;
align-items: center;
justify-content: center;
overflow: hidden; // 禁用弹窗内的滚动
// 蒙层
.rulemodal-mask {
...
...
@@ -43,15 +44,46 @@
background-position: center;
}
.rulemodaltextimg {
// 规则内容滚动容器
.rulemodal-text-container {
width: 481rpx;
height: 471rpx;
position: absolute;
top: 154rpx;
left: 35rpx;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
overflow-y: auto;
overflow-x: hidden;
z-index: 3;
// 自定义滚动条样式
&::-webkit-scrollbar {
width: 8rpx;
}
&::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 4rpx;
}
&::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.3);
border-radius: 4rpx;
&:hover {
background: rgba(0, 0, 0, 0.5);
}
}
// 规则图片样式
.rulemodaltextimg {
position: relative;
top: 0;
left: 0;
width: 100%;
height: auto;
object-fit: contain;
display: block;
}
}
.rulemodalclosebtn {
...
...
activity0915/lottery/lottery.vue
View file @
67ae9b57
...
...
@@ -85,7 +85,7 @@
<span
class=
"lotterypagelefttimes"
>
剩余次数:
{{
remainingTimes
}}
</span>
<!-- 规则弹窗 -->
<RuleModal
:visible=
"showRuleModal"
:rules=
"activityRules"
@
close=
"handleRuleModalClose"
/>
<RuleModal
:visible=
"showRuleModal"
:rules=
"activityRules"
:config=
"ruleModalConfig"
@
close=
"handleRuleModalClose"
/>
<!-- 抽奖成功弹窗 -->
<DrawSucModal
:visible=
"showDrawSucModal"
:award-name=
"currentAwardName"
@
close=
"handleDrawSucModalClose"
...
...
@@ -102,7 +102,7 @@ import { lotteryConfig, getImageUrl } from './config.js'
import
RuleModal
from
'./components/ruleModal/ruleModal.vue'
import
DrawSucModal
from
'./components/drawSucModal/drawSucModal.vue'
import
DrawFailModal
from
'./components/drawFailModal/drawFailModal.vue'
import
{
getAct915LotteryDraw
,
getAct915LotteryInfo
}
from
'../../api/activity0915/index.js'
import
{
getAct915LotteryDraw
,
getAct915LotteryInfo
,
fetchAct915LotteryJSON
}
from
'../../api/activity0915/index.js'
// 组件名称
defineOptions
({
...
...
@@ -117,6 +117,7 @@ const turntablePrizes = ref([]) // 转盘奖品列表
const
winningCarousel
=
ref
([])
// 中奖轮播列表
const
userWinningPrizes
=
ref
([])
// 用户中奖记录
const
currentNoticeIndex
=
ref
(
0
)
// 当前公告索引
const
ruleModalConfig
=
ref
({})
// 规则弹窗配置
const
carouselTimer
=
ref
(
null
)
// 轮播定时器
const
activityRules
=
ref
(
''
)
// 活动规则内容
const
isDrawing
=
ref
(
false
)
// 是否正在抽奖
...
...
@@ -258,6 +259,24 @@ const handleAwardClick = () => {
// 加载规则弹窗配置
const
loadRuleModalConfig
=
async
()
=>
{
try
{
console
.
log
(
'开始请求 fetchAct915LotteryJSON 接口...'
)
const
response
=
await
fetchAct915LotteryJSON
()
console
.
log
(
'fetchAct915LotteryJSON 接口返回结果:'
,
response
)
if
(
response
&&
response
.
ok
&&
response
.
data
)
{
ruleModalConfig
.
value
=
response
.
data
console
.
log
(
'规则弹窗配置加载成功:'
,
ruleModalConfig
.
value
)
}
else
{
console
.
warn
(
'规则弹窗配置接口返回异常:'
,
response
)
}
}
catch
(
error
)
{
console
.
error
(
'fetchAct915LotteryJSON 接口请求失败:'
,
error
)
}
}
// 加载抽奖信息
const
loadLotteryInfo
=
async
()
=>
{
try
{
...
...
@@ -482,6 +501,7 @@ const handleIKnow = () => {
// 生命周期
onMounted
(()
=>
{
console
.
log
(
'抽奖页面已加载'
)
loadRuleModalConfig
()
// 先加载规则弹窗配置
loadLotteryInfo
()
})
...
...
api/activity0915/index.js
View file @
67ae9b57
...
...
@@ -11,7 +11,7 @@ export const getAct915Home = () => api.post('/c/activity/use_invite_915/invitati
* 邀请助力
* @returns
*/
export
const
invitationAssist
=
(
inviterUserId
)
=>
api
.
post
(
'/c/activity/use_invite_915/invitation/assist'
,
{
inviterUser
Id
})
export
const
invitationAssist
=
(
inviterUserId
,
unionId
)
=>
api
.
post
(
'/c/activity/use_invite_915/invitation/assist'
,
{
invitationCode
:
inviterUserId
,
wxUnionId
:
union
Id
})
/**
* 获取抽奖信息
...
...
@@ -26,3 +26,5 @@ export const getAct915LotteryInfo = () => api.get('/c/activity/turntable_lottery
export
const
getAct915LotteryDraw
=
()
=>
api
.
post
(
'/c/activity/turntable_lottery_915/lottery/draw'
)
export
const
fetchAct915JSON
=
()
=>
api
.
get
(
'/c/front/content'
,
{
type
:
'act915'
,
version
:
'1'
})
export
const
fetchAct915LotteryJSON
=
()
=>
api
.
get
(
'/c/front/content'
,
{
type
:
'act915Lottery'
,
version
:
'1'
})
mock/act915Lottery.json
View file @
67ae9b57
{
"ok"
:
true
,
"success"
:
true
,
"msg"
:
"Request successful"
,
"code"
:
"SUCCESS"
,
"data"
:
{
"activityRules"
:
"1. 活动期间,每位用户每天有一次抽奖机会。
\n
2. 抽奖结果以页面显示为准。
\n
3. 奖品将在活动结束后统一发放。"
,
"remainingChances"
:
3
,
"turntablePrizes"
:
[
{
"prizeId"
:
1001
,
"prizeName"
:
"一等奖 - 飞鹤奶粉"
,
"prizeImageUrl"
:
"/images/prizes/prize1.png"
,
"prizeType"
:
"Physical"
,
"prizeDescription"
:
"飞鹤星飞帆幼儿配方奶粉 1段 800g"
,
"displayProbability"
:
"0.1%"
,
"remainingStock"
:
5
},
{
"prizeId"
:
1002
,
"prizeName"
:
"二等奖 - 婴儿推车"
,
"prizeImageUrl"
:
"/images/prizes/prize2.png"
,
"prizeType"
:
"Physical"
,
"prizeDescription"
:
"高端婴儿推车,适合0-3岁宝宝"
,
"displayProbability"
:
"0.5%"
,
"remainingStock"
:
10
},
{
"prizeId"
:
1003
,
"prizeName"
:
"三等奖 - 玩具套装"
,
"prizeImageUrl"
:
"/images/prizes/prize3.png"
,
"prizeType"
:
"Physical"
,
"prizeDescription"
:
"益智玩具套装,适合幼儿"
,
"displayProbability"
:
"1%"
,
"remainingStock"
:
20
},
{
"prizeId"
:
1004
,
"prizeName"
:
"四等奖 - 优惠券50元"
,
"prizeImageUrl"
:
"/images/prizes/prize4.png"
,
"prizeType"
:
"Digital"
,
"prizeDescription"
:
"飞鹤商城50元优惠券"
,
"displayProbability"
:
"5%"
,
"remainingStock"
:
100
},
{
"prizeId"
:
1005
,
"prizeName"
:
"五等奖 - 积分100分"
,
"prizeImageUrl"
:
"/images/prizes/prize5.png"
,
"prizeType"
:
"Digital"
,
"prizeDescription"
:
"可用于兑换商城商品的积分"
,
"displayProbability"
:
"10%"
,
"remainingStock"
:
500
},
{
"prizeId"
:
1006
,
"prizeName"
:
"六等奖 - 谢谢参与"
,
"prizeImageUrl"
:
"/images/prizes/prize6.png"
,
"prizeType"
:
"None"
,
"prizeDescription"
:
"未中奖,再接再厉"
,
"displayProbability"
:
"83.4%"
,
"remainingStock"
:
9999
}
],
"winningCarousel"
:
[
{
"userNickname"
:
"用户123****4567"
,
"prizeName"
:
"飞鹤奶粉"
,
"winningTime"
:
"刚刚"
},
{
"userNickname"
:
"用户789****0123"
,
"prizeName"
:
"婴儿推车"
,
"winningTime"
:
"5分钟前"
},
{
"userNickname"
:
"用户456****7890"
,
"prizeName"
:
"优惠券50元"
,
"winningTime"
:
"10分钟前"
}
],
"userWinningPrizes"
:
[
{
"winningRecordId"
:
5001
,
"prizeId"
:
1004
,
"prizeName"
:
"优惠券50元"
,
"prizeImageUrl"
:
"/images/prizes/prize4.png"
,
"prizeType"
:
"Digital"
,
"prizeDescription"
:
"飞鹤商城50元优惠券"
,
"isIssued"
:
true
,
"winningTime"
:
"2023-09-15 10:30:45"
,
"issueTime"
:
"2023-09-15 10:31:00"
},
{
"winningRecordId"
:
5002
,
"prizeId"
:
1005
,
"prizeName"
:
"积分100分"
,
"prizeImageUrl"
:
"/images/prizes/prize5.png"
,
"prizeType"
:
"Digital"
,
"prizeDescription"
:
"可用于兑换商城商品的积分"
,
"isIssued"
:
true
,
"winningTime"
:
"2023-09-14 15:22:10"
,
"issueTime"
:
"2023-09-14 15:22:30"
}
]
}
}
\ No newline at end of file
"ruleImg"
:
"LotteryPage/v1/LotteryPageBg.png"
}
\ No newline at end of file
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