123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <template>
- <view>
- <u-navbar title="我的站点"></u-navbar>
-
- <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/deviceList?id='+item.id)"
-
- class="deviceList-item deviceList-bg1" >
- <view class="deviceList-main">
-
- <span class="btn12 " v-if="item.type=='1,2'" >快/慢</span>
- <span class="btn12 btn1" v-if="item.type=='1'" >慢冲</span>
- <span class="btn12 btn2" v-if="item.type=='2'" >快冲</span>
- {{item.name}}</view>
- <view class="deviceList-head">{{item.address}}<span style="float: right;" class="iconfont more"></span></view>
- <view class="deviceList-foot">
-
- <view class="deviceList-label" style="color: #333333;" >总数{{item.totalNum}}</view>
- <view class="deviceList-label" style="color: #7a68f6;" v-if="item.fastNum" >/直流{{item.fastNum}}</view>
-
- <view class="deviceList-label" style="color: #5cbe7d;" v-if="item.slowNum" >/交流{{item.slowNum}}</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="#f4f0f0">已经到底了</u-divider>
-
-
- </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: -1,
- },
- {
- label: '自行车充电',
- value: 0,
- },
- {
- label: '交流慢充',
- value: 2,
- },
- {
- label: '直流快充',
- value: 1,
- }
- ],
- 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();
- }
- },
- 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.stationsList(this.form).then((res) => {
-
- this.list = [
- ...this.list,
- ...res.data.data
- ];
-
- uni.hideLoading()
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- onReady() {
- //this.getStation()
- this.getList()
-
- }
- }
- }
- </script>
- <style>
- page{
- background-color: #F7F7F7;
- }
- </style>
- <style lang="scss" scoped>
- .btn12{
- color: #fff;
- background-color: #449ca8;
- font-size: 16px;
- border-radius: 50px;
- padding: 1px 5px;
- }
- .btn1{
-
- background-color: #5cbe7d;
-
- }
- .btn2{
-
- background-color: #7a68f6;
-
- }
- .deviceDropdown{
- background-color: #fff;
- }
- .deviceList-item{
- margin: 16px;
- border-radius: 8px;
- .deviceList-head{
- color: #9e9e9e;
- font-size: 16px;
- padding: 8px 16px;
- }
- .deviceList-main{
- font-size: 20px/* */;
- padding:5px 16px 0px 16px;
- font-weight: bold;
- }
- .deviceList-foot{
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- padding: 0 16px 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%;
- background-color: #ffffff ;
- }
- .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%;
- }
- </style>
|