| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <template>
- <div class="systemSettings">
- <van-nav-bar class="navBar" title="设置" left-arrow @click-left="onClickLeft" />
- <div class="content">
- <div class="module">
- <div class="title">拜访设置</div>
- <div class="box">
- <div class="label">设置</div>
- <div class="value">
- <van-switch v-model="switchChecked" size="20" @change="change" />
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { mapState } from 'vuex';
- import { setPhotoMethod } from '@/api/week';
- export default {
- name: 'systemSettings',
- computed: {
- ...mapState({
- userInfo: (state) => state.user.userInfo,
- }),
- },
- data() {
- return {
- switchChecked: false,
- };
- },
- created() {
- this.switchChecked = this.userInfo.photoMethod == 0 ? false : true;
- },
- methods: {
- change(value) {
- console.log(value);
- this.toastLoading(0, '加载中...', true);
- setPhotoMethod({ photoMethod: value ? 1 : 0 }).then((res) => {
- this.toastLoading().clear();
- if (res.code == 200) {
- this.$toast('设置成功');
- }
- });
- },
- onClickLeft() {
- this.$router.go(-1);
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .systemSettings {
- width: 100%;
- height: 100%;
- .content {
- margin: 10px 16px;
- .module {
- margin-bottom: 10px;
- .title {
- font-size: 16px;
- padding: 10px 0;
- }
- .box {
- background: #fff;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 10px;
- font-size: 16px;
- }
- }
- }
- }
- </style>
|