'页面修改'

This commit is contained in:
2024-08-30 09:37:17 +08:00
parent 6afbd7b8ab
commit 0509ac28dc
3 changed files with 145 additions and 133 deletions

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -5,7 +5,7 @@
<meta name="viewport" <meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover, user-scalable=no"/> content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover, user-scalable=no"/>
<title>金价</title> <title>金价</title>
<script src="js/vue.global.prod.min.js"></script> <script src="vue2/vue.min.js"></script>
<style> <style>
body { body {
@@ -130,7 +130,7 @@
<div>贵金属行情 <span style="color:red;font-size: 14px"> --- {{ displayStatus }}</span></div> <div>贵金属行情 <span style="color:red;font-size: 14px"> --- {{ displayStatus }}</span></div>
<div id="time">{{ time }}</div> <div id="time">{{ time }}</div>
</div> </div>
<div class="container"> <div class="container" v-if="items.length > 0 && oldItems.length > 0">
<div class="left"> <div class="left">
<table> <table>
<thead> <thead>
@@ -143,102 +143,103 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<!--(items[13] && items[13].askprice >= items[13].open) ? 'up' : 'down'"-->
<td class="row-title">黄金9999</td> <td class="row-title">黄金9999</td>
<td :class="items[0]?.askprice >= items[0]?.open?'up':'down'">{{ items[0]?.bidprice }}</td> <td :class="items[0].askprice >= items[0].open?'up':'down'">{{ items[0].bidprice }}</td>
<td :class="items[0]?.askprice >= items[0]?.open?'up':'down'">{{ items[0]?.askprice }}</td> <td :class="items[0].askprice >= items[0].open?'up':'down'">{{ items[0].askprice }}</td>
<td> <td>
<p :class="items[0]?.high >= oldItems[0]?.highNumber?'up':'down'" style="color: red !important;">{{ items[0]?.high }}</p> <p :class="items[0].high >= oldItems[0].highNumber?'up':'down'" style="color: red !important;">{{ items[0].high }}</p>
<p :class="items[0]?.low >= oldItems[0]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[0]?.low }}</p> <p :class="items[0].low >= oldItems[0].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[0].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">黄金T+D</td> <td class="row-title">黄金T+D</td>
<td :class="items[16]?.askprice >= items[16]?.open?'up':'down'">{{ items[16]?.bidprice}}</td> <td :class="items[16].askprice >= items[16].open?'up':'down'">{{ items[16].bidprice}}</td>
<td :class="items[16]?.askprice >= items[16]?.open?'up':'down'">{{ items[16]?.bidprice}}</td> <td :class="items[16].askprice >= items[16].open?'up':'down'">{{ items[16].askprice}}</td>
<td> <td>
<p :class="items[16]?.high >= oldItems[16]?.highNumber?'up':'down'" style="color: red !important;">{{ items[16]?.high }}</p> <p :class="items[16].high >= oldItems[16].highNumber?'up':'down'" style="color: red !important;">{{ items[16].high }}</p>
<p :class="items[16]?.low >= oldItems[16]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[16]?.low }}</p> <p :class="items[16].low >= oldItems[16].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[16].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">黄金</td> <td class="row-title">黄金</td>
<td :class="items[1]?.askprice >= items[1]?.open?'up':'down'">{{ items[1]?.bidprice}}</td> <td :class="items[1].askprice >= items[1].open?'up':'down'">{{ items[1].bidprice}}</td>
<td :class="items[1]?.askprice >= items[1]?.open?'up':'down'">{{ items[1]?.bidprice}}</td> <td :class="items[1].askprice >= items[1].open?'up':'down'">{{ items[1].askprice}}</td>
<td> <td>
<p :class=" items[1]?.high >= oldItems[1]?.highNumber?'up':'down'" style="color: red !important;">{{ items[1]?.high }}</p> <p :class=" items[1].high >= oldItems[1].highNumber?'up':'down'" style="color: red !important;">{{ items[1].high }}</p>
<p :class=" items[1]?.low >= oldItems[1]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[1]?.low }}</p> <p :class=" items[1].low >= oldItems[1].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[1].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">白银</td> <td class="row-title">白银</td>
<td :class="items[11]?.askprice >= items[11]?.open?'up':'down'">{{ items[11]?.bidprice}}</td> <td :class="items[11].askprice >= items[11].open?'up':'down'">{{ items[11].bidprice}}</td>
<td :class="items[11]?.askprice >= items[11]?.open?'up':'down'">{{ items[11]?.bidprice}}</td> <td :class="items[11].askprice >= items[11].open?'up':'down'">{{ items[11].askprice}}</td>
<td> <td>
<p :class=" items[11]?.high >= oldItems[11]?.highNumber?'up':'down'" style="color: red !important;">{{ items[11]?.high }}</p> <p :class=" items[11].high >= oldItems[11].highNumber?'up':'down'" style="color: red !important;">{{ items[11].high }}</p>
<p :class=" items[11]?.low >= oldItems[11]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[11]?.low }}</p> <p :class=" items[11].low >= oldItems[11].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[11].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">铂金</td> <td class="row-title">铂金</td>
<td :class="items[19]?.askprice >= items[19]?.open?'up':'down'">{{ items[19]?.bidprice}}</td> <td :class="items[19].askprice >= items[19].open?'up':'down'">{{ items[19].bidprice}}</td>
<td :class="items[19]?.askprice >= items[19]?.open?'up':'down'">{{ items[19]?.bidprice}}</td> <td :class="items[19].askprice >= items[19].open?'up':'down'">{{ items[19].askprice}}</td>
<td> <td>
<p :class=" items[19]?.high >= oldItems[19]?.highNumber?'up':'down'" style="color: red !important;">{{ items[19]?.high }}</p> <p :class=" items[19].high >= oldItems[19].highNumber?'up':'down'" style="color: red !important;">{{ items[19].high }}</p>
<p :class=" items[19]?.low >= oldItems[19]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[19]?.low }}</p> <p :class=" items[19].low >= oldItems[19].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[19].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">钯金</td> <td class="row-title">钯金</td>
<td :class="items[2]?.askprice >= items[2]?.open?'up':'down'">{{ items[2]?.bidprice}}</td> <td :class="items[2].askprice >= items[2].open?'up':'down'">{{ items[2].bidprice}}</td>
<td :class="items[2]?.askprice >= items[2]?.open?'up':'down'">{{ items[2]?.bidprice}}</td> <td :class="items[2].askprice >= items[2].open?'up':'down'">{{ items[2].askprice}}</td>
<td> <td>
<p :class=" items[2]?.high >= oldItems[2]?.highNumber?'up':'down'" style="color: red !important;">{{ items[2]?.high }}</p> <p :class=" items[2].high >= oldItems[2].highNumber?'up':'down'" style="color: red !important;">{{ items[2].high }}</p>
<p :class=" items[2]?.low >= oldItems[2]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[2]?.low }}</p> <p :class=" items[2].low >= oldItems[2].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[2].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">铑金</td> <td class="row-title">铑金</td>
<td :class="items[14]?.askprice >= items[14]?.open?'up':'down'">{{ items[14]?.bidprice}}</td> <td :class="items[14].askprice >= items[14].open?'up':'down'">{{ items[14].bidprice}}</td>
<td :class="items[14]?.askprice >= items[14]?.open?'up':'down'">{{ items[14]?.bidprice}}</td> <td :class="items[14].askprice >= items[14].open?'up':'down'">{{ items[14].askprice!='NaN'? items[14].askprice:'' }}</td>
<td> <td>
<p :class=" items[14]?.high >= oldItems[14]?.highNumber?'up':'down'" style="color: red !important;">{{ items[14]?.high }}</p> <p :class=" items[14].high >= oldItems[14].highNumber?'up':'down'" style="color: red !important;">{{ items[14].high }}</p>
<p :class=" items[14]?.low >= oldItems[14]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[14]?.low }}</p> <p :class=" items[14].low >= oldItems[14].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[14].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title"></td> <td class="row-title"></td>
<td :class="items[9]?.askprice >= items[9]?.open?'up':'down'">{{ items[9]?.bidprice}}</td> <td :class="items[9].askprice >= items[9].open?'up':'down'">{{ items[9].bidprice}}</td>
<td :class="items[9]?.askprice >= items[9]?.open?'up':'down'">{{ items[9]?.bidprice}}</td> <td :class="items[9].askprice >= items[9].open?'up':'down'">{{ items[9].askprice!='NaN'? items[9].askprice:'' }}</td>
<td> <td>
<p :class=" items[9]?.high >= oldItems[9]?.highNumber?'up':'down'" style="color: red !important;">{{ items[9]?.high }}</p> <p :class=" items[9].high >= oldItems[9].highNumber?'up':'down'" style="color: red !important;">{{ items[9].high }}</p>
<p :class=" items[9]?.low >= oldItems[9]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[9]?.low }}</p> <p :class=" items[9].low >= oldItems[9].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[9].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title"></td> <td class="row-title"></td>
<td :class="items[20]?.askprice >= items[20]?.open?'up':'down'">{{ items[20]?.bidprice}}</td> <td :class="items[20].askprice >= items[20].open?'up':'down'">{{ items[20].bidprice}}</td>
<td :class="items[20]?.askprice >= items[20]?.open?'up':'down'">{{ items[20]?.bidprice}}</td> <td :class="items[20].askprice >= items[20].open?'up':'down'">{{ items[20].askprice!='NaN'? items[20].askprice:'' }}</td>
<td> <td>
<p :class=" items[20]?.high >= oldItems[20]?.highNumber?'up':'down'" style="color: red !important;">{{ items[20]?.high }}</p> <p :class=" items[20].high >= oldItems[20].highNumber?'up':'down'" style="color: red !important;">{{ items[20].high }}</p>
<p :class=" items[20]?.low >= oldItems[20]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[20]?.low }}</p> <p :class=" items[20].low >= oldItems[20].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[20].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">白银T+D</td> <td class="row-title">白银T+D</td>
<td :class="items[5]?.askprice >= items[5]?.open?'up':'down'">{{ items[5]?.bidprice}}</td> <td :class="items[5].askprice >= items[5].open?'up':'down'">{{ items[5].bidprice}}</td>
<td :class="items[5]?.askprice >= items[5]?.open?'up':'down'">{{ items[5]?.bidprice}}</td> <td :class="items[5].askprice >= items[5].open?'up':'down'">{{ items[5].askprice}}</td>
<td> <td>
<p :class=" items[5]?.high >= oldItems[5]?.highNumber?'up':'down'" style="color: red !important;">{{ items[5]?.high }}</p> <p :class=" items[5].high >= oldItems[5].highNumber?'up':'down'" style="color: red !important;">{{ items[5].high }}</p>
<p :class=" items[5]?.low >= oldItems[5]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[5]?.low }}</p> <p :class=" items[5].low >= oldItems[5].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[5].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">铂金9995</td> <td class="row-title">铂金9995</td>
<td :class="items[15]?.askprice >= items[15]?.open?'up':'down'">{{ items[15]?.bidprice}}</td> <td :class="items[15].askprice >= items[15].open?'up':'down'">{{ items[15].bidprice}}</td>
<td :class="items[15]?.askprice >= items[15]?.open?'up':'down'">{{ items[15]?.bidprice}}</td> <td :class="items[15].askprice >= items[15].open?'up':'down'">{{ items[15].askprice}}</td>
<td> <td>
<p :class=" items[15]?.high >= oldItems[15]?.highNumber?'up':'down'" style="color: red !important;">{{ items[15]?.high }}</p> <p :class=" items[15].high >= oldItems[15].highNumber?'up':'down'" style="color: red !important;">{{ items[15].high }}</p>
<p :class=" items[15]?.low >= oldItems[15]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[15]?.low }}</p> <p :class=" items[15].low >= oldItems[15].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[15].low }}</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@@ -257,92 +258,92 @@
<tbody> <tbody>
<tr> <tr>
<td class="row-title">美黄金</td> <td class="row-title">美黄金</td>
<td :class="items[13]?.askprice >= items[13]?.open?'up':'down'">{{ items[13]?.bidprice}}</td> <td :class="items[13].askprice >= items[13].open?'up':'down'">{{ items[13].bidprice}}</td>
<td :class="items[13]?.askprice >= items[13]?.open?'up':'down'">{{ items[13]?.bidprice}}</td> <td :class="items[13].askprice >= items[13].open?'up':'down'">{{ items[13].askprice}}</td>
<td> <td>
<p :class=" items[13]?.high >= oldItems[13]?.highNumber?'up':'down'" style="color: red !important;">{{ items[13]?.high }}</p> <p :class=" items[13].high >= oldItems[13].highNumber?'up':'down'" style="color: red !important;">{{ items[13].high }}</p>
<p :class=" items[13]?.low >= oldItems[13]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[13]?.low }}</p> <p :class=" items[13].low >= oldItems[13].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[13].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">美白银</td> <td class="row-title">美白银</td>
<td :class="items[4]?.askprice >= items[4]?.open?'up':'down'">{{ items[4]?.bidprice}}</td> <td :class="items[4].askprice >= items[4].open?'up':'down'">{{ items[4].bidprice}}</td>
<td :class="items[4]?.askprice >= items[4]?.open?'up':'down'">{{ items[4]?.bidprice}}</td> <td :class="items[4].askprice >= items[4].open?'up':'down'">{{ items[4].askprice}}</td>
<td> <td>
<p :class=" items[4]?.high >= oldItems[4]?.highNumber?'up':'down'" style="color: red !important;">{{ items[4]?.high }}</p> <p :class=" items[4].high >= oldItems[4].highNumber?'up':'down'" style="color: red !important;">{{ items[4].high }}</p>
<p :class=" items[4]?.low >= oldItems[4]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[4]?.low }}</p> <p :class=" items[4].low >= oldItems[4].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[4].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">美铂金</td> <td class="row-title">美铂金</td>
<td :class="items[12]?.askprice >= items[12]?.open?'up':'down'">{{ items[12]?.bidprice}}</td> <td :class="items[12].askprice >= items[12].open?'up':'down'">{{ items[12].bidprice}}</td>
<td :class="items[12]?.askprice >= items[12]?.open?'up':'down'">{{ items[12]?.bidprice}}</td> <td :class="items[12].askprice >= items[12].open?'up':'down'">{{ items[12].askprice}}</td>
<td> <td>
<p :class=" items[12]?.high >= oldItems[12]?.highNumber?'up':'down'" style="color: red !important;">{{ items[12]?.high }}</p> <p :class=" items[12].high >= oldItems[12].highNumber?'up':'down'" style="color: red !important;">{{ items[12].high }}</p>
<p :class=" items[12]?.low >= oldItems[12]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[12]?.low }}</p> <p :class=" items[12].low >= oldItems[12].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[12].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">美钯金</td> <td class="row-title">美钯金</td>
<td :class="items[18]?.askprice >= items[18]?.open?'up':'down'">{{ items[18]?.bidprice}}</td> <td :class="items[18].askprice >= items[18].open?'up':'down'">{{ items[18].bidprice}}</td>
<td :class="items[18]?.askprice >= items[18]?.open?'up':'down'">{{ items[18]?.bidprice}}</td> <td :class="items[18].askprice >= items[18].open?'up':'down'">{{ items[18].askprice}}</td>
<td> <td>
<p :class=" items[18]?.high >= oldItems[18]?.highNumber?'up':'down'" style="color: red !important;">{{ items[18]?.high }}</p> <p :class=" items[18].high >= oldItems[18].highNumber?'up':'down'" style="color: red !important;">{{ items[18].high }}</p>
<p :class=" items[18]?.low >= oldItems[18]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[18]?.low }}</p> <p :class=" items[18].low >= oldItems[18].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[18].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">美铑金</td> <td class="row-title">美铑金</td>
<td :class="items[21]?.askprice >= items[21]?.open?'up':'down'">{{ items[21]?.bidprice}}</td> <td :class="items[21].askprice >= items[21].open?'up':'down'">{{ items[21].bidprice}}</td>
<td :class="items[21]?.askprice >= items[21]?.open?'up':'down'">{{ items[21]?.bidprice}}</td> <td :class="items[21].askprice >= items[21].open?'up':'down'">{{ items[21].askprice}}</td>
<td> <td>
<p :class=" items[21]?.high >= oldItems[21]?.highNumber?'up':'down'" style="color: red !important;">{{ items[21]?.high }}</p> <p :class=" items[21].high >= oldItems[21].highNumber?'up':'down'" style="color: red !important;">{{ items[21].high }}</p>
<p :class=" items[21]?.low >= oldItems[21]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[21]?.low }}</p> <p :class=" items[21].low >= oldItems[21].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[21].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">伦敦金</td> <td class="row-title">伦敦金</td>
<td :class="items[7]?.askprice >= items[7]?.open?'up':'down'">{{ items[7]?.bidprice}}</td> <td :class="items[7].askprice >= items[7].open?'up':'down'">{{ items[7].bidprice}}</td>
<td :class="items[7]?.askprice >= items[7]?.open?'up':'down'">{{ items[7]?.bidprice}}</td> <td :class="items[7].askprice >= items[7].open?'up':'down'">{{ items[7].askprice}}</td>
<td> <td>
<p :class=" items[7]?.high >= oldItems[7]?.highNumber?'up':'down'" style="color: red !important;">{{ items[7]?.high }}</p> <p :class=" items[7].high >= oldItems[7].highNumber?'up':'down'" style="color: red !important;">{{ items[7].high }}</p>
<p :class=" items[7]?.low >= oldItems[7]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[7]?.low }}</p> <p :class=" items[7].low >= oldItems[7].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[7].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">伦敦银</td> <td class="row-title">伦敦银</td>
<td :class="items[22]?.askprice >= items[22]?.open?'up':'down'">{{ items[22]?.bidprice}}</td> <td :class="items[22].askprice >= items[22].open?'up':'down'">{{ items[22].bidprice}}</td>
<td :class="items[22]?.askprice >= items[22]?.open?'up':'down'">{{ items[22]?.bidprice}}</td> <td :class="items[22].askprice >= items[22].open?'up':'down'">{{ items[22].askprice}}</td>
<td> <td>
<p :class=" items[22]?.high >= oldItems[22]?.highNumber?'up':'down'" style="color: red !important;">{{ items[22]?.high }}</p> <p :class=" items[22].high >= oldItems[22].highNumber?'up':'down'" style="color: red !important;">{{ items[22].high }}</p>
<p :class=" items[22]?.low >= oldItems[22]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[22]?.low }}</p> <p :class=" items[22].low >= oldItems[22].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[22].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">伦敦铂</td> <td class="row-title">伦敦铂</td>
<td :class="items[3]?.askprice >= items[3]?.open?'up':'down'">{{ items[3]?.bidprice}}</td> <td :class="items[3].askprice >= items[3].open?'up':'down'">{{ items[3].bidprice}}</td>
<td :class="items[3]?.askprice >= items[3]?.open?'up':'down'">{{ items[3]?.bidprice}}</td> <td :class="items[3].askprice >= items[3].open?'up':'down'">{{ items[3].askprice}}</td>
<td> <td>
<p :class=" items[3]?.high >= oldItems[3]?.highNumber?'up':'down'" style="color: red !important;">{{ items[3]?.high }}</p> <p :class=" items[3].high >= oldItems[3].highNumber?'up':'down'" style="color: red !important;">{{ items[3].high }}</p>
<p :class=" items[3]?.low >= oldItems[3]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[3]?.low }}</p> <p :class=" items[3].low >= oldItems[3].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[3].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">伦敦钯</td> <td class="row-title">伦敦钯</td>
<td :class="items[6]?.askprice >= items[6]?.open?'up':'down'">{{ items[6]?.bidprice}}</td> <td :class="items[6].askprice >= items[6].open?'up':'down'">{{ items[6].bidprice}}</td>
<td :class="items[6]?.askprice >= items[6]?.open?'up':'down'">{{ items[6]?.bidprice}}</td> <td :class="items[6].askprice >= items[6].open?'up':'down'">{{ items[6].askprice}}</td>
<td> <td>
<p :class=" items[6]?.high >= oldItems[6]?.highNumber?'up':'down'" style="color: red !important;">{{ items[6]?.high }}</p> <p :class=" items[6].high >= oldItems[6].highNumber?'up':'down'" style="color: red !important;">{{ items[6].high }}</p>
<p :class=" items[6]?.low >= oldItems[6]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[6]?.low }}</p> <p :class=" items[6].low >= oldItems[6].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[6].low }}</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row-title">美元</td> <td class="row-title">美元</td>
<td :class="items[17]?.askprice >= items[17]?.open?'up':'down'">{{ items[17]?.bidprice}}</td> <td :class="items[17].askprice >= items[17].open?'up':'down'">{{ items[17].bidprice}}</td>
<td :class="items[17]?.askprice >= items[17]?.open?'up':'down'">{{ items[17]?.bidprice}}</td> <td :class="items[17].askprice >= items[17].open?'up':'down'">{{ items[17].askprice}}</td>
<td> <td>
<p :class=" items[17]?.high >= oldItems[17]?.highNumber?'up':'down'" style="color: red !important;">{{ items[17]?.high }}</p> <p :class=" items[17].high >= oldItems[17].highNumber?'up':'down'" style="color: red !important;">{{ items[17].high }}</p>
<p :class=" items[17]?.low >= oldItems[17]?.lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[17]?.low }}</p> <p :class=" items[17].low >= oldItems[17].lowNumber?'up':'down'" style="color: #0f0 !important;">{{ items[17].low }}</p>
</td> </td>
</tr> </tr>
@@ -354,26 +355,23 @@
<script> <script>
new Vue({
const {createApp} = Vue el: '#app',
data: function() {
createApp({
data() {
return { return {
message: 'Hello Vue!', message: 'Hello Vue!',
time: "", time: "",
status: null, status: null,
items: [], items: [],
oldItems: [], oldItems: []
} };
}, },
computed: { computed: {
displayStatus() { displayStatus: function() {
let that = this
// 根据 status 的值返回相应的字符串 // 根据 status 的值返回相应的字符串
if (that.status === 1) { if (this.status === 1) {
return '开盘'; return '开盘';
} else if (that.status === 0) { } else if (this.status === 0) {
return '收盘'; return '收盘';
} else { } else {
return '未知状态'; // 处理其他可能的状态 return '未知状态'; // 处理其他可能的状态
@@ -381,48 +379,44 @@
} }
}, },
methods: { methods: {
getFlag() { getFlag: function() {
let that = this var that = this;
fetch('https://19year.cn/jin/api.php?type=flag') // 替换为你的接口地址 var url = 'https://19year.cn/jin/api.php?type=flag'; // 替换为你的接口地址
.then(response => { fetch(url)
// console.log(response) .then(function(response) {
if (!response.ok) { if (!response.ok) {
throw new Error('Network response was not ok'); throw new Error('Network response was not ok');
} }
return response.json(); return response.json();
}) })
.then(data => { .then(function(data) {
// console.log(data)
that.status = data.status; // 将获取的数据存储到 data 中 that.status = data.status; // 将获取的数据存储到 data 中
}) })
.catch(error => { .catch(function(error) {
console.error('There was a problem with the fetch operation:', error); console.error('There was a problem with the fetch operation:', error);
}); });
}, },
getPq() { getPq: function() {
let that = this var that = this;
// let items = reactive({items:[]}); var url = 'https://19year.cn/jin/api.php?type=pq'; // 替换为你的接口地址
fetch('https://19year.cn/jin/api.php?type=pq') // 替换为你的接口地址 fetch(url)
.then(response => { .then(function(response) {
console.log(response)
if (!response.ok) { if (!response.ok) {
throw new Error('Network response was not ok'); throw new Error('Network response was not ok');
} }
return response.json(); return response.json();
}) })
.then(data => { .then(function(data) {
that.items = data.items that.items = data.items;
that.oldItems = data.items that.oldItems = data.items;
// that.status = data.status; // 将获取的数据存储到 data 中
}) })
.catch(error => { .catch(function(error) {
console.error('There was a problem with the fetch operation:', error); console.error('There was a problem with the fetch operation:', error);
}); });
}, },
updateTime() { updateTime: function() {
let that = this var now = new Date();
const now = new Date(); var options = {
const options = {
year: 'numeric', year: 'numeric',
month: '2-digit', month: '2-digit',
day: '2-digit', day: '2-digit',
@@ -431,22 +425,23 @@
second: '2-digit', second: '2-digit',
hour12: false hour12: false
}; };
that.time = now.toLocaleString('zh-CN', options); this.time = now.toLocaleString('zh-CN', options);
} }
}, },
mounted() { mounted: function() {
this.getFlag(); // 初始加载数据 var that = this;
this.getPq(); that.getFlag(); // 初始加载数据
this.updateTime(); that.getPq();
setInterval(() => { that.updateTime();
this.getFlag(); // 每隔一定时间获取数据 setInterval(function() {
this.getPq(); that.getFlag(); // 每隔一定时间获取数据
this.updateTime(); that.getPq();
}, 1000); // 5000 毫秒5 秒) that.updateTime();
}, 1000); // 每秒更新一次
} }
}).mount('#app') });
</script> </script>
</body> </body>

11
server/vue2/vue.min.js vendored Normal file

File diff suppressed because one or more lines are too long