dcc
2024-06-13 3616db170333df7d668c97323344335b52c4153c
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
<!-- 订单确认 -->
<template>
  <div>
    <el-dialog
        :title="$t('message.jiaoyi.zhiyingzhisun')"
        v-model="isShow"
        :close-on-click-modal="false"
        width="500px"
        center
        :append-to-body="true"
        class="confirmWrapper"
    >
      <div class="dialog-box">
        <div class="delivery-text margin-top20">
          <div class="delivery-text-left">
            {{ $t("message.jiaoyi.price_profit") }}
          </div>
          <el-input-number
              class="slider-input-amount"
              v-model="profitAmount"
              :min="0"
          />
        </div>
        <div class="delivery-text margin-top20">
          <div class="delivery-text-left">
            {{ $t("message.jiaoyi.price_loss") }}
          </div>
          <el-input-number
              class="slider-input-amount"
              v-model="lossAmount"
          />
        </div>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="info" @click="confirmOrder" class="continueOrder">{{
              $t("message.home.queren")
            }}</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
 
<script>
import Axios from "@/api/perpetualContract.js"
export default {
  emits: ["confirmOrder", "closeDialog"],
  props: {
    dialogVisible: {
      // 弹窗是否展示
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      orderData: {}, //订单详情
      profitAmount:undefined, //这样设置输入框就可以是空的
      lossAmount:undefined,
      isShow:false
    };
  },
 
  computed: {
 
  },
  methods: {
    confirmOrder() {
      const data ={
        order_no: this.orderData.row.order_no,
        stop_price_profit: this.profitAmount,
        stop_price_loss: this.lossAmount,
      }
      Axios.stopLossAndProfit(data).then(res=>{
        this.$message({
          message: this.$t("message.user.tijiaochenggong"),
          type: "success",
        });
        this.isShow = false;
      })
    },
    open(data) {
      this.orderData = data;
      this.isShow = true;
      this.profitAmount = this.orderData.row.stop_price_profit === 0 ? undefined : this.orderData.row.stop_price_profit
      this.lossAmount = this.orderData.row.stop_price_loss === 0 ? undefined : this.orderData.row.stop_price_loss
    },
  },
};
</script>
<style lang="scss">
.confirmWrapper {
  background: #1f2328 !important;
  border-radius: 5px !important;
 
  .el-dialog__title {
    color: #fff !important;
  }
}
</style>
 
<style scoped>
.dialog-box {
  width: 430px;
  margin: 0 auto;
}
 
.circleBox {
  position: relative;
  text-align: center;
}
 
.circleCenter {
  width: 150px;
  text-align: center;
  position: absolute;
  top: 60px;
  left: 50px;
}
 
.delivery-text {
  display: flex;
  align-items: center;
}
 
.delivery-text > div {
  /* flex: 1; */
  padding: 10px 0;
}
 
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
}
 
.time-div {
  width: 65px;
  height: 42px;
  background: #1d91ff;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
 
.dot {
  color: #da9226;
  font-size: 20px;
  font-weight: bold;
  margin: 0 10px;
}
 
.delivery-text-left {
  color: #929aa5;
  min-width: 100px;
  max-width: 200px;
}
 
.yingkui {
  padding: 15px 0 0 0;
}
 
.continueOrder {
  width: 100%;
  height: 50px;
  background: #1d91ff;
  border: none;
}
</style>