Browse Source

修改合约价格

master
liaoxinyu 1 year ago
parent
commit
28e3f0f2ff
  1. 17
      pages/exchange/index.vue

17
pages/exchange/index.vue

@ -26,7 +26,8 @@
> >
<view class="col"> <view class="col">
<view class="num fn-26 color-light"> <view class="num fn-26 color-light">
{{ activeCoin.price }} <!-- {{ activeCoin.price }} -->
{{ price1 }}
</view> </view>
<view class="d-flex"> <view class="d-flex">
<view <view
@ -72,7 +73,7 @@
</van-tab> </van-tab>
</van-tabs> </van-tabs>
<view class="chart-box"> <view class="chart-box">
<iframe <iframe
class="chart-tradingview" class="chart-tradingview"
:src="`${mobileBase}static/tradingview.html?${setQuery( :src="`${mobileBase}static/tradingview.html?${setQuery(
iframeQuery iframeQuery
@ -218,6 +219,9 @@ export default {
isLoad: false, isLoad: false,
isShow: true, isShow: true,
price_cny: 0, price_cny: 0,
newPriceObj: {},
price1:"",
intervalId:'',
app app
}; };
}, },
@ -355,6 +359,12 @@ export default {
division:math.division, division:math.division,
setQuery: qs.stringify, setQuery: qs.stringify,
omitTo: math.omitTo, omitTo: math.omitTo,
startWatchingPrice(){
this.intervalId = setInterval(() => {
let newPrice = uni.getStorageSync('price');
this.price1 = newPrice;
}, 100); //
},
// //
tabInterval(idx) { tabInterval(idx) {
// if (this.isLoad) return; // if (this.isLoad) return;
@ -495,6 +505,8 @@ export default {
if (sub == `${this.ajax.trade}${symbol}`) { if (sub == `${this.ajax.trade}${symbol}`) {
this.tradeList.unshift(data); this.tradeList.unshift(data);
this.tradeList.pop(); this.tradeList.pop();
this.newPriceObj = data;
uni.setStorageSync("price",this.newPriceObj.price)
} }
}); });
}, },
@ -511,6 +523,7 @@ export default {
this.getCollect(); this.getCollect();
this.socketMessage(); this.socketMessage();
this.getCurrencyExCny(); this.getCurrencyExCny();
this.startWatchingPrice()
}, },
destroyed() { destroyed() {
this.ws.send({ this.ws.send({

Loading…
Cancel
Save