|
@@ -1,19 +1,75 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="systemSettings">systemSettings</div>
|
|
|
|
|
|
|
+ <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>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import { mapState } from 'vuex';
|
|
|
|
|
+import { setPhotoMethod } from '@/api/week';
|
|
|
export default {
|
|
export default {
|
|
|
name: 'systemSettings',
|
|
name: 'systemSettings',
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ ...mapState({
|
|
|
|
|
+ userInfo: (state) => state.user.userInfo,
|
|
|
|
|
+ }),
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
- return {};
|
|
|
|
|
|
|
+ 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);
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
- methods: {},
|
|
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.systemSettings {
|
|
.systemSettings {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
- background: #fff;
|
|
|
|
|
|
|
+ .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>
|
|
</style>
|