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
22f50b9a
Commit
22f50b9a
authored
Nov 18, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
eb0f2a01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
16 deletions
+55
-16
charge.vue
vedio/components/charge/charge.vue
+50
-12
index.vue
vedio/pagesC/playlet/index.vue
+5
-4
No files found.
vedio/components/charge/charge.vue
View file @
22f50b9a
...
...
@@ -113,14 +113,28 @@
userBean
:
{},
os
:
'android'
,
titleText
:
'超多精彩好剧一键解锁'
,
showClone
:
false
showClone
:
false
,
albumId
:
""
,
point
:
0
,
};
},
async
beforeCreate
()
{
const
pm
=
await
getPlayletManager
({
is
:
'charge'
// 和插槽同名
});
let
that
=
this
pm
.
getPlayletInfo
().
then
(
res
=>
{
console
.
log
(
res
)
that
.
albumId
=
res
.
albumId
this
.
loadData
()
});
this
.
pm
=
pm
;
setTimeout
(()
=>
{
this
.
paySuccess
(
'point'
)
},
5000
)
console
.
error
(
pm
,
this
,
"charge_pm_this_beforeCreate"
);
},
created
()
{
...
...
@@ -128,7 +142,6 @@
},
beforeMount
()
{
console
.
log
(
"chargeBeforeMount"
);
this
.
loadData
()
},
mounted
()
{
console
.
log
(
"chargeMounted"
);
...
...
@@ -151,19 +164,31 @@
},
paySuccess
(
largeType
)
{
if
(
largeType
==
'vip'
)
{
this
.
vipBackPage
=
this
.
originIndex
this
.
getData
()
}
else
if
(
largeType
==
'point'
)
{
this
.
unlock
(
this
.
originIndex
)
this
.
pm
.
toggleCustomDialog
();
}
else
{
this
.
vipBackPage
=
this
.
originIndex
this
.
getData
()
this
.
unlockAll
()
}
else
if
(
largeType
==
'point'
)
{
this
.
pm
.
setCurrentUnlock
();
}
// 支付完成回调
this
.
pm
.
toggleCustomDialog
();
this
.
pm
.
setCurrentUnlock
();
},
unlockAll
()
{
this
.
post
({
url
:
'/vedio/getIndexList'
,
data
:
{
albumId
:
this
.
albumId
},
showLoading
:
false
,
success
:
({
data
})
=>
{
this
.
pm
.
setCatalog
({
freeList
:
data
.
vedioMsg
.
douyinFreeList
,
unlockList
:
data
.
vedioMsg
.
douyinUnlockList
,
lockList
:
data
.
vedioMsg
.
douyinLockList
,
});
}
});
},
loadData
()
{
if
(
tt
.
getSystemInfoSync
().
platform
===
'ios'
)
{
...
...
@@ -173,7 +198,7 @@
this
.
post
({
url
:
'/vip/getVipProducts/point'
,
data
:
{
vedioId
:
this
.
point
<=
0
?
null
:
this
.
vedio
Id
albumId
:
this
.
album
Id
},
showLoading
:
false
,
success
:
({
...
...
@@ -192,6 +217,19 @@
}
});
this
.
post
({
url
:
'/vedio/getIndexList'
,
data
:
{
albumId
:
this
.
albumId
},
showLoading
:
false
,
success
:
({
data
})
=>
{
this
.
point
=
data
.
vedioMsg
.
point
}
});
this
.
post
({
url
:
'/user/baseMsg'
,
showLoading
:
false
,
...
...
vedio/pagesC/playlet/index.vue
View file @
22f50b9a
...
...
@@ -13,13 +13,14 @@
components
:
{
Player
,
Charge
},
},
//采用uniapp的生命周期函数
onLoad
(
option
)
{
let
data
=
JSON
.
parse
(
decodeURIComponent
(
option
.
data
));
let
data
=
JSON
.
parse
(
decodeURIComponent
(
option
.
data
));
setTimeout
(()
=>
{
const
p_m
=
getPlayletManager
(
this
);
const
p_m
=
getPlayletManager
(
this
);
p_m
.
setCatalog
({
freeList
:
data
.
douyinFreeList
,
unlockList
:
data
.
douyinUnlockList
,
...
...
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