123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <template>
- <view>
- <view class="onekeep" v-for="(item,index) in keeplist" :key="item.id">
- <view class="onekeeplabel" @click="optionShow(index)">
- <text>{{item.poleGroupName}}</text>
- </view>
- <view class="twokeep" v-for="(item2,index2) in item.cameraList" :key="item2.id" v-show="item.show">
- <text>{{item2.poleGroupName}}</text>
- <button type="primary" @click="lookVedio(index,index2)">查看</button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- direct
- } from '../api/Supervisory/Supervisory.js'
- export default {
- data() {
- return {
- keeplist: []
- };
- },
- methods: {
- lookVedio(index,index2){
- uni.navigateTo({
- url:'/pages/Supervisory_keep/Supervisory_keep?index=' + index + '&index2=' + index2,
- })
- },
- optionShow(index){
- var that = this
- var keeplist = that.keeplist
- keeplist[index].show == true ? keeplist[index].show = false : keeplist[index].show = true
- that.keeplist = keeplist
- }
- },
- onLoad() {
- direct().then(res => {
- if (res.code == 200) {
- var keeplist = res.data
- for(let arr of keeplist){
- arr.show = false
- }
- this.keeplist = keeplist
- }
- })
- },
- onShow() {
- if(this.keeplist.length == 0){
- direct().then(res => {
- if (res.code == 200) {
- var keeplist = res.data
- for(let arr of keeplist){
- arr.show = false
- }
- this.keeplist = keeplist
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .onekeep{
- margin-bottom: 4rpx;
- width: 750rpx;
- }
-
- .onekeeplabel{
- width: 750rpx;
- height: 110rpx;
- background-color: #333333;
- color: #ffffff;
- position: relative;
- text{
- font-size: 36rpx;
- position: absolute;
- left: 20rpx;
- top: 37rpx;
- }
- }
-
- .twokeep{
- width: 750rpx;
- height: 100rpx;
- position: relative;
- border-bottom: 1px royalblue solid;
- text{
- position: absolute;
- top: 34rpx;
- font-size: 32rpx;
- left: 30rpx;
- }
- button{
- width: 140rpx;
- height: 80rpx;
- position: absolute;
- font-size: 32rpx;
- top: 10rpx;
- right: 30rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
- </style>
|