Commit e0803661 by hank

api

parent f6cee916
......@@ -4,7 +4,7 @@ module.exports = {
browsers: ['Android >= 4.0', 'iOS >= 7']
},
'postcss-pxtorem': {
rootValue: 37.5,
rootValue: 75,
propList: ['*']
}
}
......
......@@ -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>
......
<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>
......
import { post } from './index'
export function getTeampalteList (page , size ) {
import { post, get } from './index'
export function getTempalteList (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
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)
}
})
......
......@@ -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,
......
......@@ -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 } },
]
},
{
......
<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>
......@@ -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: {
}
};
......
<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