123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <template>
- <view class="">
- <view class="cu-list menu-avatar">
- <!-- <view class="cu-item deviceTypeItem" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
- :key="index" :data-target="'move-box-' + index" @tap="hrefKing(index)">
- <view class="cu-avatar round lg" :style="`background-image:url(${item.imgUrl})`"></view>
- <view class="content">
- <view class="">{{item.title}}</view>
- </view>
- <view class="nav-right num">
- <view class="text-grey">
- 共{{item.num}}个设备
- <text class="icon iconfont margin-right-xs margin-left-lg"></text>
- </view>
- </view>
- </view> -->
-
- <view class="cu-item deviceTypeItem" @tap="goVideoList()">
- <view class="cu-avatar round lg" style="background-image:url(../../static/square-video.png)"></view>
- <view class="content">
- <view class="">视频</view>
- </view>
- <view class="nav-right num">
- <view class="text-grey">
- 共{{videoDeviceCount}}个设备
- <text class="icon iconfont margin-right-xs margin-left-lg"></text>
- </view>
- </view>
- </view>
- <view class="cu-item deviceTypeItem" @tap="goDeviceManage()">
- <view class="cu-avatar round lg" style="background-image:url(../../static/square-dl.png)"></view>
- <view class="content">
- <view class="">电力监测</view>
- </view>
- <view class="nav-right num">
- <view class="text-grey">
- 共{{powerDeviceCount}}个设备
- <text class="icon iconfont margin-right-xs margin-left-lg"></text>
- </view>
- </view>
- </view>
-
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
-
- powerDeviceCount:'',
- videoDeviceCount:'',
- companyCode:'',
- // deviceData: [{
- // imgUrl: '../../static/square-video.png',
- // title: '视频',
- // num: 6
- // }, {
- // imgUrl: '../../static/square-dl.png',
- // title: '电力监测',
- // num: 11
- // }
- // ],
- modalName: null,
- };
- },
- onLoad:function(option){
- console.log(111)
- console.log(option.companyCode)
- this.companyCode=option.companyCode
- this.getSiteType(option.companyCode)
- },
-
-
- methods: {
- async getSiteType(ming) {
- const res= await this.$myRequest({
- url:'OperationMonitoring/getDeviceStatistics',
- data:{
- "companyCode": ming,
-
- }
- })
- console.log(res.data.data[0])
- this.powerDeviceCount= res.data.data[0].powerDeviceCount
- this.videoDeviceCount= res.data.data[0].videoDeviceCount
-
- },
-
-
-
- goDeviceManage(item){
- if(this.powerDeviceCount){
- uni.navigateTo({
- url: '/pages/device-Manage/device-Manage?deviceType=1&companyCode='+this.companyCode+'',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- }
-
- },
-
- goVideoList(item){
- if(this.videoDeviceCount){
- uni.navigateTo({
- url: '/pages/videoList/videoList?deviceType=2&companyCode='+this.companyCode+'',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- }
-
- },
-
- hrefKing(index) {
- // log(index)
- let url = "";
- switch (index) {
- case 0:
- url = "/pages/videoList/videoList" //进口水果
- break;
- case 1:
- url = "/pages/device-Manage/device-Manage" //热门品种
- break;
- default:
- break;
- }
- if (url) {
- uni.navigateTo({
- url: url
- })
- } else {
- uni.showToast({
- title: '功能未完成~',
- icon: 'none'
- })
- }
- },
- }
- }
- </script>
- <style lang="scss">
- .cu-list.menu-avatar>.cu-item .content>uni-view:first-child {
- font-size: 32rpx;
- }
- .num {
- font-size: 30rpx;
- color: #666;
- }
- </style>
|