Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client
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
e0803661
authored
Jun 14, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api
parent
f6cee916
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
133 additions
and
18 deletions
+133
-18
postcss.config.js
+1
-1
public/index.html
+1
-1
src/App.vue
+6
-3
src/api/api.js
+69
-2
src/api/index.js
+3
-1
src/main.js
+3
-2
src/router/index.js
+3
-0
src/views/Home.vue
+5
-2
src/views/layout/index.vue
+11
-6
src/views/layout/navbar.vue
+31
-0
No files found.
postcss.config.js
View file @
e0803661
...
...
@@ -4,7 +4,7 @@ module.exports = {
browsers
:
[
'Android >= 4.0'
,
'iOS >= 7'
]
},
'postcss-pxtorem'
:
{
rootValue
:
37.
5
,
rootValue
:
7
5
,
propList
:
[
'*'
]
}
}
...
...
public/index.html
View file @
e0803661
...
...
@@ -5,7 +5,7 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<title>
vue-project-template
</title>
<title>
Vmatrix
</title>
</head>
<body>
<noscript>
...
...
src/App.vue
View file @
e0803661
<
template
>
<div
id=
"app"
>
<div
id=
"nav"
>
<
!--
<
div
id=
"nav"
>
<router-link
to=
"/"
>
Home
</router-link>
|
<router-link
to=
"/about"
>
About
</router-link>
</div>
<router-view/>
</div>
-->
<keep-alive>
<router-view/>
</keep-alive>
</div>
</
template
>
...
...
src/api/api.js
View file @
e0803661
import
{
post
}
from
'./index'
export
function
getTe
ampalteList
(
page
,
size
)
{
import
{
post
,
get
}
from
'./index'
export
function
getTe
mpalteList
(
page
=
1
,
size
=
10
)
{
// 获取模板列表
return
post
(
'/template/get/list'
,
{
p
:
page
,
c
:
size
})
}
export
function
getTempalteDetail
(
templateId
)
{
// 获取模板详情
return
get
(
`/template/get/info/
${
templateId
}
`
)
}
export
function
createTempalte
(
data
)
{
/**
* 添加模板临时
* {
"templateName": "string",
"templateUrl": "string",
"frameInfo": {
"frameUrl": "string"
},
"resourceInfo": {
"resourceUrl": "string"
}
}
*
*/
return
post
(
'/template/add/film'
,
data
)
}
export
function
createFilm
(
data
)
{
/**
* 添加影片
* {
"clientId": "string",
"clientSecret": "string",
"templateId": "string",
"resourceId": "string",
"frameId": "string",
"filmData": "string",
"filmName": "string"
}
*/
return
post
(
'/template/add/film'
,
data
)
}
export
function
getFilmDetail
(
filmId
)
{
// 获取影片详情
return
get
(
`/myequipment/get/film/info/
${
filmId
}
`
)
}
export
function
getFilmList
(
clientId
=
'maxrocky'
,
clientSecret
=
'maxrocky'
)
{
// 获取某设备下所有影片
return
post
(
`/myequipment/get/film/list`
,
{
clientId
,
clientSecret
})
}
export
function
setDeviceDefaltFilm
(
clientId
=
'maxrocky'
,
clientSecret
=
'maxrocky'
,
filmId
)
{
// 根据设备标识以及影片id设置默认影片
return
post
(
`/myequipment/update/film/def/version`
,
{
clientId
,
clientSecret
,
filmId
})
}
export
function
updateFilmInfo
(
filmId
,
filmData
)
{
// 更新影片信息
return
post
(
'/myequipment/update/film/info'
,
{
filmId
,
filmData
})
}
export
function
deleteFilm
(
filmId
)
{
// 删除影片
return
get
(
`/myequipment/del/film/info/
${
filmId
}
`
)
}
\ No newline at end of file
src/api/index.js
View file @
e0803661
import
request
from
'@/utils/request'
import
{
Toast
}
from
'vant'
;
function
requestHandle
(
res
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
res
)
if
(
res
.
status
==
200
)
{
if
(
res
.
status
==
200
&&
(
!
res
.
data
.
code
||
res
.
data
.
code
===
0
)
)
{
resolve
(
res
)
}
else
{
Toast
(
res
.
data
.
msg
)
reject
(
res
)
}
})
...
...
src/main.js
View file @
e0803661
...
...
@@ -6,8 +6,9 @@ import '@/utils/flexible'
import
'./registerServiceWorker'
import
'vant/lib/index.css'
;
Vue
.
config
.
productionTip
=
false
import
{
Tabbar
,
TabbarItem
}
from
'vant'
;
Vue
.
use
(
Tabbar
).
use
(
TabbarItem
);
// import { Tabbar, TabbarItem } from 'vant';
import
Vant
from
'vant'
;
Vue
.
use
(
Vant
)
new
Vue
({
router
,
...
...
src/router/index.js
View file @
e0803661
...
...
@@ -11,6 +11,9 @@ const router = new Router({
component
:
()
=>
import
(
/* webpackChunkName: "about" */
'@/views/layout'
),
children
:
[
{
path
:
''
,
name
:
'Home'
,
component
:
Home
,
meta
:
{
keepAlive
:
true
}
},
{
path
:
'devices'
,
name
:
'Home'
,
component
:
Home
,
meta
:
{
keepAlive
:
true
}
},
{
path
:
'device'
,
name
:
'Home'
,
component
:
Home
,
meta
:
{
keepAlive
:
true
}
},
{
path
:
'user'
,
name
:
'Home'
,
component
:
Home
,
meta
:
{
keepAlive
:
true
}
},
]
},
{
...
...
src/views/Home.vue
View file @
e0803661
<
template
>
<div
class=
"home"
>
<
!--
<img
alt=
"Vue logo"
src=
"../assets/logo.png"
>
--
>
<
NavBar></NavBar
>
<HelloWorld
msg=
"Welcome to Your Vue.js App"
/>
</div>
</
template
>
<
script
>
// @ is an alias to /src
import
HelloWorld
from
'@/components/HelloWorld.vue'
import
NavBar
from
'@/views/layout/navbar.vue'
export
default
{
name
:
'home'
,
components
:
{
HelloWorld
HelloWorld
,
NavBar
}
}
</
script
>
src/views/layout/index.vue
View file @
e0803661
...
...
@@ -3,17 +3,22 @@
<div
class=
"layout-content"
>
<router-view></router-view>
</div>
<
!--
<van-tabbar
route
>
<van-tabbar-item
replace
to=
"/"
icon=
"home-o"
>
模板库
</van-tabbar-item>
<van-tabbar-item
replace
to=
"/"
icon=
"search"
>
设备组
</van-tabbar-item>
<van-tabbar-item
replace
to=
"/"
icon=
"friends-o"
>
我的设备
</van-tabbar-item>
<van-tabbar-item
replace
to=
"/"
icon=
"setting-o"
>
个人中心
</van-tabbar-item>
</van-tabbar>
-->
<
van-tabbar
route
>
<van-tabbar-item
replace
to=
"/"
active
icon=
"home-o"
>
模板库
</van-tabbar-item>
<van-tabbar-item
replace
to=
"/
devices
"
icon=
"search"
>
设备组
</van-tabbar-item>
<van-tabbar-item
replace
to=
"/
device
"
icon=
"friends-o"
>
我的设备
</van-tabbar-item>
<van-tabbar-item
replace
to=
"/
user
"
icon=
"setting-o"
>
个人中心
</van-tabbar-item>
</van-tabbar>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
index
:
0
}
},
components
:
{
}
};
...
...
src/views/layout/navbar.vue
0 → 100644
View file @
e0803661
<
template
>
<van-nav-bar
title=
"标题"
:left-arrow=
"left-arrow ? true : false"
@
click-left=
"onClickLeft"
@
click-right=
"onClickRight"
>
<div
slot=
"right"
>
<van-icon
name=
"chat-o"
/>
<slot></slot>
</div>
</van-nav-bar>
</
template
>
<
script
>
export
default
{
props
:
[
'left-arrow'
],
data
()
{
return
{}
},
methods
:{
onClickLeft
()
{
this
.
$router
.
back
()
},
onClickRight
()
{
}
}
}
</
script
>
<
style
>
</
style
>
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