1
jhzh
2025-07-28 a8b0eb32d97e7a540692a8a29f610fe76d67ef74
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
<template>
  <van-dialog
    width="90%"
    className="zyd-dialog"
    v-model="show"
    :show-cancel-button="false"
    :show-confirm-button="false"
  >
    <div class="title-dialog">{{ title }}</div>
    <slot name="center"></slot>
 
    <div class="footer">
      <div class="cancel-dialog" @click="show = false" v-if="showCancelButton">
        {{ $t(cancelButtonText) }}
      </div>
      <div class="confirm-dialog" v-if="showConfirmButton" @click="confirm">
        {{ $t(confirmButtonText) }}
      </div>
    </div>
  </van-dialog>
</template>
 
<script>
import { Dialog } from "vant";
export default {
  props: {
    title: {
      type: String,
      default: "标题",
    },
    "confirm-button-text": {
      type: String,
      default: "hj161",
    },
    "cancel-button-text": {
      type: String,
      default: "qx",
    },
    "show-cancel-button": {
      type: Boolean,
      default: true,
    },
    "show-confirm-button": {
      type: Boolean,
      default: true,
    },
    confirm: {
      type: Function,
      default: () => {},
    },
  },
  components: {
    [Dialog.Component.name]: Dialog.Component,
  },
  data() {
    return {
      show: false,
    };
  },
  methods: {},
};
</script>
 
<style  scoped lang="less">
.zyd-dialog {
  padding: 24px;
  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 500;
  font-size: 0.53333rem;
  line-height: 0.74667rem;
  color: #14181f;
  .title-dialog {
    margin-bottom: 20px;
  }
  .footer {
    display: flex;
    justify-content: center;
    text-align: center;
    line-height: 65px;
    margin-top: 40px;
    .cancel-dialog {
      flex: 1;
      height: 100%;
      padding: 0 15px;
      border: 1px solid #c5cfd5;
      border-radius: 8px;
    }
    .confirm-dialog {
      border-radius: 8px;
      flex: 1;
      height: 100%;
      padding: 0 15px;
      background-color: #185546;
      border: 1px solid #185546;
      color: #fff;
      margin-left: 20px;
    }
  }
}
</style>