Browse Source

add all

voice
刘嘉炜 4 years ago
parent
commit
3d7cd9e3a3
  1. 2
      src/js/server.js
  2. 2
      src/pages/index/index.vue
  3. 1
      src/store/index.js
  4. 4
      src/subpackage/device/components/device_name/device_name.vue
  5. 7
      src/subpackage/device/js/device_api.js
  6. 10
      src/subpackage/device/js/device_server.js
  7. 8
      src/subpackage/device/pages/device_manage/device_manage.vue
  8. 14
      src/subpackage/device/pages/index/index.vue
  9. BIN
      src/subpackage/device/static/images/position.png

2
src/js/server.js

@ -88,4 +88,4 @@ export class Server {
export const servers = new Server();
export default {servers,Server};
export default { servers, Server };

2
src/pages/index/index.vue

@ -123,7 +123,7 @@
{
id: 9,
name: '设备管理',
path: '',
path: '/subpackage/device/pages/index/index',
serverKey: 1010 //
},
];

1
src/store/index.js

@ -22,6 +22,7 @@ export default new Vuex.Store({
'1007': '员工管理',
'1008': '查询核销',
'1009': '场地管理',
'1010': '设备管理',
}
},
mutations,

4
src/subpackage/device/components/device_name/device_name.vue

@ -4,7 +4,7 @@
<view class="dn-content">
<view class="dc-store-name">文字文字文字文字文字文字文字</view>
<view class="dc-name">
<image class="dn-ico"></image>
<image class="dn-ico" mode="aspectFit" src="/subpackage/device/static/images/position.png"></image>
<text class="dn-txt">文字文字文字文字文字文字文字-01</text>
</view>
</view>
@ -53,10 +53,10 @@ export default {
text-overflow: ellipsis;
white-space: nowrap;
.dn-ico{
vertical-align: middle;
margin-right: 12upx;
width: 28upx;
height: 28upx;
background-color: skyblue;
}
}
}

7
src/subpackage/device/js/device_api.js

@ -0,0 +1,7 @@
import { ORIGIN } from '../../../js/api';
export const DEVICE_API = {
hardwareList:`${ORIGIN}/admin/stadium/hardware/list`, // 品牌信息
}
export default DEVICE_API;

10
src/subpackage/device/js/device_server.js

@ -0,0 +1,10 @@
import { Server } from '../../../js/server';
class DeviceServer extends Server {
constructor(props){
super(props)
}
}
export default new DeviceServer();

8
src/subpackage/device/pages/device_manage/device_manage.vue

@ -5,7 +5,7 @@
<view class="dm-list">
<view class="dl-item" v-for="i in 10" :key="i">
<view class="di-header">
<image></image>
<image mode="aspectFit" :src="getIcon()"></image>
<view class="dh-name">欧轩智能测试柜-01</view>
<view class="dh-test-btn" v-if="pageInfo.isTestBtn" @click="testBtn">
<image mode="aspectFit" :src="pageInfo.testBtnIcon || ''"></image>
@ -104,6 +104,11 @@ export default {
uni.setNavigationBarTitle({ title: _pageInfo.name });
},
methods: {
getIcon(){
let { pageInfo } = this;
if(!pageInfo.id)return '';
return `/subpackage/device/static/images/devices/${pageInfo.id}.png`
},
stockBtn(){
console.log(123)
let { pageInfo } = this;
@ -149,7 +154,6 @@ export default {
margin-right: 20upx;
width: 80upx;
height: 80upx;
background-color: skyblue;
}
.dh-name{
flex-grow: 1;

14
src/subpackage/device/pages/index/index.vue

@ -15,6 +15,9 @@
<script>
import util from '../../../../utils/util';
import store_name from '../../components/store_name/store_name';
import deviceServer from '../../js/device_server';
import deviceApi from '../../js/device_api';
const rootPage = '/subpackage/device'
const tabArr = [
{id: 1, name: '照明', path: `/pages/switch_manage/switch_manage`},
@ -42,6 +45,17 @@ export default {
tabArr,
}
},
onLoad(){
deviceServer.get({
url: deviceApi.hardwareList,
data: {
'filter[hardware_type]': 'GateControl',
'filter[stadium_id]': 151,
},
failMsg: '加载失败!',
})
.then(console.log)
},
methods: {
getImgPath(id){
if(!id)return '';

BIN
src/subpackage/device/static/images/position.png

After

Width: 28  |  Height: 28  |  Size: 368 B

Loading…
Cancel
Save