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
65233f66
authored
Nov 21, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改视片流程
parent
b0386bf4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
32 deletions
+76
-32
src/api/common.ts
+9
-0
src/api/template.ts
+6
-0
src/pages/home/film/schedule_add/components/device/index.tsx
+39
-27
src/pages/home/tempaltes/conpoments/temp_item/index.tsx
+8
-1
src/pages/home/tempaltes/film_detail.tsx
+14
-4
No files found.
src/api/common.ts
View file @
65233f66
...
...
@@ -200,6 +200,15 @@ class UsersApi extends ApiClient {
}
})
}
/** 影片绑定设备 */
bindFilmDevice
(
data
)
{
return
this
.
request
({
method
:
'post'
,
url
:
'/template/maintain/calendar'
,
data
})
}
/** 创建日程 */
createSchedule
(
data
:
IUpdateScheduleInfo
)
{
...
...
src/api/template.ts
View file @
65233f66
...
...
@@ -59,6 +59,12 @@ class TeplateApi extends ApiClient {
url
:
`/template/get/type/tag/list?p=
${
page
}
&c=
${
limit
}
`
})
}
getTempalteFilmCount
(
id
:
string
)
{
return
this
.
request
({
method
:
'GET'
,
url
:
`/template/get/film/count/
${
id
}
`
})
}
}
export
default
new
TeplateApi
()
src/pages/home/film/schedule_add/components/device/index.tsx
View file @
65233f66
...
...
@@ -66,7 +66,7 @@ class DeviceSelect extends Component {
showTempalte
:
'HORIZONTAL'
})
cId
===
undefine
d
&&
!
fI
d
&&
Taro
.
getStorage
({
key
:
'schedule-add-device'
})
.
then
(
res
=>
{
let
arr
=
JSON
.
parse
(
res
.
data
).
map
(
item
=>
{
...
...
@@ -205,43 +205,55 @@ class DeviceSelect extends Component {
}
console
.
log
(
cId
,
'cId'
)
let
checkedArr
:
any
=
[]
const
equipmentsIds
=
[]
const
equipmentTopicList
=
[]
const
equipmentsIds
:
any
=
[]
const
equipmentTopicList
:
any
=
[]
list
.
map
(
item
=>
{
if
(
checked
.
has
(
item
.
equipmentId
))
{
checkedArr
.
push
(
item
)
if
(
cId
||
cId
===
''
)
{
if
(
fId
)
{
equipmentsIds
.
push
(
item
.
equipmentId
)
equipmentTopicList
.
push
(
item
.
mqttTopic
)
}
}
})
if
(
cId
||
cId
===
''
)
{
let
obj
=
{
calendarName
:
'DEFAULstring'
,
filmInfos
:
[
{
filmId
:
fId
,
time
:
'00:00'
}
],
equipmentsIds
:
equipmentsIds
,
equipmentTopicList
:
equipmentTopicList
,
calendarType
:
'DEFAUL'
,
calendarId
:
''
}
if
(
cId
===
''
)
{
console
.
log
(
'createSchedule'
)
delete
obj
.
calendarId
api
.
common
.
createSchedule
(
obj
).
then
(()
=>
{
Taro
.
navigateBack
()
if
(
fId
)
{
api
.
common
.
bindFilmDevice
({
filmId
:
fId
,
equipmentsIds
:
equipmentsIds
,
equipmentTopicList
:
equipmentTopicList
})
}
else
{
obj
.
calendarId
=
cId
api
.
common
.
updateSchedule
(
obj
).
then
(()
=>
{
.
then
(()
=>
{
showMyToast
({
title
:
'绑定成功'
})
Taro
.
navigateBack
()
})
}
// let obj = {
// calendarName: 'DEFAULstring',
// filmInfos: [
// {
// filmId: fId,
// time: '00:00'
// }
// ],
// equipmentsIds: equipmentsIds,
// equipmentTopicList: equipmentTopicList,
// calendarType: 'DEFAUL',
// calendarId: ''
// }
// if (!cId) {
// console.log('createSchedule')
// delete obj.calendarId
// api.common.createSchedule(obj).then(() => {
// Taro.navigateBack()
// })
// } else {
// obj.calendarId = cId
// api.common.updateSchedule(obj).then(() => {
// Taro.navigateBack()
// })
// }
}
else
{
Taro
.
setStorage
({
key
:
'schedule-add-device'
,
...
...
src/pages/home/tempaltes/conpoments/temp_item/index.tsx
View file @
65233f66
...
...
@@ -5,6 +5,7 @@ import { ITempItem } from '@/reducers/counter'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
'./index.scss'
import
api
from
'@/api'
type
IProps
=
ITempItem
...
...
@@ -24,7 +25,13 @@ class TempItem extends Component {
Taro
.
navigateTo
({
url
:
`/pages/home/tempaltes/film_detail?filmId=
${
filmId
}
`
})
// Taro.navigateTo({ url: `/pages/home/device/my_film/index` })
}
else
{
Taro
.
navigateTo
({
url
:
`/pages/home/tempaltes/detail?templateId=
${
templateId
}
`
})
api
.
tempalte
.
getTempalteFilmCount
(
templateId
).
then
(
res
=>
{
if
(
res
.
data
===
0
)
{
Taro
.
navigateTo
({
url
:
`/pages/home/tempaltes/film_detail?templateId=
${
templateId
}
`
})
}
else
{
Taro
.
navigateTo
({
url
:
`/pages/home/tempaltes/detail?templateId=
${
templateId
}
`
})
}
})
}
}
...
...
src/pages/home/tempaltes/film_detail.tsx
View file @
65233f66
...
...
@@ -36,11 +36,12 @@ interface FilmDetail {
class
FilmDetail
extends
Component
{
config
:
Config
=
{
navigationBarTitleText
:
'视片详情'
// navigationStyle: undefined
}
constructor
()
{
super
()
const
filmId
=
this
.
$router
.
params
.
filmId
||
'32263ed8295746c99ab66282c26fbc65'
const
filmId
=
this
.
$router
.
params
.
filmId
this
.
state
=
{
filmId
,
page
:
1
,
...
...
@@ -56,6 +57,11 @@ class FilmDetail extends Component {
componentWillMount
()
{
// this.getData()
// setTimeout(() => {
// Taro.navigateBack({
// delta: -1
// })
// }, 10000)
}
componentDidShow
()
{
// this.getData()
...
...
@@ -154,11 +160,13 @@ class FilmDetail extends Component {
render
()
{
const
{
filmInfo
,
filmList
,
showModal
,
filmId
}
=
this
.
state
const
templateId
=
this
.
$router
.
params
.
templateId
filmInfo
.
templateName
=
filmInfo
.
filmName
filmInfo
.
templateDescribe
=
filmInfo
.
filmDescribe
console
.
log
(
'film-detailRender'
)
return
(
<
View
className=
"film-detail"
>
<
View
className=
"film-detail-scroll"
>
{
/*
<View className="film-detail-scroll">
<ScrollView className="film-detail-scroll-view" scrollY>
<View className="film-detail-scroll-top">
<DetailTop {...filmInfo} />
...
...
@@ -205,9 +213,11 @@ class FilmDetail extends Component {
/>
</View>
</Modal>
)
:
null
}
) : null}
*/
}
<
WebView
src=
{
`${WEBVIEW_URL}/#/tempaltes/filmdetail?filmId=${filmId}&token=${token.getToken()}`
}
src=
{
`${WEBVIEW_URL}/tempaltes/edit?${
templateId ? 'templateId=' + templateId : 'filmId=' + filmId
}&token=${token.getToken()}`
}
/>
</
View
>
)
...
...
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