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
39db792e
Commit
39db792e
authored
Apr 13, 2020
by
程智春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播
parent
841a3502
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
205 additions
and
61 deletions
+205
-61
config/prod.env.js
+4
-2
src/api/live.js
+2
-2
src/components/livedModel/livedControls.vue
+11
-2
src/components/livedModel/livedExplainingCommodities.vue
+31
-5
src/components/livedModel/livedGoodsDia.vue
+10
-2
src/components/livedModel/livedIsEnded.vue
+10
-2
src/components/livedModel/livedSelectionSpe.vue
+10
-2
src/components/livedModel/livedShareDia.vue
+41
-8
src/components/livedModel/livedposterDia.vue
+18
-15
src/components/livedModel/notStarted.vue
+11
-3
src/pages/historyLive/index.vue
+9
-2
src/pages/lived/index.vue
+48
-16
No files found.
config/prod.env.js
View file @
39db792e
module
.
exports
=
{
SHOP_MIXID
:
"'zjgyl'"
,
// SHOP_MIXID:"'zjgyl'",
SHOP_MIXID
:
"'ant'"
,
NODE_ENV
:
'"production"'
,
BASE_URL
:
"'https://shop.mayi888.com'"
,
OLSHOP_URL
:
'"https://shop.mayi888.com/innerApi/shopApiService"'
,
IMG_DOMAIN
:
'"http://cdn.mayi888.com"'
IMG_DOMAIN
:
'"https://mayi-newshop.oss-cn-shanghai.aliyuncs.com"'
// IMG_DOMAIN: '"http://cdn.mayi888.com"'
}
src/api/live.js
View file @
39db792e
...
...
@@ -58,8 +58,8 @@ export default {
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/broadcastReminderRecord/addLiveNoticeByCustomer`
,
options
);
},
// 获取小程序码
getLiveQRCode
(
options
)
{
return
requestGET
(
`
${
process
.
env
.
OLSHOP_URL
}
/liveBroadcastInfo/getLiveQRCode?id=
${
options
}
`
);
getLiveQRCode
(
options
,
data
)
{
return
requestGET
(
`
${
process
.
env
.
OLSHOP_URL
}
/liveBroadcastInfo/getLiveQRCode?id=
${
options
}
&kl=
${
data
}
`
);
},
// 获取直播配置
getConfigValueByConfigCode
(
options
)
{
...
...
src/components/livedModel/livedControls.vue
View file @
39db792e
...
...
@@ -154,8 +154,17 @@ export default {
},
created
()
{},
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
if
(
options
.
params
){
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
}
else
if
(
options
.
scene
){
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
console
.
log
(
scene
)
let
sceneInfo
=
scene
.
split
(
','
)
console
.
log
(
'sceneInfo'
,
sceneInfo
)
this
.
liveId
=
sceneInfo
[
0
].
split
(
'='
)[
1
]
}
let
_this
=
this
;
wx
.
getStorage
({
key
:
"sessionid"
,
...
...
src/components/livedModel/livedExplainingCommodities.vue
View file @
39db792e
<
template
>
<!-- 讲解商品 -->
<div
class=
"livedExplainingCommodities"
>
<div
class=
"goods clearfix"
v-if=
"!showFixedGoods"
>
<div
class=
"goods clearfix"
v-if=
"!showFixedGoods"
@
touchstart=
"touchstart"
@
touchmove=
"touchmove"
@
touchend=
"touchend"
>
<div
class=
"goodsList"
:class=
"
{isEC:item.upperScreenState==1}"
...
...
@@ -42,6 +42,10 @@ export default {
fixedGoodsList
:
[],
firstCom
:
true
,
//首次进入
liveId
:
0
,
fixedGoodsTimer
:
null
,
//讲解商品隐藏的定时器
reserveList
:
[]
};
},
watch
:
{
...
...
@@ -61,8 +65,9 @@ export default {
}
});
this
.
list
=
[...
arr1
,
...
arr2
];
this
.
reserveList
=
arr1
;
console
.
log
(
this
.
list
,
'--------------------------------this.list1212'
)
setTimeout
(()
=>
{
this
.
fixedGoodsTimer
=
setTimeout
(()
=>
{
this
.
fixedGoodsList
=
arr1
?
arr1
:
[];
this
.
showFixedGoods
=
true
;
},
5000
);
...
...
@@ -85,8 +90,16 @@ export default {
computed
:
{},
created
()
{},
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
if
(
options
.
params
){
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
}
else
if
(
options
.
scene
){
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
console
.
log
(
scene
)
let
sceneInfo
=
scene
.
split
(
','
)
console
.
log
(
'sceneInfo'
,
sceneInfo
)
this
.
liveId
=
sceneInfo
[
0
].
split
(
'='
)[
1
]
}
},
onUnload
()
{
this
.
fixedGoodsList
=
[];
...
...
@@ -94,6 +107,7 @@ export default {
},
mounted
()
{},
methods
:
{
// 到商品详情
toGoodsInfo
(
val
)
{
// 点击商品埋点
...
...
@@ -170,7 +184,19 @@ export default {
// 走到这里,说明数组或者对象中所有元素都相同,返回true
return
true
;
}
},
touchstart
(){
clearTimeout
(
this
.
fixedGoodsTimer
)
},
touchmove
(){
clearTimeout
(
this
.
fixedGoodsTimer
)
},
touchend
(){
this
.
fixedGoodsTimer
=
setTimeout
(()
=>
{
this
.
fixedGoodsList
=
this
.
reserveList
this
.
showFixedGoods
=
true
;
},
5000
)
},
}
};
</
script
>
...
...
src/components/livedModel/livedGoodsDia.vue
View file @
39db792e
...
...
@@ -90,8 +90,16 @@ export default {
computed
:
{},
created
()
{},
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
if
(
options
.
params
){
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
}
else
if
(
options
.
scene
){
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
console
.
log
(
scene
)
let
sceneInfo
=
scene
.
split
(
','
)
console
.
log
(
'sceneInfo'
,
sceneInfo
)
this
.
liveId
=
sceneInfo
[
0
].
split
(
'='
)[
1
]
}
},
mounted
()
{},
methods
:
{
...
...
src/components/livedModel/livedIsEnded.vue
View file @
39db792e
...
...
@@ -91,8 +91,16 @@ export default {
},
computed
:
{},
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
if
(
options
.
params
){
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
}
else
if
(
options
.
scene
){
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
console
.
log
(
scene
)
let
sceneInfo
=
scene
.
split
(
','
)
console
.
log
(
'sceneInfo'
,
sceneInfo
)
this
.
liveId
=
sceneInfo
[
0
].
split
(
'='
)[
1
]
}
},
created
()
{},
mounted
()
{},
...
...
src/components/livedModel/livedSelectionSpe.vue
View file @
39db792e
...
...
@@ -166,8 +166,16 @@ export default {
computed
:
{},
created
()
{},
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
if
(
options
.
params
){
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
}
else
if
(
options
.
scene
){
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
console
.
log
(
scene
)
let
sceneInfo
=
scene
.
split
(
','
)
console
.
log
(
'sceneInfo'
,
sceneInfo
)
this
.
liveId
=
sceneInfo
[
0
].
split
(
'='
)[
1
]
}
this
.
product_goods_info
.
goodsImgUrl
=
this
.
goodsImg
;
this
.
init
();
},
...
...
src/components/livedModel/livedShareDia.vue
View file @
39db792e
...
...
@@ -40,6 +40,7 @@
import
livedposterDia
from
"@/components/livedModel/livedposterDia"
;
import
live
from
"@/api/live"
;
import
{
DFSImg
}
from
"@/utils/index"
;
import
spokesman
from
"@/api/spokesman"
;
export
default
{
props
:
[
"showShareDia"
,
"info"
],
name
:
""
,
...
...
@@ -53,6 +54,7 @@ export default {
posterInfo
:
{},
againLoadingPoster
:
false
,
// 是否开始加载海报
userInfo
:
{},
spokesmanObj
:
{},
//分销员信息
};
},
components
:
{
...
...
@@ -61,12 +63,22 @@ export default {
computed
:
{},
created
()
{},
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
this
.
shopName
=
params
.
shopName
;
this
.
backPath
=
params
.
fromPagePath
||
"/"
;
this
.
shopLogo
=
DFSImg
(
params
.
shopLogo
,
40
,
40
);
this
.
init
();
if
(
options
.
params
){
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
this
.
shopName
=
params
.
shopName
;
this
.
backPath
=
params
.
fromPagePath
||
"/"
;
this
.
shopLogo
=
DFSImg
(
params
.
shopLogo
,
40
,
40
);
}
else
if
(
options
.
scene
){
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
console
.
log
(
scene
)
let
sceneInfo
=
scene
.
split
(
','
)
console
.
log
(
'sceneInfo'
,
sceneInfo
)
this
.
liveId
=
sceneInfo
[
0
].
split
(
'='
)[
1
]
}
this
.
getSpokesman
()
// this.init();
console
.
log
(
this
.
info
,
"--------------------------67"
);
},
onUnload
()
{},
...
...
@@ -74,17 +86,38 @@ export default {
onShow
(){
console
.
log
(
'onSHow..........................'
)
this
.
againLoadingPoster
=
false
;
this
.
init
();
// this.init();
this
.
getSpokesman
()
},
methods
:
{
closePosterDia
()
{
this
.
showPosterDia
=
false
;
},
getSpokesman
()
{
spokesman
.
getSpokesmanidByShare
().
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
data
.
hasInvitationStatus
==
1
)
{
this
.
hasInvitationStatus
=
1
;
this
.
spokesmanObj
=
{
spokesmanGroupId
:
res
.
data
.
data
.
groupId
,
spokesmanShopId
:
res
.
data
.
data
.
shopId
,
spokesmanRelId
:
res
.
data
.
data
.
spokesmanId
};
}
this
.
init
()
}
});
},
// 初始化信息
init
()
{
// 获取小程序码
console
.
log
(
this
.
spokesmanObj
,
'this.spokesmanObj'
)
let
id
=
Number
(
this
.
liveId
);
live
.
getLiveQRCode
(
id
).
then
(
res
=>
{
let
fxyInfo
=
''
;
if
(
this
.
spokesmanObj
.
spokesmanGroupId
){
fxyInfo
=
`hb_
${
this
.
spokesmanObj
.
spokesmanGroupId
}
_
${
this
.
spokesmanObj
.
spokesmanShopId
}
_
${
this
.
spokesmanObj
.
spokesmanRelId
}
`
}
live
.
getLiveQRCode
(
id
,
fxyInfo
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
let
cImg
=
DFSImg
(
this
.
info
.
posterCoverUrl
);
...
...
src/components/livedModel/livedposterDia.vue
View file @
39db792e
...
...
@@ -46,8 +46,16 @@ export default {
computed
:
{},
onLoad
(
options
)
{
this
.
posterStatus
=
false
;
this
.
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
this
.
params
.
liveId
;
if
(
options
.
params
){
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
}
else
if
(
options
.
scene
){
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
console
.
log
(
scene
)
let
sceneInfo
=
scene
.
split
(
','
)
console
.
log
(
'sceneInfo'
,
sceneInfo
)
this
.
liveId
=
sceneInfo
[
0
].
split
(
'='
)[
1
]
}
console
.
log
(
this
.
userInfo
)
Object
.
assign
(
this
.
info
,
this
.
info
,
this
.
posterInfo
);
console
.
log
(
this
.
info
,
"--------------------35"
);
...
...
@@ -149,27 +157,22 @@ export default {
ctx
.
drawImage
(
path
,
200
*
bili
,
390
*
bili
,
100
*
bili
,
100
*
bili
);
ctx
.
save
();
//头像
// this.saveThe(info.avatarUrl, path => {
ctx
.
clip
();
ctx
.
drawImage
(
info
.
avatarUrl
,
10
*
bili
,
370
*
bili
,
54
*
bili
,
54
*
bili
);
ctx
.
save
();
ctx
.
stroke
();
ctx
.
draw
();
this
.
posterStatus
=
true
;
console
.
log
(
"--------海报生成成功"
);
// });
ctx
.
clip
();
ctx
.
drawImage
(
info
.
avatarUrl
,
10
*
bili
,
370
*
bili
,
54
*
bili
,
54
*
bili
);
ctx
.
save
();
ctx
.
stroke
();
ctx
.
draw
();
this
.
posterStatus
=
true
;
console
.
log
(
"--------海报生成成功"
);
});
});
},
// 小程序需要将图片下载下来,然后才能绘制到画布上
saveThe
(
url
,
callback
)
{
console
.
log
(
'url=========='
,
url
)
wx
.
getImageInfo
({
src
:
url
,
//服务器返回的图片地址
success
:
res
=>
{
console
.
log
(
res
.
path
,
"--------------------131"
);
callback
(
res
.
path
);
},
fail
:
function
(
res
)
{
...
...
src/components/livedModel/notStarted.vue
View file @
39db792e
...
...
@@ -27,9 +27,17 @@ export default {
computed
:
{},
created
()
{},
onLoad
(
options
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
console
.
log
(
params
,
"--------------------126"
);
if
(
options
.
params
){
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
}
else
if
(
options
.
scene
){
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
console
.
log
(
scene
)
let
sceneInfo
=
scene
.
split
(
','
)
console
.
log
(
'sceneInfo'
,
sceneInfo
)
this
.
liveId
=
sceneInfo
[
0
].
split
(
'='
)[
1
]
}
this
.
startTime
=
this
.
info
.
startTime
;
console
.
log
(
this
.
info
)
},
...
...
src/pages/historyLive/index.vue
View file @
39db792e
...
...
@@ -7,8 +7,8 @@
<div
class=
"navbar-title"
>
直播计划
</div>
</div>
<div
class=
"uprefresh"
v-if=
"isUprefresh"
>
正在刷新...
</div>
<div
class=
"
history-list"
>
<div
class=
"
no-history"
v-if=
"!list.length"
>
无历史直播
</div
>
<div
class=
"history-list"
>
<div
class=
"list-item"
v-for=
"(item,index) in list"
:key=
"index"
@
click=
"liveDetail(item)"
>
<div
class=
"item-top"
>
<div
class=
"top-img"
>
...
...
@@ -42,6 +42,7 @@
</div>
</div>
</div>
<van-divider
class=
"no-more"
v-if=
"isNoMore"
...
...
@@ -217,6 +218,12 @@ export default {
color
:
#999
;
text-align
:
center
;
}
.no-history
{
text-align
:
center
;
padding-top
:
20vh
;
font-size
:
30px
;
color
:
#999999
;
}
.history-list
{
width
:
100%
;
box-sizing
:
border-box
;
...
...
src/pages/lived/index.vue
View file @
39db792e
...
...
@@ -167,21 +167,51 @@ export default {
}
}
});
this
.
params
=
JSON
.
parse
(
options
.
params
);
console
.
log
(
this
.
params
,
"-----------------133"
);
this
.
$store
.
commit
(
"setOfflineShopCode"
,
this
.
params
.
offlineShopCode
);
this
.
liveId
=
this
.
params
.
liveId
;
this
.
shopName
=
this
.
params
.
shopName
;
this
.
backPath
=
this
.
params
.
fromPagePath
||
"/"
;
this
.
shopLogo
=
DFSImg
(
this
.
params
.
shopLogo
,
40
,
40
);
// 是否有分销员信息
if
(
this
.
params
.
spokesmanGroupId
)
{
this
.
$store
.
commit
(
"setSpokesman"
,
{
spokesmanGroupId
:
this
.
params
.
spokesmanGroupId
,
spokesmanShopId
:
this
.
params
.
spokesmanShopId
,
spokesmanRelId
:
this
.
params
.
spokesmanRelId
,
userId
:
this
.
params
.
userId
});
if
(
options
.
params
){
this
.
params
=
JSON
.
parse
(
options
.
params
);
console
.
log
(
this
.
params
,
"-----------------133"
);
this
.
$store
.
commit
(
"setOfflineShopCode"
,
this
.
params
.
offlineShopCode
);
this
.
liveId
=
this
.
params
.
liveId
;
this
.
shopName
=
this
.
params
.
shopName
;
this
.
backPath
=
this
.
params
.
fromPagePath
||
"/"
;
this
.
shopLogo
=
DFSImg
(
this
.
params
.
shopLogo
,
40
,
40
);
// 是否有分销员信息
if
(
this
.
params
.
spokesmanGroupId
)
{
this
.
$store
.
commit
(
"setSpokesman"
,
{
spokesmanGroupId
:
this
.
params
.
spokesmanGroupId
,
spokesmanShopId
:
this
.
params
.
spokesmanShopId
,
spokesmanRelId
:
this
.
params
.
spokesmanRelId
,
userId
:
this
.
params
.
userId
});
}
}
else
if
(
options
.
scene
){
var
scene
=
decodeURIComponent
(
options
.
scene
);
//参数二维码传递过来的参数
console
.
log
(
scene
)
let
sceneInfo
=
scene
.
split
(
','
)
console
.
log
(
'sceneInfo'
,
sceneInfo
)
this
.
liveId
=
sceneInfo
[
0
].
split
(
'='
)[
1
]
this
.
backPath
=
'/'
;
console
.
log
(
'liveId'
,
this
.
liveId
)
if
(
sceneInfo
[
1
]){
let
fxyInfo
=
sceneInfo
[
1
].
split
(
'='
)[
1
]
console
.
log
(
'fxyInfo'
,
fxyInfo
)
if
(
fxyInfo
){
let
querys
=
fxyInfo
.
split
(
'_'
);
if
(
querys
[
1
]){
this
.
$store
.
commit
(
"setSpokesman"
,
{
spokesmanGroupId
:
querys
[
1
],
spokesmanShopId
:
querys
[
2
],
spokesmanRelId
:
querys
[
3
]
});
this
.
$set
(
this
.
params
,
'spokesmanGroupId'
,
querys
[
1
])
this
.
$set
(
this
.
params
,
'spokesmanShopId'
,
querys
[
2
])
this
.
$set
(
this
.
params
,
'spokesmanRelId'
,
querys
[
3
])
console
.
log
(
'this.params'
,
this
.
params
)
}
}
}
}
this
.
init
();
...
...
@@ -271,6 +301,8 @@ export default {
live
.
getLiveInfo
(
liveBroadcastId
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
console
.
log
(
res
.
data
.
data
,
"------73"
);
this
.
shopName
=
res
.
data
.
data
.
orgName
;
this
.
shopLogo
=
DFSImg
(
res
.
data
.
data
.
logoUrl
,
40
,
40
);
this
.
liveNoticeInfo
=
res
.
data
.
data
;
this
.
liveNoticeInfo
.
coverUrl
=
this
.
liveNoticeInfo
.
coverUrl
?
DFSImg
(
this
.
liveNoticeInfo
.
coverUrl
)
...
...
@@ -308,7 +340,6 @@ export default {
key
:
"sessionid"
,
success
:
res
=>
{
// 查询分销员信息
console
.
log
(
res
,
'绑定关系'
,
this
.
params
,
this
.
params
.
spokesmanRelId
,
this
.
params
.
userId
)
if
(
this
.
params
.
spokesmanRelId
){
live
.
becomepokesmanCustomer
(
this
.
params
.
spokesmanRelId
).
then
(
res
=>
{
...
...
@@ -367,6 +398,7 @@ export default {
});
}
},
//获取分销员信息
getSpokesman
()
{
spokesman
.
getSpokesmanidByShare
().
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
...
...
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