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
b9b8c0c0
Commit
b9b8c0c0
authored
Mar 24, 2020
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改bug
parent
c3ebe44f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
38 deletions
+70
-38
src/api/live.js
+5
-0
src/components/livedModel/livedControls.vue
+18
-8
src/components/livedModel/livedExplainingCommodities.vue
+39
-25
src/components/livedModel/livedIsEnded.vue
+3
-3
src/pages/lived/index.vue
+5
-2
No files found.
src/api/live.js
View file @
b9b8c0c0
...
...
@@ -61,4 +61,8 @@ export default {
getLiveQRCode
(
options
)
{
return
requestGET
(
`
${
process
.
env
.
OLSHOP_URL
}
/liveBroadcastInfo/getLiveQRCode?id=
${
options
}
`
);
},
// 获取直播配置
getConfigValueByConfigCode
(
options
)
{
return
requestGET
(
`
${
process
.
env
.
OLSHOP_URL
}
/liveBroadcastInfo/getConfigValueByConfigCode`
,
options
);
},
};
\ No newline at end of file
src/components/livedModel/livedControls.vue
View file @
b9b8c0c0
...
...
@@ -156,14 +156,16 @@ export default {
this
.
liveId
=
params
.
liveId
;
let
_this
=
this
;
wx
.
getStorage
({
key
:
"sessionid"
,
success
(
res
)
{
_this
.
loadingShare
=
true
;
},
fail
(
res
)
{
_this
.
loadingShare
=
false
;
}
});
key
:
"sessionid"
,
success
(
res
)
{
_this
.
loadingShare
=
true
;
},
fail
(
res
)
{
_this
.
loadingShare
=
false
;
}
});
// 获取直播配置
this
.
getLivedConfig
();
},
mounted
()
{},
methods
:
{
...
...
@@ -294,6 +296,14 @@ export default {
this
.
$emit
(
"toSendMsg"
,
query
);
}
}
},
getLivedConfig
(){
let
configCode
=
"LIVE_LIKE_ICON"
;
live
.
getConfigValueByConfigCode
(
configCode
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
){
this
.
iconList
=
JSON
.
parse
(
res
.
data
.
data
);
}
})
}
}
};
...
...
src/components/livedModel/livedExplainingCommodities.vue
View file @
b9b8c0c0
...
...
@@ -2,7 +2,12 @@
<!-- 讲解商品 -->
<div
class=
"livedExplainingCommodities"
>
<div
class=
"goods clearfix"
v-if=
"!showFixedGoods"
>
<div
class=
"goodsList"
:class=
"
{isEC:item.upperScreenState==1}" v-for="(item,index) in list" :key="index">
<div
class=
"goodsList"
:class=
"
{isEC:item.upperScreenState==1}"
v-for="(item,index) in list"
:key="index"
>
<img
:src=
"item.productImgUrl"
alt
/>
<p
class=
"num"
>
{{
item
.
number
}}
</p>
<div
class=
"explain"
v-if=
"item.upperScreenState==1"
>
讲解中
</div>
...
...
@@ -12,8 +17,11 @@
<div
class=
"fixedGoods"
v-else-if=
"showFixedGoods&&fixedGoodsList&&fixedGoodsList.length>0"
>
<div
class=
"goodsList"
v-for=
"(item,index) in fixedGoodsList"
:key=
"index"
>
<img
:src=
"item.productImgUrl"
alt
/>
<
p
class=
"num"
>
{{
item
.
number
}}
</p
>
<
!--
<p
class=
"num"
>
{{
item
.
number
}}
</p>
--
>
<div
class=
"explain"
v-if=
"item.upperScreenState==1"
>
讲解中
</div>
<p
class=
"price"
v-if=
"item.minPrice"
>
<span>
¥
</span>
<span>
{{
item
.
minPrice
}}
</span>
</p>
</div>
</div>
</div>
...
...
@@ -30,38 +38,39 @@ export default {
list
:
[],
// 讲解中浮动商品
fixedGoodsList
:
[],
firstCom
:
true
,
//首次进入
firstCom
:
true
//首次进入
};
},
watch
:
{
updateGoods
()
{
if
(
this
.
firstCom
==
true
){
this
.
list
=
[];
this
.
firstCom
=
false
;
let
arr1
=
[];
let
arr2
=
[];
this
.
goodsList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
upperScreenState
==
1
){
console
.
log
(
this
.
goodsList
,
'---------------------------------46goodsList'
)
if
(
this
.
firstCom
==
true
)
{
this
.
list
=
[];
this
.
firstCom
=
false
;
let
arr1
=
[];
let
arr2
=
[];
this
.
goodsList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
upperScreenState
==
1
)
{
arr1
.
push
(
item
);
}
else
if
(
item
.
upperScreenState
==
0
)
{
}
else
if
(
item
.
upperScreenState
==
0
)
{
arr2
.
push
(
item
);
}
});
this
.
list
=
[...
arr1
,
...
arr2
];
this
.
list
=
[...
arr1
,
...
arr2
];
setTimeout
(()
=>
{
this
.
fixedGoodsList
=
arr1
?
arr1
:
[];
this
.
showFixedGoods
=
true
;
},
5000
);
}
else
{
if
(
!
this
.
equalsObj
(
this
.
list
,
this
.
goodsList
))
{
let
newArr
=
[];
newArr
=
this
.
goodsList
.
filter
((
item
,
index
)
=>
{
if
(
item
.
upperScreenState
==
1
)
{
}
else
{
if
(
!
this
.
equalsObj
(
this
.
list
,
this
.
goodsList
))
{
let
newArr
=
[];
newArr
=
this
.
goodsList
.
filter
((
item
,
index
)
=>
{
if
(
item
.
upperScreenState
==
1
)
{
return
item
;
}
});
if
(
newArr
)
{
this
.
fixedGoodsList
=
newArr
;
if
(
newArr
)
{
this
.
fixedGoodsList
=
newArr
;
}
}
}
...
...
@@ -212,16 +221,14 @@ img {
left
:
12px
;
.goodsList
{
width
:
22vw
;
height
:
22vw
;
border
:
1px
solid
#ff3334
;
margin-right
:
10px
;
overflow
:
hidden
;
margin-bottom
:
10px
;
position
:
relative
;
padding
:
2px
;
img
{
width
:
100%
;
height
:
100%
;
width
:
22vw
;
height
:
22vw
;
object-fit
:
cover
;
}
.num
{
...
...
@@ -237,12 +244,19 @@ img {
.explain
{
position
:
absolute
;
top
:
0
;
righ
t
:
0
;
lef
t
:
0
;
color
:
#fff
;
font-size
:
12px
;
background
:
#ff3334
;
padding
:
2px
4px
;
border-bottom-left-radius
:
6px
;
border-bottom-right-radius
:
6px
;
}
.price
{
width
:
100%
;
color
:
#FA7018
;
background
:
#fff
;
text-align
:
center
;
font-size
:
16px
;
}
}
}
...
...
src/components/livedModel/livedIsEnded.vue
View file @
b9b8c0c0
...
...
@@ -232,8 +232,8 @@ export default {
color
:
#fff
;
}
.endTxt
{
font-size
:
3
0
px
;
font-weight
:
400
;
font-size
:
3
4
px
;
font-weight
:
bold
;
}
.time
{
margin-top
:
10px
;
...
...
@@ -315,7 +315,7 @@ export default {
}
}
.itemBorder
{
border-bottom
:
1
px
solid
#b8b8b8
;
border-bottom
:
0.5
px
solid
#b8b8b8
;
}
}
}
...
...
src/pages/lived/index.vue
View file @
b9b8c0c0
...
...
@@ -130,6 +130,9 @@ export default {
},
computed
:
{},
onLoad
(
options
)
{
wx
.
setKeepScreenOn
({
keepScreenOn
:
true
})
getNavbarInfo
(
res
=>
{
console
.
log
(
res
,
"--------------------125"
);
this
.
navTop
=
res
.
navTop
;
...
...
@@ -560,8 +563,8 @@ img {
}
}
.toShop
{
background
:
#fb566d
;
padding
:
0
4
px
;
background
:
linear-gradient
(
90deg
,
rgba
(
255
,
135
,
125
,
1
),
rgba
(
251
,
86
,
109
,
1
))
;
padding
:
0
8
px
;
color
:
#fff
;
font-size
:
14px
;
display
:
inline-block
;
...
...
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