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
300b258f
Commit
300b258f
authored
Nov 14, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抖音官方播放器接入
parent
60d4dd8c
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1218 additions
and
552 deletions
+1218
-552
androidPrivacy.json
vedio/androidPrivacy.json
+0
-27
page-route.js
vedio/common/page-route.js
+28
-0
charge.vue
vedio/components/charge/charge.vue
+405
-0
follow.vue
vedio/components/home/follow.vue
+7
-5
index.vue
vedio/components/home/index.vue
+14
-17
recommendVideo.vue
vedio/components/home/recommendVideo.vue
+7
-5
number-box.vue
vedio/components/number-box/number-box.vue
+0
-163
player.vue
vedio/components/player/player.vue
+463
-0
q-button.vue
vedio/components/q-button/q-button.vue
+0
-77
common.js
vedio/mixins/common.js
+180
-176
package.json
vedio/package.json
+1
-29
pages.json
vedio/pages.json
+18
-46
index.vue
vedio/pagesC/playlet/index.vue
+85
-0
watchRecord.vue
vedio/pagesD/watchRecord/watchRecord.vue
+10
-7
No files found.
vedio/androidPrivacy.json
deleted
100644 → 0
View file @
60d4dd8c
{
"version"
:
"1"
,
"prompt"
:
"template"
,
"title"
:
"服务协议和隐私政策"
,
"message"
:
"请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=
\"
https://shimo.im/docs/dPkpKL1EVNIBbXqO
\"
>《用户协议》</a>和<a href=
\"
https://shimo.im/docs/aBAYVY4mNXfgLm3j
\"
>《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。"
,
"buttonAccept"
:
"同意并接受"
,
"buttonRefuse"
:
"暂不同意"
,
"second"
:
{
"title"
:
"确认提示"
,
"message"
:
"进入应用前,你需先同意<a href=
\"
https://shimo.im/docs/dPkpKL1EVNIBbXqO
\"
>《用户协议》</a>和<a href=
\"
https://shimo.im/docs/aBAYVY4mNXfgLm3j
\"
>《隐私政策》</a>,否则将退出应用。"
,
"buttonAccept"
:
"同意并继续"
,
"buttonRefuse"
:
"退出应用"
},
"styles"
:
{
"backgroundColor"
:
"#ffffff"
,
"borderRadius"
:
"5px"
,
"title"
:
{
"color"
:
"#008cfb"
},
"buttonAccept"
:
{
"color"
:
"#008cfb"
},
"buttonRefuse"
:
{
"color"
:
"#c0c0c0"
}
}
}
vedio/common/page-route.js
0 → 100644
View file @
300b258f
function
gotoVideoPlayerPage
(
detail
,
playNext
=
0
)
{
if
(
tt
.
canIUse
(
'PlayletExtension'
))
{
if
(
detail
.
douyinAlbumIdNext
&&
detail
.
douyinEpisodeIdNext
)
{
//跳转至绑定短剧的页面
uni
.
navigateTo
({
url
:
'/pagesC/playlet/index?data='
+
encodeURIComponent
(
JSON
.
stringify
(
detail
))
+
'&tt_album_id='
+
detail
.
douyinAlbumIdNext
+
'&tt_episode_id='
+
detail
.
douyinEpisodeIdNext
})
return
}
//跳转至绑定短剧的页面
uni
.
navigateTo
({
url
:
'/pagesC/playlet/index?data='
+
encodeURIComponent
(
JSON
.
stringify
(
detail
))
+
'&tt_album_id='
+
detail
.
douyinAlbumId
+
'&tt_episode_id='
+
detail
.
douyinEpisodeId
})
}
else
{
tt
.
navigateTo
({
url
:
'/pagesC/ttvideo/ttVideoDetail?data='
+
encodeURIComponent
(
JSON
.
stringify
(
detail
))
+
'&tt_album_id='
+
detail
.
douyinAlbumId
+
'&tt_episode_id='
+
detail
.
douyinEpisodeId
+
'&playNext='
+
playNext
})
}
}
export
{
gotoVideoPlayerPage
}
\ No newline at end of file
vedio/components/charge/charge.vue
0 → 100644
View file @
300b258f
This diff is collapsed.
Click to expand it.
vedio/components/home/follow.vue
View file @
300b258f
...
...
@@ -38,9 +38,14 @@
import
common
from
'@/mixins/common'
;
import
{
message
,
navigateTo
,
}
from
'@/utils/fun.js'
;
import
{
gotoVideoPlayerPage
}
from
"@/common/page-route.js"
const
app
=
getApp
();
export
default
{
...
...
@@ -95,8 +100,7 @@
this
.
$emit
(
"goRecommend"
)
},
click
(
detail
)
{
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
detail
))
+
'&tt_album_id='
+
detail
.
douyinAlbumId
+
'&tt_episode_id='
+
detail
.
douyinEpisodeId
);
gotoVideoPlayerPage
(
detail
)
},
longClick
(
key
)
{
this
.
isEditStyle
=
true
...
...
@@ -141,9 +145,7 @@
data
})
=>
{
this
.
isEditStyle
=
false
uni
.
showToast
({
title
:
"删除成功"
})
message
.
notify
(
"删除成功"
)
this
.
loadData
()
}
});
...
...
vedio/components/home/index.vue
View file @
300b258f
...
...
@@ -239,6 +239,10 @@
getToLocal
}
from
"@/utils/utils.js"
import
{
gotoVideoPlayerPage
}
from
'@/common/page-route.js'
import
{
navigateTo
,
message
,
...
...
@@ -341,21 +345,17 @@
}
});
},
handleBanner
(
item
)
{
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
))
+
'&tt_album_id='
+
item
.
douyinAlbumId
+
'&tt_episode_id='
+
item
.
douyinEpisodeId
);
handleBanner
(
item
)
{
gotoVideoPlayerPage
(
item
)
},
handleInfo
(
item
)
{
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
))
+
'&tt_album_id='
+
item
.
douyinAlbumId
+
'&tt_episode_id='
+
item
.
douyinEpisodeId
);
gotoVideoPlayerPage
(
item
)
},
handleTop
(
item
)
{
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
))
+
'&tt_album_id='
+
item
.
douyinAlbumId
+
'&tt_episode_id='
+
item
.
douyinEpisodeId
);
handleTop
(
item
)
{
gotoVideoPlayerPage
(
item
)
},
handleBottomPlay
(
item
)
{
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
))
+
'&tt_album_id='
+
item
.
douyinAlbumId
+
'&tt_episode_id='
+
item
.
douyinEpisodeId
);
handleBottomPlay
(
item
)
{
gotoVideoPlayerPage
(
item
)
},
handleBottomClose
()
{
this
.
newRecordBean
=
null
;
...
...
@@ -383,11 +383,8 @@
success
:
({
data
})
=>
{
if
(
data
.
vedioMsg
!=
null
)
{
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
data
.
vedioMsg
))
+
'&tt_album_id='
+
data
.
vedioMsg
.
douyinAlbumId
+
'&tt_episode_id='
+
data
.
vedioMsg
.
douyinEpisodeId
);
if
(
data
.
vedioMsg
!=
null
)
{
gotoVideoPlayerPage
(
data
.
vedioMsg
)
// 重置短视频挂载id
uni
.
setStorage
({
...
...
@@ -416,7 +413,7 @@
.show-mask
{
width
:
100%
;
height
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
background
:
rgba
(
0
,
0
,
0
,
0
.6
);
position
:
absolute
;
z-index
:
999
;
color
:
white
;
...
...
vedio/components/home/recommendVideo.vue
View file @
300b258f
...
...
@@ -11,8 +11,8 @@
:show-fullscreen-btn=
"false"
@
controlstoggle=
"controlstoggle"
@
ended=
"ended"
/>
</view>
<view
v-if=
"!isqp"
class=
"userInfo flex"
>
<!--
点赞
-->
<view
class=
"flex"
style=
"opacity: 0.9; margin-top: 10rpx;"
>
<!--
收藏
-->
<view
v-show=
"false"
class=
"flex"
style=
"opacity: 0.9; margin-top: 10rpx;"
>
<image
@
click
.
stop=
"collect(list.vedioId,index)"
v-if=
"list.collect==0"
src=
"@/static/home_collect_img_0.png"
/>
<image
@
click
.
stop=
"cancelCollect(list.vedioId,index)"
v-if=
"list.collect==1"
...
...
@@ -59,6 +59,10 @@
let
audo
=
uni
.
createInnerAudioContext
()
import
{
gotoVideoPlayerPage
}
from
"@/common/page-route.js"
export
default
{
name
:
"recommendVideo"
,
mixins
:
[
common
],
...
...
@@ -271,9 +275,7 @@
this
.
isqp
=
e
.
detail
.
show
},
detail
(
detail
)
{
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
detail
))
+
'&tt_album_id='
+
detail
.
douyinAlbumId
+
'&tt_episode_id='
+
detail
.
douyinEpisodeId
+
`&playNext=1`
);
gotoVideoPlayerPage
(
detail
,
1
)
},
collect
(
vedioId
,
index
)
{
this
.
originList
[
index
].
collect
=
1
...
...
vedio/components/number-box/number-box.vue
deleted
100644 → 0
View file @
60d4dd8c
<
template
>
<view
class=
"number-box"
>
<view
@
click=
"_calcValue('minus')"
class=
"number-box-btns"
:class=
"
{ 'number-box-disabled': inputValue
<
=
min
||
disabled
}"
>
<icons
icon=
"minus"
:color=
"inputValue
<
=
min
||
disabled
?
'#
868686
'
:
'#
299FEF
'"
size=
"40"
/>
</view>
<input
:disabled=
"disabled"
@
focus=
"_onFocus"
@
blur=
"_onBlur"
class=
"number-box-input"
type=
"number"
v-model=
"inputValue"
/>
<view
@
click=
"_calcValue('plus')"
class=
"number-box-btns"
><icons
icon=
"plus"
:color=
"inputValue >= max || disabled ? '#868686' : '#299FEF'"
size=
"40"
/></view>
</view>
</
template
>
<
script
>
/**
* NumberBox 数字输入框
* @description 带加减按钮的数字输入框
* @tutorial https://ext.dcloud.net.cn/plugin?id=31
* @property {Number} value 输入框当前值
* @property {Number} min 最小值
* @property {Number} max 最大值
* @property {Number} step 每次点击改变的间隔大小
* @property {String} color 字体颜色(前景色)
* @property {Boolean} disabled = [true|false] 是否为禁用状态
* @event {Function} change 输入框值改变时触发的事件,参数为输入框当前的 value
* @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象
* @event {Function} blur 输入框失焦时触发的事件,参数为 event 对象
*/
export
default
{
name
:
'NumberBox'
,
emits
:
[
'change'
,
'input'
,
'update:modelValue'
,
'blur'
,
'focus'
],
props
:
{
value
:
{
type
:
[
Number
,
String
],
default
:
1
},
modelValue
:
{
type
:
[
Number
,
String
],
default
:
1
},
min
:
{
type
:
Number
,
default
:
0
},
max
:
{
type
:
Number
,
default
:
100
},
step
:
{
type
:
Number
,
default
:
1
},
disabled
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
inputValue
:
0
};
},
watch
:
{
value
(
val
)
{
this
.
inputValue
=
+
val
;
},
modelValue
(
val
)
{
this
.
inputValue
=
+
val
;
}
},
created
()
{
if
(
this
.
value
===
1
)
{
this
.
inputValue
=
+
this
.
modelValue
;
}
if
(
this
.
modelValue
===
1
)
{
this
.
inputValue
=
+
this
.
value
;
}
},
methods
:
{
_calcValue
(
type
)
{
if
(
this
.
disabled
)
{
return
;
}
const
scale
=
this
.
_getDecimalScale
();
let
value
=
this
.
inputValue
*
scale
;
let
step
=
this
.
step
*
scale
;
if
(
type
===
'minus'
)
{
value
-=
step
;
if
(
value
<
this
.
min
*
scale
)
{
return
;
}
if
(
value
>
this
.
max
*
scale
)
{
value
=
this
.
max
*
scale
;
}
}
if
(
type
===
'plus'
)
{
value
+=
step
;
if
(
value
>
this
.
max
*
scale
)
{
return
;
}
if
(
value
<
this
.
min
*
scale
)
{
value
=
this
.
min
*
scale
;
}
}
this
.
inputValue
=
(
value
/
scale
).
toFixed
(
String
(
scale
).
length
-
1
);
this
.
$emit
(
'change'
,
+
this
.
inputValue
);
// TODO vue2 兼容
this
.
$emit
(
'input'
,
+
this
.
inputValue
);
// TODO vue3 兼容
this
.
$emit
(
'update:modelValue'
,
+
this
.
inputValue
);
},
_getDecimalScale
()
{
let
scale
=
1
;
// 浮点型
if
(
~~
this
.
step
!==
this
.
step
)
{
scale
=
Math
.
pow
(
10
,
String
(
this
.
step
).
split
(
'.'
)[
1
].
length
);
}
return
scale
;
},
_onBlur
(
event
)
{
this
.
$emit
(
'blur'
,
event
);
let
value
=
event
.
detail
.
value
;
if
(
!
value
)
{
// this.inputValue = 0;
return
;
}
value
=
+
value
;
if
(
value
>
this
.
max
)
{
value
=
this
.
max
;
}
else
if
(
value
<
this
.
min
)
{
value
=
this
.
min
;
}
const
scale
=
this
.
_getDecimalScale
();
this
.
inputValue
=
value
.
toFixed
(
String
(
scale
).
length
-
1
);
this
.
$emit
(
'change'
,
+
this
.
inputValue
);
this
.
$emit
(
'input'
,
+
this
.
inputValue
);
},
_onFocus
(
event
)
{
this
.
$emit
(
'focus'
,
event
);
}
}
};
</
script
>
<
style
lang=
"scss"
>
.number-box
{
display
:
inline-flex
;
align-items
:
center
;
margin-right
:
-16rpx
;
&
-btns
{
line-height
:
1
;
vertical-align
:
bottom
;
display
:
inline-block
;
padding
:
16rpx
;
cursor
:
pointer
;
}
&
-input
{
margin
:
0
4rpx
;
width
:
50rpx
;
text-align
:
center
;
color
:
black
;
}
}
</
style
>
vedio/components/player/player.vue
0 → 100644
View file @
300b258f
This diff is collapsed.
Click to expand it.
vedio/components/q-button/q-button.vue
deleted
100644 → 0
View file @
60d4dd8c
<
template
>
<view>
<button
class=
"reset-button button"
@
click=
"onClick"
hover-class=
"button-hover"
:class=
"[shape == 'circle' ? 'round-circle' : '']"
>
<slot></slot>
</button>
</view>
</
template
>
<
script
>
/**
* m-field button 按钮组件
* @description 常用按钮组件。
* @tutorial https://ui.ymeoo.cn
* @property {String} color 按钮主题色
* @property {String} shape 设置为circle,则按钮两边为半圆形
* @event {Function} click 组件自定义点击事件
* @example <u-form-item label="姓名"><u-input v-model="form.name" /></u-form-item>
*/
export
default
{
name
:
'q-button'
,
props
:
{
shape
:
{
type
:
String
,
default
:
'circle'
}
},
data
()
{
return
{};
},
methods
:
{
onClick
()
{
this
.
$emit
(
'click'
,
''
);
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
// 去除button的所有默认样式
.reset-button
{
padding
:
0
;
font-size
:
inherit
;
line-height
:
inherit
;
background-color
:
transparent
;
color
:
inherit
;
}
.
reset-button
:
:
after
{
border
:
none
;
}
// button样式
.button
{
display
:
block
;
padding
:
20rpx
;
margin
:
20rpx
;
background-image
:
-moz-linear-gradient
(
135deg
,
rgb
(
0
,
255
,
255
)
,
rgb
(
29
,
147
,
251
));
background-image
:
-webkit-linear-gradient
(
135deg
,
rgb
(
0
,
255
,
255
)
,
rgb
(
29
,
147
,
251
));
background-image
:
linear-gradient
(
135deg
,
rgb
(
0
,
255
,
255
)
,
rgb
(
29
,
147
,
251
));
color
:
#fff
;
}
.button-hover
{
background-color
:
#f5f5f5
!
important
;
}
.round-circle
{
border-radius
:
100rpx
;
}
</
style
>
vedio/mixins/common.js
View file @
300b258f
import
{
navigateTo
,
redirectTo
,
loading
,
message
,
confirm
,
alert
}
from
'../utils/fun.js'
;
const
app
=
getApp
();
export
default
{
data
()
{
return
{
xhrPool
:
new
Set
(),
bottomSafePadding
:
app
.
globalData
.
bottomSafePadding
,
options
:
{},
auth
:
false
,
// 登录验证
paying
:
false
,
// 支付按钮状态
};
},
onLoad
(
options
)
{
this
.
options
=
options
;
},
onShow
()
{
this
.
loadData
();
},
onHide
()
{
if
(
this
.
xhrPool
.
size
)
{
this
.
xhrPool
.
forEach
((
requestTask
)
=>
{
requestTask
.
abort
();
})
}
},
methods
:
{
authTo
(
url
)
{
//登录校验
},
authToNs
(
url
)
{
//登录校验不保留当前页面
},
loadData
()
{},
startPay
()
{
loading
.
show
();
this
.
paying
=
true
;
},
stopPay
()
{
loading
.
hide
();
this
.
paying
=
false
;
},
/**
* @param {Object} url 接口请求地址
* @param {Object} method 接口请求方式
* @param {Object} data 接口请求参数
*/
$http
(
url
,
method
,
data
=
{},
showLoading
=
false
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
[
method
.
toLowerCase
()]({
url
:
url
,
data
:
data
,
showLoading
:
showLoading
,
success
:
(
res
)
=>
{
resolve
(
res
)
},
fail
:
(
e
)
=>
{
reject
(
e
)
}
});
})
},
login
()
{
// navigateTo('user/login');
// let redirect = this.$scope.$page.fullPath.replace('/pages', '');
// console.log(redirect)
// navigateTo('user/login?redirect=' + encodeURIComponent(redirect));
},
logout
()
{
uni
.
removeStorageSync
(
'token'
);
},
put
(
options
)
{
options
=
Object
.
assign
({
showLoading
:
true
},
options
,
{
method
:
'PUT'
})
this
.
req
(
options
);
},
post
(
options
)
{
options
=
Object
.
assign
({
showLoading
:
true
},
options
,
{
method
:
'POST'
})
this
.
req
(
options
);
},
get
(
options
)
{
options
=
Object
.
assign
({
showLoading
:
false
},
options
,
{
method
:
'GET'
})
this
.
req
(
options
);
},
req
(
options
)
{
let
{
showLoading
,
url
,
data
,
auth
}
=
options
;
const
success
=
options
?.
success
;
const
fail
=
options
?.
fail
;
const
header
=
options
?.
header
??
{};
showLoading
&&
loading
.
show
();
let
requestTask
;
let
uniChannel
=
'wechat'
;
// #ifdef MP-KUAISHOU
uniChannel
=
'kuaishou'
;
// #endif
// #ifdef MP-TOUTIAO
uniChannel
=
'douyin'
;
// #endif
Object
.
assign
(
header
,
{
token
:
uni
.
getStorageSync
(
'token'
),
pkgName
:
app
.
globalData
.
pkgName
,
version
:
app
.
globalData
.
versionName
,
proChannel
:
uniChannel
})
options
=
Object
.
assign
(
options
,
{
url
:
`
${
app
.
globalData
.
baseUrl
}${
url
}
`
,
header
,
data
,
success
:
(
res
)
=>
{
showLoading
&&
loading
.
hide
();
switch
(
res
.
data
.
status
)
{
case
200
:
if
(
success
)
{
success
(
res
.
data
);
}
break
;
default
:
if
(
fail
)
{
fail
(
res
.
data
.
message
);
}
message
.
notify
(
res
.
data
.
message
);
break
;
}
},
fail
:
(
e
)
=>
{
message
.
notify
(
'服务器开小差了'
);
// alert({
// content: JSON.stringify(e)
// });
if
(
fail
)
{
fail
(
e
);
}
},
complete
:
()
=>
{
this
.
xhrPool
.
delete
(
requestTask
)
}
})
requestTask
=
uni
.
request
(
options
);
this
.
xhrPool
.
add
(
requestTask
)
}
}
};
import
{
navigateTo
,
redirectTo
,
loading
,
message
,
confirm
,
alert
}
from
'../utils/fun.js'
;
const
app
=
getApp
();
export
default
{
data
()
{
return
{
xhrPool
:
new
Set
(),
bottomSafePadding
:
app
.
globalData
.
bottomSafePadding
,
options
:
{},
auth
:
false
,
// 登录验证
paying
:
false
,
// 支付按钮状态
};
},
onLoad
(
options
)
{
this
.
options
=
options
;
},
onShow
()
{
this
.
loadData
();
},
onHide
()
{
if
(
this
.
xhrPool
&&
this
.
xhrPool
.
size
)
{
this
.
xhrPool
.
forEach
((
requestTask
)
=>
{
requestTask
.
abort
();
})
}
},
methods
:
{
authTo
(
url
)
{
//登录校验
},
authToNs
(
url
)
{
//登录校验不保留当前页面
},
loadData
()
{},
startPay
()
{
loading
.
show
();
this
.
paying
=
true
;
},
stopPay
()
{
loading
.
hide
();
this
.
paying
=
false
;
},
/**
* @param {Object} url 接口请求地址
* @param {Object} method 接口请求方式
* @param {Object} data 接口请求参数
*/
$http
(
url
,
method
,
data
=
{},
showLoading
=
false
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
[
method
.
toLowerCase
()]({
url
:
url
,
data
:
data
,
showLoading
:
showLoading
,
success
:
(
res
)
=>
{
resolve
(
res
)
},
fail
:
(
e
)
=>
{
reject
(
e
)
}
});
})
},
login
()
{
// navigateTo('user/login');
// let redirect = this.$scope.$page.fullPath.replace('/pages', '');
// console.log(redirect)
// navigateTo('user/login?redirect=' + encodeURIComponent(redirect));
},
logout
()
{
uni
.
removeStorageSync
(
'token'
);
},
put
(
options
)
{
options
=
Object
.
assign
({
showLoading
:
true
},
options
,
{
method
:
'PUT'
})
this
.
req
(
options
);
},
post
(
options
)
{
options
=
Object
.
assign
({
showLoading
:
true
},
options
,
{
method
:
'POST'
})
this
.
req
(
options
);
},
get
(
options
)
{
options
=
Object
.
assign
({
showLoading
:
false
},
options
,
{
method
:
'GET'
})
this
.
req
(
options
);
},
req
(
options
)
{
let
{
showLoading
,
url
,
data
,
auth
}
=
options
;
const
success
=
options
?.
success
;
const
fail
=
options
?.
fail
;
const
header
=
options
?.
header
??
{};
showLoading
&&
loading
.
show
();
let
requestTask
;
let
uniChannel
=
'wechat'
;
// #ifdef MP-KUAISHOU
uniChannel
=
'kuaishou'
;
// #endif
// #ifdef MP-TOUTIAO
uniChannel
=
'douyin'
;
// #endif
Object
.
assign
(
header
,
{
token
:
uni
.
getStorageSync
(
'token'
),
pkgName
:
app
.
globalData
.
pkgName
,
version
:
app
.
globalData
.
versionName
,
proChannel
:
uniChannel
})
options
=
Object
.
assign
(
options
,
{
url
:
`
${
app
.
globalData
.
baseUrl
}${
url
}
`
,
header
,
data
,
success
:
(
res
)
=>
{
showLoading
&&
loading
.
hide
();
switch
(
res
.
data
.
status
)
{
case
200
:
if
(
success
)
{
success
(
res
.
data
);
}
break
;
default
:
if
(
fail
)
{
fail
(
res
.
data
.
message
);
}
message
.
notify
(
res
.
data
.
message
);
break
;
}
},
fail
:
(
e
)
=>
{
message
.
notify
(
'服务器开小差了'
);
// alert({
// content: JSON.stringify(e)
// });
if
(
fail
)
{
fail
(
e
);
}
},
complete
:
()
=>
{
if
(
this
.
xhrPool
)
{
this
.
xhrPool
.
delete
(
requestTask
)
}
}
})
requestTask
=
uni
.
request
(
options
);
if
(
this
.
xhrPool
)
{
this
.
xhrPool
.
add
(
requestTask
)
}
}
}
};
\ No newline at end of file
vedio/package.json
View file @
300b258f
{
"uni-app"
:
{
"scripts"
:
{
"mp-dingtalk"
:
{
"title"
:
"钉钉小程序"
,
"env"
:
{
"UNI_PLATFORM"
:
"mp-alipay"
},
"define"
:
{
"MP-DINGTALK"
:
true
}
},
"mp-weixin-test"
:
{
"title"
:
"本地测试版本"
,
"env"
:
{
"UNI_PLATFORM"
:
"mp-weixin"
},
"define"
:
{
"MP-APP-TEST"
:
true
}
},
"mp-app-test"
:
{
"title"
:
"App 本地测试版本"
,
"env"
:
{
"UNI_PLATFORM"
:
"mp-weixin"
},
"define"
:
{
"MP-APP-TEST"
:
true
}
}
}
"scripts"
:
{}
},
"dependencies"
:
{
"json-bignumber"
:
"^1.1.1"
,
...
...
vedio/pages.json
View file @
300b258f
...
...
@@ -10,55 +10,37 @@
"pages"
:
[
//
#ifndef
APP-PLUS
{
"path"
:
"pages/loading"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#F2F1FF"
,
"navigationBarTextStyle"
:
"#000000"
}
"path"
:
"pages/loading"
},
//
#endif
{
"path"
:
"pages/home"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarTitleText"
:
"巨爽短剧"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
"navigationBarTitleText"
:
"巨爽短剧"
}
},
{
"path"
:
"pages/brower/brower"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
}
"path"
:
"pages/brower/brower"
}
],
//
分包配置
"subPackages"
:
[{
"root"
:
"pagesA"
,
"pages"
:
[{
"path"
:
"vipPay/vipPay"
,
"style"
:
{
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#2196f3"
,
"navigationBarTextStyle"
:
"black"
}
"path"
:
"vipPay/vipPay"
}]
},
{
"root"
:
"pagesC"
,
"pages"
:
[{
"path"
:
"ttvideo/ttVideoDetail"
,
"usingComponents"
:
{
"tt-video-player"
:
"ext://industry/video-player"
}
},
{
"path"
:
"playlet/index"
,
"style"
:
{
"backgroundColor"
:
"#000000"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#000000"
,
"navigationBarTextStyle"
:
"#ffffff"
,
"usingComponents "
:
{
"video-player"
:
"ext://industry/video-player"
}
"extends"
:
"ext://industry/playlet-plugin"
,
"isPageExtension"
:
true
}
}]
},
...
...
@@ -67,34 +49,22 @@
"pages"
:
[{
"path"
:
"watchRecord/watchRecord"
,
"style"
:
{
"navigationBarTitleText"
:
"观看记录"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
"navigationBarTitleText"
:
"观看记录"
}
},
{
"path"
:
"payRecord/payRecord"
,
"style"
:
{
"navigationBarTitleText"
:
"我的订单"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
"navigationBarTitleText"
:
"我的订单"
}
},
{
"path"
:
"dotRecord/dotRecord"
,
"style"
:
{
"navigationBarTitleText"
:
"看点记录"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
"navigationBarTitleText"
:
"看点记录"
}
},
{
"path"
:
"useDotRecord/useDotRecord"
,
"style"
:
{
"navigationBarTitleText"
:
"消费记录"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
"navigationBarTitleText"
:
"消费记录"
}
}]
}
...
...
@@ -108,8 +78,10 @@
}
},
"globalStyle"
:
{
"backgroundColor"
:
"#f5f5f5"
,
"navigationStyle"
:
"default"
,
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
,
"backgroundColor"
:
"#f5f5f5"
,
"app-plus"
:
{
"bounce"
:
"none"
,
"scrollIndicator"
:
"none"
...
...
vedio/pagesC/playlet/index.vue
0 → 100644
View file @
300b258f
<
script
>
import
Player
from
"@/components/player/player.vue"
;
import
Charge
from
"@/components/charge/charge.vue"
;
const
{
PlayletExtension
,
getPlayletManager
}
=
tt
;
PlayletExtension
();
import
common
from
'@/mixins/common'
;
export
default
{
components
:
{
Player
,
Charge
},
//采用uniapp的生命周期函数
onLoad
(
option
)
{
let
data
=
JSON
.
parse
(
decodeURIComponent
(
option
.
data
));
this
.
loadData
(
data
)
},
onReady
()
{
const
p_m
=
getPlayletManager
(
this
);
p_m
.
setCatalog
({
freeList
:
[{
start_episode_no
:
1
,
end_episode_no
:
5
,
}],
lockList
:
[{
start_episode_no
:
6
,
end_episode_no
:
200
,
}],
});
p_m
.
onPlay
((
e
)
=>
{
console
.
error
(
"可以播放了,可以播放了,可以播放了,可以播放了"
,
e
);
});
p_m
.
onError
((
e
)
=>
{
console
.
error
(
"插件页onload 报错了 报错了"
,
e
);
});
p_m
.
onPause
((
e
)
=>
{
console
.
error
(
"触发暂停播放onPause回调:"
,
e
);
});
},
onShow
()
{
console
.
log
(
"show"
);
},
mounted
()
{
console
.
error
(
this
,
"this"
);
// const child = this.$refs.childRef;
// console.error(child, this.$refs, "childRef");
},
onShareAppMessage
()
{
console
.
log
(
"share"
);
},
methods
:
{
cliPause
(
num
)
{
console
.
log
(
num
,
"cliPause"
);
},
loadData
(
data
)
{
const
p_m
=
getPlayletManager
(
this
);
common
.
methods
.
post
({
url
:
'/vedio/getIndexList'
,
data
:
{
vedioId
:
data
.
vedioId
},
showLoading
:
false
,
success
:
({
data
})
=>
{
let
_data
=
data
.
vedioMsg
p_m
.
setCatalog
({
freeList
:
_data
.
douyinFreeList
,
unlockList
:
_data
.
douyinUnlockList
,
lockList
:
_data
.
douyinLockList
,
});
}
});
}
},
};
</
script
>
\ No newline at end of file
vedio/pagesD/watchRecord/watchRecord.vue
View file @
300b258f
...
...
@@ -15,7 +15,7 @@
<view
style=
"font-size: 22rpx;color: gray;margin-top: 16rpx;"
>
观看至第
{{
item
.
seeIndex
}}
集
</view>
</view>
</view>
<view
style=
"display: flex;align-items: center;margin-right: 8rpx;"
>
<view
style=
"display: flex;align-items: center;margin-right: 8rpx;"
v-if=
"false"
>
<view
style=
"display: flex;flex-direction: column;"
>
<image
v-if=
"item.collect==0"
@
click=
"handleXing(item)"
style=
"width: 50rpx;height: 50rpx;display: flex;align-items: right;padding-right: 4rpx;"
...
...
@@ -51,6 +51,10 @@
openUrl
}
from
'@/utils/app+.js'
;
import
{
gotoVideoPlayerPage
}
from
"@/common/page-route.js"
const
app
=
getApp
();
export
default
{
...
...
@@ -69,10 +73,10 @@
},
queryList
(
page
,
size
)
{
this
.
post
({
url
:
'/vedio/history'
,
data
:
{
page
,
size
url
:
'/vedio/history'
,
data
:
{
page
,
size
},
showLoading
:
false
,
success
:
({
...
...
@@ -83,8 +87,7 @@
});
},
handleInfo
(
item
)
{
navigateTo
(
`/pagesC/ttvideo/ttVideoDetail?data=`
+
encodeURIComponent
(
JSON
.
stringify
(
item
))
+
'&tt_album_id='
+
item
.
douyinAlbumId
+
'&tt_episode_id='
+
item
.
douyinEpisodeId
);
gotoVideoPlayerPage
(
item
)
},
handleXing
(
item
)
{
var
that
=
this
;
...
...
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