1
PC-20250623MANY\Administrator
2025-07-16 61944978f51ca99a001162ac1ff3d32dcd5315ed
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<template>
  <div class="ipo">
    <page-head title="IPO">
      <template slot="right">
        <div class="head_right" @click="$router.push('/ipoOrder')">
          {{ $t("订单") }}
        </div>
      </template>
    </page-head>
 
    <div class="trading_card" v-for="i in list" :key="i.id">
      <div class="card_label1 flex-between-start">
        <div>
          <p class="flex-start gp">
            <span>{{ i.code }}</span>
          </p>
          <p class="flex-start">
            <span class="label_icon">{{ i.stockType }}</span>
            <span class="label_name line-one">{{ i.name }}</span>
          </p>
        </div>
 
        <div class="flex-end">
          <span class="label_status" v-if="i.listDate > Date.now()">{{
            $t("待上市")
          }}</span>
          <span class="label_status1" v-else>{{ $t("已上市") }}</span>
        </div>
      </div>
 
      <p class="card_label2 flex-between">
        <span>{{ $t("hj81") }}</span>
        <span>{{ i.stockType | currencySymbol }} {{ i.price }}</span>
      </p>
 
      <p class="card_label2 flex-between">
        <span>{{ $t("可申购数量") }}</span>
        <span>{{ i.orderNumber }}</span>
      </p>
 
      <p class="card_label2 flex-between">
        <span>{{ $t("发行时间") }}</span>
        <span>{{ i.subscriptionTime | gettime }}</span>
      </p>
 
      <p class="card_label2 flex-between">
        <span>{{ $t("上市时间") }}</span>
        <span>{{ i.listDate | gettime }}</span>
      </p>
 
      <p class="card_buy flex-center" @click="buyOpen(i)">
        <van-icon name="add-square" size=".4em" />
        <span>{{ $t("申购") }}</span>
      </p>
    </div>
 
    <!-- 无数据时显示 -->
    <div class="no_data flex-center" v-show="!list || list.length === 0">
      <img src="@/assets/img/zhaobudao2.png" alt="" />
    </div>
 
    <n-pagination
      :pageNo.sync="pageNum"
      :pageSize="pageSize"
      :total="total"
    ></n-pagination>
 
    <!-- 购买弹窗 -->
    <van-popup v-model="buyShow" round>
      <van-form class="buy_popup" @submit="popupSubmit">
        <div class="popup_title flex-center">
          <span>{{ $t("操作确认") }}</span>
        </div>
 
        <div class="buts flex-between">
          <p class="flex-center" @click="buyShow = false">
            <span>{{ $t("qx") }}</span>
          </p>
          <p class="flex-center" native-type="submit">
            <van-button native-type="submit">{{ $t("qr") }}</van-button>
          </p>
        </div>
      </van-form>
    </van-popup>
  </div>
</template>
 
<script>
import PageHead from "@/components/pageHead.vue";
import nPagination from "@/components/nPagination.vue";
import * as api from "@/axios/api";
import { Toast } from "vant";
 
export default {
  components: {
    PageHead,
    nPagination
  },
  data() {
    return {
      pageNum: 1,
      pageSize: 10,
      total: 1,
      searchValue: "",
      buyShow: false, // 购买弹窗控制
      popupData: {}, // 点击购买的数据
      list: []
    };
  },
  watch: {
    pageNum() {
      this.list = [];
      this.getStockSubscribeList();
    }
  },
  created() {
    this.getStockSubscribeList();
  },
  methods: {
    // 购买弹窗
    buyOpen(i) {
      this.popupData = i;
      this.buyShow = true;
    },
    // 购买提交
    async popupSubmit() {
      let opt = {
        newCode: this.popupData.code,
        applyNums: this.popupData.orderNumber,
        password: this.popupData.password,
        newlistId: this.popupData.newlistId,
        type: this.popupData.type,
      }
      let data = await api.getNewAdd(opt);
      console.log(data.status);
      
      if (data.status == 0) {
        Toast.success();
        setTimeout(() => {
          this.buyShow = false;
        }, 1000);
      } else {
        Toast.fail(data.msg);
      }
    },
    // 获取列表
    async getStockSubscribeList() {
      let opt = {
        pageNum: this.pageNum,
        pageSize: this.pageSize
      };
      let data = await api.getStockSubscribeList(opt);
      if (data.status === 0) {
        this.list = data.data.list;
        this.total = data.data.total || 1;
      } else {
        Toast(data.msg);
      }
    }
  }
};
</script>
 
