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
e0b861e4
Commit
e0b861e4
authored
Oct 19, 2025
by
王炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签到接口对接,任务项执行
parent
0ff8a1d9
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
654 additions
and
87 deletions
+654
-87
integral.js
api/integral.js
+7
-1
request.js
api/request.js
+2
-1
GongzhonghaoPop.less
components/renwu/GongzhonghaoPop.less
+110
-0
GongzhonghaoPop.vue
components/renwu/GongzhonghaoPop.vue
+74
-0
TaskPerson.less
components/renwu/TaskPerson.less
+6
-0
TaskPerson.vue
components/renwu/TaskPerson.vue
+19
-3
TaskPop.less
components/renwu/TaskPop.less
+7
-3
TaskPop.vue
components/renwu/TaskPop.vue
+17
-53
checkIndata.json
mock/checkIndata.json
+9
-0
getSigninAndTaskInMock.json
mock/getSigninAndTaskInMock.json
+155
-0
integral.js
stores/integral.js
+40
-0
Integral.vue
views/Integral.vue
+208
-26
No files found.
api/integral.js
View file @
e0b861e4
...
...
@@ -29,4 +29,10 @@ export const fetchBatchReceiveJSON = () => api.post('/c/equity/birthdayGift/batc
export
const
fetchActivityStateJSON
=
()
=>
api
.
get
(
'/c/third/activity/state'
);
//获取配置项和商品列表
export
const
getResourceList
=
()
=>
api
.
get
(
'c/resource/list'
);
\ No newline at end of file
export
const
getResourceList
=
()
=>
api
.
get
(
'/c/resource/list'
);
//获取签到和任务信息接口
export
const
getSigninAndTaskInfoJSON
=
()
=>
api
.
get
(
'/c/activity/todo/list'
);
//签到接口
export
const
checkInJSON
=
(
activityId
)
=>
api
.
post
(
'/c/activity/todo/checkIn'
,
{
activityId
});
\ No newline at end of file
api/request.js
View file @
e0b861e4
...
...
@@ -17,7 +17,8 @@ const {
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.230.108:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
let
baseUrl
=
"https://momclub.feihe.com/pmall"
;
//生产环境
const
baseUrl
=
"https://momclub-test.feihe.com/pmall"
;
// let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
// const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
...
...
components/renwu/GongzhonghaoPop.less
0 → 100644
View file @
e0b861e4
.gongzhonghao_pop_overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: flex-end;
justify-content: center;
z-index: 9999;
.gongzhonghao_pop_container {
width: 100%;
height: 812rpx;
background: #ffffff;
border-radius: 24rpx 24rpx 0 0;
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.1);
overflow: hidden;
animation: slideUp 0.3s ease-out;
.pop_header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 30rpx 0rpx 30rpx;
// border-bottom: 1rpx solid #f0f0f0;
.pop_title {
font-size: 36rpx;
font-weight: bold;
color: #1D1E25;
}
.close_button {
width: 70rpx;
height: 70rpx;
display: flex;
align-items: center;
justify-content: center;
.close_icon {
font-size: 50rpx;
color: #999999;
font-weight: bold;
line-height: 1;
}
}
}
.pop_content {
padding: 30rpx 40rpx 60rpx 40rpx;
display: flex;
flex-direction: column;
align-items: center;
.description_text {
font-size: 28rpx;
color: #6F6D67; ;
text-align: center;
line-height: 1.5;
margin-bottom: 60rpx;
// padding: 0 20rpx;
}
.qr_code_container {
width: 340rpx;
height: 340rpx;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 60rpx;
// padding: 30rpx;
.qr_code_img {
width: 100%;
height: 100%;
}
}
.download_button {
width: 286rpx;
height: 89rpx;
// align-items: center;
// justify-content: center;
// flex-direction: row;
.download_icon {
width: 100%;
height: 100%;
}
// .download_text {
// font-size: 28rpx;
// color: #666666;
// }
}
}
}
}
@keyframes slideUp {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
components/renwu/GongzhonghaoPop.vue
0 → 100644
View file @
e0b861e4
<
template
>
<view
class=
"gongzhonghao_pop_overlay"
v-if=
"visible"
@
click=
"handleClose"
>
<view
class=
"gongzhonghao_pop_container"
@
click
.
stop
>
<!-- 弹窗头部 -->
<view
class=
"pop_header"
>
<text
class=
"pop_title"
>
{{
props
.
title
}}
</text>
<view
class=
"close_button"
@
click=
"handleClose"
>
<text
class=
"close_icon"
>
×
</text>
</view>
</view>
<!-- 弹窗内容 -->
<view
class=
"pop_content"
>
<text
class=
"description_text"
>
{{
props
.
description
}}
</text>
<!-- 二维码区域 -->
<view
class=
"qr_code_container"
>
<image
class=
"qr_code_img"
:src=
"props.qrCodeUrl"
mode=
"aspectFit"
/>
</view>
<!-- 下载二维码按钮 -->
<view
class=
"download_button"
@
click=
"handleDownload"
>
<image
class=
"download_icon"
src=
"https://course.feihe.com/momclub-picture/homepage/btn_download.png"
mode=
"aspectFit"
/>
<!--
<text
class=
"download_text"
>
下载二维码
</text>
-->
</view>
</view>
</view>
</view>
</
template
>
<
script
setup
>
import
{
defineProps
,
defineEmits
}
from
'vue'
;
// Props 定义
const
props
=
defineProps
({
visible
:
{
type
:
Boolean
,
default
:
false
},
title
:
{
type
:
String
,
default
:
'公众号'
},
description
:
{
type
:
String
,
default
:
'长按关注星妈会公众号,了解更多专业育儿资讯'
},
qrCodeUrl
:
{
type
:
String
,
default
:
'https://course.feihe.com/momclub-picture/homepage/qrcode_gzh.png'
}
});
// Emits 定义
const
emit
=
defineEmits
([
'close'
,
'download'
]);
// 关闭弹窗
const
handleClose
=
()
=>
{
emit
(
'close'
);
};
// 下载二维码
const
handleDownload
=
()
=>
{
emit
(
'download'
,
props
.
title
);
};
</
script
>
<
style
lang=
"less"
scoped
>
@import '@/components/renwu/GongzhonghaoPop.less';
</
style
>
components/renwu/TaskPerson.less
View file @
e0b861e4
...
...
@@ -181,6 +181,11 @@
font-size: 24rpx;
color: #666666;
line-height: 1.4;
.agreement_link {
// color: #D3A458;
// text-decoration: underline;
}
}
}
}
...
...
@@ -195,6 +200,7 @@
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 50rpx;
border: none;
outline: none;
...
...
components/renwu/TaskPerson.vue
View file @
e0b861e4
...
...
@@ -104,11 +104,11 @@
</view>
<view
class=
"agreement_section"
>
<view
class=
"agreement_checkbox"
@
click=
"toggleAgreement"
>
<view
class=
"checkbox"
:class=
"
{ checked: agreementChecked }">
<view
class=
"agreement_checkbox"
>
<view
class=
"checkbox"
:class=
"
{ checked: agreementChecked }"
@click="toggleAgreement"
>
<text
v-if=
"agreementChecked"
class=
"checkmark"
>
✓
</text>
</view>
<text
class=
"agreement_text"
>
我已阅读并同意
《星妈会用户注册协议》《星妈会隐私政策》
</text>
<text
class=
"agreement_text"
>
我已阅读并同意
<text
class=
"agreement_link"
@
click=
"handleAgreementClick('member')"
>
《星妈会用户注册协议》
</text><text
class=
"agreement_link"
@
click=
"handleAgreementClick('privacy')"
>
《星妈会隐私政策》
</text>
</text>
</view>
</view>
...
...
@@ -564,6 +564,22 @@ const toggleAgreement = () => {
agreementChecked
.
value
=
!
agreementChecked
.
value
;
};
// 协议点击事件处理
const
handleAgreementClick
=
(
type
)
=>
{
console
.
log
(
'点击协议:'
,
type
);
if
(
type
===
"member"
)
{
jump
({
type
:
JumpType
.
INNER
,
url
:
"/pages/webview/webview?type=MEMBER_URL"
});
}
else
if
(
type
===
"privacy"
)
{
jump
({
type
:
JumpType
.
INNER
,
url
:
"/pages/webview/webview?type=PRIVACY_URL"
});
}
};
function
onDateStatusChange
(
status
)
{
if
(
pageType
.
value
===
"edit"
&&
status
<
userStore
.
babyInfo
.
babyStage
)
{
uni
.
showToast
({
...
...
components/renwu/TaskPop.less
View file @
e0b861e4
...
...
@@ -79,8 +79,9 @@
margin-right: 20rpx;
.icon_img {
width: 50rpx;
height: 50rpx;
width: 100%;
height: 100%;
border-radius: 50%;
}
}
...
...
@@ -118,13 +119,16 @@
font-weight: 500;
}
&:active {
// 只有非已完成状态的按钮才有点击效果
&:not(.completed):active {
transform: scale(0.95);
}
&.completed {
background: #F6DEB7;
// border: 1rpx solid #d4a468;
// 已完成状态不添加点击效果
transition: none;
.task_button_text {
color: #ffffff;
...
...
components/renwu/TaskPop.vue
View file @
e0b861e4
...
...
@@ -13,26 +13,26 @@
<view
class=
"task_list"
>
<view
class=
"task_item"
v-for=
"(task, index) in
taskList
"
v-for=
"(task, index) in
props.taskTodo
"
:key=
"index"
>
<view
class=
"task_icon"
>
<image
class=
"icon_img"
:src=
"task.icon"
:src=
"task
?.taskTodoExtra?
.icon"
mode=
"aspectFit"
/>
</view>
<view
class=
"task_content"
>
<text
class=
"task_title"
>
{{
task
.
title
}}
</text>
<text
class=
"task_points"
>
积分+
{{
task
.
poin
ts
}}
</text>
<text
class=
"task_title"
>
{{
task
?.
taskTodoExtra
?
.
title
}}
</text>
<text
class=
"task_points"
>
积分+
{{
task
?.
taskTodoExtra
?.
credi
ts
}}
</text>
</view>
<view
class=
"task_button"
:class=
"
{ completed: task
.completed
}"
:class=
"
{ completed: task
?.taskTodoExtra?.status == '3'
}"
@click="handleTaskClick(task, index)"
>
<text
class=
"task_button_text"
>
{{
task
.
completed
?
'已完成'
:
'去完成'
}}
</text>
<text
class=
"task_button_text"
>
{{
task
?.
taskTodoExtra
?.
status
==
'3'
?
'已完成'
:
'去完成'
}}
</text>
</view>
</view>
</view>
...
...
@@ -49,70 +49,34 @@
</
template
>
<
script
setup
>
import
{
defineProps
,
defineEmits
,
ref
}
from
'vue'
;
import
{
defineProps
,
defineEmits
,
ref
,
onMounted
,
watch
}
from
'vue'
;
import
TaskCompleteTips
from
'./TaskCompleteTips.vue'
;
import
{
useIntegralStore
}
from
'../../stores/integral'
;
// Props 定义
const
props
=
defineProps
({
visible
:
{
type
:
Boolean
,
default
:
false
},
taskTodo
:
{
type
:
Array
,
default
:
()
=>
[]
}
});
// Emits 定义
const
emit
=
defineEmits
([
'close'
,
'taskClick'
]);
const
integralStore
=
useIntegralStore
();
// 任务完成提示弹窗状态
const
showTaskCompleteTips
=
ref
(
false
);
const
currentTaskPoints
=
ref
(
0
);
const
currentTaskTitle
=
ref
(
''
);
// 任务列表数据
const
taskList
=
[
{
id
:
1
,
title
:
'完善信息'
,
points
:
20
,
icon
:
'/static/images/task_info.png'
,
completed
:
false
},
{
id
:
2
,
title
:
'邀请好友'
,
points
:
20
,
icon
:
'/static/images/task_invite.png'
,
completed
:
false
},
{
id
:
3
,
title
:
'浏览星妈优选商城'
,
points
:
20
,
icon
:
'/static/images/task_browse.png'
,
completed
:
false
},
{
id
:
4
,
title
:
'完成首单优选消费'
,
points
:
20
,
icon
:
'/static/images/task_browse.png'
,
completed
:
false
},
{
id
:
5
,
title
:
'关注公众号'
,
points
:
20
,
icon
:
'/static/images/task_follow.png'
,
completed
:
true
},
{
id
:
6
,
title
:
'添加企业微信'
,
points
:
20
,
icon
:
'/static/images/task_wechat.png'
,
completed
:
false
}
];
const
taskList
=
ref
([]);
// 关闭弹窗
const
handleClose
=
()
=>
{
...
...
@@ -121,9 +85,9 @@ const handleClose = () => {
// 任务点击事件
const
handleTaskClick
=
(
task
,
index
)
=>
{
if
(
task
.
completed
)
{
if
(
task
?.
taskTodoExtra
?.
status
===
'3'
)
{
// 已完成的任务不触发跳转
console
.
log
(
'任务已完成:'
,
task
.
title
);
console
.
log
(
'任务已完成:'
,
task
?.
taskTodoExtra
?
.
title
);
return
;
}
...
...
mock/checkIndata.json
0 → 100644
View file @
e0b861e4
{
"code"
:
"dolor ut labore aliqua"
,
"message"
:
"ea deserunt"
,
"ok"
:
true
,
"success"
:
true
,
"data"
:
{
"credits"
:
"50"
}
}
mock/getSigninAndTaskInMock.json
0 → 100644
View file @
e0b861e4
{
"ok"
:
true
,
"success"
:
true
,
"msg"
:
"获取签到任务成功"
,
"code"
:
"200"
,
"data"
:
{
"checkInTodo"
:
{
"id"
:
1
,
"name"
:
"每日签到"
,
"checkInExtra"
:
{
"rule"
:
"连续签到7天可获得额外奖励"
,
"type"
:
"daily_checkin"
,
"taskCode"
:
"CHECKIN_001"
,
"taskId"
:
"checkin_daily_001"
,
"joinRecord"
:
[
{
"index"
:
1
,
"joined"
:
true
,
"credits"
:
10
,
"coefficient"
:
0
,
"today"
:
false
},
{
"index"
:
2
,
"joined"
:
true
,
"credits"
:
10
,
"coefficient"
:
0
,
"today"
:
false
},
{
"index"
:
3
,
"joined"
:
true
,
"credits"
:
10
,
"coefficient"
:
1
,
"today"
:
true
},
{
"index"
:
4
,
"joined"
:
false
,
"credits"
:
10
,
"coefficient"
:
1
,
"today"
:
false
},
{
"index"
:
5
,
"joined"
:
false
,
"credits"
:
10
,
"coefficient"
:
1
,
"today"
:
false
},
{
"index"
:
6
,
"joined"
:
false
,
"credits"
:
10
,
"coefficient"
:
1
,
"today"
:
false
},
{
"index"
:
7
,
"joined"
:
false
,
"credits"
:
20
,
"coefficient"
:
2
,
"today"
:
false
}
]
}
},
"taskTodo"
:
[
{
"id"
:
1
,
"name"
:
"完善信息"
,
"taskTodoExtra"
:
{
"title"
:
"完善信息"
,
"sort"
:
1
,
"credits"
:
20
,
"type"
:
"Perfect"
,
"icon"
:
"https://course.feihe.com/momclub-picture/brandpage/v1_ip1.png"
,
"desc"
:
"完善宝宝基本信息,获得个性化推荐"
,
"extra"
:
"完善信息"
,
"status"
:
"1"
}
},
{
"id"
:
3
,
"name"
:
"浏览星妈优选商城"
,
"taskTodoExtra"
:
{
"title"
:
"浏览星妈优选商城"
,
"sort"
:
3
,
"credits"
:
20
,
"type"
:
"BROWSE_PAGE"
,
"icon"
:
"https://course.feihe.com/momclub-picture/brandpage/v1_ip1.png"
,
"desc"
:
"浏览星妈优选商城商品"
,
"extra"
:
"浏览星妈优选商城"
,
"status"
:
"1"
}
},
{
"id"
:
4
,
"name"
:
"完成首单优选消费"
,
"taskTodoExtra"
:
{
"title"
:
"完成首单优选消费"
,
"sort"
:
4
,
"credits"
:
20
,
"type"
:
"EXCHANGE_GOODS"
,
"icon"
:
"https://course.feihe.com/momclub-picture/brandpage/v1_ip2.png"
,
"desc"
:
"在星妈优选商城完成首单消费"
,
"extra"
:
"完成首单优选消费"
,
"status"
:
"1"
}
},
{
"id"
:
5
,
"name"
:
"关注公众号"
,
"taskTodoExtra"
:
{
"title"
:
"关注公众号"
,
"sort"
:
5
,
"credits"
:
20
,
"type"
:
"FollowWx"
,
"icon"
:
"https://course.feihe.com/momclub-picture/brandpage/v1_ip2.png"
,
"desc"
:
"关注星妈会官方微信公众号"
,
"extra"
:
"关注公众号"
,
"status"
:
"1"
}
},
{
"id"
:
6
,
"name"
:
"添加企业微信"
,
"taskTodoExtra"
:
{
"title"
:
"添加企业微信"
,
"sort"
:
6
,
"credits"
:
20
,
"type"
:
"AddQw"
,
"icon"
:
"https://course.feihe.com/momclub-picture/brandpage/v1_ip1.png"
,
"desc"
:
"添加星妈会企业微信客服"
,
"extra"
:
"添加企业微信"
,
"status"
:
"1"
}
},
{
"id"
:
7
,
"name"
:
"注册会员"
,
"taskTodoExtra"
:
{
"title"
:
"注册会员"
,
"sort"
:
7
,
"credits"
:
20
,
"type"
:
"Register"
,
"icon"
:
"https://course.feihe.com/momclub-picture/brandpage/v1_ip1.png"
,
"desc"
:
"注册星妈会会员"
,
"extra"
:
"注册会员"
,
"status"
:
"1"
}
}
]
}
}
\ No newline at end of file
stores/integral.js
0 → 100644
View file @
e0b861e4
import
{
defineStore
}
from
"pinia"
;
import
{
getSigninAndTaskInfoJSON
,
checkInJSON
}
from
"../api/integral"
;
import
signinAndTaskInfoMock
from
'../mock/getSigninAndTaskInMock.json'
;
import
checkInMock
from
'../mock/checkIndata.json'
;
export
const
useIntegralStore
=
defineStore
(
"integral"
,
{
state
:
()
=>
{
return
{
_signinAndTaskInfo
:
null
,
_checkInData
:
null
,
// 新增:存储签到数据
};
},
actions
:
{
async
getSigninAndTaskInfo
(
isdebug
=
false
)
{
if
(
isdebug
)
{
this
.
_signinAndTaskInfo
=
signinAndTaskInfoMock
;
return
signinAndTaskInfoMock
;
}
else
{
const
res
=
await
getSigninAndTaskInfoJSON
();
this
.
_signinAndTaskInfo
=
res
;
return
res
;
}
},
async
checkIn
(
activityId
,
isdebug
=
false
)
{
if
(
isdebug
)
{
this
.
_checkInData
=
checkInMock
;
// 存储到state中
return
checkInMock
;
}
else
{
const
res
=
await
checkInJSON
(
activityId
);
this
.
_checkInData
=
res
;
// 存储到state中
return
res
;
}
},
},
getters
:
{
signinAndTaskInfo
:
(
state
)
=>
{
return
state
.
_signinAndTaskInfo
;
},
checkInData
:
(
state
)
=>
{
return
state
.
_checkInData
;
},
},
});
\ No newline at end of file
views/Integral.vue
View file @
e0b861e4
...
...
@@ -289,7 +289,7 @@
<view class="
help_icon
" @click="
handleHelpClick
">
<text class="
help_text
">?</text>
</view>
<text class="
signin_sub_title
">再连续签
4
天,获得5倍积分</text>
<text class="
signin_sub_title
">再连续签
{{ 7 - signedCount
}}
天,获得5倍积分</text>
</view>
<!-- 奖励展示区域 -->
...
...
@@ -298,7 +298,7 @@
<view class="
daily_reward_item
" v-for="
day
in
7
" :key="
day
">
<!-- 奖励内容容器 -->
<view class="
reward_content_container
" :class="
{
signed
:
signinStatus
[
day
-
1
]
}
">
<text class="
reward_points
">
{{ day === 7 ? '+100' : '+20'
}}
</text>
<text class="
reward_points
">
+{{ rewardPoints[day - 1]
}}
</text>
<!-- 奖励标签,通过变量控制显示 -->
<view class="
bonus_tag
" v-if="
bonusTagStatus
[
day
-
1
]
">
<text class="
bonus_text
">{{ bonusTagText[day - 1]
}}
</text>
...
...
@@ -477,8 +477,18 @@
<SignRuleDes :visible="
showSignRuleDes
" @close="
handleCloseSignRuleDes
" />
<!-- 任务弹窗 -->
<TaskPop :visible="
showTaskPop
" @close="
handleCloseTaskPop
" @taskClick="
handleTaskClick
" />
<TaskPop :visible="
showTaskPop
"
:taskTodo="
integralStore
?.
signinAndTaskInfo
?.
data
?.
taskTodo
"
@close="
handleCloseTaskPop
" @taskClick="
handleTaskClick
" />
<TaskPerson :visible="
showTaskPerson
" @close="
handleCloseTaskPerson
" @submit="
handleTaskPersonSubmit
" />
<!-- 公众号弹窗 -->
<GongzhonghaoPop
:visible="
showGongzhonghaoPop
"
:title="
gongzhonghaoTitle
"
:description="
gongzhonghaoDescription
"
:qrCodeUrl="
gongzhonghaoQrCodeUrl
"
@close="
handleCloseGongzhonghaoPop
"
@download="
handleDownloadQrCode
"
/>
</view>
</template>
...
...
@@ -515,9 +525,13 @@ import SignedTips from '../components/qiandao/SignedTips.vue';
import SignRuleDes from '../components/qiandao/SignRuleDes.vue';
import TaskPop from '../components/renwu/TaskPop.vue';
import TaskPerson from '../components/renwu/TaskPerson.vue';
import GongzhonghaoPop from '../components/renwu/GongzhonghaoPop.vue';
import bannerDataIntegral from '../mock/bannerDataIntegral.json';
import jifenGoodsData from '../mock/jifenGoodsData.json';
import { onShow
}
from "
@
dcloudio
/uni-app"
;
import
{
useIntegralStore
}
from
'../stores/integral'
;
const
isdebug
=
ref
(
false
);
// 进度条图片加载错误处理
const
onProgressBarError
=
(
e
)
=>
{
...
...
@@ -1419,7 +1433,11 @@ const privilegeSizes = ref([
{
width
:
'71rpx'
,
height
:
'90rpx'
,
name
:
'溯源游'
}
]);
const
userStore
=
useUserStore
();
const
integralStore
=
useIntegralStore
();
const
memberInfo
=
ref
({
recentAnnualPointsTotal
:
0
,
willExpiredPoints
:
0
,
...
...
@@ -1441,6 +1459,7 @@ const mdMap = ref([]);
const
showPopupShengri
=
ref
(
false
);
const
signinInfo
=
ref
({
}
);
// 签到状态数组,控制每天是否已签到
const
signinStatus
=
ref
([
true
,
false
,
false
,
false
,
false
,
false
,
false
]);
// 示例:第1天已签到,其他未签到
...
...
@@ -1450,6 +1469,9 @@ const bonusTagStatus = ref([false, false, false, false, false, false, true]); //
// 奖励标签文本数组,控制每天标签的文本内容
const
bonusTagText
=
ref
([
''
,
''
,
''
,
''
,
''
,
''
,
'5倍'
]);
// 示例:第7天显示"5倍"
// 奖励积分数组,控制每天获得的积分
const
rewardPoints
=
ref
([
20
,
20
,
20
,
20
,
20
,
20
,
100
]);
// 默认积分值
// 签到提示弹窗相关
const
showSignedTips
=
ref
(
false
);
const
earnedPoints
=
ref
(
0
);
...
...
@@ -1460,9 +1482,17 @@ const showSignRuleDes = ref(false);
// 任务弹窗相关
const
showTaskPop
=
ref
(
false
);
const
showTaskPerson
=
ref
(
false
);
const
showGongzhonghaoPop
=
ref
(
false
);
// 公众号弹窗参数
const
gongzhonghaoTitle
=
ref
(
'公众号'
);
const
gongzhonghaoDescription
=
ref
(
'长按关注星妈会公众号,了解更多专业育儿资讯'
);
const
gongzhonghaoQrCodeUrl
=
ref
(
'https://course.feihe.com/momclub-picture/homepage/qrcode_gzh.png'
);
//今天已经签到过
const
todaySigned
=
ref
(
true
);
const
todaySigned
=
ref
(
false
);
//已经连续签到天数
const
signedCount
=
ref
(
0
);
// Props 定义
const
props
=
defineProps
({
...
...
@@ -1772,7 +1802,13 @@ onMounted(async () => {
}
);
await
userStore
.
loadMemberInfo
();
await
integralStore
.
getSigninAndTaskInfo
(
isdebug
.
value
);
//初始化签掉数据
initSignin
();
//初始化ui
initNetData
();
...
...
@@ -1818,6 +1854,42 @@ const initExposure = () => {
}
);
}
const
initSignin
=
()
=>
{
if
(
!
integralStore
?.
signinAndTaskInfo
?.
success
){
uni
.
showToast
({
title
:
'获取签到信息失败,请稍后重试'
,
icon
:
'none'
}
);
return
;
}
signinInfo
.
value
=
integralStore
?.
signinAndTaskInfo
?.
data
?.
checkInTodo
;
console
.
log
(
'signinInfo111111111='
,
signinInfo
.
value
);
signinInfo
.
value
?.
checkInExtra
?.
joinRecord
?.
forEach
((
element
,
index
)
=>
{
signinStatus
.
value
[
index
]
=
element
.
joined
;
if
(
element
.
coefficient
&&
Number
(
element
.
coefficient
)
>
1
){
bonusTagStatus
.
value
[
index
]
=
true
;
bonusTagText
.
value
[
index
]
=
element
.
coefficient
+
'倍'
;
}
else
{
bonusTagStatus
.
value
[
index
]
=
false
;
bonusTagText
.
value
[
index
]
=
''
;
}
rewardPoints
.
value
[
index
]
=
element
.
credits
;
// 使用接口返回的credits
if
(
element
.
today
){
todaySigned
.
value
=
element
.
joined
;
if
(
element
.
joined
){
signedCount
.
value
=
index
+
1
;
}
else
{
signedCount
.
value
=
index
;
}
}
}
);
}
const
initNetData
=
()
=>
{
console
.
log
(
'initNetData'
);
...
...
@@ -2562,7 +2634,7 @@ const handleHelpClick = () => {
}
// 签到按钮点击事件
const handleSigninClick = () => {
const handleSigninClick =
async
() => {
console.log('
签到按钮点击
');
// 埋点统计
...
...
@@ -2572,24 +2644,18 @@ const handleSigninClick = () => {
buttonName: "立即签到",
}
);
// 找到下一个未签到的天数
const nextUnsignedDay = signinStatus.value.findIndex(status => !status);
if (nextUnsignedDay !== -1) {
// 标记该天为已签到
signinStatus.value[nextUnsignedDay] = true;
// 设置获得的积分数
earnedPoints.value = nextUnsignedDay === 6 ? 100 : 20; // 第7天100积分,其他天20积分
// 显示签到提示弹窗
const data = await integralStore.checkIn(signinInfo.value.id,isdebug.value);
console.log('
datacheckIn
=
', data);
if(data.success){
showSignedTips.value = true;
}
else {
// 所有天都已签到
earnedPoints.value = data?.data?.credits;
await integralStore.getSigninAndTaskInfo(isdebug.value);
console.log('
5555555
');
initSignin();
}
else{
uni.showToast({
title: "本周已全部签到完成!",
icon: "success",
duration: 2000
title: '
签到失败,请稍后重试
',
icon: '
none
'
}
);
}
}
...
...
@@ -2613,6 +2679,7 @@ const handleTaskButtonClick = () => {
// return
console.log('
任务按钮点击
');
console.log('
taskTodo
数据
:
', integralStore?.signinAndTaskInfo?.data?.taskTodo);
showTaskPop.value = true;
}
...
...
@@ -2626,6 +2693,67 @@ const handleCloseTaskPerson = () => {
showTaskPerson.value = false;
}
// 关闭公众号弹窗
const handleCloseGongzhonghaoPop = () => {
showGongzhonghaoPop.value = false;
}
// 处理下载二维码
const handleDownloadQrCode = (title) => {
console.log('
下载二维码
', title);
// 这里可以添加下载二维码的具体逻辑
// '
公众号
', '
企业微信
'
md.sensorLogTake({
xcxClick: `${title
}
拉起半屏二维码入口页面点击`,
pageName: `${title
}
拉起半屏二维码入口页面点击`,
buttonName: `下载二维码`
}
);
if (title === '
公众号
') {
const courseUrl = '
https
:
//course.feihe.com/momclub-picture/homepage/qrcode_gzh.png';
downloadQrCode
(
courseUrl
);
}
else
if
(
title
===
'企业微信'
)
{
const
courseUrl
=
'https://course.feihe.com/momclub-picture/homepage/qrcode_qw.png'
;
downloadQrCode
(
courseUrl
);
}
}
const
downloadQrCode
=
(
imgurl
)
=>
{
//现在二维码图片
uni
.
downloadFile
({
url
:
imgurl
,
success
:
(
downloadRes
)
=>
{
if
(
downloadRes
.
statusCode
===
200
)
{
uni
.
saveImageToPhotosAlbum
({
filePath
:
downloadRes
.
tempFilePath
,
success
:
(
res
)
=>
{
uni
.
showToast
({
title
:
'保存成功'
,
icon
:
'success'
}
);
}
,
fail
:
(
err
)
=>
{
uni
.
showToast
({
title
:
'保存失败'
,
icon
:
'none'
}
);
}
}
);
}
else
{
uni
.
showToast
({
title
:
'下载失败'
,
icon
:
'none'
}
);
}
}
,
fail
:
(
err
)
=>
{
uni
.
showToast
({
title
:
'下载失败'
,
icon
:
'none'
}
);
}
}
);
}
// 处理任务信息提交
const
handleTaskPersonSubmit
=
(
formData
)
=>
{
console
.
log
(
'任务信息提交:'
,
formData
);
...
...
@@ -2643,13 +2771,67 @@ const handleTaskClick = (data) => {
console
.
log
(
'任务点击:'
,
data
);
// 如果是完善信息任务,显示TaskPerson弹窗
if
(data.task && data.task.title === '
完善信息
')
{
showTaskPop.value = false; // 先关闭TaskPop
setTimeout(() => {
showTaskPerson.value = true; // 延迟显示TaskPerson
}
, 100
);
if
(
!
data
.
task
)
{
uni
.
showToast
({
title
:
'任务不存在'
,
icon
:
'none'
}
);
return
;
}
switch
(
data
.
task
.
taskTodoExtra
.
type
){
case
'Perfect'
:
showTaskPop
.
value
=
false
;
// 先关闭TaskPop
setTimeout
(()
=>
{
showTaskPerson
.
value
=
true
;
// 延迟显示TaskPerson
}
,
100
);
break
;
case
'BROWSE_PAGE'
:
//浏览商城
jump
({
type
:
JumpType
.
H5
,
url
:
'https://www.baidu.com'
}
)
break
;
case
'EXCHANGE_GOODS'
:
//完成首单优选消费
jump
({
type
:
JumpType
.
H5
,
url
:
'https://www.baidu.com'
}
)
break
;
case
'FollowWx'
:
//关注公众号
showTaskPop
.
value
=
false
;
// 先关闭TaskPop
setTimeout
(()
=>
{
// 设置公众号弹窗参数
gongzhonghaoTitle
.
value
=
'公众号'
;
gongzhonghaoDescription
.
value
=
'长按关注星妈会公众号,了解更多专业育儿资讯'
;
gongzhonghaoQrCodeUrl
.
value
=
'https://course.feihe.com/momclub-picture/homepage/qrcode_gzh.png'
;
showGongzhonghaoPop
.
value
=
true
;
// 延迟显示公众号弹窗
}
,
100
);
break
;
case
'AddQw'
:
//添加企业微信
showTaskPop
.
value
=
false
;
// 先关闭TaskPop
gongzhonghaoTitle
.
value
=
'企业微信'
;
gongzhonghaoDescription
.
value
=
'长按添加星妈管家,享受专家问诊与社群福利活动'
;
gongzhonghaoQrCodeUrl
.
value
=
'https://course.feihe.com/momclub-picture/homepage/qrcode_qw.png'
;
showGongzhonghaoPop
.
value
=
true
;
// 延迟显示企业微信弹窗
break
;
case
'Register'
:
//注册会员
if
(
!
islogin
.
value
)
{
needReinit
.
value
=
true
jump
({
type
:
JumpType
.
INNER
,
url
:
"/pages/activity/register"
,
}
)
}
break
;
default
:
uni
.
showToast
({
title
:
'任务类型不支持'
,
icon
:
'none'
}
);
break
;
}
// 其他任务的处理逻辑
// 这里可以添加具体的任务跳转逻辑
...
...
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