交易所前端蓝色ui 4.5 jiem
lxf
2025-04-18 02a3d94d359b34e915f34abec024cbc1504a6a7c
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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<template>
  <div>
    <section class="section1 text-center text-white">
      <pc-header
        :needTransparent="needTransparent"
        :class="needTransparent ? 'transparent-header' : 'fix-header'"
      ></pc-header>
      <h1 class="text-white mt-12">{{ t("h-s1-t1", { TITLE: $title }) }}</h1>
      <div class="mt-8 mb-12">{{ t("h-s1-d1") }}</div>
      <el-button class="blue-middle-btn" @click="handleTrade">{{
        t("learn-more")
      }}</el-button>
    </section>
 
    <!-- 公告 -->
    <div class="notice-box mt-8" scope>
      <notice-bar></notice-bar>
    </div>
    <!-- 在1000多种交易产品上发掘交易机会 -->
    <pc-section class="pt-12 pb-20" innerclass="flex">
      <div class="section2-left mr-20">
        <el-tabs
          v-model="marketListType"
          class="demo-tabs"
          style="width: 600px"
          @tab-click="handleClick"
        >
          <el-tab-pane
            :label="_item.name"
            :name="_item.type"
            v-for="_item in marketList"
            :key="_item.type"
          >
            <el-table
              style="width: 600px"
              :data="activeList"
              class="self-table"
              :empty-text="t('message.home.noData')"
            >
              <el-table-column
                v-for="(item, index) in tableList"
                :key="index"
                :prop="item.prop"
                :width="item.width"
                :label="t(`h-s2-h${index + 1}`)"
              >
                <template #default="scope" v-if="item.prop == 'symbol'">
                  <div class="flex items-center">
                    <!-- :src="`${ConfigURL.HOST_URL}/symbol/${scope.row.symbol}.png`" -->
 
                    <el-image
                      :src="handleSymbolImg(scope.row.symbol)"
                      class="el-img-style"
                    >
                      <div slot="error" class="image-slot">
                        <img
                          :src="`${ConfigURL.HOST_URL}/symbol/noCoins.png`"
                          class="el-img-style"
                        />
                      </div>
                    </el-image>
                    <!-- <img :src="scope.row.img" style="width: 40px;height:40px;margin-right: 30px;" alt="" /> -->
                    <span>{{ getName(scope.row.symbol) }}</span>
                  </div>
                </template>
                <template #default="scope" v-if="item.prop == 'amount'">
                  <div class="flex items-center">
                    <span>{{ fixData(scope.row.amount) }}</span>
                  </div>
                </template>
                <template #default="scope" v-if="item.prop == 'change_ratio'">
                  <div class="flex items-center">
                    <span :class="scope.row.change_ratio > 0 ? 'green' : 'red'"
                      >{{ scope.row.change_ratio }}%</span
                    >
                  </div>
                </template>
              </el-table-column>
              <el-table-column>
                <template #default="scope">
                  <el-button
                    class="blue-small-btn"
                    @click="goDetail(scope.row.symbol, scope.row)"
                    >{{ t("trade") }}</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <p class="text-gray-400">{{ t("h-s2-1-d1") }}</p>
          </el-tab-pane>
        </el-tabs>
      </div>
      <div class="section2-content">
        <h6 class="font-normal">{{ t("h-s2-2-t1", { TITLE: $title }) }}</h6>
        <h1>{{ t("h-s2-2-t2") }}</h1>
        <h5 class="w-300 my-4">
          {{ t("h-s2-2-d1") }}
        </h5>
        <el-button
          class="gray-middle-btn font-normal"
          @click="gotoPage('/trading/spreads-swaps-commissions')"
        >
          {{ t("h-s2-2-b1") }}
        </el-button>
      </div>
    </pc-section>
    <!-- 卓越交易者 -->
    <pc-section>
      <div class="section3">
        <h2 class="text-white">{{ t("h-s3-t1") }}</h2>
        <h5 class="w-500 mb-12 text-white">{{ t("h-s3-d1") }}</h5>
        <el-button class="white-small-btn" @click="gotoPage('/tradingview')">{{
          t("learn-more")
        }}</el-button>
      </div>
    </pc-section>
    <!-- 对您现在的经纪商不满意 -->
    <pc-section class="section4 bg-white text-center pt-12">
      <div>{{ t("h-s2-2-t1", { TITLE: $title }) }}</div>
      <h2>{{ t("h-s4-t1") }}</h2>
      <h2>{{ t("h-s4-t2") }}</h2>
      <div class="grid grid-cols-2 gap-4 my-12">
        <card-advantage
          @click="gotoPage(item.url)"
          v-for="(item, i) in advantageList4"
          :key="i"
          :title="t(`h-s4-${i + 1}-t1`)"
          :desc="t(`h-s4-${i + 1}-d1`)"
          :imgPath="`/src/assets/forexImages/home/iphone${i + 1}.png`"
        ></card-advantage>
      </div>
    </pc-section>
    <!-- 一个账户,多个交易平台 -->
    <pc-section class="bd-gray py-12">
      <div class="text-sm text-center">{{ t("h-s5-t1") }}</div>
      <h2 class="text-center">{{ t("h-s5-t2") }}</h2>
      <div class="grid grid-cols-4 gap-x-4 mt-12">
        <card-platform
          v-for="(item, i) in platformList4"
          @click="gotoPage(item.url)"
          :key="i"
          :title="t(`h-s5-${i + 1}-t1`)"
          :desc="t(`h-s5-${i + 1}-d1`)"
          :imgPath="`/src/assets/forexImages/home/trade${i + 1}.png`"
        ></card-platform>
      </div>
    </pc-section>
    <!-- 立即注册并开始交易 -->
    <section class="section6 py-12">
      <h2 class="text-center text-white">{{ t("h-s5-t2") }}</h2>
      <div class="flex justify-center py-8">
        <el-input v-model="input" :placeholder="t('email')" />
        <div
          class="join bg-blue-500 flex justify-center items-center text-white"
        >
          {{ t("now-join") }}
        </div>
      </div>
      <h6
        class="text-center text-white cursor-pointer"
        @click="
          gotoPage(
            'https://files.pepperstone.com/legal/SCB/SCB_Privacy_Policy_ROW.pdf'
          )
        "
      >
        {{ t("h-s5-d1") }}
      </h6>
    </section>
    <!-- 让您的交易如虎添翼 -->
    <pc-section class="bd-gray py-12">
      <h2 class="text-center mb-10">{{ t("h-s6-t1") }}</h2>
      <div class="grid grid-cols-3 gap-x-8">
        <card-trade
          v-for="(item, i) in articleList3"
          @click="gotoPage(item.url)"
          :key="i"
          :title="t(`h-s6-${i + 1}-t1`)"
          :desc="t(`h-s6-${i + 1}-d1`)"
          :imgPath="`/src/assets/forexImages/home/article${i + 1}.png`"
          :tag="t(`h-s6-${i + 1}-b1`)"
        ></card-trade>
      </div>
      <h5
        class="mt-12 text-center cursor-pointer font-normal"
        @click="gotoPage('/market-analysis')"
      >
        {{ t("h-s6-d1") }}
      </h5>
    </pc-section>
    <!-- 年度最佳经济商 -->
    <pc-section class="pt-20">
      <div class="section8-bg p-20 flex justify-between">
        <div>
          <h2 class="text-white">{{ t("h-s7-t1") }}</h2>
          <h2 class="text-white">{{ t("h-s7-t2") }}</h2>
          <h5 class="text-white mb-4">
            {{ t("h-s7-d1") }}
          </h5>
          <el-button
            class="blue-middle-btn"
            round
            @click="gotoPage('/tradingview')"
            >{{ t("learn-more") }}</el-button
          >
        </div>
        <div class="flex flex-col justify-center items-center">
          <img
            style="width: 42.5px; height: 22.5px"
            src="../../assets/forexImages/home/biaozhi.png"
            alt=""
          />
          <img
            style="width: 120px; height: 120px; margin-top: 31.5px"
            src="../../assets/forexImages/home/icon-bg-blue.png"
            alt=""
          />
          <div class="font-size24 text-white" style="margin-top: 15px">
            {{ $title }}
          </div>
          <div class="font-size40" style="color: #f9f891">
            {{ t("message.home.niandujingxiaoshang") }}
          </div>
          <span class="font-size40" style="color: #f9f891">2022</span>
        </div>
      </div>
    </pc-section>
    <!-- 在全球范围内,我们被授予 -->
    <pc-section class="py-20">
      <div class="text-sm text-center">{{ t("h-s8-t1") }}</div>
      <h2 class="text-center">{{ t("h-s8-t2") }}</h2>
      <div class="flex justify-center">
        <img
          class="inline-block"
          v-for="(item, index) in list6"
          :key="index"
          :src="getImageUrl(`${awardPrefix}${index + 1}.png`)"
          width="174"
          height="110"
        />
      </div>
    </pc-section>
  </div>
