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.
303 lines
7.5 KiB
303 lines
7.5 KiB
2 years ago
|
<template>
|
||
|
<view>
|
||
|
<view class="header">
|
||
|
<cu-custom :isBack="true" :isCenter="true">
|
||
|
<block slot="backText">
|
||
|
<view class="backImg">
|
||
|
<image src="@/static/images/back-btn.png" mode=""></image>
|
||
|
</view>
|
||
|
</block>
|
||
|
<block slot="content">
|
||
|
<view class="tab-title">积分兑换</view>
|
||
|
</block>
|
||
|
</cu-custom>
|
||
|
</view>
|
||
|
|
||
|
<view class="banner-box">
|
||
|
<swiper class="swiper-wrapper" @change="handleChange" :autoplay="true">
|
||
|
<block v-for="(item, imgUrlsIndex) in imgUrls" :key="imgUrlsIndex">
|
||
|
<swiper-item>
|
||
|
<view class="image">{{item}}</view>
|
||
|
<!-- <image class="image" :src="item" class="slide-image" mode="aspectFill"/> -->
|
||
|
</swiper-item>
|
||
|
</block>
|
||
|
</swiper>
|
||
|
<view class="dots-box acea-row row-center">
|
||
|
<view class="dot" v-for="(item,index) in imgUrls" :key="index">
|
||
|
<view :class="(currents > index?'active2 ':'active ') + (currents == index?'on':(currents-1 == index?'on2':''))"></view>
|
||
|
</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
|
||
|
<view class="integral-box acea-row row-between">
|
||
|
<view class="integral">
|
||
|
<view class="title">我的积分</view>
|
||
|
<view class="acea-row">
|
||
|
<view class="item" v-for="(item, integralIndex) in integral" :key="integralIndex">
|
||
|
<view class="top"></view>
|
||
|
<view class="bottom"></view>
|
||
|
<view class="num">{{ item || 0 }}</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
<view @click="goIntegral" class="btn acea-row row-between-wrapper">
|
||
|
<image src="@/static/images/mingxi.png" mode=""></image>
|
||
|
<view>明细</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="integral get-way acea-row row-column row-between">
|
||
|
<view class="title">获取积分</view>
|
||
|
<view class="acea-row row-between">
|
||
|
<view class="btn2">去签到</view>
|
||
|
<view class="btn2">去下单</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
|
||
|
<view class="list-box">
|
||
|
<view class="title">积分兑换</view>
|
||
|
<PromotionGood :benefit="productList" :isIntegral="true" />
|
||
|
</view>
|
||
|
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import { mapGetters } from 'vuex';
|
||
|
import store from '@/store';
|
||
|
import PromotionGood from '@/components/PromotionGood';
|
||
|
import { getProductsIntegral } from '@/api/store';
|
||
|
export default {
|
||
|
components: {
|
||
|
PromotionGood
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
currents: 0,
|
||
|
imgUrls: 5,
|
||
|
integral: 0,
|
||
|
from: {
|
||
|
page: 1,
|
||
|
limit: 15,
|
||
|
// sid: 0,
|
||
|
news: 0,
|
||
|
isIntegral: 1
|
||
|
},
|
||
|
productList: [],
|
||
|
};
|
||
|
},
|
||
|
computed: mapGetters(['userInfo']),
|
||
|
onLoad() {
|
||
|
getProductsIntegral(this.from).then(res => {
|
||
|
this.productList.push.apply(this.productList, res.data);
|
||
|
})
|
||
|
},
|
||
|
onShow() {
|
||
|
if (this.$store.getters.token) {
|
||
|
this.$store.dispatch('getUser', true);
|
||
|
}
|
||
|
if(this.userInfo.integral === undefined) this.userInfo.integral = 0;
|
||
|
this.integral = this.prefixInteger(this.userInfo.integral, 5);
|
||
|
console.log('userInfo', this.userInfo);
|
||
|
},
|
||
|
methods: {
|
||
|
handleChange(e) {
|
||
|
this.currents = e.mp.detail.current;
|
||
|
},
|
||
|
// 给数字补0;num:需要补0的数字,length:长度(补到多少位)
|
||
|
prefixInteger(num, length) {
|
||
|
return (Array(length).join("0") + num).slice(-length).split("");
|
||
|
},
|
||
|
goIntegral() {
|
||
|
this.$yrouter.push('/pages/user/signIn/Integral/index')
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style lang="less" scoped>
|
||
|
.header {
|
||
|
.tab-title {
|
||
|
font-size: 32rpx;
|
||
|
font-family: PingFang SC;
|
||
|
font-weight: 600;
|
||
|
color: #2DB5AE;
|
||
|
line-height: 42rpx;
|
||
|
}
|
||
|
.backImg {
|
||
|
width: 88rpx;
|
||
|
height: 62rpx;
|
||
|
padding-left: 26rpx;
|
||
|
image {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.banner-box {
|
||
|
padding: 20rpx 32rpx;
|
||
|
.swiper-wrapper {
|
||
|
width: 686rpx;
|
||
|
height: 398rpx;
|
||
|
border-radius: 16rpx;
|
||
|
.image {
|
||
|
width: 686rpx;
|
||
|
height: 398rpx;
|
||
|
border-radius: 16rpx;
|
||
|
background-color: #FFFFFF;
|
||
|
}
|
||
|
}
|
||
|
.dots-box {
|
||
|
padding-top: 26rpx;
|
||
|
.dot {
|
||
|
width: 92rpx;
|
||
|
height: 4rpx;
|
||
|
background: #CCEDEB;
|
||
|
margin: 0rpx 6rpx;
|
||
|
position: relative;
|
||
|
.active {
|
||
|
width: 0rpx;
|
||
|
height: 4rpx;
|
||
|
background: #2DB5AE;
|
||
|
position: absolute;
|
||
|
top: 0;
|
||
|
left: 0;
|
||
|
transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-webkit-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-moz-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-o-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
}
|
||
|
.active2 {
|
||
|
width: 0rpx;
|
||
|
height: 4rpx;
|
||
|
background: #2DB5AE;
|
||
|
position: absolute;
|
||
|
top: 0;
|
||
|
left: 92rpx;
|
||
|
transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-webkit-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-moz-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-o-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
}
|
||
|
.active.on {
|
||
|
width: 92rpx;
|
||
|
transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-webkit-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-moz-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-o-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
}
|
||
|
.active.on2 {
|
||
|
width: 92rpx;
|
||
|
left: 0;
|
||
|
transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-webkit-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-moz-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
-o-transition: all .6s cubic-bezier(.18,.89,.17,.88);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.integral-box {
|
||
|
padding: 6rpx 32rpx 12rpx;
|
||
|
.title {
|
||
|
font-size: 26rpx;
|
||
|
font-family: PingFangTC;
|
||
|
font-weight: 600;
|
||
|
color: #F5F6F8;
|
||
|
line-height: 34rpx;
|
||
|
padding-bottom: 8rpx;
|
||
|
}
|
||
|
.integral {
|
||
|
width: 480rpx;
|
||
|
height: 130rpx;
|
||
|
background: linear-gradient(135deg, #39D396 0%, #2DB7AD 43%, #1B8DCC 100%);
|
||
|
box-shadow: 0rpx 10rpx 16rpx 0rpx rgba(0,0,0,0.15);
|
||
|
border-radius: 16rpx;
|
||
|
padding: 18rpx;
|
||
|
position: relative;
|
||
|
.item {
|
||
|
position: relative;
|
||
|
margin-right: 6rpx;
|
||
|
.top {
|
||
|
width: 40rpx;
|
||
|
height: 26rpx;
|
||
|
background: #3A3A3C;
|
||
|
border-radius: 8rpx 8rpx 0rpx 0rpx;
|
||
|
margin-bottom: 4rpx;
|
||
|
}
|
||
|
.bottom {
|
||
|
width: 40rpx;
|
||
|
height: 26rpx;
|
||
|
background: #3A3A3C;
|
||
|
border-radius: 0rpx 0rpx 8rpx 8rpx;
|
||
|
}
|
||
|
.num {
|
||
|
width: 40rpx;
|
||
|
height: 56rpx;
|
||
|
font-size: 40rpx;
|
||
|
font-family: Futura;
|
||
|
font-weight: 600;
|
||
|
color: #F5F6F8;
|
||
|
line-height: 56rpx;
|
||
|
text-align: center;
|
||
|
position: absolute;
|
||
|
top: 0;
|
||
|
left: 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.btn {
|
||
|
position: absolute;
|
||
|
bottom: 18rpx;
|
||
|
right: 18rpx;
|
||
|
width: 70rpx;
|
||
|
height: 26rpx;
|
||
|
padding: 0rpx 8rpx;
|
||
|
background: #FFFFFF;
|
||
|
border-radius: 16rpx;
|
||
|
font-size: 16rpx;
|
||
|
font-family: PingFangTC;
|
||
|
font-weight: 600;
|
||
|
color: #2DB5AE;
|
||
|
line-height: 26rpx;
|
||
|
image {
|
||
|
width: 20rpx;
|
||
|
height: 20rpx;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.integral-box .get-way {
|
||
|
width: 184rpx;
|
||
|
height: 130rpx;
|
||
|
background: linear-gradient(135deg, #39D396 0%, #2DB7AD 43%, #1B8DCC 100%);
|
||
|
box-shadow: 0rpx 10rpx 16rpx 0rpx rgba(0,0,0,0.15);
|
||
|
border-radius: 16rpx;
|
||
|
.btn2 {
|
||
|
width: 70rpx;
|
||
|
height: 26rpx;
|
||
|
background: #FFFFFF;
|
||
|
border-radius: 16rpx;
|
||
|
font-size: 16rpx;
|
||
|
font-family: PingFangTC;
|
||
|
font-weight: 600;
|
||
|
color: #2DB5AE;
|
||
|
line-height: 26rpx;
|
||
|
text-align: center;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.list-box {
|
||
|
.title {
|
||
|
font-size: 30rpx;
|
||
|
font-family: SourceHanSansSCVF;
|
||
|
font-weight: 600;
|
||
|
color: #3A3A3C;
|
||
|
line-height: 46rpx;
|
||
|
padding: 20rpx 32rpx;
|
||
|
}
|
||
|
}
|
||
|
</style>
|