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/set.vue | 105 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 89 insertions(+), 16 deletions(-)
diff --git a/pda/pages/index/set.vue b/pda/pages/index/set.vue
index 2a6c345..13473b0 100644
--- a/pda/pages/index/set.vue
+++ b/pda/pages/index/set.vue
@@ -1,33 +1,74 @@
<template>
<view class="main_app">
- <view class="title">
- <view class="icon"></view>
- <view class="name">瀹夋嘲鐗╂祦鍗歌揣鏈堝彴</view>
- </view>
- <div class="data_list">
- <div
- class="item"
- :class="{ active: i == 1 }"
- v-for="(item, i) in 7"
- :key="i"
- >
- {{ i }}鍙锋湀鍙�
- </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="item"
+ :class="{ active: platform.showConfig }"
+ v-for="(platform, i) in item.platformList"
+ :key="platform.id"
+ @click="platformClick(platform.id)"
+ >
+ {{platform.name}}
+ </view>
+ </view>
+ </template>
+ <view class="btns">
+ <div class="btn" @click="$goBack">鍙栨秷</div>
+ <div class="btn active" @click="updUserPlatform">纭畾</div>
+ </view>
</view>
</template>
<script>
+import { getPlatformGroupList, updUserPlatformConfig } from '@/api'
export default {
data() {
return {
+ platformGroupList: []
}
},
onLoad() {
-
+ this.getPlatformGroup()
},
methods: {
-
+ updUserPlatform(){
+ const { platformGroupList } = this
+ let ids = []
+ platformGroupList.forEach(item => {
+ item.platformList.forEach(platform => {
+ if(platform.showConfig){
+ ids.push(platform.id)
+ }
+ })
+ })
+ updUserPlatformConfig({ids}).then(res => {
+ this.showToast('鏇存柊鎴愬姛')
+ this.$goBack()
+ })
+ },
+ platformClick(id) {
+ const { platformGroupList } = this
+ platformGroupList.forEach(item => {
+ item.platformList.forEach(platform => {
+ if(platform.id === id){
+ platform.showConfig = !platform.showConfig
+ }
+ })
+ })
+ },
+ getPlatformGroup() {
+ getPlatformGroupList({
+ queryData: 1,
+ queryType: 1
+ }).then(res => {
+ this.platformGroupList = res.data || []
+ })
+ },
}
}
</script>
@@ -43,6 +84,9 @@
margin-bottom: 20rpx;
padding: 30rpx;
background-color: #fff;
+ &:nth-last-child(1){
+ margin-bottom: 120rpx;
+ }
.item {
width: 210rpx;
height: 80rpx;
@@ -83,4 +127,33 @@
}
}
}
+.btns{
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ width: 750rpx;
+ height: 120rpx;
+ background: #FFFFFF;
+ box-shadow: 0rpx -4rpx 12rpx 0rpx rgba(0,0,0,0.1);
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 30rpx;
+ .btn{
+ width: 336rpx;
+ height: 88rpx;
+ background: #FFFFFF;
+ border-radius: 44rpx;
+ border: 1rpx solid #999999;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 32rpx;
+ color: #333333;
+ }
+ .active{
+ background: $uni-color-primary;
+ color: #fff;
+ }
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3