bitcooo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

107 lines
2.0 KiB

<template>
<view class="main_con">
<view class="title">
Market
</view>
<view class="main">
<view class="title_item flex">
<view class="text1">Tranding Pairs</view>
<view class="text1">Price/Vol</view>
<view class="text1 flex">
24h Chang
</view>
</view>
<view class="item flex" v-for="(item,index) in recordInfo">
<view class="text2">
{{item.name}}/USDT
</view>
<view class="text2">
<view class="">
{{item.current_price_usd}}
</view>
<view class="t1">
{{item.current_price}}
</view>
</view>
<view class="btn" :class="item.change_percent>0?'red':'green'">
<image src="../../../static/tongyonh/arrow-down-left1.png" mode="aspectFit" class="img1" v-if="item.change_percent>=0"></image>
<image src="../../../static/tongyonh/arrow-down-left.png" mode="aspectFit" class="img1" v-if="item.change_percent<0"></image>
{{item.change_percent}}%
</view>
</view>
</view>
<tab-bar :selectActive="3"></tab-bar>
</view>
</template>
<script>
import cont from "@/components/navigation/navigation.vue"
export default {
data() {
return {
recordInfo:[],
}
},
methods: {
getHomeSlideFunc(){
var _self = this;
uni.request({
url: 'https://dncapi.fxhapp.com/api/coin/web-coinrank?page=1&type=0&pagesize=10', //请求接口
header: {
'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
},
success: (res) => {
this.recordInfo=res.data.data
setTimeout(function(){_self.getHomeSlideFunc()},2000)
this.$forceUpdate()
}
});
},
},
onLoad() {
this.getHomeSlideFunc()
}
};
</script>
<style scoped>
page{
background-color: #FAFAFA;
}
</style>
<style>
@import './index.css';
</style>