123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <template>
- <uni-table class="table-box" emptyText="暂无更多数据">
- <!-- 表头行 -->
- <uni-tr>
- <uni-th>
- <view class="table-th">
- 交易对
- </view>
- </uni-th>
- <uni-th >
- <view class="table-th table-th-title" @click.stop="alterRankRule(`rankRule`)">
- <text>最新价</text>
- <view class="title-arrows">
- <image class="arrows-icon" :src="rankRule === 1 ? activeRankRuleIcon : rankRuleIcon"
- mode="aspectFit"></image>
- <image class="arrows-icon" :src="rankRule === 2 ? activeRankRuleIcon : rankRuleIcon"
- mode="aspectFit"></image>
- </view>
- </view>
- </uni-th>
- <uni-th >
- <view class="table-th table-th-title" @click.stop="alterRankRule(`rankRule`)">
- <text>日涨跌</text>
- <view class="title-arrows">
- <image class="arrows-icon" :src="rankRule === 1 ? activeRankRuleIcon : rankRuleIcon"
- mode="aspectFit"></image>
- <image class="arrows-icon" :src="rankRule === 2 ? activeRankRuleIcon : rankRuleIcon"
- mode="aspectFit"></image>
- </view>
- </view>
- </uni-th>
- </uni-tr>
- <!-- 表格数据行 -->
- <uni-tr v-for="item in 30" :rise-fall="stocksColor">
- <uni-td>
- <view class="table-title">
- <view class="title">
- <text>BTC</text>
- <text class="title-sub">/USDT</text>
- </view>
- <view class="title-num">
- 24H额:476.62m
- </view>
- </view>
- </uni-td>
- <uni-td>
- <view class="title">
- <view class="">
- 30188.2
- </view>
- <view class="title-num">
- ¥207695.01
- </view>
- </view>
- </uni-td>
- <uni-td class="table-right">
- <view class="table-btn-box">
- <view :class="['table-btn' , item % 2 ? 'fall-btn' : 'rise-btn']">
- +0.03%
- </view>
- </view>
- </uni-td>
- </uni-tr>
- </uni-table>
- </template>
- <script>
- import {
- mapGetters
- } from 'vuex'
- export default {
- name: "marketplace",
- data() {
- return {
- rankRule: 0,
- rankRuleIcon: require("@/static/images/jiantou.png"),
- activeRankRuleIcon: require("@/static/images/jiantou_01.png")
- };
- },
- computed: {
- ...mapGetters([
- 'stocksColor'
- ]),
- },
- methods: {
- alterRankRule(rankRule) {
- console.log('alterRankRule' , rankRule)
- switch (this['rankRule']) {
- case 0:
- this['rankRule'] = 1;
- break;
- case 1:
- this['rankRule'] = 2;
- break;
- default:
- this['rankRule'] = 0
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .table-box {
- .uni-table-tr {
- .uni-table-th,
- .uni-table-td {
- padding: 0;
- flex-shrink: 0;
- &:nth-child(3n - 2) {
- padding-left: $pages-padding;
- flex: 2;
- }
- &:nth-child(3n - 1) {
- text-align: right !important;
- flex: 2;
- }
- &:nth-child(3n) {
- flex: 1;
- padding-right: $pages-padding;
- }
- // &:nth-child()
- }
- .table-th{
- padding-top: 20rpx;
- padding-bottom: 10rpx;
- }
- .uni-table-th {
- font-size: 22rpx;
- border-bottom: none;
- .table-th-title {
- width: 100%;
- display: flex;
- justify-content: flex-end;
- .title-arrows {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: flex-end;
- padding-left: 3px;
- .arrows-icon {
- width: 18rpx;
- height: 18rpx;
- &:first-child {
- transform: rotate(180deg);
- margin-bottom: -4rpx;
- }
- &:last-child {
- margin-top: -4rpx;
- }
- }
-
- }
- }
- }
- .uni-table-td {
- padding-top: 20rpx;
- padding-bottom: 20rpx;
- .table-title {
- width: 100%;
- line-height: 1.2;
- }
- .title {
- line-height: 1.2;
- font-size: 28rpx;
- font-family: PingFang SC, PingFang SC-Bold;
- font-weight: 700;
- .title-sub {
- font-size: 24rpx;
- font-weight: 400;
- }
- }
- .title-num {
- padding-top: 18rpx;
- font-size: 24rpx;
- }
- // <view class="table-title">
- // <view class="title">
- // <text>BTC</text>
- // <text class="title-sub">/USDT</text>
- // </view>
- // <view class="title-num">
- // 24H额:476.62m
- // </view>
- // </view>
- // &:nth-child(3n - 2) {
- // padding-left: $pages-padding;
- // }
- // &:nth-child(3n) {
- // padding-right: $pages-padding;
- // background-color: yellow;
- // text-align: right;
- // }
- // &:nth-child()
- }
- .table-btn-box {
- // width: 100%;
- // height: 100%;
- // display: flex;
- // justify-content: flex-end;
- // align-items: center;
- // background-color: yellowgreen;
- }
- .table-btn {
- // 138
- // width: 138rpx;
- // height: 60rpx;
- border-radius: 6rpx;
- color: #fff;
- font-family: PingFang SC, PingFang SC-Bold;
- font-weight: 700;
- text-align: center;
- // line-height: 60rpx;
- font-size: 26rpx;
- // margin-left: calc(100% - 138rpx);
- }
- }
- .table-right {
- padding: 0 !important;
- // display: flex;
- // justify-content: flex-end;
- // align-items: center;
-
- }
- }
- </style>
|