zhaoxiaoqiang
2021-07-28 6970e36ad97ba1a4a9d69e4b388173a7d84be7bb
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!--
 * @Author: 小明丶
 * @Date: 2019-08-15 11:04:12
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-12-09 16:00:40
 * @Description: 用户管理页面
 -->
<template>
  <div class="mine-box">
    <header class="header flex-between-g" :style="{background: $store.state.lastColor}">
      <img
        v-if="hasPic"
        src="../../../static/img/left.png"
        style="
          position: absolute;
          left: 0px;
          top: 0;
          height: 144px;
          width: 166px;
        "
      />
      <img
        v-if="hasPic"
        src="../../../static/img/right.png"
        style="position: absolute; right: 0; top: 0; height: 47px; width: 62px"
      />
      <div class="flex-start-g" style="z-index: 99">
        <p class="icon-box flex-center-g">
          <svg
            class="icon"
            aria-hidden="true"
            style="width: 40px; height: 40px"
          >
            <use xlink:href="#icongerenzhongxintouxiang"></use>
          </svg>
        </p>
        <div class="userinfo">
          <p class="name text-clip-g font-16-g">{{ userinfo.name }}</p>
          <p>{{ userinfo.mblNo.replace(/(\d{3})\d*(\d{4})/, "$1****$2") }}</p>
          <!--<p class="copy" v-if="orgType == 1 || orgType == 2">-->
            <!--邀请码:{{ inviteCode }} <span @click="copy">复制</span>-->
          <!--</p>-->
        </div>
      </div>
      <div>
        <p class="text-center-g font-16-g">{{ userLabel }}</p>
        <van-button
          class="btn-toggle"
          @click="$router.push('/mine/toggle-identity?title=切换身份')"
          >切换身份</van-button
        >
      </div>
    </header>
 
    <div class="grid">
      <router-link
        :to="item.path || ''"
        class="item flex-center-g"
        v-for="(item, index) in menu"
        :key="index"
      >
        <div class="text-center-g">
          <svg
            class="icon"
            aria-hidden="true"
            style="width: 35px; height: 35px"
            :style="{'fill':$store.state.backColor}"
          >
            <use :xlink:href="'#' + item.icon"></use>
          </svg>
          <p class="label">{{ item.label }}</p>
        </div>
      </router-link>
      <!-- <router-link :to="item.path || ''" class="item flex-center-g" v-for="(item, index) in menu" :key="index">
                <div class="text-center-g">
                    <svg class="icon" aria-hidden="true" style="width:35px;height:35px;">
                        <use :xlink:href="'#' +item.icon"></use>
                    </svg>
                    <p class="label">{{item.label}}</p>
                </div>
            </router-link> -->
    </div>
  </div>
</template>
 
<script>
import { mapState, mapGetters } from "vuex";
import { _copyToClipboard } from "@/utils/index";
export default {
  data() {
    return {
      copyText: "",
      walletOpenStatus: "",
    };
  },
  created() {
 
  },
  computed: {
    ...mapState(["userinfo", "userPage", "inviteCode"]),
    ...mapGetters(["orgType"]),
    hasPic(){
      if(sessionStorage.isddxt != 1){
        return true
      }else{
        return false
      }
    },
    userLabel() {
      switch (this.orgType) {
        case 1:
          return "代理";
        case 2:
          return "渠道";
        case 3:
          return "商户";
        case 4:
          return "门店";
      }
    },
    menu() {
      let arr = [];
      if (this.orgType == 1) {
        arr.push(
          {
            icon: "iconmobanguanli",
            label: "模板管理",
            path: "/template/list",
          }
        );
      }
      let usrArr = [
          ...arr,
          ...this.userPage,
          {
              icon: "iconshezhizhongxin",
              label: "设置中心",
              path: "/mine/setting",
          },
      ];
      usrArr.forEach(item => {
            if(item.powerId == '100005' && this.orgType == 3){
                usrArr.splice(usrArr.length-2,usrArr.length-2);
             }
        })
      return usrArr;
    },
  },
  methods: {
    copy() {
      _copyToClipboard(this.inviteCode);
      this.$notify_success("复制成功");
    },
  },
};
</script>
<style lang="less" scoped>
.mine-box {
  background-color: @c-bg-f5;
  padding-bottom: 100px;
}
 
.header {
  height: 144px;
  background-color: @c-bg-black;
  color: @c-text-fe;
  padding: 0 20px;
 
  .icon-box {
    width: 60px;
    height: 60px;
    background-color: @c-bg-fff;
    border-radius: 50%;
    margin-right: 15px;
  }
 
  .userinfo {
    max-width: 155px;
 
    .name {
      margin-bottom: 5px;
    }
  }
 
  .btn-toggle {
    .lh(24px);
    padding: 0 10px;
    background: #55516e;
    border: 0.02rem solid #55516e;
    margin-top: 8px;
    color: @c-text-fe;
    border-radius: 12px;
    font-size: @font-11;
  }
}
 
.grid {
  margin: 0 auto;
  width: 360px;
  background-color: @c-bg-fff;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  z-index: @zIndex-20;
  transform: translateY(-15px);
  box-shadow: 0px 8px 20px 0px rgba(66, 61, 93, 0.05);
  border-radius: 3px;
 
  .item {
    width: 120px;
    height: 122px;
  }
 
  .label {
    margin-top: 15px;
    color: @c-text-666;
  }
}
.copy {
  color: #fefeff;
  font-size: 12px;
  margin-top: 10px;
  span {
    width: 40px;
    height: 16px;
    background: #55516e;
    padding: 0 10px;
    // opacity:0.1;
    border-radius: 16px;
    color: #fefeff;
    font-size: 11px;
    line-height: 16px;
  }
}
</style>