longyvfengyun
2023-12-25 d8d792a6842832e8f6af6604274c438b25053afe
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
<template>
  <div class="params-container">
    <el-steps :active="active" finish-status="success" simple>
      <el-step title="插入ukey">123</el-step>
      <el-step title="ukey验证"></el-step>
      <el-step title="用户验证"></el-step>
      <el-step title="绑定状态"></el-step>
    </el-steps>
    <div class="el-step" v-if="active == 1">
      <div class="el-step-text-content">
        未插入ukey,请插入ukey
      </div>
    </div>
    <bind-step2 :id="id" @next="next" v-if="active == 2"></bind-step2>
    <bind-step3 :id="id" @next="next" v-if="active == 3"></bind-step3>
    <div class="params-dialog" v-if="active == 4">
      <div class="el-step-text-content">
        已完成绑定
      </div>
      <div class="form-footer">
        <three-btn @click="close">关闭</three-btn>
      </div>
    </div>
  </div>
</template>
 
<script>
import BindStep2 from "@/components/UKeyBind/BindStep2";
import BindStep3 from "@/components/UKeyBind/BindStep3";
export default {
  name: "UkeyBind",
  components: { BindStep3, BindStep2 },
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
  },
  watch: {
    "$store.state.ukey.id"(id) {
      this.id = id;
      if (id) {
        this.active = 2;
      } else {
        this.active = 1;
      }
    },
  },
  data() {
    let active = this.$store.state.ukey.isIn ? 2 : 1;
    return {
      active: active,
      id: "",
    };
  },
  methods: {
    next() {
      this.active++;
    },
    close() {
      this.$emit("update:visible", false);
    },
  },
  mounted() {
    this.id = this.$store.state.ukey.id;
  },
};
</script>
 
<style scoped>
.params-container {
  padding: 8px 8px 0 8px;
  background-color: #ececec;
}
.el-step-text-content {
  padding: 8px;
  text-align: center;
  font-size: 16px;
}
</style>