1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
  | <template> 
 |    <view class="main_app"> 
 |          <template v-for="item in platformGroupList"> 
 |              <view class="title"> 
 |                <view class="icon"></view> 
 |                <view class="name">{{item.name}}</view> 
 |              </view> 
 |              <view class="data_list"> 
 |                <view class="line" v-for="(platform, i) in item.platformList" :key="platform.id"> 
 |                  <view class="name">{{platform.name}}</view> 
 |                  <u-switch v-model="platform.status" activeColor="#279BAA" inactiveColor="#cccccc" :inactiveValue="1" :activeValue="0" @change="e => changeStatus(platform)" /> 
 |                </view> 
 |              </view> 
 |          </template> 
 |    </view> 
 |  </template> 
 |    
 |  <script> 
 |      import { getPlatformGroupList, updPlatformStatus } from '@/api' 
 |  export default { 
 |    data() { 
 |      return { 
 |        platformGroupList: [] 
 |      } 
 |    }, 
 |    onLoad() { 
 |          this.getPlatformGroup() 
 |    }, 
 |    methods: { 
 |          changeStatus(item) { 
 |              console.log(item); 
 |              updPlatformStatus({ 
 |                  id: item.id, 
 |                  status: item.status 
 |              }) 
 |          }, 
 |          getPlatformGroup() { 
 |              getPlatformGroupList({ 
 |                  queryData: 0, 
 |                  queryType: 0 
 |              }).then(res => { 
 |                  this.platformGroupList = res.data || [] 
 |              }) 
 |          }, 
 |    } 
 |  } 
 |  </script> 
 |  <style lang="scss"> 
 |  .main_app { 
 |    padding: 30rpx 0; 
 |    background: #fff; 
 |    .data_list { 
 |      padding: 30rpx; 
 |      .line { 
 |        padding: 0 30rpx; 
 |        background: #F4F9F8; 
 |        margin-bottom: 20rpx; 
 |        display: flex; 
 |        align-items: center; 
 |        height: 84rpx; 
 |        font-size: 32rpx; 
 |        color: #333333; 
 |        border-radius: 8rpx; 
 |        justify-content: space-between; 
 |        &:nth-of-type(2n){ 
 |          background: #F7F7F7; 
 |        } 
 |      } 
 |    } 
 |    .title { 
 |      display: flex; 
 |      align-items: center; 
 |      padding: 0 30rpx; 
 |      .icon { 
 |        width: 22rpx; 
 |        height: 22rpx; 
 |        margin-right: 16rpx; 
 |        border: 6rpx solid $uni-color-primary; 
 |        border-radius: 50%; 
 |      } 
 |      .name { 
 |        font-weight: 600; 
 |        font-size: 34rpx; 
 |        color: #111111; 
 |      } 
 |    } 
 |  } 
 |  </style> 
 |  
  |