Bläddra i källkod

Merge branch 'feature_20260427_经销商用户多身份切换' into uat(dev)

zhujindu 7 timmar sedan
förälder
incheckning
808e58e736
3 ändrade filer med 84 tillägg och 0 borttagningar
  1. 6 0
      src/router/index.js
  2. 73 0
      src/views/week/changeChain.vue
  3. 5 0
      src/views/week/index.vue

+ 6 - 0
src/router/index.js

@@ -563,6 +563,12 @@ const router = new VueRouter({
           component: () => import('@/views/week/SUPTaskApproval/SUPTaskApprovalDetail.vue'),
           meta: { title: '主管任务审批详情', keepAlive: true },
         },
+        {
+          path: '/changeChain',
+          name: 'changeChain',
+          component: () => import('@/views/week/changeChain.vue'),
+          meta: { title: '切换经销商' },
+        },
       ],
     },
     {

+ 73 - 0
src/views/week/changeChain.vue

@@ -0,0 +1,73 @@
+<template>
+  <div class="changeChain">
+    <van-nav-bar class="navBar" title="切换经销商" left-arrow @click-left="onClickLeft" />
+    <div class="content">
+      <div class="module">
+        <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';
+import store from '@/store';
+export default {
+  name: 'changeChain',
+  computed: {
+    ...mapState({
+      userInfo: (state) => state.user.userInfo,
+    }),
+  },
+  data() {
+    return {};
+  },
+  created() {},
+  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('设置成功');
+          // 获取移动端获取用户信息接口
+          store.dispatch('getUserInfo');
+        }
+      });
+    },
+    onClickLeft() {
+      this.$router.go(-1);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.changeChain {
+  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>

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

@@ -68,6 +68,11 @@
               <van-icon name="setting-o" class="zicon" color="#0158ba" />
             </template>
           </van-cell>
+          <van-cell title="切换经销商" is-link to="/changeChain">
+            <template #icon>
+              <van-icon name="exchange" class="zicon" color="#0158ba" />
+            </template>
+          </van-cell>
         </van-cell-group>
         <!--      客资类-->
         <van-cell-group inset class="mtb10">