Переглянути джерело

使用原生手机拍照,优化企业微信拍照模糊问题

zhujindu 8 місяців тому
батько
коміт
08e8f652aa
4 змінених файлів з 82 додано та 4 видалено
  1. 9 0
      src/api/week.js
  2. 6 0
      src/router/index.js
  3. 7 0
      src/views/week/index.vue
  4. 60 4
      src/views/week/systemSettings.vue

+ 9 - 0
src/api/week.js

@@ -8,3 +8,12 @@ export function selectAllocationPermission(query) {
     params: query,
   });
 }
+
+// 设置用户的拍照方式
+export function setPhotoMethod(query) {
+  return request({
+    url: '/mobile/setPhotoMethod',
+    method: 'get',
+    params: query,
+  });
+}

+ 6 - 0
src/router/index.js

@@ -431,6 +431,12 @@ const router = new VueRouter({
           meta: { title: '客资跟进' },
           component: () => import('@/views/week/assignAwait/JZfollowUp.vue'),
         },
+        {
+          path: '/systemSettings',
+          name: 'systemSettings',
+          component: () => import('@/views/week/systemSettings.vue'),
+          meta: { title: '设置' },
+        },
       ],
     },
     {

+ 7 - 0
src/views/week/index.vue

@@ -44,6 +44,13 @@
             </template>
           </van-cell>
         </van-cell-group>
+        <van-cell-group inset class="mtb10">
+          <van-cell title="设置" is-link to="/systemSettings">
+            <template #icon>
+              <van-icon name="setting-o" class="zicon" color="#0158ba" />
+            </template>
+          </van-cell>
+        </van-cell-group>
         <!--      客资类-->
         <van-cell-group inset class="mtb10">
           <van-cell title="客资&投诉任务" to="/clew" v-if="customerClueButton">

+ 60 - 4
src/views/week/systemSettings.vue

@@ -1,19 +1,75 @@
 <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>
 <script>
+import { mapState } from 'vuex';
+import { setPhotoMethod } from '@/api/week';
 export default {
   name: 'systemSettings',
+  computed: {
+    ...mapState({
+      userInfo: (state) => state.user.userInfo,
+    }),
+  },
   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>
 <style lang="scss" scoped>
 .systemSettings {
   width: 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>