ZaiZai 1 year ago
parent
commit
22c18beaff
1 changed files with 27 additions and 0 deletions
  1. 27 0
      pages/my/config.vue

+ 27 - 0
pages/my/config.vue

@@ -8,6 +8,15 @@
                 </view>
                 <view class="action">{{userInfo.real_name}}</view>
             </view>
+            <view class="cu-item">
+                <view class="content hc-flex">
+                    <text class="i-solar-calendar-search-outline text-blue text-32 mr-1"/>
+                    <text class="text-gray-4">填报提醒</text>
+                </view>
+                <view class="action">
+                    <switch :checked="appCheck" @change="fillSwitchChange" style="transform:scale(0.9)"/>
+                </view>
+            </view>
         </view>
         <view class="cu-list menu sm-border">
             <view class="cu-item">
@@ -35,6 +44,7 @@
 import {ref} from "vue";
 import {onLoad} from '@dcloudio/uni-app'
 import {useAppStore} from "@/store";
+import userApi from '~api/user/index';
 
 //初始变量
 const store = useAppStore()
@@ -45,9 +55,26 @@ const appInfo = ref({version: '-', wgt: '-'});
 onLoad(() => {
     const {appVersion, appWgtVersion} = uni.getSystemInfoSync();
     appInfo.value = {version: appVersion, wgt: appWgtVersion}
+    userConfigInfo()
 })
 
 const toPageClick = (url) => {
     uni.navigateTo({url: url});
 }
+
+//获取配置
+const appCheck = ref(true)
+const userConfigInfo = async () => {
+    const { data } = await userApi.userConfigInfo()
+    appCheck.value = data?.appCheck !== 2
+}
+
+//填报弹窗
+const fillSwitchChange = ({detail}) => {
+    const check = detail.value ? 1 : 2
+    userApi.userConfigSave({
+        appCheck: check
+    })
+    appCheck.value = detail.value
+}
 </script>