<style lang="less" scoped>
@green: #c4d600;
@brown: #ff976a;
.ipo {
  font-size: 10vw;
  width: 100%;
  background-color: #f5f5f5;
  min-height: 100vh;
  padding-bottom: 0.3em;
 
  .trading_card {
    width: 9.5em;
    margin: 0.25em auto 0;
    border-radius: 0.25em;
    background: #fff;
    .card_buy {
      height: 1.33em;
      color: @green;
      box-shadow: 0 -0.05333rem 0.26667rem #0000000d;
 
      span {
        font-size: 0.45em;
        font-weight: 600;
        margin-left: 0.2em;
      }
    }
    .card_label2,
    .card_label1 {
      margin: 0 auto;
      width: 9em;
      border-bottom: #f5f5f5 solid 0.01em;
    }
    .card_label2 {
      height: 1.1em;
      color: #323233;
      span {
        font-size: 0.4em;
        font-weight: 300;
      }
      & > span:last-child {
        color: #969799;
        font-size: 0.36em;
      }
    }
 
    .card_label1 {
      color: @green;
      min-height: 1.33em;
      padding: 0.25em 0;
      .label_name {
        // width: 14em;
        flex: 1;
        color: #969799;
      }
      .label_status {
        background-color: @brown;
        color: #fff;
        padding: 0.3em 0.5em;
        border-radius: 0.3em;
      }
      .label_status1 {
        background-color: @green;
        color: #fff;
        padding: 0.3em 0.5em;
        border-radius: 0.3em;
      }
      span {
        font-size: 0.4em;
      }
      .label_icon {
        background: @green;
        color: #fff;
        padding: 0.2em 0.35em;
        border-radius: 0.15em;
        margin-right: 0.3em;
        font-size: 0.3em;
      }
      .gp {
        margin-bottom: 0.2em;
      }
    }
  }
  .buy_popup {
    width: 8.8em;
    /deep/ .van-cell {
      padding: 0;
      font-size: 0.4em;
    }
    /deep/ .van-field__body {
      // border: 0.01em solid #f5f5f5;
      // height: 2.5em;
      // padding: 0 0.5em;
      // margin-top: 0.5em;
    }
    /deep/ .van-field__label {
      color: #000;
    }
    /deep/ .van-stepper__minus {
      width: 1rem;
      height: 1rem;
    }
    /deep/ .van-stepper__plus {
      width: 1rem;
      height: 1rem;
    }
    /deep/ .van-stepper__input {
      height: 1rem;
      width: 2rem;
      font-size: 0.4rem;
    }
    .division {
      width: 100%;
      height: 0.25em;
      background-color: #f5f5f5;
    }
    .popup_title {
      width: 100%;
      min-height: 2.22em;
      font-weight: bold;
      padding: 0 0.25em;
      border: #f5f5f5 solid 0.01em;
    }
    .popup_name {
      color: @green;
      .popup_icon {
        background: @green;
        color: #fff;
        padding: 0.2em 0.35em;
        border-radius: 0.15em;
        margin-right: 0.3em;
        font-size: 0.3em;
      }
    }
    .popup_item {
      width: 8.3em;
      margin: 0 auto;
      padding: 0.35em 0;
      border-bottom: #f5f5f5 solid 0.01em;
 
      .zxgm {
        height: 0.8em;
        width: 2em;
        border-radius: 0.1em;
        border: #ddd solid 0.01em;
        span {
          font-size: 0.3em;
        }
      }
    }
    span {
      font-size: 0.4em;
    }
    .buts {
      width: 100%;
      height: 1.22em;
 
      /deep/ .van-button {
        border: none;
        font-size: 1em;
        color: @green;
      }
      p {
        height: 100%;
        flex: 1;
      }
      & > p:last-child {
        border-left: #f5f5f5 solid 0.01em;
        color: @green;
      }
    }
  }
 
  .head_right {
    color: @green;
    font-size: 0.4em;
  }
}
</style>