Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bh_face_counter
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄天晨
bh_face_counter
Commits
f01907b4
Commit
f01907b4
authored
Sep 18, 2020
by
zeven
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
764f4243
3319738f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
121 additions
and
25 deletions
+121
-25
store.js
src/models/store.js
+3
-0
CounterMixins.js
src/pages/CounterMixins.js
+26
-1
VerticalPage.js
src/pages/VerticalPage.js
+88
-24
store.js
src/services/store.js
+4
-0
No files found.
src/models/store.js
View file @
f01907b4
...
...
@@ -140,6 +140,9 @@ export default {
const
{
data
}
=
yield
call
(
api
.
verifysms
,
action
);
return
data
;
},
*
getAdvertising
(
action
,
{
call
})
{
return
yield
call
(
api
.
getAdvertising
,
action
);
},
},
};
...
...
src/pages/CounterMixins.js
View file @
f01907b4
...
...
@@ -53,9 +53,23 @@ const CounterMixins = ComposeComponent => {
title
:
''
,
dot
:
false
,
luckyVisible
:
false
,
autoplayTime
:
10
,
imgArr
:
[],
adType
:
'image'
,
};
componentWillMount
=
async
()
=>
{
const
{
data
}
=
await
this
.
props
.
dispatch
({
type
:
'store/getAdvertising'
,
service
:
'counter'
,
});
if
(
data
.
code
===
1
&&
data
.
data
&&
Object
.
keys
(
data
.
data
))
{
this
.
setState
({
autoplayTime
:
Number
(
data
.
data
.
time
),
imgArr
:
data
.
data
.
image
,
adType
:
data
.
data
.
type
,
});
}
const
qrHost
=
await
AsyncStorage
.
getItem
(
'QRHOST'
);
await
this
.
setState
({
qrHost
});
};
...
...
@@ -121,7 +135,18 @@ const CounterMixins = ComposeComponent => {
if
(
window
.
socket
.
hasListeners
(
'cmdOperate'
))
{
window
.
socket
.
removeAllListeners
(
'cmdOperate'
);
}
if
(
window
.
socket
.
hasListeners
(
'adsOperate'
))
{
window
.
socket
.
removeAllListeners
(
'adsOperate'
);
}
window
.
socket
.
on
(
'cmdOperate'
,
this
.
command
.
bind
(
this
));
window
.
socket
.
on
(
'adsOperate'
,
({
adsData
})
=>
{
console
.
warn
(
adsData
);
this
.
setState
({
autoplayTime
:
Number
(
adsData
.
time
),
imgArr
:
adsData
[
adsData
.
type
],
adType
:
adsData
.
type
,
});
});
window
.
socket
.
on
(
'counterOrder'
,
({
type
,
msg
,
sid
,
token
,
payType
,
orderId
})
=>
{
...
...
@@ -728,7 +753,7 @@ const CounterMixins = ComposeComponent => {
};
}
return
connect
(({
goods
,
admin
})
=>
({
goods
,
admin
}))(
Mixins
);
return
connect
(({
goods
,
admin
,
store
})
=>
({
goods
,
admin
,
store
}))(
Mixins
);
};
const
CloseButton
=
({
onClose
,
style
})
=>
{
...
...
src/pages/VerticalPage.js
View file @
f01907b4
...
...
@@ -422,7 +422,16 @@ class VerticalPage extends Component {
);
render
()
{
let
{
admin
,
goods
,
goodsArr
,
qrHost
,
current
}
=
this
.
props
;
let
{
admin
,
goods
,
goodsArr
,
qrHost
,
current
,
autoplayTime
,
imgArr
,
adType
,
}
=
this
.
props
;
let
{
contact
}
=
this
.
state
;
pageSize
=
goods
&&
goods
.
bags
.
length
>
0
...
...
@@ -542,7 +551,7 @@ class VerticalPage extends Component {
marginRight
:
50
,
marginLeft
:
50
,
}}
>
<
Text
style
=
{
styles
.
btnText
}
>
无码商品
<
/Text
>
<
Text
style
=
{
styles
.
btnText
}
>
输入价格
<
/Text
>
<
/Touch
>
<
Touch
onPress
=
{
this
.
props
.
clearList
}
...
...
@@ -693,28 +702,83 @@ class VerticalPage extends Component {
<
/View
>
{
width
>
801
?
(
<
View
style
=
{
styles
.
footer
}
>
<
Swiper
style
=
{
styles
.
swiper
}
// 样式
loop
// 如果设置为false,那么滑动到最后一张时,再次滑动将不会滑到第一张图片。
autoplay
// 自动轮播
autoplayTimeout
=
{
10
}
// 每隔4秒切换
horizontal
// 水平方向,为false可设置为竖直方向
showsButtons
=
{
false
}
// 为false时不显示控制按钮
showsPagination
=
{
false
}
// 为false不显示下方圆点
>
<
Image
source
=
{
require
(
'../assets/Vertical/first.jpg'
)}
style
=
{
styles
.
swiperImg
}
/
>
<
Image
source
=
{
require
(
'../assets/Vertical/second.jpg'
)}
style
=
{
styles
.
swiperImg
}
/
>
<
Image
source
=
{
require
(
'../assets/Vertical/third.jpg'
)}
style
=
{
styles
.
swiperImg
}
/
>
<
/Swiper
>
{
adType
===
'image'
?
(
imgArr
&&
imgArr
.
length
>
0
?
(
imgArr
.
length
===
1
?
(
imgArr
.
map
((
v
,
index
)
=>
(
<
Image
key
=
{
index
}
source
=
{{
uri
:
v
}}
style
=
{
styles
.
swiperImg
}
/
>
))
)
:
(
<
Swiper
style
=
{
styles
.
swiper
}
// 样式
loop
// 如果设置为false,那么滑动到最后一张时,再次滑动将不会滑到第一张图片。
autoplay
// 自动轮播
autoplayTimeout
=
{
autoplayTime
||
10
}
// 每隔10秒切换
horizontal
// 水平方向,为false可设置为竖直方向
showsButtons
=
{
false
}
// 为false时不显示控制按钮
showsPagination
=
{
false
}
// 为false不显示下方圆点
>
{
imgArr
.
map
((
v
,
index
)
=>
(
<
Image
key
=
{
index
}
source
=
{{
uri
:
v
}}
style
=
{
styles
.
swiperImg
}
/
>
))}
<
/Swiper
>
)
)
:
(
<
Swiper
style
=
{
styles
.
swiper
}
// 样式
loop
// 如果设置为false,那么滑动到最后一张时,再次滑动将不会滑到第一张图片。
autoplay
// 自动轮播
autoplayTimeout
=
{
autoplayTime
||
10
}
// 每隔10秒切换
horizontal
// 水平方向,为false可设置为竖直方向
showsButtons
=
{
false
}
// 为false时不显示控制按钮
showsPagination
=
{
false
}
// 为false不显示下方圆点
>
<
Image
source
=
{
require
(
'../assets/Vertical/first.jpg'
)}
style
=
{
styles
.
swiperImg
}
/
>
<
Image
source
=
{
require
(
'../assets/Vertical/second.jpg'
)}
style
=
{
styles
.
swiperImg
}
/
>
<
Image
source
=
{
require
(
'../assets/Vertical/third.jpg'
)}
style
=
{
styles
.
swiperImg
}
/
>
<
/Swiper
>
)
)
:
(
<
Swiper
style
=
{
styles
.
swiper
}
// 样式
loop
// 如果设置为false,那么滑动到最后一张时,再次滑动将不会滑到第一张图片。
autoplay
// 自动轮播
autoplayTimeout
=
{
autoplayTime
||
10
}
// 每隔10秒切换
horizontal
// 水平方向,为false可设置为竖直方向
showsButtons
=
{
false
}
// 为false时不显示控制按钮
showsPagination
=
{
false
}
// 为false不显示下方圆点
>
<
Image
source
=
{
require
(
'../assets/Vertical/first.jpg'
)}
style
=
{
styles
.
swiperImg
}
/
>
<
Image
source
=
{
require
(
'../assets/Vertical/second.jpg'
)}
style
=
{
styles
.
swiperImg
}
/
>
<
Image
source
=
{
require
(
'../assets/Vertical/third.jpg'
)}
style
=
{
styles
.
swiperImg
}
/
>
<
/Swiper
>
)}
<
/View
>
)
:
(
<
View
/>
...
...
src/services/store.js
View file @
f01907b4
...
...
@@ -53,3 +53,7 @@ export function sendsms({phone}) {
export
function
verifysms
({
phone
,
code
,
userId
})
{
return
axios
.
post
(
'/store/verifysms'
,
qs
.
stringify
({
phone
,
code
,
userId
}));
}
export
function
getAdvertising
(
action
)
{
return
axios
.
get
(
`/store/advertising?
${
qs
.
stringify
(
action
)}
`
);
}
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