123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- <template>
- <view>
- <u-navbar title="我的设备"></u-navbar>
- <!-- <view class="deviceDropdown">
- <u-dropdown>
- <u-dropdown-item v-model="value1" @change="change1" title="充电桩类型" :options="options1"></u-dropdown-item>
- <u-dropdown-item v-model="value2" @change="change2" title="所属站点" :options="options2"></u-dropdown-item>
- <u-dropdown-item v-model="value3" @change="change3" title="运行状态" :options="options3"></u-dropdown-item>
- </u-dropdown>
- </view> -->
- <view class="deviceList"
-
- >
- <view style="text-align: center;margin-top: 100px" v-if="!list.length">
- <img src="@/assets/img/blankpage.png">
- <view>查询为空</view>
- </view>
- <view v-for="(item ,index) in list" :key="item.id"
- @click="gotoUrl('pagesFinance/user/deviceLine?id='+item.id)"
- :class="{
-
- 'deviceList-bg4':true
-
- }"
- class="deviceList-item " >
- <view class="deviceList-head">{{item.deviceName}} <span style="float: right;font-size: 12px;" class="iconfont more">详情</span></view>
- <view class="deviceList-main"> {{item.roomAddress}}</view>
- <view class="deviceList-foot">
- <!-- <view class="deviceList-label">{{item.classifyText}}</view>
- --> <view class="deviceList-label"
- :style="item.status?'':'color:red'"
- >{{item.status?'在线':'离线'}}</view>
- <!-- <view class="deviceList-label">{{item.roleName}}</view> -->
- </view>
- </view>
- <u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;" bg-color="#f7f7f7">已经到底了</u-divider>
-
- <!-- <view class="deviceList-item deviceList-bg2">
- <view class="deviceList-head">荆鹏软件园充电站</view>
- <view class="deviceList-main">A0001</view>
- <view class="deviceList-foot">
- <view class="deviceList-label">直流快充</view>
- <view class="deviceList-label">正常运行</view>
- <view class="deviceList-label">市场服务 70%</view>
- </view>
- </view>
- <view class="deviceList-item deviceList-bg3">
- <view class="deviceList-head">荆鹏软件园充电站</view>
- <view class="deviceList-main">A0001</view>
- <view class="deviceList-foot">
- <view class="deviceList-label">直流快充</view>
- <view class="deviceList-label">正常运行</view>
- <view class="deviceList-label">市场服务 70%</view>
- </view>
- </view> -->
- </view>
- </view>
- </template>
- <script>
- import * as API from '@/apis/finance.js'
-
- export default {
- data() {
- return {
- form: {
-
- },
- startDate:'',
- endDate:'',
- pageIndex: 1,
- recordsTotal: 0,
- list: [],
- value1: -1,
- value2: -1,
- value3: -1,
- stationList:[],
- options0: [
-
- {
- label: '自行车充电',
- value: 0,
- },
- {
- label: '直流快充',
- value: 1,
- },
- {
- label: '交流慢充',
- value: 2,
- }
-
- ],
- options1: [{
- label: '全部',
- value: '-1',
- },
- {
- label: '自行车充电',
- value: 0,
- },
- {
- label: '交流慢充',
- value: 2,
- },
- {
- label: '直流快充',
- value: 1,
- }
- ],
- options2: [
- ],
- options3: [
- {
- label: '全部',
- value: -1,
- },
- {
- label: '在线',
- value: 1,
- },
- {
- label: '离线',
- value: 0,
- },
- ],
- }
- },
- onReachBottom() {
- if (this.list.length < this.recordsTotal) {
- this.myLoadmore();
- }
- },
- onLoad(op) {
- this.form.stationId=op.id
- },
- methods: {
- change1(e){
- this.form.type=e
- if(e==-1){
- this.form.type=""
- }
- this.getList(true)
- },
- change2(e){
- this.form.stationId=e
- if(e==-1){
- this.form.stationId=""
- }
- this.getList(true)
- },
- change3(e){
- this.form.onlineStatus=e
- if(e==-1){
- this.form.onlineStatus=""
- }
- this.getList(true)
- },
- getStation() {
-
- API.stationList().then((res) => {
- this.options2.push({
- label: '全部',
- value:-1,
- })
- this.stationList = res.data.stationList
- this.stationList.forEach(item=>{
- this.options2.push({
- label: item.name,
- value: item.id,
- })
- })
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- myLoadmore() {
- this.pageIndex += 1;
- this.getList()
- },
- getList(bl) {
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- if (bl) {
- this.list = [];
- this.pageIndex = 1;
- }
- this.form.pageIndex= this.pageIndex
-
- API.cameraList(this.form).then((res) => {
- this.list = [
- ...this.list,
- ...res.data.data
- ];
- this.recordsTotal = res.data.recordsTotal
- uni.hideLoading()
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- onReady() {
- //this.getStation()
- this.getList()
-
- }
- }
- }
- </script>
- <style>
- page{
- background-color: #F7F7F7;
- }
- </style>
- <style lang="scss" scoped>
- .deviceDropdown{
- background-color: #fff;
- }
- .deviceList-item{
- margin: 16px;
- border-radius: 8px;
- .deviceList-head{
- font-size: 16px;
- padding: 8px 16px;
- }
- .deviceList-main{
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-
- font-size: 18px;
- padding: 0px 16px;
- font-weight: bold;
- }
- .deviceList-foot{
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- padding: 16px;
- .deviceList-label{
- background-color: #F0F2F4 ;
- padding: 4px 10px;
- margin: 1px;
- border-radius: 4px;
- }
- }
- }
- .deviceList-bg1{
- background:url(../../assets/img/charging_type_fast.png) no-repeat #fff;
- background-size:100%;
- }
- .deviceList-bg2{
- background:url(../../assets/img/charging_type_slow.png) no-repeat #fff;
- background-size:100%;
- }
- .deviceList-bg3{
- background:url(../../assets/img/charging_type_bike.png) no-repeat #fff;
- background-size:100%;
- }
- .deviceList-bg4{
- background:url(../../assets/img/charging_type_line.png) no-repeat #fff;
- background-size:100%;
- }
- </style>
|