123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- <template>
- <view class="container">
- <view class="status_bar"><!-- 这里是状态栏 --></view>
- <view class="content-money">
- <view class="body-title">
- <view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
- <view class="header">服务器兑换</view>
- </view>
- <view class="content-bg"><image src="../../static/img/fwq-bg.png" mode=""></image></view>
- <view class="money">
- <view class="num">2600</view>
- <view class="font">我的购物积分</view>
- <view class="all" @click="nav('/pages/money/integralShopping')">查看明细</view>
- </view>
- </view>
- <view class="main">
- <view class="main-title">
- <image src="../../static/icon/f-l.png" mode=""></image>
- <view class="title-font">热门兑换</view>
- <image src="../../static/icon/f-r.png" mode=""></image>
- </view>
- <view class="main-box">
- <view class="main-item" v-for="(item, index) in list" :key="index">
- <view class="item-bg"><image :src="item.logo" mode=""></image></view>
- <view class="item-info">
- <view class="item-name">{{ item.name }}</view>
- <view class="item-tip">合约周期:{{ item.first_step_time + item.second_step_time }}天 + {{ item.third_step_time }}天</view>
- <view class="item-tip">有效空间:{{ item.step }}T</view>
- <view class="price">
- {{ item.cost_money*1 }}
- <text>{{ item.cost_money_type}}</text>
- </view>
- <view class="btn" @click="go(item)">立即兑换</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { mining } from '@/api/market.js';
- import { wallet } from '@/api/finance.js';
- export default {
- data() {
- return {
- tabCurrent: '全部',
- tabType: 1,
- list: [],
- buyId: '',
- password: '',
- num: ''
- };
- },
- onLoad(option) {
- this.loadData();
- },
- onShow() {},
- //下拉刷新
- onPullDownRefresh() {
- },
- methods: {
- nav(url) {
- uni.navigateTo({
- url
- });
- },
- go() {
- uni.navigateTo({
- url:'/pages/market/details'
- })
- },
- // 点击返回 我的页面
- toBack() {
- uni.navigateBack({
-
- })
- },
- // 请求载入数据
- async loadData() {
- let obj = this;
- uni.showLoading({
- title: '加载中...'
- });
- mining({
- page: 1,
- limit: 1000
- }).then(({ data }) => {
- uni.hideLoading();
- console.log(data.data, '9999999999999999999999999999999999');
- obj.list = data.data.map(e => {
- e.step = +e.step;
- e._cost_money = +e._cost_money.replace(e.cost_money_type, '') + e.cost_money_type;
- return e;
- });
- console.log(obj.list, 'obj.list++++++++++++');
- });
- },
- go(ls) {
- uni.navigateTo({
- url: '/pages/market/details?id=' + ls.id + '&type=' + ls.type
- });
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background: #ffffff;
- height: 100%;
- }
- .status_bar {
- height: var(--status-bar-height);
- width: 100%;
- }
- .content-money {
- padding-bottom: 30rpx;
- position: relative;
- height: 448rpx;
- .content-bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- width: 750rpx;
- height: 448rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .body-title {
- height: 80rpx;
- text-align: center;
- font-size: 35rpx;
- position: relative;
- .header {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #fffeff;
- height: 80rpx;
- font-size: 36rpx;
- font-weight: 700;
- z-index: 9;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .goback-box {
- position: absolute;
- left: 18rpx;
- top: 0;
- height: 80rpx;
- display: flex;
- align-items: center;
- }
- .goback {
- z-index: 100;
- width: 34rpx;
- height: 34rpx;
- }
- }
- }
- .money {
- position: relative;
- z-index: 10;
- padding-top: 64rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- .num {
- font-size: 84rpx;
- font-family: PingFang SC;
- font-weight: 800;
- color: #ffffff;
- }
- .font {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- }
- .all {
- margin-top: 20rpx;
- width: 194rpx;
- height: 60rpx;
- line-height: 60rpx;
- border: 1px solid #ffffff;
- border-radius: 30rpx;
- font-size: 26rpx;
- font-family: SourceHanSansCN;
- font-weight: 500;
- color: #ffffff;
- text-align: center;
- }
- }
- .main {
- margin-top: 26rpx;
- .main-title {
- display: flex;
- justify-content: center;
- align-items: center;
- image {
- width: 24rpx;
- height: 24rpx;
- }
- .title-font {
- width: 170rpx;
- font-size: 34rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #2E58FF;
- text-align: center;
- }
- }
- .main-box {
- padding: 16rpx 20rpx 70rpx;
- .main-item {
- margin-top: 20rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- border-radius: 10rpx;
- padding: 14rpx;
- display: flex;
- justify-content: flex-start;
- .item-bg {
- width: 260rpx;
- height: 260rpx;
- flex-shrink: 0;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .item-info {
- position: relative;
- margin-left: 30rpx;
- padding-top: 20rpx;
- width: 100%;
- .item-name {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .item-tip {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- .price {
- margin-top: 70rpx;
- font-size: 40rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #E83F30;
- text {
- font-size: 22rpx;
- }
- }
- }
- .btn {
- position: absolute;
- right: 24rpx;
- bottom: 34rpx;
- width: 141rpx;
- height: 50rpx;
- background: linear-gradient(0deg, #2E58FF, #32C6FF);
- border-radius: 25rpx;
- text-align: center;
- line-height: 50rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- }
- }
- }
- }
- </style>
|