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
b3f1fc6b
Commit
b3f1fc6b
authored
Mar 18, 2020
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口对接
parent
99291d7d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
286 additions
and
114 deletions
+286
-114
src/components/livedModel/livedControls.vue
+85
-28
src/components/livedModel/livedGoodsDia.vue
+95
-55
src/components/livedModel/livedSelectionSpe.vue
+6
-4
src/components/livedModel/notStarted.vue
+29
-3
src/pages/lived/index.vue
+24
-3
src/pages/login/index.vue
+47
-21
No files found.
src/components/livedModel/livedControls.vue
View file @
b3f1fc6b
<
template
>
<
template
>
<div
class=
"livedControls"
>
<div
class=
"livedControls"
>
<!-- 公告层 -->
<!-- 公告层 -->
<livedAnnouncement
v-if=
"info.liveNotice"
:liveNotice=
"info.liveNotice"
></livedAnnouncement>
<livedAnnouncement
v-if=
"info.liveNotice"
:liveNotice=
"info.liveNotice"
></livedAnnouncement>
<!-- 用户进入通知 -->
<!-- 用户进入通知 -->
<div
class=
"userComing userComingAni"
v-if=
"userComing"
>
<div
class=
"userComing userComingAni"
v-if=
"userComing"
>
<span>
xxx
</span>
<span>
xxx
</span>
...
@@ -12,21 +12,26 @@
...
@@ -12,21 +12,26 @@
<!-- 带货商品层 -->
<!-- 带货商品层 -->
<livedExplainingCommodities
v-if=
"info.liveBroadcastState==1"
></livedExplainingCommodities>
<livedExplainingCommodities
v-if=
"info.liveBroadcastState==1"
></livedExplainingCommodities>
<!-- 商品列表弹层 -->
<!-- 商品列表弹层 -->
<livedGoodsDia
:showDia=
"showDia"
@
changeStatus=
"changeStatus"
></livedGoodsDia>
<livedGoodsDia
:showDia=
"showDia"
:info=
"info"
v-if=
"info.goodsRespDTOs&&showDia"
@
changeStatus=
"changeStatus"
></livedGoodsDia>
<!-- 底部控制层 -->
<!-- 底部控制层 -->
<div
class=
"control flex"
>
<div
class=
"control flex"
>
<template
v-if=
"!isSend"
>
<template
v-if=
"!isSend"
>
<div
class=
"goodsImg"
@
click=
"showGoodsList"
>
<div
class=
"goodsImg"
@
click=
"showGoodsList"
>
<img
src=
"../../../static/images/lived/goodsImg.png"
alt
/>
<img
src=
"../../../static/images/lived/goodsImg.png"
alt
/>
<p
class=
"goodsNum"
>
99
</p>
<p
class=
"goodsNum"
v-if=
"info.goodsRespDTOs.length>0"
>
{{
info
.
goodsRespDTOs
.
length
}}
</p>
</div>
</div>
<div
class=
"iptCopy"
@
click=
"
toSendOut
"
>
跟主播说点什么...
</div>
<div
class=
"iptCopy"
@
click=
"
isLogin
"
>
跟主播说点什么...
</div>
<div
class=
"shareIcon"
>
<div
class=
"shareIcon"
>
<van-icon
name=
"share"
/>
<van-icon
name=
"share"
/>
</div>
</div>
<div
class=
"heardIcon"
@
click=
"addLike(1)"
>
<div
class=
"heardIcon"
@
click=
"addLike(1)"
>
<van-icon
name=
"like"
class=
"like"
/>
<van-icon
name=
"like"
class=
"like"
/>
<p
class=
"heardNum"
>
{{
likeNumCopy
}}
</p>
<p
class=
"heardNum"
v-if=
"likeNum>0"
>
{{
likeNumCopy
}}
</p>
<div
class=
"box"
>
<div
class=
"box"
>
<div
class=
"img"
v-for=
"(item,index) in imgList"
:key=
"index"
>
<div
class=
"img"
v-for=
"(item,index) in imgList"
:key=
"index"
>
<img
:src=
"item.img"
alt
/>
<img
:src=
"item.img"
alt
/>
...
@@ -36,7 +41,14 @@
...
@@ -36,7 +41,14 @@
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<div
class=
"sendOut"
>
<div
class=
"sendOut"
>
<input
class=
"sendIpt"
:focus=
"getFocus"
type=
"text"
@
blur=
"onblur"
v-model=
"sendVal"
placeholder=
"和主播说点什么吧~"
>
<input
class=
"sendIpt"
:focus=
"getFocus"
type=
"text"
@
blur=
"onblur"
v-model=
"sendVal"
placeholder=
"和主播说点什么吧~"
/>
<div
class=
"send"
:class=
"
{'noSendVal':sendVal==''}" @click="toSend">发送
</div>
<div
class=
"send"
:class=
"
{'noSendVal':sendVal==''}" @click="toSend">发送
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -50,10 +62,11 @@ import livedIsMsg from "@/components/livedModel/livedIsMsg";
...
@@ -50,10 +62,11 @@ import livedIsMsg from "@/components/livedModel/livedIsMsg";
import
livedExplainingCommodities
from
"@/components/livedModel/livedExplainingCommodities"
;
import
livedExplainingCommodities
from
"@/components/livedModel/livedExplainingCommodities"
;
import
livedGoodsDia
from
"@/components/livedModel/livedGoodsDia"
;
import
livedGoodsDia
from
"@/components/livedModel/livedGoodsDia"
;
export
default
{
export
default
{
props
:[
"info"
],
props
:
[
"info"
],
name
:
""
,
name
:
""
,
data
()
{
data
()
{
return
{
return
{
liveId
:
0
,
likeNum
:
0
,
//点赞数
likeNum
:
0
,
//点赞数
imgList
:
[],
imgList
:
[],
iconList
:
[
iconList
:
[
...
@@ -65,9 +78,9 @@ export default {
...
@@ -65,9 +78,9 @@ export default {
num
:
0
,
num
:
0
,
userComing
:
false
,
userComing
:
false
,
showDia
:
false
,
//显示商品列表弹窗
showDia
:
false
,
//显示商品列表弹窗
isSend
:
false
,
//显示评论输入框
isSend
:
false
,
//显示评论输入框
sendVal
:
''
,
//输入内容
sendVal
:
""
,
//输入内容
getFocus
:
false
,
//获取焦点
getFocus
:
false
//获取焦点
};
};
},
},
components
:
{
components
:
{
...
@@ -82,11 +95,11 @@ export default {
...
@@ -82,11 +95,11 @@ export default {
}
}
},
},
created
()
{},
created
()
{},
onLoad
(){
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
},
this
.
liveId
=
params
.
liveId
;
mounted
()
{
},
},
mounted
()
{},
methods
:
{
methods
:
{
// 数量大于1w
// 数量大于1w
watchMan
(
val
)
{
watchMan
(
val
)
{
...
@@ -94,6 +107,10 @@ export default {
...
@@ -94,6 +107,10 @@ export default {
},
},
// 点赞
// 点赞
addLike
(
val
)
{
addLike
(
val
)
{
if
(
!
this
.
info
.
liveBroadcastState
<
1
)
{
this
.
notAgainLive
();
return
;
}
if
(
val
==
1
)
{
if
(
val
==
1
)
{
this
.
likeNum
++
;
this
.
likeNum
++
;
}
}
...
@@ -107,6 +124,18 @@ export default {
...
@@ -107,6 +124,18 @@ export default {
});
});
},
300
);
},
300
);
},
},
// 直播未开始提示
notAgainLive
()
{
wx
.
showModal
({
content
:
"直播还未开始"
,
confirmColor
:
"#ff877d"
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
}
else
if
(
res
.
cancel
)
{
}
}
});
},
// 接口获取触发点赞
// 接口获取触发点赞
getAdd
()
{
getAdd
()
{
if
(
this
.
imgList
.
length
>
20
)
{
if
(
this
.
imgList
.
length
>
20
)
{
...
@@ -125,25 +154,53 @@ export default {
...
@@ -125,25 +154,53 @@ export default {
changeStatus
()
{
changeStatus
()
{
this
.
showDia
=
false
;
this
.
showDia
=
false
;
},
},
// 是否登录
isLogin
()
{
let
_this
=
this
;
wx
.
getStorage
({
key
:
"sessionid"
,
success
(
res
)
{
_this
.
toSendOut
();
},
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
});
}
});
},
// 发送评论
// 发送评论
toSendOut
(){
toSendOut
()
{
if
(
!
this
.
info
.
liveBroadcastState
<
1
)
{
this
.
notAgainLive
();
return
;
}
// 登录及未开始判断
// 登录及未开始判断
this
.
isSend
=
true
;
this
.
isSend
=
true
;
this
.
getFocus
=
true
;
this
.
getFocus
=
true
;
},
},
// 失焦点
// 失焦点
onblur
(){
onblur
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
isSend
=
false
;
this
.
isSend
=
false
;
this
.
sendVal
=
""
;
this
.
sendVal
=
""
;
},
10
);
},
10
);
},
},
// 点击发送留言
// 点击发送留言
toSend
(){
toSend
()
{
if
(
this
.
sendVal
==
""
){
if
(
this
.
sendVal
==
""
)
{
this
.
getFocus
=
true
;
this
.
getFocus
=
true
;
}
else
{
}
else
{
}
}
}
}
}
}
...
@@ -297,7 +354,7 @@ export default {
...
@@ -297,7 +354,7 @@ export default {
}
}
}
}
}
}
.sendOut
{
.sendOut
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
space-between
;
...
@@ -308,12 +365,12 @@ export default {
...
@@ -308,12 +365,12 @@ export default {
border-radius
:
38px
;
border-radius
:
38px
;
line-height
:
38px
;
line-height
:
38px
;
font-size
:
16px
;
font-size
:
16px
;
.sendIpt{
.sendIpt
{
width
:
60vw
;
width
:
60vw
;
color
:
#999
;
color
:
#999
;
padding-left
:
10px
;
padding-left
:
10px
;
}
}
.send
{
.send
{
color
:
#fff
;
color
:
#fff
;
height
:
30px
;
height
:
30px
;
width
:
80px
;
width
:
80px
;
...
@@ -322,8 +379,8 @@ export default {
...
@@ -322,8 +379,8 @@ export default {
border-radius
:
30px
;
border-radius
:
30px
;
background
:
linear-gradient
(
to
right
,
#ff877d
,
#fb566d
);
background
:
linear-gradient
(
to
right
,
#ff877d
,
#fb566d
);
}
}
.noSendVal
{
.noSendVal
{
background
:
#ababa9
;
background
:
#ababa9
;
}
}
}
}
}
}
...
...
src/components/livedModel/livedGoodsDia.vue
View file @
b3f1fc6b
...
@@ -10,22 +10,22 @@
...
@@ -10,22 +10,22 @@
<div
class=
"list"
>
<div
class=
"list"
>
<div
class=
"item"
v-for=
"(item,index) in goodsList"
:key=
"index"
>
<div
class=
"item"
v-for=
"(item,index) in goodsList"
:key=
"index"
>
<div
class=
"img"
@
click=
"toGoodsInfo(item)"
>
<div
class=
"img"
@
click=
"toGoodsInfo(item)"
>
<img
:src=
"item.productImg
Url"
alt
/>
<img
v-if=
"item.goodsImageUrl"
:src=
"item.goodsImage
Url"
alt
/>
</div>
</div>
<div
class=
"info"
>
<div
class=
"info"
>
<p
class=
"name line-clamp2"
>
{{
item
.
product
Name
}}
</p>
<p
class=
"name line-clamp2"
>
{{
item
.
goods
Name
}}
</p>
<div
class=
"bottom"
>
<div
class=
"bottom"
>
<div
class=
"price"
>
<div
class=
"price"
>
<p>
<p>
<span>
¥
</span>
<span>
¥
</span>
<span>
{{
item
.
min
Price
}}
</span>
<span>
{{
item
.
goods
Price
}}
</span>
</p>
</p>
<p
class=
"del"
>
<
!--
<
p
class=
"del"
>
<span>
¥
</span>
<span>
¥
</span>
<span>
{{
999
}}
</span>
<span>
{{
999
}}
</span>
</p>
</p>
-->
</div>
</div>
<div
class=
"icon"
@
click=
"
showSpeDia
(item)"
>
<div
class=
"icon"
@
click=
"
isLogin
(item)"
>
<van-icon
name=
"shopping-cart"
/>
<van-icon
name=
"shopping-cart"
/>
</div>
</div>
</div>
</div>
...
@@ -34,7 +34,18 @@
...
@@ -34,7 +34,18 @@
</div>
</div>
</van-popup>
</van-popup>
<!-- 选择规格弹层 -->
<!-- 选择规格弹层 -->
<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>
<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
>
...
@@ -44,28 +55,15 @@ import { DFSImg } from "@/utils/index";
...
@@ -44,28 +55,15 @@ import { DFSImg } from "@/utils/index";
import
live
from
"@/api/live"
;
import
live
from
"@/api/live"
;
export
default
{
export
default
{
props
:
{
props
:
{
showDia
:
{
showDia
:
Boolean
,
type
:
Boolean
,
info
:
Object
,
default
:
false
}
},
},
name
:
""
,
name
:
""
,
data
()
{
data
()
{
return
{
return
{
liveId
:
0
,
liveId
:
0
,
goodsList
:
[
goodsList
:
[],
{
itemGoods
:
{},
//选中商品
productId
:
"266"
,
productName
:
"瑞士进口 雀巢(Nestle) 金牌 黑咖啡粉 至臻原味 速溶 咖啡豆微研磨"
,
productImgUrl
:
'http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/jpg/de6ca6a1-f161-49da-8b76-3450144b4d47.jpg'
,
},
{
productId
:
"102"
,
productName
:
"ad新 外衣"
,
productImgUrl
:
'http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/jpg/58ab315c-61d5-4799-8d1b-f0d3b0e1f0ad.jpg'
,
},
],
itemGoods
:{},
//选中商品
showSpe
:
false
showSpe
:
false
};
};
},
},
...
@@ -74,12 +72,14 @@ export default {
...
@@ -74,12 +72,14 @@ export default {
},
},
computed
:
{},
computed
:
{},
created
()
{},
created
()
{},
onLoad
(
options
){
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
this
.
liveId
=
params
.
liveId
;
this
.
goodsList
.
forEach
((
item
,
index
)
=>
{
this
.
goodsList
=
this
.
info
.
goodsRespDTOs
;
item
.
img
=
DFSImg
(
item
.
productImgUrl
);
this
.
goodsList
.
forEach
((
item
,
index
)
=>
{
})
item
.
goodsPrice
=
Number
(
item
.
goodsPrice
);
item
.
goodsImageUrl
=
DFSImg
(
item
.
goodsImageUrl
);
});
},
},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
...
@@ -87,43 +87,82 @@ export default {
...
@@ -87,43 +87,82 @@ export default {
closeDia
()
{
closeDia
()
{
this
.
$emit
(
"changeStatus"
);
this
.
$emit
(
"changeStatus"
);
},
},
// 是否登录
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
)
{
showSpeDia
(
val
)
{
let
productId
=
val
.
productId
;
let
productId
=
val
.
productId
;
this
.
itemGoods
.
productId
=
productId
;
this
.
itemGoods
.
productId
=
productId
;
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'加载中...'
,
title
:
"加载中..."
})
})
;
live
.
getProductInfo
(
productId
).
then
(
res
=>
{
live
.
getProductInfo
(
productId
).
then
(
res
=>
{
wx
.
hideLoading
();
wx
.
hideLoading
();
if
(
res
.
data
.
code
==
200
){
if
(
res
.
data
.
code
==
200
)
{
this
.
itemGoods
.
maxSale
=
Number
(
res
.
data
.
data
.
maxSuggestedRetailPrice
);
this
.
itemGoods
.
maxSale
=
Number
(
this
.
itemGoods
.
minSale
=
Number
(
res
.
data
.
data
.
minSuggestedRetailPrice
);
res
.
data
.
data
.
maxSuggestedRetailPrice
this
.
itemGoods
.
maxDiscountPrice
=
Number
(
res
.
data
.
data
.
maxDiscountPrice
);
);
this
.
itemGoods
.
minDiscountPrice
=
Number
(
res
.
data
.
data
.
minDiscountPrice
);
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
.
productNature
=
res
.
data
.
data
.
productNature
;
this
.
itemGoods
.
goodsLowerShelf
=
res
.
data
.
data
.
saleStatus
!=
1
?
true
:
false
;
//1 上架 0下架 true 下架
this
.
itemGoods
.
goodsLowerShelf
=
if
(
res
.
data
.
data
.
productPictures
&&
res
.
data
.
data
.
productPictures
.
length
>
0
){
res
.
data
.
data
.
saleStatus
!=
1
?
true
:
false
;
//1 上架 0下架 true 下架
this
.
itemGoods
.
goodsImg
=
DFSImg
(
res
.
data
.
data
.
productPictures
[
0
].
url
);
if
(
}
res
.
data
.
data
.
productPictures
&&
res
.
data
.
data
.
productPictures
.
length
>
0
)
{
this
.
itemGoods
.
goodsImg
=
DFSImg
(
res
.
data
.
data
.
productPictures
[
0
].
url
);
}
this
.
showSpe
=
true
;
this
.
showSpe
=
true
;
}
}
})
})
;
},
},
closeSpeDia
()
{
closeSpeDia
()
{
this
.
showSpe
=
false
;
this
.
showSpe
=
false
;
},
},
// 到商品详情
// 到商品详情
toGoodsInfo
(
val
){
toGoodsInfo
(
val
)
{
let
query
=
{
let
query
=
{
fromLived
:
1
,
fromLived
:
1
,
liveId
:
this
.
liveId
,
liveId
:
this
.
liveId
}
}
;
this
.
backPath
=
`/goods/
${
val
.
productId
}
`
;
this
.
backPath
=
`/goods/
${
val
.
productId
}
`
;
wx
.
reLaunch
({
wx
.
reLaunch
({
url
:
`../index/main?from=livedToGoodsInfo&backpath=
${
url
:
`../index/main?from=livedToGoodsInfo&backpath=
${
this
.
backPath
this
.
backPath
}
¶ms=
${
JSON
.
stringify
(
query
)}
`
}
¶ms=
${
JSON
.
stringify
(
query
)}
`
})
})
;
}
}
}
}
};
};
...
@@ -141,6 +180,7 @@ export default {
...
@@ -141,6 +180,7 @@ export default {
height
:
70px
;
height
:
70px
;
border-radius
:
6px
;
border-radius
:
6px
;
overflow
:
hidden
;
overflow
:
hidden
;
background
:
#999
;
img
{
img
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
...
...
src/components/livedModel/livedSelectionSpe.vue
View file @
b3f1fc6b
...
@@ -280,6 +280,7 @@ export default {
...
@@ -280,6 +280,7 @@ export default {
changeQty
(
event
){
changeQty
(
event
){
console
.
log
(
event
.
mp
.
detail
,
'------------------------------279'
)
console
.
log
(
event
.
mp
.
detail
,
'------------------------------279'
)
this
.
buyQty
=
event
.
mp
.
detail
;
this
.
buyQty
=
event
.
mp
.
detail
;
this
.
getMixId
(
1
,
true
);
},
},
// 默认选中一组规格
// 默认选中一组规格
// 两个参数goodsSpc,allSpc sku及所有规格
// 两个参数goodsSpc,allSpc sku及所有规格
...
@@ -376,7 +377,7 @@ export default {
...
@@ -376,7 +377,7 @@ export default {
}
}
},
},
// 取价格
// 取价格
getMixId
(
val
)
{
getMixId
(
val
,
getNewPrice
)
{
if
(
!
this
.
isDefault
){
if
(
!
this
.
isDefault
){
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'加载中...'
,
title
:
'加载中...'
,
...
@@ -422,9 +423,10 @@ export default {
...
@@ -422,9 +423,10 @@ export default {
Number
(
res
.
data
.
data
.
goodsSuggestedRetailPrice
);
Number
(
res
.
data
.
data
.
goodsSuggestedRetailPrice
);
this
.
product_goods_info
.
singleItemActivityId
=
this
.
product_goods_info
.
singleItemActivityId
=
res
.
data
.
data
.
singleItemActivityId
||
''
;
res
.
data
.
data
.
singleItemActivityId
||
''
;
if
(
!
getNewPrice
){
this
.
buyQty
=
this
.
buyQty
=
this
.
product_goods_info
.
productMinCount
>
0
?
this
.
product_goods_info
.
productMinCount
:
1
;
this
.
product_goods_info
.
productMinCount
>
0
?
this
.
product_goods_info
.
productMinCount
:
1
;
}
if
(
if
(
this
.
product_goods_info
.
oversoldFlag
!=
1
&&
this
.
product_goods_info
.
oversoldFlag
!=
1
&&
this
.
product_goods_info
.
sellMaxQty
-
0
<=
0
this
.
product_goods_info
.
sellMaxQty
-
0
<=
0
...
...
src/components/livedModel/notStarted.vue
View file @
b3f1fc6b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
class=
"time"
>
<div
class=
"time"
>
<timeDown
v-if=
"startTime"
:startTime=
"startTime"
></timeDown>
<timeDown
v-if=
"startTime"
:startTime=
"startTime"
></timeDown>
</div>
</div>
<div
class=
"remindBtn"
@
click=
"
remind
"
>
开播提醒
</div>
<div
class=
"remindBtn"
@
click=
"
isLogin
"
>
开播提醒
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -15,6 +15,7 @@ export default {
...
@@ -15,6 +15,7 @@ export default {
name
:
""
,
name
:
""
,
data
()
{
data
()
{
return
{
return
{
liveId
:
0
,
startTime
:
null
,
startTime
:
null
,
};
};
},
},
...
@@ -23,7 +24,9 @@ export default {
...
@@ -23,7 +24,9 @@ export default {
},
},
computed
:
{},
computed
:
{},
created
()
{},
created
()
{},
onLoad
(){
onLoad
(
options
){
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
console
.
log
(
this
.
info
,
'--------------------126'
)
console
.
log
(
this
.
info
,
'--------------------126'
)
this
.
startTime
=
this
.
info
.
startTime
;
this
.
startTime
=
this
.
info
.
startTime
;
},
},
...
@@ -31,7 +34,30 @@ export default {
...
@@ -31,7 +34,30 @@ export default {
methods
:
{
methods
:
{
// 开播提醒
// 开播提醒
remind
()
{
remind
()
{
console
.
log
(
"开播"
);
console
.
log
(
"点击开播,'------------34"
)
},
// 是否登录
isLogin
(){
let
_this
=
this
;
wx
.
getStorage
({
key
:
"sessionid"
,
success
(
res
)
{
_this
.
remind
();
},
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
});
}
});
}
}
}
}
};
};
...
...
src/pages/lived/index.vue
View file @
b3f1fc6b
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
</div>
</div>
<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"
>
<p
class=
"num"
v-if=
"liveNoticeInfo.liveBroadcastState>0"
>
<span>
999
</span>
<span>
{{
liveNoticeInfo
.
watchNum
}}
</span>
<span>
观看
</span>
<span>
观看
</span>
</p>
</p>
</div>
</div>
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<live-player
<live-player
v-if=
"liveNoticeInfo.liveBroadcastState==1"
v-if=
"liveNoticeInfo.liveBroadcastState==1"
class=
"livePlayer"
class=
"livePlayer"
:src=
"live
dUrl
"
:src=
"live
NoticeInfo.boStreamM3U8
"
mode=
"RTC"
mode=
"RTC"
autoplay
autoplay
bindstatechange=
"statechange"
bindstatechange=
"statechange"
...
@@ -138,6 +138,27 @@ export default {
...
@@ -138,6 +138,27 @@ export default {
wx
.
reLaunch
({
wx
.
reLaunch
({
url
:
`../index/main?from=livedToIndex&backpath=
${
this
.
backPath
}
`
url
:
`../index/main?from=livedToIndex&backpath=
${
this
.
backPath
}
`
});
});
},
// 是否登录
isLogin
(){
wx
.
getStorage
({
key
:
"sessionid"
,
success
(
res
)
{
console
.
log
(
"登录----------147"
)
},
fail
(
res
)
{
console
.
log
(
"未登录------150"
)
// 跳转登录页
let
backUrl
=
'/lived/main'
;
let
query
=
{
liveId
:
this
.
liveId
,
}
let
url
=
`/pages/login/main?backpath=
${
backUrl
}
¶ms=
${
JSON
.
stringify
(
query
)}
`
;
wx
.
reLaunch
({
url
:
url
});
}
});
}
}
}
}
};
};
...
...
src/pages/login/index.vue
View file @
b3f1fc6b
...
@@ -61,7 +61,8 @@ export default {
...
@@ -61,7 +61,8 @@ export default {
testd
:
""
,
testd
:
""
,
test_sessionId
:
""
,
test_sessionId
:
""
,
test_isHaveUnion
:
""
,
test_isHaveUnion
:
""
,
test_unionId
:
""
test_unionId
:
""
,
fromType
:
''
,
//来源类型 mini:小程序跳转到当前登录页
};
};
},
},
created
()
{},
created
()
{},
...
@@ -72,6 +73,8 @@ export default {
...
@@ -72,6 +73,8 @@ export default {
}
}
if
(
options
.
params
)
{
if
(
options
.
params
)
{
this
.
backParams
=
serialize
(
options
.
params
);
this
.
backParams
=
serialize
(
options
.
params
);
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
fromType
=
params
.
fromType
;
}
}
this
.
getshop
();
this
.
getshop
();
},
},
...
@@ -179,11 +182,14 @@ export default {
...
@@ -179,11 +182,14 @@ export default {
if
(
this
.
isHaveUnion
)
{
if
(
this
.
isHaveUnion
)
{
wx
.
hideLoading
();
wx
.
hideLoading
();
//是会员 直接登录
//是会员 直接登录
wx
.
reLaunch
({
// 0318写直播改后面注释逻辑相同
url
:
`../index/main?from=login&backpath=
${
// wx.reLaunch({
this
.
backPath
// url: `../index/main?from=login&backpath=${
}
¶ms=
${
encodeURIComponent
(
this
.
backParams
)}
`
// this.backPath
});
// }¶ms=${encodeURIComponent(this.backParams)}`
// });
// 跳转回小程序页面
this
.
pushPageType
();
}
else
{
}
else
{
var
data
=
wx_decode
(
var
data
=
wx_decode
(
this
.
appid
,
this
.
appid
,
...
@@ -210,11 +216,13 @@ export default {
...
@@ -210,11 +216,13 @@ export default {
key
:
"sessionid"
,
key
:
"sessionid"
,
data
:
res
.
data
.
data
.
sessionId
data
:
res
.
data
.
data
.
sessionId
});
});
wx
.
reLaunch
({
// 跳转回小程序页面
url
:
`../index/main?from=login&backpath=
${
this
.
pushPageType
();
this
.
backPath
// wx.reLaunch({
}
¶ms=
${
encodeURIComponent
(
this
.
backParams
)}
`
// url: `../index/main?from=login&backpath=${
});
// this.backPath
// }¶ms=${encodeURIComponent(this.backParams)}`
// });
}
else
{
}
else
{
//不是会员需要绑定手机号
//不是会员需要绑定手机号
this
.
isShowPhone
=
true
;
this
.
isShowPhone
=
true
;
...
@@ -232,6 +240,20 @@ export default {
...
@@ -232,6 +240,20 @@ export default {
}
}
}
}
},
},
// 是否跳转h5或小程序
pushPageType
(){
if
(
this
.
fromType
==
'mini'
){
wx
.
navigateBack
({
delta
:
1
});
}
else
{
wx
.
reLaunch
({
url
:
`../index/main?from=login&backpath=
${
this
.
backPath
}
¶ms=
${
encodeURIComponent
(
this
.
backParams
)}
`
});
}
},
getPhoneNumber
(
e
)
{
getPhoneNumber
(
e
)
{
wx
.
checkSession
({
wx
.
checkSession
({
success
:
()
=>
{
success
:
()
=>
{
...
@@ -287,11 +309,13 @@ export default {
...
@@ -287,11 +309,13 @@ export default {
key
:
"sessionid"
,
key
:
"sessionid"
,
data
:
res
.
data
.
data
.
sessionId
data
:
res
.
data
.
data
.
sessionId
});
});
wx
.
reLaunch
({
// 跳转回小程序页面
url
:
`../index/main?from=login&backpath=
${
this
.
pushPageType
();
this
.
backPath
// wx.reLaunch({
}
¶ms=
${
encodeURIComponent
(
this
.
backParams
)}
`
// url: `../index/main?from=login&backpath=${
});
// this.backPath
// }¶ms=${encodeURIComponent(this.backParams)}`
// });
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -299,11 +323,13 @@ export default {
...
@@ -299,11 +323,13 @@ export default {
});
});
},
},
backMainHandle
()
{
backMainHandle
()
{
wx
.
reLaunch
({
// 跳转回小程序页面
url
:
`../index/main?from=login&backpath=
${
this
.
pushPageType
();
this
.
backPath
// wx.reLaunch({
}
¶ms=
${
encodeURIComponent
(
this
.
backParams
)}
`
// url: `../index/main?from=login&backpath=${
});
// this.backPath
// }¶ms=${encodeURIComponent(this.backParams)}`
// });
},
},
eLogin
()
{
eLogin
()
{
//企业员工登录
//企业员工登录
...
...
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