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
72ddf8a2
Commit
72ddf8a2
authored
Mar 20, 2020
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播结束
parent
b30110e8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
7 deletions
+115
-7
src/components/livedModel/livedControls.vue
+0
-1
src/components/livedModel/livedIsEnded.vue
+113
-4
src/pages/lived/index.vue
+2
-2
No files found.
src/components/livedModel/livedControls.vue
View file @
72ddf8a2
...
@@ -101,7 +101,6 @@ export default {
...
@@ -101,7 +101,6 @@ export default {
},
},
watch
:{
watch
:{
updateVal
(
newVal
,
oldVal
){
updateVal
(
newVal
,
oldVal
){
console
.
log
(
this
.
likeInfo
,
'-----------101'
)
if
(
this
.
likeNum
<
this
.
likeInfo
.
likeNum
){
if
(
this
.
likeNum
<
this
.
likeInfo
.
likeNum
){
this
.
getAdd
();
this
.
getAdd
();
}
}
...
...
src/components/livedModel/livedIsEnded.vue
View file @
72ddf8a2
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<p
class=
"endTxt"
>
直播已结束
</p>
<p
class=
"endTxt"
>
直播已结束
</p>
<p
class=
"time"
>
<p
class=
"time"
>
<span>
直播时长:
</span>
<span>
直播时长:
</span>
<span>
01:22:33
</span>
<span>
{{
endInfo
.
liveTime
}}
</span>
</p>
</p>
<div
class=
"data"
>
<div
class=
"data"
>
<div>
<div>
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<span>
¥
</span>
<span>
¥
</span>
<span>
{{
item
.
minPrice
}}
</span>
<span>
{{
item
.
minPrice
}}
</span>
</p>
</p>
<div
class=
"icon"
>
<div
class=
"icon"
@
click=
"isLogin(item)"
>
<van-icon
name=
"shopping-cart"
/>
<van-icon
name=
"shopping-cart"
/>
</div>
</div>
</div>
</div>
...
@@ -48,17 +48,35 @@
...
@@ -48,17 +48,35 @@
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 选择规格弹层 -->
<livedSelectionSpe
v-if=
"showSpe"
:show=
"showSpe"
:productInfoId=
"itemGoods.productId"
:minSale=
"itemGoods.minSale"
:maxSale=
"itemGoods.maxSale"
:goodsImg=
"itemGoods.goodsImg"
:minSuggestedRetailPrice=
"itemGoods.minSuggestedRetailPrice"
:maxSuggestedRetailPrice=
"itemGoods.maxSuggestedRetailPrice"
:goodsLowerShelf=
"itemGoods.goodsLowerShelf"
@
closeSpeDia=
"closeSpeDia"
></livedSelectionSpe>
</div>
</div>
</
template
>
</
template
>
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
import
livedSelectionSpe
from
"@/components/livedModel/livedSelectionSpe"
;
import
{
DFSImg
}
from
"@/utils/index"
;
import
live
from
"@/api/live"
;
export
default
{
export
default
{
props
:
[
"updateGoods"
,
"goodsList"
,
"endInfo"
],
props
:
[
"updateGoods"
,
"goodsList"
,
"endInfo"
],
name
:
""
,
name
:
""
,
data
()
{
data
()
{
return
{
return
{
list
:
[],
list
:
[],
liveId
:
0
liveId
:
0
,
itemGoods
:
{},
//选中商品
showSpe
:
false
};
};
},
},
watch
:
{
watch
:
{
...
@@ -66,7 +84,9 @@ export default {
...
@@ -66,7 +84,9 @@ export default {
this
.
list
=
this
.
goodsList
;
this
.
list
=
this
.
goodsList
;
}
}
},
},
components
:
{},
components
:
{
livedSelectionSpe
},
computed
:
{},
computed
:
{},
onLoad
(
options
)
{
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
let
params
=
JSON
.
parse
(
options
.
params
);
...
@@ -87,6 +107,95 @@ export default {
...
@@ -87,6 +107,95 @@ export default {
query
query
)}
`
)}
`
});
});
},
// 是否登录
isLogin
(
val
)
{
let
_this
=
this
;
wx
.
getStorage
({
key
:
"sessionid"
,
success
(
res
)
{
_this
.
showSpeDia
(
val
);
},
fail
(
res
)
{
console
.
log
(
"未登录------150"
);
// 跳转登录页
let
backUrl
=
"/lived/main"
;
let
query
=
{
liveId
:
_this
.
liveId
,
fromType
:
"mini"
};
let
url
=
`/pages/login/main?back=
${
backUrl
}
¶ms=
${
JSON
.
stringify
(
query
)}
`
;
wx
.
navigateTo
({
url
:
url
});
}
});
},
showSpeDia
(
val
)
{
if
(
val
.
multiSpecificationFlag
!=
1
)
{
// 不是多规格直接加入购物车
live
.
addCart
([{
productGoodsId
:
val
.
productGoodsId
,
qty
:
1
}])
.
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
wx
.
showToast
({
title
:
"加入成功"
,
icon
:
"success"
});
this
.
showSize
=
false
;
}
else
{
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
});
}
});
return
;
}
let
productId
=
val
.
productId
;
this
.
itemGoods
.
productId
=
productId
;
wx
.
showLoading
({
title
:
"加载中..."
});
live
.
getProductInfo
(
productId
).
then
(
res
=>
{
wx
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
this
.
itemGoods
.
maxSale
=
Number
(
res
.
data
.
data
.
maxSuggestedRetailPrice
);
this
.
itemGoods
.
minSale
=
Number
(
res
.
data
.
data
.
minSuggestedRetailPrice
);
this
.
itemGoods
.
maxDiscountPrice
=
Number
(
res
.
data
.
data
.
maxDiscountPrice
);
this
.
itemGoods
.
minDiscountPrice
=
Number
(
res
.
data
.
data
.
minDiscountPrice
);
this
.
itemGoods
.
productNature
=
res
.
data
.
data
.
productNature
;
this
.
itemGoods
.
goodsLowerShelf
=
res
.
data
.
data
.
saleStatus
!=
1
?
true
:
false
;
//1 上架 0下架 true 下架
if
(
res
.
data
.
data
.
productPictures
&&
res
.
data
.
data
.
productPictures
.
length
>
0
)
{
this
.
itemGoods
.
goodsImg
=
DFSImg
(
res
.
data
.
data
.
productPictures
[
0
].
url
);
}
this
.
showSpe
=
true
;
}
else
{
wx
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
});
}
});
},
closeSpeDia
()
{
this
.
showSpe
=
false
;
}
}
}
}
};
};
...
...
src/pages/lived/index.vue
View file @
72ddf8a2
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<notStarted
v-if=
"liveNoticeInfo.liveBroadcastState==0"
:info=
"liveNoticeInfo"
></notStarted>
<notStarted
v-if=
"liveNoticeInfo.liveBroadcastState==0"
:info=
"liveNoticeInfo"
></notStarted>
<!-- 结束展示 -->
<!-- 结束展示 -->
<livedIsEnded
<livedIsEnded
v-if=
"liveNoticeInfo.liveBroadcastState==2
&&endInfo
"
v-if=
"liveNoticeInfo.liveBroadcastState==2"
:updateGoods=
"updateGoods"
:updateGoods=
"updateGoods"
:endInfo=
"endInfo"
:endInfo=
"endInfo"
:goodsList=
"goodsList"
:goodsList=
"goodsList"
...
@@ -399,7 +399,7 @@ export default {
...
@@ -399,7 +399,7 @@ export default {
}
}
}
}
.info
{
.info
{
margin
-left
:
6
px
;
margin
:
0
8
px
;
color
:
#fff
;
color
:
#fff
;
flex
:
1
;
flex
:
1
;
font-size
:
14px
;
font-size
:
14px
;
...
...
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