zhengyiming
2025-02-10 0f686ea1fe4700a909a6159efcf1fcb0e1f88a17
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
<template>
  <PageLayout title="微信授权设置" class="wxSetting-page-wrapper" hasBorder>
    <List>
      <ListItem title="地理位置" :showArrow="false">
        <template #extra>
          <nut-switch
            v-model="authSetting['scope.userLocation']"
            @change="(v) => handleSetting(v, 'scope.userLocation')"
          />
        </template>
      </ListItem>
    </List>
  </PageLayout>
</template>
 
<script setup lang="ts">
import { List, ListItem } from '@12333/components';
import Taro from '@tarojs/taro';
 
defineOptions({
  name: 'wxSetting',
});
 
const authSetting = reactive<Taro.AuthSetting>({
  'scope.userLocation': false,
});
 
onMounted(() => {
  Taro.getSetting({
    success: function (res) {
      authSetting['scope.userLocation'] = res.authSetting['scope.userLocation'];
    },
  });
});
 
function handleSetting(val: boolean, key: keyof Taro.AuthSetting) {}
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
</style>