Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
3fc6ba20
Commit
3fc6ba20
authored
May 07, 2020
by
程智春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播v2.0
parent
0c1816c9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
208 additions
and
163 deletions
+208
-163
src/components/common/navbar.vue
+1
-1
src/components/livedModel/livedControls.vue
+1
-1
src/components/livedModel/livedExplainingCommodities.vue
+5
-0
src/components/livedModel/livedIsMsg.vue
+2
-2
src/components/livedModel/livedShareDia.vue
+7
-0
src/components/livedModel/livedposterDia.vue
+140
-81
src/components/setting/index.vue
+0
-25
src/pages/live/index.vue
+24
-23
src/pages/lived/index.vue
+28
-30
No files found.
src/components/common/navbar.vue
View file @
3fc6ba20
...
@@ -177,9 +177,9 @@ export default {
...
@@ -177,9 +177,9 @@ export default {
this
.
$set
(
this
.
liveInfo
,
'boStream'
,
''
)
this
.
$set
(
this
.
liveInfo
,
'boStream'
,
''
)
this
.
$set
(
this
.
liveInfo
,
'tuiStream'
,
''
)
this
.
$set
(
this
.
liveInfo
,
'tuiStream'
,
''
)
this
.
pusher
.
stop
();
wx
.
navigateTo
({
url
:
`../liveOver/main?id=
${
this
.
id
}
&liveInfo=
${
JSON
.
stringify
(
this
.
liveInfo
)}
`
})
wx
.
navigateTo
({
url
:
`../liveOver/main?id=
${
this
.
id
}
&liveInfo=
${
JSON
.
stringify
(
this
.
liveInfo
)}
`
})
// wx.reLaunch({url:`../liveList/main`})
}
}
})
})
},
},
...
...
src/components/livedModel/livedControls.vue
View file @
3fc6ba20
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<p
class=
"goodsNum"
v-if=
"list.length>0"
>
{{
list
.
length
}}
</p>
<p
class=
"goodsNum"
v-if=
"list.length>0"
>
{{
list
.
length
}}
</p>
</div>
</div>
<div
class=
"goodsImg"
v-else
></div>
<div
class=
"goodsImg"
v-else
></div>
<div
class=
"iptCopy"
v-if=
"!info.playbackUrl || info.liveBroadcastState==3"
@
click=
"isLogin"
>
跟主播说点什么...
</div>
<div
class=
"iptCopy"
v-if=
"!info.playbackUrl || info.liveBroadcastState==3
|| info.liveBroadcastState==1
"
@
click=
"isLogin"
>
跟主播说点什么...
</div>
<div
class=
"iptCopy"
style=
"background:none;"
v-else
></div>
<div
class=
"iptCopy"
style=
"background:none;"
v-else
></div>
<div
class=
"shareIcon"
@
click=
"showShare"
>
<div
class=
"shareIcon"
@
click=
"showShare"
>
<img
src=
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADwElEQVR4Xu2aS6hNURjH//+RgYGRKAMDr1tmFJGBSxmIjGTgKq/rUURi5qKQkhKlLt1IHkl05VUG7r3lkW4MPMIVRXkNFMqAqL++2len45y99mPtc/bu7FWnc2qv9X3f/7fX41trHaLFC1tcP0oAZQ9ocQLlEGjxDlBOguUQKIdAixPI1RCQ1EbyZSPfSW4ASHoGYCqABwC2kBxsBIhcAJB0CsDKCsGfAKwleTNrCHkB0A9gbpXY3wDWkDyTJYQ8AxjWvY3k4awgFAGAad9PcmcWEIoCwLQfJ7nBN4QiATDtl22yJPnDF4iiATDdAwGEdz4gFBGA6bacwXrCo7QQmg5A0iQAJ2osgy5tliusInnLVTHsecMBSBoHYAaAmcG3/R6ZUITlCgbhXML2jTsPkDQdwLrgkzTeeu22kjySxGjmPSBj4ZWa95HsigshMwCSxgDYHnzixpW0fjfJjXEaZwJAkiUsJn5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LHuCDYpFtlD2gyG/PR+wt3wP+AsW7I1AzjlUOAAAAAElFTkSuQmCC"
alt=
""
>
...
...
src/components/livedModel/livedExplainingCommodities.vue
View file @
3fc6ba20
...
@@ -67,10 +67,14 @@ export default {
...
@@ -67,10 +67,14 @@ export default {
arr2
.
push
(
item
);
arr2
.
push
(
item
);
}
}
});
});
this
.
list
=
[...
arr1
,
...
arr2
];
this
.
list
=
[...
arr1
,
...
arr2
];
this
.
reserveList
=
arr1
;
this
.
reserveList
=
arr1
;
console
.
log
(
this
.
list
,
'--------------------------------this.list1212'
)
console
.
log
(
this
.
list
,
'--------------------------------this.list1212'
)
this
.
fixedGoodsTimer
=
setTimeout
(()
=>
{
this
.
fixedGoodsTimer
=
setTimeout
(()
=>
{
console
.
log
(
'这是上屏商品'
,
arr1
)
this
.
fixedGoodsList
=
arr1
?
arr1
:
[];
this
.
fixedGoodsList
=
arr1
?
arr1
:
[];
this
.
showFixedGoods
=
true
;
this
.
showFixedGoods
=
true
;
},
5000
);
},
5000
);
...
@@ -83,6 +87,7 @@ export default {
...
@@ -83,6 +87,7 @@ export default {
}
}
});
});
if
(
newArr
)
{
if
(
newArr
)
{
console
.
log
(
'这是上屏商品'
,
newArr
)
this
.
fixedGoodsList
=
newArr
;
this
.
fixedGoodsList
=
newArr
;
}
}
}
}
...
...
src/components/livedModel/livedIsMsg.vue
View file @
3fc6ba20
...
@@ -29,7 +29,7 @@ export default {
...
@@ -29,7 +29,7 @@ export default {
},
},
watch
:{
watch
:{
updateVal
(){
updateVal
(){
if
(
!
this
.
info
.
playbackUrl
){
if
(
!
this
.
info
.
playbackUrl
||
this
.
info
.
liveBroadcastState
==
1
||
this
.
info
.
liveBroadcastState
==
3
){
console
.
log
(
'2222222222222'
)
console
.
log
(
'2222222222222'
)
this
.
list
=
[...
this
.
list
,...
this
.
guestBookList
];
this
.
list
=
[...
this
.
list
,...
this
.
guestBookList
];
this
.
scrollTop
=
this
.
list
.
length
*
1000
;
this
.
scrollTop
=
this
.
list
.
length
*
1000
;
...
@@ -41,7 +41,7 @@ export default {
...
@@ -41,7 +41,7 @@ export default {
computed
:
{},
computed
:
{},
created
()
{},
created
()
{},
onLoad
(){
onLoad
(){
if
(
this
.
info
.
playbackUrl
&&
this
.
info
.
playbackUrl
[
0
]){
if
(
this
.
info
.
playbackUrl
&&
this
.
info
.
playbackUrl
[
0
]
&&
(
this
.
info
.
liveBroadcastState
!=
1
||
this
.
info
.
liveBroadcastState
!=
3
)
){
this
.
init
()
this
.
init
()
}
}
...
...
src/components/livedModel/livedShareDia.vue
View file @
3fc6ba20
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
:showPosterDia=
"showPosterDia"
:showPosterDia=
"showPosterDia"
:posterInfo=
"posterInfo"
:posterInfo=
"posterInfo"
:userInfo=
"userInfo"
:userInfo=
"userInfo"
:infoIsComplete=
"infoIsComplete"
@
closePosterDia=
"closePosterDia"
@
closePosterDia=
"closePosterDia"
></livedposterDia>
></livedposterDia>
</div>
</div>
...
@@ -55,6 +56,8 @@ export default {
...
@@ -55,6 +56,8 @@ export default {
againLoadingPoster
:
false
,
// 是否开始加载海报
againLoadingPoster
:
false
,
// 是否开始加载海报
userInfo
:
{},
userInfo
:
{},
spokesmanObj
:
{},
//分销员信息
spokesmanObj
:
{},
//分销员信息
infoIsComplete
:
false
,
};
};
},
},
components
:
{
components
:
{
...
@@ -85,6 +88,8 @@ export default {
...
@@ -85,6 +88,8 @@ export default {
mounted
()
{},
mounted
()
{},
onShow
(){
onShow
(){
console
.
log
(
'onSHow..........................'
)
console
.
log
(
'onSHow..........................'
)
this
.
showPosterDia
=
false
;
this
.
infoIsComplete
=
false
;
this
.
againLoadingPoster
=
false
;
this
.
againLoadingPoster
=
false
;
// this.init();
// this.init();
this
.
getSpokesman
()
this
.
getSpokesman
()
...
@@ -143,6 +148,7 @@ export default {
...
@@ -143,6 +148,7 @@ export default {
live
.
getUserInfo
().
then
(
res1
=>
{
live
.
getUserInfo
().
then
(
res1
=>
{
if
(
res1
.
data
.
code
==
'200'
){
if
(
res1
.
data
.
code
==
'200'
){
this
.
infoIsComplete
=
true
this
.
userInfo
=
res1
.
data
.
data
;
this
.
userInfo
=
res1
.
data
.
data
;
this
.
againLoadingPoster
=
true
;
this
.
againLoadingPoster
=
true
;
...
@@ -204,6 +210,7 @@ export default {
...
@@ -204,6 +210,7 @@ export default {
// 1}日 ${newTime.getHours()}:${newTime.getMinutes()}`;
// 1}日 ${newTime.getHours()}:${newTime.getMinutes()}`;
// console.log(this.info, "--------------96");
// console.log(this.info, "--------------96");
// this.posterInfo=query;
// this.posterInfo=query;
this
.
$emit
(
"closeShareDia"
);
this
.
showPosterDia
=
true
;
this
.
showPosterDia
=
true
;
// let url = `/pages/livedPoster/main?params=${JSON.stringify(query)}`;
// let url = `/pages/livedPoster/main?params=${JSON.stringify(query)}`;
// wx.navigateTo({
// wx.navigateTo({
...
...
src/components/livedModel/livedposterDia.vue
View file @
3fc6ba20
...
@@ -6,13 +6,13 @@
...
@@ -6,13 +6,13 @@
:close-on-click-overlay=
"true"
:close-on-click-overlay=
"true"
@
close=
"closeDia"
@
close=
"closeDia"
>
>
<div
class=
"posterWrap"
@
click=
"closeDia"
>
<div
class=
"posterWrap"
@
click
.
stop
=
"closeDia"
>
<div
class=
"canvas-wrap"
>
<div
class=
"canvas-wrap"
>
<canvas
canvas-id=
"posterCanvas"
class=
"myCanvas"
></canvas>
<canvas
canvas-id=
"posterCanvas"
class=
"myCanvas"
></canvas>
<div
v-if=
"!posterStatus"
class=
"masker"
>
加载中...
</div>
<div
v-if=
"!posterStatus"
class=
"masker"
>
加载中...
</div>
</div>
</div>
<div
class=
"saveBtn"
@
click=
"getImg"
>
点击保存海报
</div>
<div
class=
"saveBtn"
@
click
.
stop
=
"getImg"
>
点击保存海报
</div>
</div>
</div>
</van-popup>
</van-popup>
</div>
</div>
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
import
live
from
"@/api/live"
;
import
live
from
"@/api/live"
;
import
{
DFSImg
}
from
'../../utils/common.js'
import
{
DFSImg
}
from
'../../utils/common.js'
export
default
{
export
default
{
props
:
[
"showPosterDia"
,
"posterInfo"
,
"userInfo"
],
props
:
[
"showPosterDia"
,
"posterInfo"
,
"userInfo"
,
"infoIsComplete"
],
name
:
""
,
name
:
""
,
data
()
{
data
()
{
return
{
return
{
...
@@ -40,6 +40,8 @@ export default {
...
@@ -40,6 +40,8 @@ export default {
miniCode
:
""
miniCode
:
""
},
},
posterStatus
:
false
,
posterStatus
:
false
,
tempFilePath
:
''
,
};
};
},
},
components
:
{},
components
:
{},
...
@@ -76,16 +78,19 @@ export default {
...
@@ -76,16 +78,19 @@ export default {
this
.
$set
(
this
.
info
,
'avatarUrl'
,
this
.
userInfo
.
headPortraitUrl
)
this
.
$set
(
this
.
info
,
'avatarUrl'
,
this
.
userInfo
.
headPortraitUrl
)
// this.info.avatarUrl = this.userInfo.headPortraitUrl
// this.info.avatarUrl = this.userInfo.headPortraitUrl
let
_this
=
this
;
let
_this
=
this
;
wx
.
getUserInfo
({
if
(
this
.
infoIsComplete
){
//获取微信用户信息
wx
.
getUserInfo
({
success
:
function
(
res
)
{
//获取微信用户信息
(
_this
.
info
.
nickName
=
res
.
userInfo
.
nickName
),
success
:
function
(
res
)
{
(
_this
.
info
.
nickName
=
res
.
userInfo
.
nickName
),
_this
.
initPoster
(
_this
.
info
);
},
fail
:
function
(
res
)
{
_this
.
initPoster
(
_this
.
info
);
_this
.
initPoster
(
_this
.
info
);
},
}
fail
:
function
(
res
)
{
});
_this
.
initPoster
(
_this
.
info
);
}
}
});
},
},
initPoster
(
info
)
{
initPoster
(
info
)
{
console
.
log
(
info
,
"---------------------71"
);
console
.
log
(
info
,
"---------------------71"
);
...
@@ -111,14 +116,11 @@ export default {
...
@@ -111,14 +116,11 @@ export default {
ctx
.
setFontSize
(
15
);
ctx
.
setFontSize
(
15
);
ctx
.
fillText
(
info
.
nickName
,
70
*
bili
,
410
*
bili
);
ctx
.
fillText
(
info
.
nickName
,
70
*
bili
,
410
*
bili
);
//
ctx
.
setFillStyle
(
"#FDC330"
);
ctx
.
setFillStyle
(
"#FDC330"
);
ctx
.
fillRect
(
0
,
330
*
bili
,
310
*
bili
,
40
*
bili
);
ctx
.
fillRect
(
0
,
330
*
bili
,
310
*
bili
,
40
*
bili
);
if
(
this
.
info
.
livedStatus
==
0
){
if
(
this
.
info
.
livedStatus
==
0
){
console
.
log
(
'直播
预告'
)
console
.
log
(
'直播
时间'
,
this
.
info
.
livedTime
)
this
.
saveThe
(
'https://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/2a6cbdf0-91ca-4993-9ec5-963cb30ba9b8.png'
,
path
=>
{
this
.
saveThe
(
'https://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/2a6cbdf0-91ca-4993-9ec5-963cb30ba9b8.png'
,
path
=>
{
ctx
.
drawImage
(
path
,
160
*
bili
,
340
*
bili
,
18
*
bili
,
18
*
bili
);
ctx
.
drawImage
(
path
,
160
*
bili
,
340
*
bili
,
18
*
bili
,
18
*
bili
);
ctx
.
save
()
ctx
.
save
()
...
@@ -126,59 +128,120 @@ export default {
...
@@ -126,59 +128,120 @@ export default {
ctx
.
setFillStyle
(
"#3F2F00"
);
ctx
.
setFillStyle
(
"#3F2F00"
);
ctx
.
setFontSize
(
14
);
ctx
.
setFontSize
(
14
);
ctx
.
fillText
(
this
.
info
.
livedTime
,
184
*
bili
,
355
*
bili
);
ctx
.
fillText
(
this
.
info
.
livedTime
,
184
*
bili
,
355
*
bili
);
})
}
this
.
saveThe
(
'https://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/cc6db4d4-55bb-4add-a9ba-5733499aa5d0.png'
,
path
=>
{
ctx
.
drawImage
(
path
,
20
*
bili
,
340
*
bili
,
20
*
bili
,
18
*
bili
);
ctx
.
save
()
ctx
.
setTextAlign
(
"left"
);
ctx
.
setFillStyle
(
"#3F2F00"
);
ctx
.
setFontSize
(
14
);
this
.
saveThe
(
'https://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/cc6db4d4-55bb-4add-a9ba-5733499aa5d0.png'
,
path
=>
{
ctx
.
drawImage
(
path
,
20
*
bili
,
340
*
bili
,
20
*
bili
,
18
*
bili
);
ctx
.
save
()
ctx
.
setTextAlign
(
"left"
);
ctx
.
setFillStyle
(
"#3F2F00"
);
ctx
.
setFontSize
(
14
);
let
liveText
=
''
;
let
liveText
=
''
;
if
(
this
.
info
.
livedStatus
==
0
){
if
(
this
.
info
.
livedStatus
==
0
){
liveText
=
'直播预告'
liveText
=
'直播预告'
}
else
if
(
this
.
info
.
livedStatus
==
1
){
}
else
if
(
this
.
info
.
livedStatus
==
1
||
this
.
info
.
livedStatus
==
3
){
liveText
=
'直播中'
liveText
=
'直播中'
}
else
{
}
else
{
liveText
=
'直播结束'
liveText
=
'直播结束'
}
}
ctx
.
fillText
(
liveText
,
48
*
bili
,
355
*
bili
);
console
.
log
(
'直播状态'
,
liveText
)
ctx
.
fillText
(
liveText
,
48
*
bili
,
355
*
bili
);
})
ctx
.
setTextAlign
(
"left"
);
ctx
.
setFillStyle
(
"#3F2F00"
);
ctx
.
setFontSize
(
14
);
ctx
.
fillText
(
"邀你一起看直播"
,
10
*
bili
,
450
*
bili
);
// 直播名
ctx
.
setTextAlign
(
"left"
);
ctx
.
setFillStyle
(
"#3F2F00"
);
ctx
.
setFontSize
(
18
);
ctx
.
fillText
(
info
.
livedTitle
,
10
*
bili
,
500
*
bili
);
//圆形头像框
ctx
.
setStrokeStyle
(
"rgba(0,0,0,0)"
);
ctx
.
arc
(
36
*
bili
,
400
*
bili
,
25
*
bili
,
0
,
2
*
Math
.
PI
);
ctx
.
fill
();
this
.
saveThe
(
info
.
qrCode
,
path
=>
{
ctx
.
drawImage
(
path
,
200
*
bili
,
390
*
bili
,
100
*
bili
,
100
*
bili
);
ctx
.
save
();
//头像
ctx
.
clip
();
this
.
saveThe
(
info
.
avatarUrl
,
path
=>
{
ctx
.
drawImage
(
path
,
10
*
bili
,
370
*
bili
,
54
*
bili
,
54
*
bili
);
ctx
.
save
();
ctx
.
stroke
();
// ctx.draw(false,this.drawImageHanlder());
ctx
.
draw
();
this
.
posterStatus
=
true
;
console
.
log
(
"--------海报生成成功"
);
})
});
})
})
}
else
{
this
.
saveThe
(
'https://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/cc6db4d4-55bb-4add-a9ba-5733499aa5d0.png'
,
path
=>
{
ctx
.
drawImage
(
path
,
20
*
bili
,
340
*
bili
,
20
*
bili
,
18
*
bili
);
ctx
.
save
()
ctx
.
setTextAlign
(
"left"
);
ctx
.
setFillStyle
(
"#3F2F00"
);
ctx
.
setFontSize
(
14
);
ctx
.
setTextAlign
(
"left"
);
let
liveText
=
''
;
ctx
.
setFillStyle
(
"#3F2F00"
);
if
(
this
.
info
.
livedStatus
==
0
){
ctx
.
setFontSize
(
14
);
liveText
=
'直播预告'
ctx
.
fillText
(
"邀你一起看直播"
,
10
*
bili
,
450
*
bili
);
}
else
if
(
this
.
info
.
livedStatus
==
1
||
this
.
info
.
livedStatus
==
3
){
// 直播名
liveText
=
'直播中'
ctx
.
setTextAlign
(
"left"
);
}
else
{
ctx
.
setFillStyle
(
"#3F2F00"
);
liveText
=
'直播结束'
ctx
.
setFontSize
(
18
);
}
ctx
.
fillText
(
info
.
livedTitle
,
10
*
bili
,
500
*
bili
);
console
.
log
(
'直播状态'
,
liveText
)
//圆形头像框
ctx
.
fillText
(
liveText
,
48
*
bili
,
355
*
bili
);
ctx
.
setStrokeStyle
(
"rgba(0,0,0,0)"
);
ctx
.
arc
(
36
*
bili
,
400
*
bili
,
25
*
bili
,
0
,
2
*
Math
.
PI
);
ctx
.
fill
();
ctx
.
setTextAlign
(
"left"
);
this
.
saveThe
(
info
.
qrCode
,
path
=>
{
ctx
.
setFillStyle
(
"#3F2F00"
);
ctx
.
drawImage
(
path
,
200
*
bili
,
390
*
bili
,
100
*
bili
,
100
*
bili
);
ctx
.
setFontSize
(
14
);
ctx
.
save
();
ctx
.
fillText
(
"邀你一起看直播"
,
10
*
bili
,
450
*
bili
);
//头像
// 直播名
ctx
.
clip
();
ctx
.
setTextAlign
(
"left"
);
this
.
saveThe
(
info
.
avatarUrl
,
path
=>
{
ctx
.
setFillStyle
(
"#3F2F00"
);
ctx
.
drawImage
(
path
,
10
*
bili
,
370
*
bili
,
54
*
bili
,
54
*
bili
);
ctx
.
setFontSize
(
18
);
ctx
.
save
();
ctx
.
fillText
(
info
.
livedTitle
,
10
*
bili
,
500
*
bili
);
//圆形头像框
ctx
.
setStrokeStyle
(
"rgba(0,0,0,0)"
);
ctx
.
arc
(
36
*
bili
,
400
*
bili
,
25
*
bili
,
0
,
2
*
Math
.
PI
);
ctx
.
fill
();
this
.
saveThe
(
info
.
qrCode
,
path
=>
{
ctx
.
drawImage
(
path
,
200
*
bili
,
390
*
bili
,
100
*
bili
,
100
*
bili
);
ctx
.
save
();
//头像
ctx
.
clip
();
this
.
saveThe
(
info
.
avatarUrl
,
path
=>
{
ctx
.
drawImage
(
path
,
10
*
bili
,
370
*
bili
,
54
*
bili
,
54
*
bili
);
ctx
.
save
();
ctx
.
stroke
();
ctx
.
stroke
();
ctx
.
draw
();
// ctx.draw(false,this.drawImageHanlder());
ctx
.
draw
();
this
.
posterStatus
=
true
;
console
.
log
(
"--------海报生成成功"
);
this
.
posterStatus
=
true
;
console
.
log
(
"--------海报生成成功"
);
})
});
})
})
});
}
});
});
},
},
// 小程序需要将图片下载下来,然后才能绘制到画布上
// 小程序需要将图片下载下来,然后才能绘制到画布上
...
@@ -206,26 +269,20 @@ export default {
...
@@ -206,26 +269,20 @@ export default {
// 点击保存时,将画布生成海报
// 点击保存时,将画布生成海报
handleSave
()
{
handleSave
()
{
var
that
=
this
;
var
that
=
this
;
wx
.
showLoading
({
title
:
"正在保存..."
,
mask
:
true
});
wx
.
getSetting
({
wx
.
getSetting
({
success
(
res
)
{
success
(
res
)
{
console
.
log
(
'11111111111'
)
if
(
res
.
authSetting
[
"scope.writePhotosAlbum"
])
{
if
(
res
.
authSetting
[
"scope.writePhotosAlbum"
])
{
wx
.
showLoading
({
title
:
"正在保存..."
,
mask
:
true
});
that
.
saveImg
();
that
.
saveImg
();
}
else
if
(
res
.
authSetting
[
"scope.writePhotosAlbum"
]
===
undefined
)
{
}
else
if
(
res
.
authSetting
[
"scope.writePhotosAlbum"
]
===
undefined
)
{
console
.
log
(
'3333333333333'
)
wx
.
authorize
({
wx
.
authorize
({
scope
:
"scope.writePhotosAlbum"
,
scope
:
"scope.writePhotosAlbum"
,
success
()
{
success
()
{
wx
.
showLoading
({
title
:
"正在保存..."
,
mask
:
true
});
that
.
saveImg
();
that
.
saveImg
();
},
},
fail
()
{
fail
()
{
...
@@ -237,15 +294,9 @@ export default {
...
@@ -237,15 +294,9 @@ export default {
}
}
});
});
}
else
{
}
else
{
console
.
log
(
'44444444444444'
)
wx
.
openSetting
({
wx
.
openSetting
({
success
(
res
)
{
success
(
res
)
{
if
(
res
.
authSetting
[
"scope.writePhotosAlbum"
])
{
if
(
res
.
authSetting
[
"scope.writePhotosAlbum"
])
{
wx
.
showLoading
({
title
:
"正在保存..."
,
mask
:
true
});
that
.
saveImg
();
that
.
saveImg
();
}
else
{
}
else
{
wx
.
showToast
({
wx
.
showToast
({
...
@@ -267,6 +318,11 @@ export default {
...
@@ -267,6 +318,11 @@ export default {
});
});
},
},
saveImg
()
{
saveImg
()
{
let
_this
=
this
;
// 按照设备比例去计算图片和画布尺寸
// 按照设备比例去计算图片和画布尺寸
let
bili
=
this
.
InfoSync
.
windowWidth
/
375
*
1
;
let
bili
=
this
.
InfoSync
.
windowWidth
/
375
*
1
;
wx
.
canvasToTempFilePath
({
wx
.
canvasToTempFilePath
({
...
@@ -286,6 +342,7 @@ export default {
...
@@ -286,6 +342,7 @@ export default {
wx
.
saveImageToPhotosAlbum
({
wx
.
saveImageToPhotosAlbum
({
filePath
:
tempFilePath
,
filePath
:
tempFilePath
,
success
(
res
)
{
success
(
res
)
{
_this
.
$emit
(
"closePosterDia"
);
wx
.
showModal
({
wx
.
showModal
({
content
:
"图片已保存到相册,赶紧晒一下吧~"
,
content
:
"图片已保存到相册,赶紧晒一下吧~"
,
showCancel
:
false
,
showCancel
:
false
,
...
@@ -304,6 +361,8 @@ export default {
...
@@ -304,6 +361,8 @@ export default {
});
});
},
},
fail
:
err
=>
{
fail
:
err
=>
{
console
.
log
(
err
,
'保存相册出错'
);
wx
.
hideLoading
();
wx
.
hideLoading
();
wx
.
showToast
({
wx
.
showToast
({
title
:
"出现了错误,请稍后再试2222"
,
title
:
"出现了错误,请稍后再试2222"
,
...
...
src/components/setting/index.vue
View file @
3fc6ba20
...
@@ -222,31 +222,6 @@ export default {
...
@@ -222,31 +222,6 @@ export default {
//开始直播
//开始直播
startLive
(){
startLive
(){
this
.
$emit
(
'setBeautyStart'
,
'start'
)
this
.
$emit
(
'setBeautyStart'
,
'start'
)
//判断网络环境
// wx.getNetworkType({
// success : (res) => {
// if(res.errMsg == 'getNetworkType:ok'){
// if(res.networkType != 'wifi'){
// wx.showModal({
// title: '流量提醒',
// content: '你目前处于非WIFI环境,是否继续',
// confirmText : '继续',
// confirmColor : '#07c160',
// success : (res1) => {
// if (res1.confirm) {
// this.$emit('setBeautyStart','start')
// console.log('用户点击确定')
// } else if (res1.cancel) {
// // console.log('用户点击取消')
// }
// }
// })
// }else{
// this.$emit('setBeautyStart','start')
// }
// }
// }
// })
}
}
}
}
...
...
src/pages/live/index.vue
View file @
3fc6ba20
...
@@ -253,13 +253,6 @@ export default {
...
@@ -253,13 +253,6 @@ export default {
}
}
},
},
// tuiStream(oldval,newval){
// if(newval){
// console.log('tuiStream',newval)
// this.tuiStream = newval
// }
// }
},
},
components
:{
components
:{
navBar
,
navBar
,
...
@@ -454,9 +447,6 @@ export default {
...
@@ -454,9 +447,6 @@ export default {
//获取直播间详情
//获取直播间详情
getLiveDetail
(
id
){
getLiveDetail
(
id
){
console
.
log
(
'获取'
,
this
.
recoverLive
)
if
(
this
.
isDetailLock
&&
this
.
isDetailControlLock
){
if
(
this
.
isDetailLock
&&
this
.
isDetailControlLock
){
this
.
isDetailLock
=
false
;
this
.
isDetailLock
=
false
;
liveApi
.
queryLiveDetail
({
id
}).
then
(
res
=>
{
liveApi
.
queryLiveDetail
({
id
}).
then
(
res
=>
{
...
@@ -466,8 +456,6 @@ export default {
...
@@ -466,8 +456,6 @@ export default {
let
result
=
res
.
data
.
data
let
result
=
res
.
data
.
data
if
(
result
){
if
(
result
){
result
.
coverUrl
=
DFSImg
(
result
.
coverUrl
)
result
.
coverUrl
=
DFSImg
(
result
.
coverUrl
)
result
.
logoUrl
=
DFSImg
(
result
.
logoUrl
)
result
.
logoUrl
=
DFSImg
(
result
.
logoUrl
)
this
.
liveInfo
=
result
;
this
.
liveInfo
=
result
;
...
@@ -493,9 +481,6 @@ export default {
...
@@ -493,9 +481,6 @@ export default {
}
else
{
}
else
{
this
.
realStartTime
=
0
this
.
realStartTime
=
0
}
}
this
.
getLiveTimeHandler
(
result
.
startTime
)
this
.
getLiveTimeHandler
(
result
.
startTime
)
this
.
getProductList
();
//获取商品列表
this
.
getProductList
();
//获取商品列表
...
@@ -512,10 +497,6 @@ export default {
...
@@ -512,10 +497,6 @@ export default {
}
}
})
})
}
}
}
else
if
(
res
.
data
.
code
==
'-1'
){
}
else
if
(
res
.
data
.
code
==
'-1'
){
wx
.
showModal
({
wx
.
showModal
({
title
:
'提示'
,
title
:
'提示'
,
...
@@ -634,7 +615,27 @@ export default {
...
@@ -634,7 +615,27 @@ export default {
}
}
})
})
}
else
{
}
else
{
this
.
startLive
(
type
);
liveApi
.
queryLiveDetail
({
id
:
this
.
liveId
}).
then
(
res2
=>
{
if
(
res2
.
data
.
code
==
'200'
){
if
(
res2
.
data
.
data
==
null
||
res2
.
data
.
data
.
liveBroadcastState
==
4
||
res2
.
data
.
data
.
liveBroadcastState
==
2
){
wx
.
showModal
({
title
:
'提示'
,
content
:
'直播已关闭'
,
success
(
res3
)
{
if
(
res3
.
confirm
)
{
wx
.
reLaunch
({
url
:
`../liveList/main`
})
}
else
if
(
res3
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
}
else
{
this
.
startLive
(
type
);
}
}
})
}
}
}
}
}
}
...
@@ -852,9 +853,9 @@ export default {
...
@@ -852,9 +853,9 @@ export default {
liveBroadcastId
:
this
.
liveId
,
liveBroadcastId
:
this
.
liveId
,
upperScreenState
:
type
upperScreenState
:
type
}).
then
(
res
=>
{
}).
then
(
res
=>
{
this
.
isChangeProduct
=
true
;
if
(
res
.
data
.
code
==
'200'
){
if
(
res
.
data
.
code
==
'200'
){
this
.
isChangeProduct
=
true
;
console
.
log
(
'上下屏'
)
console
.
log
(
'上下屏'
)
if
(
type
==
1
){
if
(
type
==
1
){
...
@@ -886,7 +887,7 @@ export default {
...
@@ -886,7 +887,7 @@ export default {
}
}
})
})
}
}
console
.
log
(
this
.
productList
)
console
.
log
(
this
.
speakProductList
,
'上下屏商品'
)
}
else
{
}
else
{
wx
.
showModal
({
wx
.
showModal
({
...
...
src/pages/lived/index.vue
View file @
3fc6ba20
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<div
class=
"info"
>
<div
class=
"info"
>
<p
class=
"name line-clamp1"
v-if=
"shopName"
>
{{
shopName
}}
</p>
<p
class=
"name line-clamp1"
v-if=
"shopName"
>
{{
shopName
}}
</p>
<p
class=
"num"
v-if=
"liveNoticeInfo.liveBroadcastState != 2 && liveNoticeInfo.liveBroadcastState != 4"
>
<p
class=
"num"
v-if=
"liveNoticeInfo.liveBroadcastState != 2 && liveNoticeInfo.liveBroadcastState != 4"
>
<span>
{{
liveNoticeInfo
.
historyWatchNum
}}
</span>
<span>
{{
historyWatchNum
}}
</span>
<span
style=
"margin-left:6px;"
>
观看
</span>
<span
style=
"margin-left:6px;"
>
观看
</span>
</p>
</p>
</div>
</div>
...
@@ -61,8 +61,6 @@
...
@@ -61,8 +61,6 @@
style=
"width:100%;height:100vh;z-index:-1"
style=
"width:100%;height:100vh;z-index:-1"
:src=
"liveNoticeInfo.playbackUrl[0]"
:src=
"liveNoticeInfo.playbackUrl[0]"
autoplay
autoplay
loop
:controls=
"false"
:show-fullscreen-btn=
"false"
:show-fullscreen-btn=
"false"
object-fit=
"cover"
object-fit=
"cover"
/>
/>
...
@@ -120,6 +118,7 @@ export default {
...
@@ -120,6 +118,7 @@ export default {
status
:
0
,
// 0:未开始 1:直播中 2:已结束
status
:
0
,
// 0:未开始 1:直播中 2:已结束
// 总数据
// 总数据
liveNoticeInfo
:
{},
//详情
liveNoticeInfo
:
{},
//详情
historyWatchNum
:
0
,
entryNoticeText
:
""
,
//用户通知
entryNoticeText
:
""
,
//用户通知
guestBookList
:
[],
// 定时查评论
guestBookList
:
[],
// 定时查评论
goodsList
:
[],
//商品列表
goodsList
:
[],
//商品列表
...
@@ -147,6 +146,8 @@ export default {
...
@@ -147,6 +146,8 @@ export default {
newCommentsTime
:
0
,
newCommentsTime
:
0
,
userActivebeginTime
:
0
,
userActivebeginTime
:
0
,
videoContext
:
null
,
videoContext
:
null
,
openLiveTimer
:
null
,
};
};
},
},
components
:
{
components
:
{
...
@@ -237,7 +238,12 @@ export default {
...
@@ -237,7 +238,12 @@ export default {
}
}
}
}
this
.
init
();
this
.
init
();
this
.
openLiveTimer
=
setInterval
(()
=>
{
this
.
init
();
},
5000
)
// this.userEntry("IN");
// this.userEntry("IN");
...
@@ -320,6 +326,10 @@ export default {
...
@@ -320,6 +326,10 @@ export default {
clearInterval
(
this
.
goodTiming
);
clearInterval
(
this
.
goodTiming
);
this
.
goodTiming
=
null
;
this
.
goodTiming
=
null
;
}
}
if
(
this
.
openLiveTimer
){
clearInterval
(
this
.
openLiveTimer
);
this
.
openLiveTimer
=
null
;
}
},
},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
...
@@ -333,31 +343,27 @@ export default {
...
@@ -333,31 +343,27 @@ export default {
this
.
shopName
=
res
.
data
.
data
.
orgName
;
this
.
shopName
=
res
.
data
.
data
.
orgName
;
this
.
shopLogo
=
DFSImg
(
res
.
data
.
data
.
logoUrl
,
40
,
40
);
this
.
shopLogo
=
DFSImg
(
res
.
data
.
data
.
logoUrl
,
40
,
40
);
this
.
liveNoticeInfo
=
res
.
data
.
data
;
this
.
liveNoticeInfo
=
res
.
data
.
data
;
this
.
liveNoticeInfo
.
coverUrl
=
this
.
liveNoticeInfo
.
coverUrl
this
.
liveNoticeInfo
.
coverUrl
=
this
.
liveNoticeInfo
.
coverUrl
?
DFSImg
(
this
.
liveNoticeInfo
.
coverUrl
):
""
;
?
DFSImg
(
this
.
liveNoticeInfo
.
coverUrl
)
this
.
liveNoticeInfo
.
shareUrl
=
this
.
liveNoticeInfo
.
coverUrl
?
DFSImg
(
this
.
liveNoticeInfo
.
coverUrl
,
500
,
400
):
""
;
:
""
;
this
.
liveNoticeInfo
.
shareUrl
=
this
.
liveNoticeInfo
.
coverUrl
?
DFSImg
(
this
.
liveNoticeInfo
.
coverUrl
,
500
,
400
)
:
""
;
this
.
getGoodsList
();
this
.
getGoodsList
();
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
==
2
)
{
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
==
2
)
{
// 调直播结束
// 调直播结束
this
.
endLived
();
this
.
endLived
();
}
else
{
}
else
{
console
.
log
(
"这里"
);
console
.
log
(
"这里"
);
this
.
timingGetInfo
();
// this.timingGetInfo();
}
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
!=
2
&&
!
this
.
goodTiming
)
{
this
.
goodTiming
=
setInterval
(()
=>
{
console
.
log
(
"--------获取商品接口"
);
this
.
getGoodsList
();
},
5000
);
}
else
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
==
2
&&
this
.
goodTiming
)
{
clearInterval
(
this
.
goodTiming
);
}
}
// if (this.liveNoticeInfo.liveBroadcastState != 2 && !this.goodTiming) {
// this.goodTiming = setInterval(() => {
// console.log("--------获取商品接口");
// }, 5000);
// } else if (
// this.liveNoticeInfo.liveBroadcastState == 2 &&
// this.goodTiming
// ) {
// clearInterval(this.goodTiming);
// }
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
==
4
){
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
==
4
){
this
.
endLived
();
this
.
endLived
();
...
@@ -503,13 +509,6 @@ export default {
...
@@ -503,13 +509,6 @@ export default {
(
this
.
liveNoticeInfo
.
liveBroadcastState
==
1
&&
(
this
.
liveNoticeInfo
.
liveBroadcastState
==
1
&&
resData
.
liveState
==
"END_LIVE"
)
resData
.
liveState
==
"END_LIVE"
)
)
{
)
{
console
.
log
(
this
.
liveNoticeInfo
.
liveBroadcastState
,
resData
.
liveState
,
this
.
firstComing
,
"直播中----结束"
,
"结束----结束"
);
//直播结束且接口已结束
//直播结束且接口已结束
if
(
this
.
firstComing
)
{
if
(
this
.
firstComing
)
{
this
.
firstComing
=
false
;
this
.
firstComing
=
false
;
...
@@ -545,6 +544,7 @@ export default {
...
@@ -545,6 +544,7 @@ export default {
// 数据初始化
// 数据初始化
this
.
entryNoticeText
=
""
;
this
.
entryNoticeText
=
""
;
this
.
liveNoticeInfo
.
historyWatchNum
=
resData
.
historyWatchNum
-
0
>=
10000
?
((
resData
.
historyWatchNum
-
0
)
/
10000
).
toFixed
(
1
)
+
'w'
:
resData
.
historyWatchNum
;
//观看人数
this
.
liveNoticeInfo
.
historyWatchNum
=
resData
.
historyWatchNum
-
0
>=
10000
?
((
resData
.
historyWatchNum
-
0
)
/
10000
).
toFixed
(
1
)
+
'w'
:
resData
.
historyWatchNum
;
//观看人数
this
.
historyWatchNum
=
resData
.
historyWatchNum
-
0
>=
10000
?
((
resData
.
historyWatchNum
-
0
)
/
10000
).
toFixed
(
1
)
+
'w'
:
resData
.
historyWatchNum
;
//观看人数
if
(
resData
.
entryNoticeList
.
length
>
0
)
{
if
(
resData
.
entryNoticeList
.
length
>
0
)
{
if
(
resData
.
entryNoticeList
.
length
==
1
)
{
if
(
resData
.
entryNoticeList
.
length
==
1
)
{
this
.
entryNoticeText
=
`
${
resData
.
entryNoticeList
[
0
].
userName
}
`
;
//用户进入
this
.
entryNoticeText
=
`
${
resData
.
entryNoticeList
[
0
].
userName
}
`
;
//用户进入
...
@@ -624,8 +624,6 @@ export default {
...
@@ -624,8 +624,6 @@ export default {
getServerTimeNow
()
{
getServerTimeNow
()
{
live
.
queryServerTimeNow
().
then
(
res
=>
{
live
.
queryServerTimeNow
().
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
//定时查询数据
// this.timingGetInfo(res.data.data);
this
.
newCommentsTime
=
res
.
data
.
data
;
this
.
newCommentsTime
=
res
.
data
.
data
;
this
.
userActivebeginTime
=
res
.
data
.
data
;
this
.
userActivebeginTime
=
res
.
data
.
data
;
...
...
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