</template>
 
<script setup>
import { useRoute, useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
import API from "@/api/api";
import cardAdvantage from "@comForex/home/cardAdvantage.vue";
import cardPlatform from "@comForex/home/cardPlatform.vue";
import cardTrade from "@comForex/home/cardTrade.vue";
import PcHeader from "@comForex/header.vue";
import noticeBar from "@comForex/noticeBar.vue";
import { fixData } from "@/utils/utils";
import ConfigURL from "@/config/index";
import { getImageUrl, handleSymbolImg } from "@/utils/index";
import { onMounted } from "vue";
const needTransparent = ref(true);
 
const router = useRouter();
const { t } = useI18n();
 
onMounted(() => {
  getSymbol();
  window.addEventListener("scroll", handlePageScroll);
});
 
const handlePageScroll = () => {
  let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
  needTransparent.value = scrollTop < 800;
};
 
const list6 = Array(6);
const marketList = [
  {
    id: 0,
    name: t("h-s2-t1"),
    type: "hot",
  },
  {
    id: 1,
    name: t("message.user.waihui"),
    type: "forex",
  },
  {
    id: 2,
    name: t("message.user.shuzihuobi"),
    type: "cryptos",
  },
  {
    id: 3,
    name: t("h-s2-t4"),
    type: "indices",
  },
  {
    id: 4,
    name: t("h-s2-t5"),
    type: "commodities",
  },
];
const tableList = [
  {
    prop: "symbol",
    width: 180,
  },
  {
    prop: "close",
  },
  {
    prop: "amount",
  },
  {
    prop: "change_ratio",
  },
];
const articleList3 = [
  {
    url: "/market-analysis/forex-market-unlimited-opportunities",
  },
  {
    url: "/market-analysis/what-will-take-gold",
  },
  {
    url: "/market-analysis/-us-aug-cpi-review-risk-sentiment-changed",
  },
];
const advantageList4 = [
  {
    url: "/trading/spreads-swaps-commissions",
  },
  {
    url: "/trading",
  },
  {
    url: "/why-demo/about/",
  },
  {
    url: "/trading-platforms",
  },
];
const platformList4 = [
  {
    url: "/trading-platforms/platforms/ctrader",
  },
  {
    url: "/trading-platforms/platforms/metatrader5",
  },
  {
    url: "/trading-platforms/platforms/metatrader4",
  },
  {
    url: "/trading-platforms/platforms/ctrader",
  },
];
 
const awardPrefix = "/src/assets/forexImages/home/award";
 
const allSymbol = ref("");
const marketListType = ref("forex");
const activeList = ref([]);
const topListData = ref([]);
const jsonArray = ref([]);
 
const handleTrade = () => {
  router.push("/trading/spreads-swaps-commissions");
};
const getSymbol = () => {
  console.log("getSymbol");
  API.url("wap/api/item!list.action", {})
    .then((res) => {
      allSymbol.value = res.data
        .map((val) => {
          return val.symbol;
        })
        .join(",");
      getList();
    })
    .catch((err) => {
      console.log(err);
    });
};
const getList = () => {
  API.url("wap/api/hobi!getRealtime.action", { symbol: allSymbol.value }).then(
    (res) => {
      jsonArray.value = res.data;
      fliterTypeData();
    }
  );
};
const fliterTypeData = () => {
  console.log(marketListType.value);
  if (marketListType.value == "hot") {
    //获取顶部热门
    jsonArray.value.map((val) => {
      if (topListData.value.length < 4) {
        //val.isTop=="1"
        if (val.isTop == 1) {
          topListData.value.push(val);
        }
      }
    });
    if (topListData.value.length == 0) {
      jsonArray.value.map((val) => {
        if (topListData.value.length < 4) {
          //val.isTop=="1"
          topListData.value.push(val);
        }
      });
    }
    activeList.value = topListData.value;
  } else {
    activeList.value = jsonArray.value.filter((val) => {
      return val.type == marketListType.value;
    });
  }
  if (activeList.value.length > 4) {
    activeList.value = activeList.value.slice(0, 4);
  }
};
const handleClick = (tab, event) => {
  marketListType.value = tab.props.name;
  fliterTypeData();
};
const getName = (symbol) => {
  // console.log("item = " + JSON.stringify(item));
  if (marketListType.value == "cryptos") {
    return symbol.toUpperCase();
  } else {
    return symbol;
  }
};
const goDetail = (symbol, item) => {
  let RouterName = "sustainable"; //永续
  if (item.type == "US-stocks") {
    router.push({
      path: `usStocks/constract/${symbol}`,
      query: { timestamp: Date.now(), RouterName: RouterName },
    });
  } else if (item.type == "cryptos") {
    router.push({
      path: `coin/constract/${symbol}`,
      query: { timestamp: Date.now(), RouterName: RouterName },
    });
  } else if (item.type == "indices") {
    router.push({
      path: `etf/constract/${symbol}`,
      query: { timestamp: Date.now(), RouterName: RouterName },
    });
  } else if (item.type == "forex") {
    router.push({
      path: `forex/constract/${symbol}`,
      query: { timestamp: Date.now(), RouterName: RouterName },
    });
  }
};
 
const gotoPage = (path) => {
  if (!path.startsWith("/")) {
    window.open(path);
    return;
  }
  router.push(path);
};
</script>
 
<style lang="scss" scoped>
.w-300 {
  width: 500px;
}
 
.bd-gray {
  background: #f1f4f6;
}
 
.w-500 {
  width: 500px;
}
 
//覆盖global.scss,home-tab单独样式
.demo-tabs :deep {
  .el-tabs__content {
    box-shadow: none;
    border-radius: 0;
  }
 
  .el-tabs__header {
    background: #fff;
    border-radius: 10px 10px 0px 0px;
    margin: 0;
  }
}
 
// home-table样式
.self-table {
  box-shadow: none;
  border-radius: 0;
}
 
.section1 {
  background-image: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.8) 0%,
      rgba(0, 0, 0, 0) 100%
    ),
    url(@/assets/forexImages/home/banner1.png);
  background-size: auto 100%;
  height: 910px;
}
 
