Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client-taro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fb6434c9
authored
Oct 28, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建页面
parent
3671f139
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
170 additions
and
4 deletions
+170
-4
src/app.tsx
+2
-0
src/pages/home/film/schedule_add/components/device/index.jsx
+0
-0
src/pages/home/film/schedule_add/components/films/index.jsx
+0
-0
src/pages/home/film/schedule_add/components/films/index.scss
+11
-0
src/pages/home/film/schedule_add/components/films/index.tsx
+139
-0
src/pages/home/film/schedule_add/index.tsx
+18
-3
src/pages/home/tempaltes/collection.tsx
+0
-1
No files found.
src/app.tsx
View file @
fb6434c9
...
...
@@ -53,6 +53,8 @@ class App extends Component {
'pages/home/tempaltes/film_preview'
,
'pages/home/tempaltes/film_edit'
,
'pages/home/film/schedule_add/index'
,
'pages/home/film/schedule_add/components/films/index'
,
'pages/home/film/schedule_add/components/device/index'
,
'pages/home/tempaltes/detail'
,
'pages/home/tempaltes/collection'
,
'pages/home/tempaltes/template_type'
,
...
...
src/pages/home/film/components/device/index.jsx
→
src/pages/home/film/
schedule_add/
components/device/index.jsx
View file @
fb6434c9
File moved
src/pages/home/film/components/films/index.jsx
→
src/pages/home/film/
schedule_add/
components/films/index.jsx
View file @
fb6434c9
File moved
src/pages/home/film/schedule_add/components/films/index.scss
0 → 100644
View file @
fb6434c9
@import
'@styles/var.scss'
;
.films
{
width
:
100%
;
height
:
100%
;
background-color
:
$bgColor
;
.scroll-view
{
height
:
100%
;
}
}
src/pages/home/film/schedule_add/components/films/index.tsx
0 → 100644
View file @
fb6434c9
import
api
from
'@/api/index'
import
{
ComponentClass
}
from
'react'
import
{
AtSwipeAction
}
from
'taro-ui'
import
{
connect
}
from
'@tarojs/redux'
import
{
View
}
from
'@tarojs/components'
import
{
showMyToast
}
from
'@/common/utils'
import
ListView
from
'@/conpoments/list_view'
import
Taro
,
{
Component
}
from
'@tarojs/taro'
import
{
getDeviceList
}
from
'@/actions/asyncCounter'
import
FilmListItem
from
'@/conpoments/film_list_item'
import
'./index.scss'
type
PageStateProps
=
{
list
:
any
[]
count
:
number
}
type
PageDispatchProps
=
{
getDeviceListData
:
(
page
:
number
)
=>
void
}
type
PageOwnProps
=
{
height
?:
number
}
export
interface
IMilmListItme
{
filmId
:
string
filmName
:
string
templateUrl
:
string
equipmentCount
:
number
}
interface
PageState
{}
type
IProps
=
PageStateProps
&
PageDispatchProps
&
PageOwnProps
interface
Films
{
props
:
IProps
state
:
PageState
}
@
connect
(
({
counter
})
=>
{
const
{
list
,
count
}
=
counter
.
deviceData
return
{
list
,
count
}
},
dispacth
=>
({
getDeviceListData
(
page
:
number
)
{
dispacth
(
getDeviceList
(
page
))
}
})
)
class
Films
extends
Component
{
protected
page
=
1
async
componentWillMount
()
{
this
.
getData
()
}
componentDidShow
()
{
this
.
getData
()
}
async
getData
()
{
this
.
props
.
getDeviceListData
(
this
.
page
)
}
async
handleItem
({
filmId
}:
IMilmListItme
)
{
Taro
.
showModal
({
content
:
'确定要删除?'
}).
then
(
async
({
confirm
})
=>
{
if
(
confirm
)
{
try
{
await
api
.
common
.
removeFilm
(
filmId
)
this
.
getData
()
showMyToast
({
title
:
'删除成功~'
})
}
catch
(
error
)
{
console
.
error
(
error
)
showMyToast
({
title
:
'失败成功~'
})
}
}
})
}
goDetail
({
filmId
}:
IMilmListItme
)
{
Taro
.
navigateTo
({
url
:
`/pages/home/tempaltes/film_detail?filmId=
${
filmId
}
`
})
}
async
onDownRefresh
(
done
:
any
)
{
this
.
page
=
1
await
this
.
getData
()
setTimeout
(()
=>
{
done
()
},
500
)
}
async
onScrollToLower
(
done
:
any
)
{
this
.
page
++
await
this
.
getData
()
done
()
}
shouldComponentUpdate
(
nextProps
:
IProps
)
{
const
{
list
}
=
this
.
props
const
{
list
:
_list
}
=
nextProps
return
list
!==
_list
}
render
()
{
const
{
list
,
height
,
count
}
=
this
.
props
return
(
<
View
className=
"films"
>
<
ListView
count=
{
count
}
height=
{
height
}
dataListLength=
{
list
.
length
}
pullingUp=
{
done
=>
this
.
onScrollToLower
(
done
)
}
pullingDown=
{
done
=>
this
.
onDownRefresh
(
done
)
}
>
{
list
.
map
(
item
=>
(
<
AtSwipeAction
autoClose
key=
{
item
.
filmId
}
onClick=
{
()
=>
this
.
handleItem
(
item
)
}
options=
{
[
{
text
:
'删除'
,
style
:
{
backgroundColor
:
'#FF4949'
}
}
]
}
>
<
FilmListItem
onClick=
{
()
=>
this
.
goDetail
(
item
)
}
{
...
item
}
/>
</
AtSwipeAction
>
))
}
</
ListView
>
</
View
>
)
}
}
export
default
Films
as
ComponentClass
<
PageOwnProps
,
PageState
>
src/pages/home/film/schedule_add/index.tsx
View file @
fb6434c9
...
...
@@ -52,7 +52,18 @@ class ScheduleAdd extends Component {
componentDidShow
()
{}
goDetail
({
filmId
}:
IMilmListItme
)
{
Taro
.
navigateTo
({
url
:
`/pages/home/tempaltes/film_detail?filmId=
${
filmId
}
`
})
Taro
.
navigateTo
({
url
:
`/pages/home/tempaltes/film_detail`
})
}
chooseFilm
()
{
// 'pages/home/film/schedule_add/components/device/index'
Taro
.
navigateTo
({
url
:
`pages/home/film/schedule_add/components/device/index`
})
}
chooseDevice
()
{
Taro
.
navigateTo
({
url
:
`pages/home/film/schedule_add/components/device/index`
})
}
scheduleNameChange
(
e
)
{
...
...
@@ -75,7 +86,9 @@ class ScheduleAdd extends Component {
className=
"schedule-add-name"
/>
<
View
className=
"schedule-add-title"
>
视片
</
View
>
<
Button
size=
"mini"
>
选择视片
</
Button
>
<
Button
size=
"mini"
onClick=
{
this
.
chooseFilm
}
>
选择视片
</
Button
>
{
filmList
&&
filmList
.
map
((
item
,
index
)
=>
{
return
<
View
key=
{
index
}
>
item 视片
{
index
}
</
View
>
...
...
@@ -86,7 +99,9 @@ class ScheduleAdd extends Component {
deviceList
.
map
((
item
,
index
)
=>
{
return
<
View
key=
{
index
}
>
item 设备
{
index
}
</
View
>
})
}
<
Button
size=
"mini"
>
选择设备
</
Button
>
<
Button
size=
"mini"
onClick=
{
this
.
chooseDevice
}
>
选择设备
</
Button
>
</
View
>
)
}
...
...
src/pages/home/tempaltes/collection.tsx
View file @
fb6434c9
...
...
@@ -6,7 +6,6 @@ import { View, Text } from '@tarojs/components'
import
{
showMyToast
}
from
'@/common/utils'
import
ListView
from
'@/conpoments/list_view'
import
Taro
,
{
Component
,
Config
}
from
'@tarojs/taro'
import
{
getDeviceList
}
from
'@/actions/asyncCounter'
import
CollectionTtem
from
'@/conpoments/collection_item'
import
'./scss/index.scss'
...
...
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