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
a51857c2
Commit
a51857c2
authored
Jan 02, 2025
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信官方阅读器
parent
a779a283
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
94 deletions
+92
-94
charge-dialog.vue
vedio/components/charge-dialog/charge-dialog.vue
+79
-77
main.js
vedio/main.js
+6
-1
novelManager.js
vedio/utils/novelManager.js
+7
-16
No files found.
vedio/components/charge-dialog/charge-dialog.vue
View file @
a51857c2
...
...
@@ -16,10 +16,10 @@
<view
v-if=
"agreementDto != null"
@
click=
"handleUnsign"
style=
"margin-top: 12rpx;margin-left: 10rpx;"
>
自动续费管理>
</view>
<view
style=
"margin-top: 1
2
rpx;margin-left: auto;display: flex;flex-direction: row;"
>
<view
style=
"margin-top: 1
5
rpx;margin-left: auto;display: flex;flex-direction: row;"
>
<view
@
click=
"handleAgree"
style=
"margin-right: 10rpx;"
>
付费须知>
</view>
<image
@
click=
"handleCl
ickCl
ose"
style=
"width: 30rpx;height: 30rpx;display: flex;align-items: right;margin-top:
20rpx;margin-left: auto
;margin-right: 20rpx;margin-bottom: 10rpx;"
<image
@
click=
"handleClose"
style=
"width: 30rpx;height: 30rpx;display: flex;align-items: right;margin-top:
13rpx;margin-left: 10rpx
;margin-right: 20rpx;margin-bottom: 10rpx;"
src=
"@/static/index/ic_quit_white.png"
></image>
</view>
...
...
@@ -81,7 +81,7 @@
import
{
apiPOST
}
from
"
..
/common/utils/apiRequest.js"
}
from
"
@
/common/utils/apiRequest.js"
export
default
{
data
()
{
...
...
@@ -89,7 +89,7 @@
vipList
:
[],
selectedIndex
:
0
,
agreeFlag
:
false
,
agreeText
:
"付费须知
\n\n
1、看点和会员属于虚拟商品,一经购买不可退换
\n\n
2、未满18岁的未成年人需要在监护人主导、同意下进行相关付费操作;
\n\n
3、充值看点一般5分钟内到账,如未到账请在“我的”页面联系客服;"
agreeText
:
"付费须知
\n\n
1、看点和会员属于虚拟商品,一经购买不可退换
\n\n
2、未满18岁的未成年人需要在监护人主导、同意下进行相关付费操作;
\n\n
3、充值看点一般5分钟内到账,如未到账请在“我的”页面联系客服;"
,
userBean
:
{},
agreementDto
:
null
,
hintText
:
''
,
...
...
@@ -126,58 +126,76 @@
methods
:
{
// 支付完成回调
paySuccess
(
largeType
)
{
this
.
$emit
(
'paySuccess'
,
largeType
);
this
.
handleClose
();
this
.
unlockSerial
()
},
unlock
()
{
// 取出对应的阅读器实例
const
novelManager
=
novelPlugin
.
getNovelManager
(
this
.
properties
.
novelManagerId
)
// 解锁剧集
unlockSerial
()
{
let
that
=
this
const
novelManager
=
novelPlugin
.
getNovelManager
(
this
.
novelManagerId
)
apiPOST
({
url
:
'/book/info'
,
data
:
{
wxId
:
that
.
bookId
,
reader
:
true
},
callback
:
(
success
,
data
)
=>
{
if
(
success
)
{
novelManager
.
paymentCompleted
()
that
.
$nextTick
(()
=>
{
novelManager
.
setContents
({
contents
:
data
.
wechatRecord
.
wxChapter
})
})
// 告诉阅读器这一章已解锁
novelManager
.
paymentCompleted
()
that
.
handleClose
()
}
}
})
},
handleShow
()
{
let
that
=
this
;
if
(
wx
.
getSystemInfoSync
().
platform
===
'ios'
)
{
this
.
os
=
'ios'
;
}
this
.
post
({
// const novelManager = novelPlugin.getNovelManager(this.novelManagerId)
// novelManager.setChargeWay({
// globalConfig: {
// mode: 1,
// buttonText: '解锁全部',
// tip: '开通会员后可继续阅读',
// },
// })
let
that
=
this
;
apiPOST
({
url
:
'/vip/getVipProducts/cyc'
,
data
:
{
bookId
:
that
.
vedioId
},
showLoading
:
false
,
success
:
({
data
})
=>
{
this
.
vipList
=
data
.
list
;
if
(
data
.
list
!=
null
)
{
this
.
hintText
=
this
.
vipList
[
0
].
trailRemark
;
for
(
let
i
=
0
;
i
<
data
.
list
.
length
;
i
++
)
{
if
(
data
.
list
[
i
].
activityType
==
1
)
{
this
.
selectedIndex
=
i
;
break
;
callback
:
(
success
,
data
)
=>
{
if
(
success
)
{
that
.
vipList
=
data
.
list
;
if
(
data
.
list
!=
null
)
{
that
.
hintText
=
that
.
vipList
[
0
].
trailRemark
;
for
(
let
i
=
0
;
i
<
data
.
list
.
length
;
i
++
)
{
if
(
data
.
list
[
i
].
activityType
==
1
)
{
that
.
selectedIndex
=
i
;
break
;
}
}
}
}
}
});
this
.
post
({
});
apiPOST
({
url
:
'/vip/getOrderList'
,
showLoading
:
false
,
success
:
({
data
})
=>
{
console
.
log
(
"agreement="
,
data
.
agreement
);
if
(
data
.
agreement
==
undefined
)
{
this
.
agreementDto
=
null
;
}
else
{
this
.
agreementDto
=
data
.
agreement
;
callback
:
(
success
,
data
)
=>
{
if
(
success
)
{
console
.
log
(
"agreement="
,
data
.
agreement
);
if
(
data
.
agreement
==
undefined
)
{
this
.
agreementDto
=
null
;
}
else
{
this
.
agreementDto
=
data
.
agreement
;
}
}
}
});
},
...
...
@@ -190,12 +208,9 @@
handleAgree
()
{
this
.
agreeFlag
=
true
},
handleClickClose
()
{
this
.
$emit
(
'clickClose'
);
this
.
$emit
(
'close'
);
},
handleClose
()
{
this
.
$emit
(
'close'
);
const
novelManager
=
novelPlugin
.
getNovelManager
(
this
.
novelManagerId
)
novelManager
.
closeChargeDialog
()
},
choosePack
(
item
,
index
)
{
this
.
selectedIndex
=
index
;
...
...
@@ -213,24 +228,22 @@
if
(
this
.
os
==
'ios'
)
{
message
.
notify
(
'暂不支持ios系统~'
);
}
else
{
this
.
post
({
apiPOST
({
url
:
'/vip/getVipPayParams/wechat'
,
data
:
{
pid
:
vipBean
.
pid
,
payChannel
:
'WEIXIN'
},
showLoading
:
true
,
success
:
({
data
})
=>
{
if
(
vipBean
.
firstPayPrice
==
0
)
{
//签约
that
.
wxSign
(
data
,
vipBean
.
largeType
);
}
else
{
//普通支付
that
.
wxPay
(
data
,
vipBean
.
largeType
);
callback
:
(
success
,
data
)
=>
{
if
(
success
)
{
if
(
vipBean
.
firstPayPrice
==
0
)
{
//签约
that
.
wxSign
(
data
,
vipBean
.
largeType
);
}
else
{
//普通支付
that
.
wxPay
(
data
,
vipBean
.
largeType
);
}
}
}
});
}
...
...
@@ -278,29 +291,18 @@
},
queryOrderStatus
(
largeType
,
tid
)
{
let
that
=
this
;
this
.
post
({
apiPOST
({
url
:
'/vip/queryVipOrder'
,
data
:
{
tid
:
tid
tid
},
url
:
'/vip/queryVipOrder'
,
showLoading
:
true
,
success
:
({
data
})
=>
{
that
.
paySuccess
(
largeType
);
callback
:
(
success
,
data
)
=>
{
if
(
success
)
{
that
.
paySuccess
(
largeType
);
}
}
});
}
},
watch
:
{
show
:
{
handler
:
function
(
newVal
,
oldVal
)
{
if
(
newVal
)
{
this
.
handleShow
();
}
},
immediate
:
true
}
}
};
</
script
>
...
...
vedio/main.js
View file @
a51857c2
...
...
@@ -13,6 +13,11 @@ import './filters'
plus
.
screen
.
lockOrientation
(
'portrait-primary'
);
// #endif
// #ifdef MP-WEIXIN
import
chargedialog
from
'./components/charge-dialog/charge-dialog.vue'
Vue
.
component
(
'charge-dialog'
,
chargedialog
)
// #endif
// let v = new vconsole();
// #ifndef VUE3
import
Vue
from
'vue'
...
...
@@ -39,4 +44,4 @@ export function createApp() {
app
}
}
// #endif
// #endif
\ No newline at end of file
vedio/utils/novelManager.js
View file @
a51857c2
...
...
@@ -13,8 +13,9 @@ function navigateToNovel(wxId, customId) {
const
proto
=
{
_onNovelLoad
(
data
)
{
const
novelManager
=
novelPlugin
.
getNovelManager
(
data
.
id
)
// this.nm = novelManager
const
nm
=
novelPlugin
.
getNovelManager
(
data
.
id
)
this
.
nm
=
nm
this
.
myId
=
data
.
id
novelPlugin
.
setLoggerConfig
({
info
:
true
,
...
...
@@ -24,21 +25,21 @@ const proto = {
error
:
true
,
})
const
customId
=
n
ovelManager
.
getCustomServerParams
()
const
customId
=
n
m
.
getCustomServerParams
()
this
.
getContent
(
customId
).
then
(
res
=>
{
n
ovelManager
.
setContents
({
n
m
.
setContents
({
contents
:
res
.
chapter
})
})
// 调整分享参数
n
ovelManager
.
setShareParams
({
n
m
.
setShareParams
({
title
:
'xxx'
,
imageUrl
:
'xxx'
})
n
ovelManager
.
onUserTriggerEvent
((
obj
)
=>
{
n
m
.
onUserTriggerEvent
((
obj
)
=>
{
console
.
log
(
'onUserTriggerEvent----->'
+
obj
.
event_id
)
//开始阅读书籍时
...
...
@@ -97,18 +98,8 @@ const proto = {
url
:
'/book/addReadRecord'
,
data
:
{
articleId
},
success
:
(
res
)
=>
{
console
.
log
(
'ssssssss'
)
},
fail
:
(
res
)
=>
{
console
.
log
(
'eeeeeee'
)
}
})
},
// 解锁剧集
unlockSerial
()
{
}
}
...
...
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