Browse Source

add all

voice
刘嘉炜 4 years ago
parent
commit
f71665b87d
  1. 14
      src/pages.json
  2. 1
      src/subpackage/device/pages/coffee_test/coffee_test.vue
  3. 16
      src/subpackage/device/pages/device_manage/device_manage.vue
  4. 41
      src/subpackage/device/pages/index/index.vue
  5. 104
      src/subpackage/device/pages/pad_manage/pad_manage.vue
  6. 271
      src/subpackage/device/pages/sell_box_manage/sell_box_manage.vue
  7. 99
      src/subpackage/device/pages/switch_manage/switch_manage.vue
  8. BIN
      src/subpackage/device/static/images/close.png
  9. BIN
      src/subpackage/device/static/images/devices/1.png
  10. BIN
      src/subpackage/device/static/images/devices/10.png
  11. BIN
      src/subpackage/device/static/images/devices/11.png
  12. BIN
      src/subpackage/device/static/images/devices/12.png
  13. BIN
      src/subpackage/device/static/images/devices/13.png
  14. BIN
      src/subpackage/device/static/images/devices/14.png
  15. BIN
      src/subpackage/device/static/images/devices/15.png
  16. BIN
      src/subpackage/device/static/images/devices/2.png
  17. BIN
      src/subpackage/device/static/images/devices/3.png
  18. BIN
      src/subpackage/device/static/images/devices/4.png
  19. BIN
      src/subpackage/device/static/images/devices/5.png
  20. BIN
      src/subpackage/device/static/images/devices/6.png
  21. BIN
      src/subpackage/device/static/images/devices/7.png
  22. BIN
      src/subpackage/device/static/images/devices/8.png
  23. BIN
      src/subpackage/device/static/images/devices/9.png
  24. BIN
      src/subpackage/device/static/images/in.png
  25. BIN
      src/subpackage/device/static/images/open.png
  26. BIN
      src/subpackage/device/static/images/out.png
  27. BIN
      src/subpackage/device/static/images/refresh.png

14
src/pages.json

@ -199,7 +199,7 @@
{
"path": "pages/coffee_test/coffee_test",
"style" : {
"navigationBarTitleText": "咖啡机管理"
"navigationBarTitleText": "咖啡机测试"
}
},
{
@ -213,6 +213,18 @@
"style" : {
"navigationBarTitleText": "订单管理"
}
},
{
"path": "pages/pad_manage/pad_manage",
"style" : {
"navigationBarTitleText": "平板管理"
}
},
{
"path": "pages/sell_box_manage/sell_box_manage",
"style" : {
"navigationBarTitleText": "平板管理"
}
}
]
}

1
src/subpackage/device/pages/coffee_test/coffee_test.vue

