页面切图
This commit is contained in:
63
pages/gateway/list.vue
Normal file
63
pages/gateway/list.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='index'>
|
||||
<uni-card title="网关信息" sub-title="副标题" v-for="item in 3" :key="item" @click="jump"
|
||||
thumbnail="/static/gateway.png">
|
||||
<view class="footer">
|
||||
<text>设备基础信息 </text>
|
||||
<view class="footer-btn" @click="newDevice">注册设备</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
newDevice () {
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/newDevice'
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.index {
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.footer-btn {
|
||||
padding: 0 20rpx;
|
||||
height: 50rpx;
|
||||
background-color: #007aff;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 50rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .uni-list-item {
|
||||
background-color: $uni-theme-white !important;
|
||||
}
|
||||
</style>
|
||||
68
pages/gateway/new.vue
Normal file
68
pages/gateway/new.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<view class='new'>
|
||||
<view style="display:flex">
|
||||
<uni-easyinput type="number" v-model="code" placeholder="请输入设备NDID" />
|
||||
<uni-icons type="camera" color="#007aff" size="30" class="ml20" @click="scanCode"></uni-icons>
|
||||
</view>
|
||||
<view class="new-btn" @click="submit"> 提交 </view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
code: '',
|
||||
type: 1,
|
||||
formData: {
|
||||
address: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
scanCode () {
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
register () {
|
||||
this.type = 2
|
||||
},
|
||||
chooseLocation () {
|
||||
uni.chooseLocation({
|
||||
success: function (res) {
|
||||
this.address = res.name
|
||||
console.log('位置名称:' + res.name);
|
||||
console.log('详细地址:' + res.address);
|
||||
console.log('纬度:' + res.latitude);
|
||||
console.log('经度:' + res.longitude);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit () {
|
||||
this.$util.toast('提交成功')
|
||||
uni.navigateBack({ delta: 1 })
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.new {
|
||||
padding: 100rpx 100rpx 0;
|
||||
|
||||
.new-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 80rpx auto 0;
|
||||
width: 320rpx;
|
||||
background: $uni-theme-blue;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
88
pages/gateway/newDevice.vue
Normal file
88
pages/gateway/newDevice.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='index'>
|
||||
<view class="content" v-for="(item, index) in formData" :key="index">
|
||||
<uni-forms :label-width="80">
|
||||
<uni-forms-item label="类型">
|
||||
<uni-data-select v-model="item.type" :localdata="range"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="MAC地址">
|
||||
<uni-easyinput type="number" v-model="item.address" placeholder="请输入设备MAC地址" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="add"> 添加 </view>
|
||||
<view class="btn-wrap-item ml20" @click="submit"> 提交 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
formData: [
|
||||
{
|
||||
type: '',
|
||||
address: '',
|
||||
}
|
||||
],
|
||||
range: [
|
||||
{ value: 0, text: "DVR" },
|
||||
{ value: 1, text: "APF" },
|
||||
],
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.formData.push({
|
||||
type: '',
|
||||
address: '',
|
||||
})
|
||||
},
|
||||
submit () {
|
||||
console.log(this.formData)
|
||||
// uni.navigateBack({ delta: 1 })
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.index {
|
||||
padding: 34rpx;
|
||||
|
||||
.content {
|
||||
margin-bottom: 20rpx;
|
||||
padding: 34rpx;
|
||||
background: $uni-theme-white;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.btn-wrap {
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn-wrap-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .uni-forms-item:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user