Commit e0803661 by hank

api

parent f6cee916
...@@ -4,7 +4,7 @@ module.exports = { ...@@ -4,7 +4,7 @@ module.exports = {
browsers: ['Android >= 4.0', 'iOS >= 7'] browsers: ['Android >= 4.0', 'iOS >= 7']
}, },
'postcss-pxtorem': { 'postcss-pxtorem': {
rootValue: 37.5, rootValue: 75,
propList: ['*'] propList: ['*']
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>vue-project-template</title> <title>Vmatrix</title>
</head> </head>
<body> <body>
<noscript> <noscript>
......
<template> <template>
<div id="app"> <div id="app">
<div id="nav"> <!-- <div id="nav">
<router-link to="/">Home</router-link> | <router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link> <router-link to="/about">About</router-link>
</div> </div> -->
<router-view/> <keep-alive>
<router-view/>
</keep-alive>
</div> </div>
</template> </template>
......
import { post } from './index' import { post, get } from './index'
export function getTeampalteList (page , size ) { export function getTempalteList (page = 1, size = 10 ) {
// 获取模板列表 // 获取模板列表
return post('/template/get/list', { return post('/template/get/list', {
p: page, p: page,
c: size 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
import request from '@/utils/request' import request from '@/utils/request'
import { Toast } from 'vant';
function requestHandle (res) { function requestHandle (res) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(res) console.log(res)
if(res.status == 200) { if(res.status == 200 && (!res.data.code || res.data.code === 0)) {
resolve(res) resolve(res)
} else { } else {
Toast(res.data.msg)
reject(res) reject(res)
} }
}) })
......
...@@ -6,8 +6,9 @@ import '@/utils/flexible' ...@@ -6,8 +6,9 @@ import '@/utils/flexible'
import './registerServiceWorker' import './registerServiceWorker'
import 'vant/lib/index.css'; import 'vant/lib/index.css';
Vue.config.productionTip = false Vue.config.productionTip = false
import { Tabbar, TabbarItem } from 'vant'; // import { Tabbar, TabbarItem } from 'vant';
Vue.use(Tabbar).use(TabbarItem); import Vant from 'vant';
Vue.use(Vant)
new Vue({ new Vue({
router, router,
......
...@@ -11,6 +11,9 @@ const router = new Router({ ...@@ -11,6 +11,9 @@ const router = new Router({
component: () => import(/* webpackChunkName: "about" */ '@/views/layout'), component: () => import(/* webpackChunkName: "about" */ '@/views/layout'),
children: [ children: [
{ path: '', name: 'Home', component: Home, meta: { keepAlive: true } }, { 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 } },
] ]
}, },
{ {
......
<template> <template>
<div class="home"> <div class="home">
<!-- <img alt="Vue logo" src="../assets/logo.png"> --> <NavBar></NavBar>
<HelloWorld msg="Welcome to Your Vue.js App"/> <HelloWorld msg="Welcome to Your Vue.js App"/>
</div> </div>
</template> </template>
<script> <script>
// @ is an alias to /src // @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue' import HelloWorld from '@/components/HelloWorld.vue'
import NavBar from '@/views/layout/navbar.vue'
export default { export default {
name: 'home', name: 'home',
components: { components: {
HelloWorld HelloWorld,
NavBar
} }
} }
</script> </script>
...@@ -3,17 +3,22 @@ ...@@ -3,17 +3,22 @@
<div class="layout-content"> <div class="layout-content">
<router-view></router-view> <router-view></router-view>
</div> </div>
<!-- <van-tabbar route> <van-tabbar route >
<van-tabbar-item replace to="/" icon="home-o">模板库</van-tabbar-item> <van-tabbar-item replace to="/" active icon="home-o">模板库</van-tabbar-item>
<van-tabbar-item replace to="/" icon="search">设备组</van-tabbar-item> <van-tabbar-item replace to="/devices" icon="search">设备组</van-tabbar-item>
<van-tabbar-item replace to="/" icon="friends-o">我的设备</van-tabbar-item> <van-tabbar-item replace to="/device" icon="friends-o">我的设备</van-tabbar-item>
<van-tabbar-item replace to="/" icon="setting-o">个人中心</van-tabbar-item> <van-tabbar-item replace to="/user" icon="setting-o">个人中心</van-tabbar-item>
</van-tabbar> --> </van-tabbar>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() {
return {
index: 0
}
},
components: { components: {
} }
}; };
......
<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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment