123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <template>
- <view class="center">
- <view class="bg"></view>
- <view class="zong flex">
- <view class="info">
- <view class="info-num">{{ USDL || '0' }}</view>
- <view class="info-font">USDL</view>
- </view>
- <view class="info">
- <view class="info-num">{{ lucky || '0' }}</view>
- <view class="info-font">幸运值</view>
- </view>
- <view class="info">
- <view class="info-num">{{ honor || '0' }}</view>
- <view class="info-font">荣誉值</view>
- </view>
- </view>
- <view class="rule">
- <view class="rule-title">福利兑换规则</view>
- <view class="rule-main">
- 每{{ list.sp_exchange_origin_cost * 1 }}{{ list.sp_exchange_origin }}+{{ list.sp_exchange_bingo_time }}幸运值可兑换{{ list.sp_exchange_target_get * 1}}{{ list.sp_exchange_target }}+{{ list.sp_exchange_bingo_time }}荣誉值
- </view>
- </view>
- <view class="main-title">
- <view class="shu"></view>
- <view class="m-title">兑换记录</view>
- </view>
- <scroll-view scroll-y class="list-box" @scrolltolower="getList()">
- <!-- <view class="empty-box"><empty v-if="exchange.length === 0 || loadingType == 'nomore'"></empty></view> -->
- <view v-for="(item, index) in exchange" :key="index" class="list-item flex">
- <view class="list-left">
- <view class="list-title">福利兑换</view>
- <view class="time">{{item.time}}</view>
- </view>
- <view class="list-right">已兑换</view>
- </view>
- <u-loadmore :status="loadingType" />
- </scroll-view>
- <view class="btn" @click="nav()">立即兑换</view>
- </view>
- </template>
- <script>
- import { getSp } from '@/api/market.js';
- import { lalaDetial } from '@/api/product.js';
- import { wallet } from '@/api/finance.js';
- import { getTime } from '@/utils/rocessor.js';
- export default {
- data() {
- return {
- id: '',
- lucky: '',
- honor: '',
- list: '',
- USDL: '',
- exchange: [],
- page: 1,
- limit: 10,
- loadingType: 'loadmore'
- };
- },
- onLoad(option) {
- this.id = option.id;
- this.loadData();
- this.getList();
- },
- methods: {
- async loadData() {
- lalaDetial({}, this.id)
- .then(({ data }) => {
- console.log(data);
- this.honor = data.exchange_point;
- this.lucky = data.luck_point-data.exchange_point;
- this.list = data.data;
- })
- .catch(e => {
- console.log(e);
- });
- wallet({}).then(({ data }) => {
- this.USDL = data.back['USDL'].money.money * 1;
- });
- },
- getList() {
- if (this.loadingType == 'nomore' || this.loadingType == 'loading') {
- return;
- }
- this.loadingType = 'loading';
- getSp(
- {
- page: this.page,
- limit: this.limit
- },
- this.id
- ).then(({ data }) => {
- if(data.count != 0){
- data.data.forEach(e => {
- e.time = getTime(e.add_time)
- })
- }
- this.exchange = data.list;
- if (data.length != this.limit) {
- this.loadingType = 'nomore';
- } else {
- this.page++;
- this.loadingType = 'loadmore';
- }
- });
- },
- nav() {
- uni.navigateTo({
- url: '/pages/market/duihuan?id=' + this.id
- });
- }
- }
- };
- </script>
- <style lang="scss">
- .center,
- page {
- height: 100%;
- background: #f7fbfe;
- }
- .bg {
- width: 750rpx;
- height: 248rpx;
- background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
- border-bottom-left-radius: 150rpx;
- border-bottom-right-radius: 150rpx;
- }
- .zong {
- width: 690rpx;
- height: 181rpx;
- background: #ffffff;
- box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
- border-radius: 20rpx;
- margin: -150rpx auto 0;
- justify-content: space-between;
- padding: 0rpx 36rpx;
- .info {
- display: flex;
- flex-direction: column;
- align-items: center;
- .info-num {
- font-size: 50rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #0f253a;
- }
- .info-font {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #6d7c88;
- }
- }
- }
- .rule {
- width: 690rpx;
- background: #ffffff;
- box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
- border-radius: 20rpx;
- margin: 16rpx auto 0;
- padding: 26rpx 36rpx;
- .rule-title {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #44969d;
- }
- .rule-main {
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #0f253a;
- margin-top: 10rpx;
- }
- }
- .main-title {
- margin-top: 36rpx;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .shu {
- margin-left: 30rpx;
- width: 5rpx;
- height: 29rpx;
- background: #0f253a;
- border-radius: 3rpx;
- }
- .m-title {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #0f253a;
- margin-left: 16rpx;
- }
- }
- .list-box {
- margin-top: 34rpx;
- height: calc(100% - 260px);
- background-color: #ffffff;
- .list-item {
- padding: 25rpx 50rpx;
- border-bottom: 1px solid #f0f4f8;
- .list-title {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #666666;
- }
- .time {
- margin-top: 10rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #aeaeae;
- }
- .list-right {
- font-size: 27rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- }
- }
- .btn {
- position: fixed;
- bottom: 28rpx;
- left: 0;
- right: 0;
- margin: 0 auto;
- width: 674rpx;
- height: 88rpx;
- background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
- border-radius: 44rpx;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- text-align: center;
- line-height: 88rpx;
- }
- </style>
|