@ -103,7 +103,6 @@ export default {
line-height: 52upx;
text-align: center;
font-size: 28upx;
line-height: 40upx;
border: 2upx solid #009874;
border-radius: 40upx;
color: #333;

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

@ -35,9 +35,25 @@
<script>
import store_name from '../../components/store_name/store_name';
const dmObj = {
'd7': {
id: 7,
name: '',
isTestBtn: true,
testBtnIcon: '',
testBtnName: '测试',
isShowStock: true,
stockBtnName: '补货',
deviceBtnOpenName: '开启售货',
deviceBtnStopName: '停止售货',
}
}
export default {
components: {
'store-name': store_name
},
onLoad(options){
console.log(options)
}
}
</script>

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

@ -3,9 +3,9 @@
<store-name></store-name>
<view class="ic-section">
<view class="is-list">
<view class="il-item" v-for="i in 15" :key="i">
<view><image></image></view>
<view>照明</view>
<view class="il-item" v-for="(e,i) in tabArr" :key="i" @click="routeTo(e)">
<view><image mode="aspectFit" :src="getImgPath(e.id) || ''"></image></view>
<view>{{e.name || ''}}</view>
</view>
</view>
</view>
@ -13,10 +13,44 @@
</template>
<script>
import util from '../../../../utils/util';
import store_name from '../../components/store_name/store_name';
const rootPage = '/subpackage/device'
const tabArr = [
{id: 1, name: '照明', path: `/pages/switch_manage/switch_manage`},
{id: 2, name: '空调', path: `/pages/switch_manage/switch_manage`},
{id: 3, name: '风扇', path: `/pages/switch_manage/switch_manage`},
{id: 4, name: '门禁', path: `/pages/switch_manage/switch_manage`},
{id: 5, name: '门闸', path: `/pages/switch_manage/switch_manage`},
{id: 6, name: '平板', path: `/pages/switch_manage/switch_manage`},
{id: 7, name: '售货柜', path: `/pages/device_manage/device_manage`},
{id: 8, name: '租售柜', path: `/pages/device_manage/device_manage`},
{id: 9, name: '储物柜', path: `/pages/device_manage/device_manage`},
{id: 10, name: '咖啡机', path: `/pages/device_manage/device_manage`},
{id: 11, name: '水阀', path: `/pages/switch_manage/switch_manage`},
{id: 12, name: '互动设备', path: `/pages/switch_manage/switch_manage`},
{id: 13, name: '监控', path: ``},
{id: 14, name: '音响', path: ``},
{id: 15, name: '机器人', path: ``},
];
export default {
components: {
'store-name': store_name
},
data(){
return {
tabArr,
}
},
methods: {
getImgPath(id){
if(!id)return '';
return `/subpackage/device/static/images/devices/${id || 14}.png`
},
routeTo(e){
if(e.path == '')return util.showNone('暂未开放!');
util.routeTo(`${rootPage}${e.path}?id=${e.id}`, 'nT');
}
}
}
</script>
@ -44,7 +78,6 @@ export default {
>image{
width: 80upx;
height: 80upx;
background-color: skyblue;
}
}
&:nth-child(2){

104
src/subpackage/device/pages/pad_manage/pad_manage.vue

@ -0,0 +1,104 @@
<template>
<view class="pad-manage">
<store-name></store-name>
<view class="pm-tit">平板管理</view>
<view class="pm-list">
<view class="cl-item" v-for="i in 5" :key="i">
<image></image>
<view>
<view class="ci-title">前门平板</view>
<view class="ci-bot">
<view>设备在线</view>
<image></image>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import store_name from '../../components/store_name/store_name';
export default {
components: {
'store-name': store_name
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.pm-tit{
padding: 50upx 40upx 30upx;
line-height: 60upx;
font-size: 44upx;
font-weight: 500;
color: #333;
}
.pm-list{
padding: 0 32upx;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.cl-item{
flex-shrink: 0;
flex-grow: 0;
display: flex;
justify-content: space-between;
margin-bottom: 24upx;
padding: 20upx 20upx 30upx;
width: 328upx;
height: 132upx;
border-radius: 10upx;
background-color: #fff;
>image{
flex-shrink: 0;
flex-grow: 0;
margin-right: 20upx;
width: 80upx;
height: 80upx;
background-color: skyblue;
}
>view{
flex-grow: 1;
.ci-title{
font-size: 32upx;
line-height: 44upx;
color: #333;
@include textHide(1);
}
.ci-bot{
@include centerFlex(flex-start);
>view{
padding: 0 12upx;
font-size: 20upx;
line-height: 28upx;
text-align: center;
border-radius: 20upx;
border: 2upx solid #9A9A9D;
color: #333;
&::before{
content: '';
margin-top: -2upx;
margin-right: 12upx;
vertical-align: middle;
display: inline-block;
width: 8upx;
height: 8upx;
border-radius: 50%;
background-color: $themeColor;
}
}
>image{
flex-shrink: 0;
flex-grow: 0;
margin-left: 8upx;
width: 32upx;
height: 32upx;
background-color: skyblue;
}
}
}
}
}
</style>

271
src/subpackage/device/pages/sell_box_manage/sell_box_manage.vue

@ -0,0 +1,271 @@
<template>
<view class="sell-box-manage">
<device-name id="devicename"></device-name>
<view class="sbm-section" :style="'height:'+ sectionHeight +'px;'">
<scroll-view class="ss-tabs" scroll-y>
<view :class="['st-item', i == 2?'active':'']" v-for="(e,i) in 20" :key="i">第一层</view>
</scroll-view>
<scroll-view class="ss-list" scroll-y>
<view class="sl-section" v-for="k in 5" :key="k">
<view class="ss-tit">第一层<text>售货机第一行的商品</text></view>
<view class="ss-goods-list">
<view class="sgl-item" v-for="i in 5" :key="i">
<view class="si-img">
<image></image>
<view class="si-tag"><view>101</view></view>
</view>
<view class="si-name">
<view>维他奶原味豆奶</view>
</view>
<view class="si-price">¥3.5</view>
<view class="si-contral">
<view hover-class="hover-active">-</view>
<input disabled value="200"/>
<view hover-class="hover-active">+</view>
</view>
</view>
</view>
</view>
<view class="sl-tip">客官到底啦</view>
</scroll-view>
</view>
<view class="sbm-fixed-bar">
<view>
<image class="active" mode="aspectFit" src="/subpackage/device/static/images/selected_987.png"></image>
<text>确认补货</text>
</view>
<view>确认补货</view>
</view>
</view>
</template>
<script>
import util from '../../../../utils/util';
import device_name from '../../components/device_name/device_name';
export default {
components: {
'device-name': device_name
},
data(){
return {
sectionHeight: 0
}
},
async onLoad(){
},
async onReady(){
let _topBar = await util.getNodeMes(`#devicename`);
let _botBar = await util.getNodeMes(`.sbm-fixed-bar`);
let _sysMes = uni.getSystemInfoSync();
this.sectionHeight = _sysMes.windowHeight - (_botBar.height + _topBar.height);
console.log(_topBar, _botBar, _sysMes, this.sectionHeight)
},
}
</script>
<style lang="scss">
@import '~style/public.scss';
.sbm-section{
display: flex;
.ss-tabs{
flex-shrink: 0;
flex-grow: 0;
width: 180upx;
height: 100%;
background-color: #fff;
.st-item{
padding: 0 10upx;
height: 92upx;
line-height: 92upx;
text-align: center;
font-size: 28upx;
color: #9a9a9d;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&.active{
font-weight: 500;
color: $themeColor;
background-color: #EDEDF5;
}
}
}
.ss-list{
padding-top: 10upx;
flex-grow: 1;
min-width: 0;
.sl-section{
padding-bottom: 30upx;
margin: 0 auto 10upx;
width: 97%;
border-radius: 10upx;
background-color: #fff;
.ss-tit{
padding: 20upx;
font-size: 28upx;
font-weight: 500;
line-height: 40upx;
color: #333;
@include textHide(1);
>text{
margin-left: 14upx;
line-height: 34upx;
font-size: 24upx;
color: #9a9a9d;
}
}
.ss-goods-list{
display: flex;
flex-wrap: wrap;
.sgl-item{
flex-shrink: 0;
margin-top: 68upx;
width: 33.33%;
&:nth-child(-n+3){
margin-top: 0;
}
>view{
margin-left: auto;
margin-right: auto;
}
.si-img{
position: relative;
margin-bottom: 10upx;
width: 148upx;
height: 148upx;
background-color: skyblue;
>image{
width: 100%;
height: 100%;
background-color: turquoise;
}
.si-tag{
position: absolute;
left: 0;
top: -6upx;
padding-bottom: 2upx;
width: 50upx;
background-image: linear-gradient(to bottom right, #00C9AC, #009874);
border-bottom-right-radius: 40%;
border-bottom-left-radius: 40%;
border-top-left-radius: 8upx;
>view{
line-height: 28upx;
width: 100%;
text-align: center;
font-size: 20upx;
color: #fff;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&::after{
content: '';
position: absolute;
right: -6upx;
top: 0;
width: 0;
height: 0;
border-left: 6upx solid #1C725F;
border-top: 6upx solid transparent;
}
}
}
.si-name{
width: 148upx;
min-height: 70upx;
>view{
font-size: 24upx;
line-height: 34upx;
@include textHide(2);
}
}
.si-price{
margin-bottom: 20upx;
width: 148upx;
font-size: 24upx;
line-height: 34upx;
color: #ff873d;
}
.si-contral{
width: 148upx;
@include centerFlex(space-between);
>view{
flex-shrink: 0;
flex-grow: 0;
width: 36upx;
height: 36upx;
line-height: 24upx;
text-align: center;
font-size: 28upx;
font-weight: bold;
border: 4upx solid $themeColor;
border-radius: 50%;
color: $themeColor;
background-color: #fff;
}
>input{
flex-grow: 1;
margin: 0 10upx;
line-height: 40upx;
text-align: center;
font-size: 28upx;
color: #333;
+view{
color: #fff;
background-color: $themeColor;
}
}
}
}
}
}
.sl-tip{
padding-top: 10upx;
padding-bottom: 92upx;
line-height: 40upx;
text-align: center;
font-size: 28upx;
color: #9a9a9d;
}
}
}
.sbm-fixed-bar{
padding: 10upx 24upx;
padding-bottom: calc( 10upx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 10upx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
background-color: #fff;
@include centerFlex(space-between);
>view{
&:first-child{
font-size: 28upx;
line-height: 40upx;
color: #494949;
>image{
margin-right: 12upx;
vertical-align: middle;
width: 32upx;
height: 32upx;
border-radius: 50%;
border: 2upx solid #DDD;
&.active{
border-width: 0;
border-color: transparent;
}
}
}
&:nth-child(2){
flex-shrink: 0;
padding: 0 56upx;
line-height: 86upx;
text-align: center;
font-size: 32upx;
border-radius: 45upx;
color: #fff;
background-color: $themeColor;
}
}
}
</style>

99
src/subpackage/device/pages/switch_manage/switch_manage.vue

@ -1,29 +1,29 @@
<template>
<view class="switch-manage">
<store-name></store-name>
<view class="sm-tit">照明管理</view>
<view class="sm-tit">{{pageInfo.name || '-'}}</view>
<view class="sm-list">
<view class="sl-item" v-for="i in 5" :key="i">
<view class="si-top">
<image></image>
<image mode="aspectFit" :src="getIcon()"></image>
<view class="st-right">
<view class="sr-name">大堂</view>
<view class="sr-bot">
<view>
<text>设备在线</text>
</view>
<image></image>
<image mode="aspectFit" src="/subpackage/device/static/images/refresh.png"></image>
</view>
</view>
</view>
<view class="si-bottom">
<view>
<image></image>
<view></view>
<view class="si-bottom" v-if="pageInfo.isOpen || pageInfo.isClose">
<view v-if="pageInfo.isOpen">
<image mode="aspectFit" :src="pageInfo.openIcon || ''"></image>
<view>{{pageInfo.openName || '-'}}</view>
</view>
<view>
<image></image>
<view></view>
<view v-if="pageInfo.isClose">
<image mode="aspectFit" :src="pageInfo.closeIcon || ''"></image>
<view>{{pageInfo.closeName || '-'}}</view>
</view>
</view>
</view>
@ -33,9 +33,80 @@
<script>
import store_name from '../../components/store_name/store_name';
const showArr = {
's1': {
id: 1, name: '照明管理', isOpen: true, isClose: true,
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',
},
's2': {
id: 2, name: '空调管理', isOpen: true, isClose: true,
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',
},
's3': {
id: 3, name: '风扇管理', isOpen: true, isClose: true,
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',
},
's4': {
id: 4, name: '门禁管理', isOpen: true, isClose: false,
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',
},
's5': {
id: 5, name: '门闸管理', isOpen: true, isClose: true,
openIcon: '/subpackage/device/static/images/in.png',
closeIcon: '/subpackage/device/static/images/out.png',
openName: '进', closeName: '出',
},
's6': {
id: 6, name: '平板管理', isOpen: false, isClose: false,
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',
},
's11': {
id: 11, name: '水阀管理', isOpen: true, isClose: true,
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',
},
's12': {
id: 12, name: '互动设备管理', isOpen: true, isClose: true,
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',
},
}
export default {
components: {
'store-name': store_name
},
computed: {
},
data(){
return {
pageInfo: {}
}
},
onLoad(options){
let _pageInfo = showArr[`s${options.id}`] || {};
this.pageInfo = _pageInfo;
uni.setNavigationBarTitle({ title: _pageInfo.name });
},
methods: {
getIcon(){
let { pageInfo } = this;
if(!pageInfo.id)return '';
return `/subpackage/device/static/images/devices/${pageInfo.id}.png`
}
}
}
</script>
@ -59,12 +130,10 @@ export default {
.sl-item{
margin-bottom: 30upx;
width: 328upx;
height: 350upx;
border-radius: 10upx;
background-color: #fff;
.si-top{
padding: 20upx 20upx 30upx;
border-bottom: 2upx solid #F2F2F7;
display: flex;
flex-wrap: nowrap;
>image{
@ -73,7 +142,6 @@ export default {
margin-right: 20upx;
width: 80upx;
height: 80upx;
background-color: skyblue;
}
.st-right{
flex-grow: 1;
@ -111,26 +179,25 @@ export default {
flex-grow: 0;
width: 32upx;
height: 32upx;
background-color: skyblue;
}
}
}
}
.si-bottom{
padding-top: 30upx;
padding-bottom: 30upx;
display: flex;
justify-content: center;
border-top: 2upx solid #F2F2F7;
>view{
flex-shrink: 0;
flex-grow: 0;
width: 50%;
background-color: skyblue;
>image{
display: block;
margin: 0 auto 20upx;
width: 100upx;
height: 100upx;
background-color: red;
}
>view{
font-size: 24upx;

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

After

Width: 100  |  Height: 100  |  Size: 816 B

BIN
src/subpackage/device/static/images/devices/1.png

After

Width: 80  |  Height: 80  |  Size: 730 B

BIN
src/subpackage/device/static/images/devices/10.png

After

Width: 80  |  Height: 82  |  Size: 826 B

BIN
src/subpackage/device/static/images/devices/11.png

After

Width: 80  |  Height: 80  |  Size: 818 B

BIN
src/subpackage/device/static/images/devices/12.png

After

Width: 80  |  Height: 80  |  Size: 1.6 KiB

BIN
src/subpackage/device/static/images/devices/13.png

After

Width: 80  |  Height: 80  |  Size: 658 B

BIN
src/subpackage/device/static/images/devices/14.png

After

Width: 80  |  Height: 80  |  Size: 1.2 KiB

BIN
src/subpackage/device/static/images/devices/15.png

After

Width: 80  |  Height: 80  |  Size: 782 B

BIN
src/subpackage/device/static/images/devices/2.png

After

Width: 80  |  Height: 80  |  Size: 741 B

BIN
src/subpackage/device/static/images/devices/3.png

After

Width: 80  |  Height: 80  |  Size: 845 B

BIN
src/subpackage/device/static/images/devices/4.png

After

Width: 80  |  Height: 80  |  Size: 687 B

BIN
src/subpackage/device/static/images/devices/5.png

After

Width: 80  |  Height: 80  |  Size: 809 B

BIN
src/subpackage/device/static/images/devices/6.png

After

Width: 80  |  Height: 80  |  Size: 634 B

BIN
src/subpackage/device/static/images/devices/7.png

After

Width: 80  |  Height: 80  |  Size: 574 B

BIN
src/subpackage/device/static/images/devices/8.png

After

Width: 80  |  Height: 80  |  Size: 1.1 KiB

BIN
src/subpackage/device/static/images/devices/9.png

After

Width: 80  |  Height: 80  |  Size: 820 B

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

After

Width: 100  |  Height: 100  |  Size: 959 B

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

After

Width: 100  |  Height: 100  |  Size: 924 B

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

After

Width: 100  |  Height: 100  |  Size: 1.0 KiB

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

After

Width: 32  |  Height: 32  |  Size: 403 B

Loading…
Cancel
Save