zhaoxiaoqiang
2021-11-07 c0457bf3334ca6d7b2db01fa1d6739b48ed3535c
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!--
 * @Author: 小明丶
 * @Date: 2019-08-20 13:57:53
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-11-19 16:42:13
 * @Description:
 -->
 
<template>
  <div class="setting-box h-100-g">
    <v-navbar title="设置中心" fixed></v-navbar>
 
    <div class="cell-group" v-if="orgType===1 || orgType===2">
      <v-cell label='商户审批' :readonly="true" isLink :placeholder="placeText"
        @click.native="$router.push('/mine/setting/merchants-approval')">
      </v-cell>
    </div>
 
    <div class="cell-group" v-if="orgType == 3">
      <v-cell label='商户资料' :readonly="true" isLink @click.native="$router.push(`/setting/mer-date?merId=${orgId}`)"></v-cell>
    </div>
    <div class="cell-group">
      <v-cell label='修改密码' v-if="hasTokenLoc && isLoginByOpenId" :readonly="true" isLink @click.native="$router.push('/user/reset-pwd')"></v-cell>
      <v-cell label='退出登录' v-if="hasTokenLoc" :readonly="true" isLink :Show_input="false" @click.native="dialogShow = !dialogShow">
      </v-cell>
    </div>
 
 
 
    <van-dialog class="setting-box-dialog" v-model="dialogShow" :confirmButtonColor="$store.state.backColor" show-cancel-button message="确定退出当前账号?"
      @confirm="LoginOut">
    </van-dialog>
  </div>
</template>
 
<script>
  import {
    SET_SESSION_ID,
    SET_USER_INFO
  } from '@/store/mutations-types';
  import {
    mapMutations, mapGetters
  } from 'vuex';
  export default {
    name: "setting",
    data() {
      return {
        placeText: '',
        dialogShow: false,
      }
    },
    computed:{
      ...mapGetters(['orgType', 'orgId']),
      hasTokenLoc(){
        if(localStorage.hjToken){
          return false
        }else{
          return true
        }
      },
      isLoginByOpenId(){
        if(sessionStorage.isLoginByOpenId == 1){
          return false
        }else{
          return true
        }
      }
    },
    created(){
      this.$api.getAuditType().then((res) => {
        this.placeText = res.body.currAuditTypeName;
      }).catch((err) => {
 
      });
    },
    methods: {
      ...mapMutations([SET_USER_INFO, SET_SESSION_ID]),
      LoginOut() {
        localStorage.removeItem('user_account')
        localStorage.removeItem('user_pwd')
        localStorage.removeItem('sib_wx_openId')
        this.SET_USER_INFO({});
        this.SET_SESSION_ID('');
          this.$router.push('/');
      },
    }
  }
</script>
 
<style scoped lang="less">
  .setting-box {
    padding-top: 44px;
    background-color: @c-bg-f5;
 
    .cell-group {
      margin: 10px auto 0 auto;
      width: 360px;
    }
  }
</style>