From 843d0abd014ec20424844546fc57a9f976f366ba Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 02 九月 2024 10:52:59 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 pda/pages/index/control.vue |   47 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/pda/pages/index/control.vue b/pda/pages/index/control.vue
index 119ab38..02e61af 100644
--- a/pda/pages/index/control.vue
+++ b/pda/pages/index/control.vue
@@ -1,34 +1,47 @@
 <template>
   <view class="main_app">
-    <view class="title">
-      <view class="icon"></view>
-      <view class="name">瀹夋嘲鐗╂祦鍗歌揣鏈堝彴</view>
-    </view>
-    <div class="data_list">
-      <div class="line">
-        <div class="name">1鍙锋湀鍙�</div>
-        <u-switch v-model="list"></u-switch>
-      </div>
-      <div class="line">
-        <div class="name">1鍙锋湀鍙�</div>
-        <u-switch v-model="list"></u-switch>
-      </div>
-    </div>
+		<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="0" :activeValue="1" @change="e => changeStatus(platform)" />
+			  </view>
+			</view>
+		</template>
   </view>
 </template>
 
 <script>
+	import { getPlatformGroupList, updPlatformStatus } from '@/api'
 export default {
   data() {
     return {
-      list: []
+      platformGroupList: []
     }
   },
   onLoad() {
-
+		this.getPlatformGroup()
   },
   methods: {
-
+		changeStatus(item) {
+			console.log(item);
+			updPlatformStatus({
+				id: item.id,
+				status: item.status
+			})
+		},
+		getPlatformGroup() {
+			getPlatformGroupList({
+				queryData: 1,
+				queryType: 0
+			}).then(res => {
+				this.platformGroupList = res.data || []
+			})
+		},
   }
 }
 </script>

--
Gitblit v1.9.3