.transparent-header {
  background: transparent !important;
}
 
.fix-header {
  position: fixed !important;
}
 
.section2 {
  &-left {
    filter: drop-shadow(0px 0px 15px rgba(0, 0, 0, 0.1));
    width: 900px;
 
    p {
      background: #f6f7f8;
      border-radius: 0px 0px 10px 10px;
      padding: 18px 32px;
    }
  }
 
  &-content {
    max-width: 650px;
  }
}
 
.section3 {
  background: url(@/assets/forexImages/home/banner2.png) no-repeat center;
  background-size: auto 100%;
  height: 468px;
  width: 1200px;
  padding: 120px 0 0 74px;
}
 
.section6 {
  background: url(@/assets/forexImages/home/banner3.png) no-repeat center;
  background-size: auto 100%;
  margin: 0 auto;
 
  .join {
    width: 224px;
    height: 50px;
  }
 
  .el-input {
    width: 500px;
    height: 50px;
  }
}
 
.el-input :deep {
  .el-input__wrapper {
    border-radius: 0;
  }
}
 
.section8 {
  &-bg {
    background: url(@/assets/forexImages/home/banner4.png) no-repeat center;
    background-size: auto 100%;
    height: 468px;
    width: 1200px;
    margin: 0 auto;
    border-radius: 20px;
  }
}
 
:deep(.el-table .cell) {
  color: #000;
}
 
:deep(.el-tabs__item:hover) {
  color: rgb(30, 35, 41) !important;
}
 
.green {
  color: #03a66d;
}
 
.red {
  color: #cf304a;
}
</style>