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
173
174
175
176
177
178
179
180
181
182
183
<template>
  <!-- 抽签 -->
  <div class="draw">
    <div class="draw-box">
      <header class="draw-box-header">
        <p class="fs-24" style="margin-bottom: 1px">{{ dataList.name }}</p>
        <p class="fs-16" style="margin-bottom: 8px; color: #747a8f">
          ({{ dataList.productName }})
        </p>
        <!-- <p class="fs-24" style="color: #F33368;">{{dataList.marketPrice}}</p> -->
      </header>
      <main class="draw-box-main">
        <div
          class="draw-box-main-text"
          v-for="(value, key, i) in valueList"
          :key="i"
        >
          <p style="color: #b7bdd1">{{ t(`message.user.${value}`) }}</p>
          <p>{{ dataList[key] }}</p>
        </div>
      </main>
      <footer class="draw-box-footer">
        <div class="draw-box-footer-number">
          <div class="flex-space-between" style="margin-bottom: 12px">
            <p class="fs-16 draw-title-color">
              {{ t(`message.user.shuliangzhang`) }}
            </p>
            <p class="fs-14 draw-text-color">
              {{ t(`message.user.yizhangdengyuyiqian`) }}
            </p>
          </div>
          <el-input
            class="draw-box-footer-number-input"
            v-model="amountValue"
            :placeholder="t(`message.user.qingshuruchouqian`)"
            @input="(value) => (amountValue = value.replace(/^(0+)|[^\d]+/g, ''))"
          />
        </div>
        <div class="draw-box-footer-number">
          <div class="flex-space-between" style="margin-bottom: 12px">
            <p class="fs-16 draw-title-color">
              {{ t(`message.user.keyongedu`) }}
            </p>
            <p class="fs-14 draw-text-color">{{ t(`message.user.yuan10`) }}</p>
          </div>
          <el-input
            class="draw-box-footer-number-input"
            v-model="dataList.defaultLimit"
            readonly
          />
        </div>
        <div class="draw-box-footer-button">
          <button class="draw-button" v-click="drawButton">
            {{ t(`message.user.yijianchouqian`) }}
          </button>
        </div>
      </footer>
    </div>
  </div>
</template>
 
<script setup>
import Axios from "@/api/newShares";
import { useRoute, useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n";
 
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
 
const dataList = ref({});
onMounted(() => {
  const { id } = route.query;
  Axios.getDrawMessage({ id }).then((res) => {
    if (res.code === 0) {
      dataList.value = res.data;
    }
  });
});
 
const valueList = {
  subscribeTotalNumber: "faxingzongzhangshu",
  startSubscribeDate: "chouqiankaishiri",
  endSubscribeDate: "chouqianjiezhiri",
  drawDate: "chouqianri",
  issuanceDate: "faquanri",
};
 
const amountValue = ref("");
 
const drawButton = () => {
  if (!amountValue.value) {
    ElMessage({
      message: t(`message.user.qingshuruchouqian`),
      type: "warning",
    });
    return;
  }
  const params = {
    code: dataList.value.productCode,
    amount: amountValue.value,
  };
  Axios.setDrawMessage(params).then((res) => {
    if (res.code === 0) {
      ElMessage({
        message: t(`message.user.choyqianchenggong`),
        type: "success",
      });
      router.replace({
        path: "/newShareSrecord/drawRecord",
        query: {
          type: 1,
        },
      });
    }
  });
};
</script>
 
<style lang="scss" scoped>
.draw {
  display: flex;
  justify-content: center;
  .draw-box {
    margin-top: 30px;
    width: 614px;
    min-height: 700px;
    background: #27293b;
    color: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0px 0px 12.85863971710205px 0px #00000033;
    .draw-box-header {
      background: #192137;
      height: 137px;
      padding: 18px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }
  }
  .draw-box-main {
    padding: 24px 37px 30px;
    .draw-box-main-text {
      display: flex;
      justify-content: space-between;
      margin-bottom: 15px;
      &:nth-last-of-type(1) {
        margin-bottom: 0;
      }
    }
  }
  .draw-box-footer {
    padding: 0px 37px 30px;
    :deep(.draw-box-footer-number) {
      margin-bottom: 20px;
      .el-input__wrapper {
        height: 60px;
        background: #1b2134;
        box-shadow: none;
        .el-input__inner {
          text-align: center;
          font-size: 18px;
          color: #fff;
        }
      }
      &:nth-last-of-type(1) {
        margin-bottom: 0;
      }
    }
    .draw-box-footer-button {
      .draw-button {
        width: 100%;
        height: 60px;
        background: linear-gradient(90deg, #2c64d4 0%, #38aeea 100%);
        font-size: 18px;
      }
    }
  }
}
</style>