Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
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
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
android
uniapp_vedio
Commits
2f2f1a2f
Commit
2f2f1a2f
authored
Jun 07, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加到桌面功能
parent
e4cda068
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
682 additions
and
679 deletions
+682
-679
task.vue
vedio/pagesA/task/task.vue
+682
-679
No files found.
vedio/pagesA/task/task.vue
View file @
2f2f1a2f
...
...
@@ -20,7 +20,7 @@
</block>
</view>
<button
v-if=
"signData.list[signData.todayMsgIndexInWeek].rewardMoreType==2"
open-type=
"share"
:class=
"signBtnStyle"
@
click=
"sign"
>
{{
signData
.
buttonText
}}
</button>
:class=
"signBtnStyle"
>
{{
signData
.
buttonText
}}
</button>
<button
v-else
:class=
"signBtnStyle"
@
click=
"sign"
>
{{
signData
.
buttonText
}}
</button>
</view>
</view>
...
...
@@ -63,7 +63,14 @@
}}
</text>
</view>
</view>
<text
:class=
"(item2.status==0)?'task-btn':((item2.status==1)?'task-btn2':'task-btn3')"
<button
v-if=
"item2.listCode == 3 && item2.status==0"
class=
"task-btn"
open-type=
"addShortcut"
@
addshortcut=
"eventHandler"
>
{{
item2
.
buttonText
}}
</button>
<text
v-else
:class=
"(item2.status==0)?'task-btn':((item2.status==1)?'task-btn2':'task-btn3')"
@
click=
"doTask(item2)"
>
{{
item2
.
buttonText
}}
</text>
</view>
</block>
...
...
@@ -246,30 +253,16 @@
}
});
},
hasShortCut
(
taskId
)
{
let
that
=
this
shortcut
.
hasInstalled
({
success
:
function
()
{
$utils
.
showToast
(
'桌面图标已创建!'
)
that
.
reportCompleteTask
(
taskId
)
},
fail
:
function
()
{
that
.
createShortCut
(
taskId
)
}
})
},
createShortCut
(
taskId
)
{
let
that
=
this
// 创建桌面图标
shortcut
.
install
({
success
:
function
()
{
$utils
.
showToast
(
'创建桌面图标成功!'
)
that
.
reportCompleteTask
(
taskId
)
},
fail
:
function
(
data
,
code
)
{
$utils
.
showToast
(
'创建桌面图标失败!'
)
eventHandler
(
e
)
{
if
(
e
.
detail
.
errNo
)
{
message
.
notify
(
"添加到桌面失败"
)
console
.
log
(
"添加到桌面失败"
,
e
.
detail
);
}
else
{
this
.
isAddShort
()
message
.
notify
(
"添加到桌面成功"
)
console
.
log
(
"添加到桌面成功"
);
}
})
},
sign
()
{
let
buttonStatus
=
this
.
signData
.
buttonStatus
...
...
@@ -288,8 +281,7 @@
let
item
=
this
.
signList
[
this
.
signData
.
todayMsgIndexInWeek
]
this
.
showAd
(
item
,
true
)
}
else
if
(
ewardMoreType
==
2
)
{
// 分享
this
.
myShare
(
this
.
signList
[
this
.
signData
.
todayMsgIndexInWeek
])
// 分享 open-type实现
}
},
reportTaskPoint
(
item
,
isSign
)
{
...
...
@@ -399,7 +391,7 @@
}
else
if
(
item
.
listCode
==
TaskConstant
.
saveToPhonePage
)
{
this
.
hasShortCut
(
item
.
taskId
)
// 保存到桌面
}
else
if
(
item
.
listCode
==
TaskConstant
.
openForHome
)
{
...
...
@@ -419,10 +411,6 @@
}
}
},
myShare
(
item
)
{
// TODO 分享
},
signMoreReward
(
item
)
{
// 签到-广告或者分享后领取更多
let
that
=
this
...
...
@@ -447,6 +435,21 @@
signClose
()
{
this
.
showSignPopup
=
false
},
isAddShort
()
{
let
that
=
this
if
(
that
.
taskList
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
that
.
taskList
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
that
.
taskList
[
i
].
taskList
.
length
;
j
++
)
{
if
(
that
.
taskList
[
i
].
taskList
[
j
].
listCode
==
TaskConstant
.
saveToPhonePage
&&
that
.
taskList
[
i
].
taskList
[
j
].
status
==
0
)
{
that
.
reportCompleteTask
(
that
.
taskList
[
i
].
taskList
[
j
].
taskId
)
return
}
}
}
}
},
isFromForHome
()
{
let
that
=
this
if
(
uni
.
getEnterOptionsSync
().
launcher
==
'shortcut'
)
{
...
...
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