<template>
|
<view class="bean">
|
<!-- 头部 -->
|
<view class="container_h" :style="{ background: `rgba(288, 288, 288, ${num})` }">
|
<view class="container_head" :style="{height: navHeight + 'px', marginTop: statusbarHeight + 'px'}">
|
<uni-icons type="back" size="25" color="#333333"></uni-icons>
|
<text>咖豆中心</text>
|
<text></text>
|
</view>
|
</view>
|
<view class="bean_bg">
|
<view class="bean_bg_box">
|
<view class="bean_bg_box_left">
|
<view class="bean_bg_box_item_left">
|
<text class="t">260</text>
|
<view class="bean_bg_box_item_left_a">
|
<text>咖豆明细 </text>
|
<uni-icons type="forward" size="15" color="#666666"></uni-icons>
|
</view>
|
</view>
|
<image src="@/static/icon/kadou_zhangdan@2x.png" mode="widthFix"></image>
|
</view>
|
<view class="x"></view>
|
<view class="bean_bg_box_right">
|
<view class="bean_bg_box_item_left">
|
<text>邀请好友领奖励</text>
|
<text>已成功邀请<text>3</text>位好友</text>
|
</view>
|
<image src="@/static/icon/kadou_yaoqing@2x.png" mode="widthFix"></image>
|
</view>
|
</view>
|
</view>
|
<!-- 任务 -->
|
<view class="bean_box">
|
<view class="sign_date_rw">
|
<view class="title">
|
<text>做任务赚咖豆</text>
|
<view class="title_right" @click="toDesc">
|
<uni-icons type="help" color="#999999" size="18"></uni-icons>
|
<text>咖豆获取规则</text>
|
</view>
|
</view>
|
<view class="list">
|
<view class="list_item" v-for="(item, index) in open ? list : list.slice(0, 3)" :key="index">
|
<view class="list_item_left">
|
<view class="top">
|
<text>{{item.name}}</text>
|
<text v-if="item.num">{{item.num}}</text>
|
</view>
|
<text>{{item.info}}</text>
|
</view>
|
<view class="list_item_submit">{{item.btn}}</view>
|
</view>
|
</view>
|
<view class="open" @click="open = !open">
|
<text>查看更多任务</text>
|
<uni-icons :type="open ? 'top' : 'bottom'" size="18" color="#999999"></uni-icons>
|
</view>
|
</view>
|
</view>
|
<!-- 商品分类 -->
|
<view class="find_box_search_cate" :style="{top: navHeight + statusbarHeight + 'px'}">
|
<view class="find_box_search_cate_item" v-for="(item, index) in cateList" :key="index" @click="i = index">
|
<text :class="i === index ? 'activeColor' : ''">{{item.name}}</text>
|
<view class="active" v-show="i === index"></view>
|
</view>
|
</view>
|
<!-- 商品列表 -->
|
<!-- <view class="bean_list">
|
<view class="fun_list_item" v-for="(item, index) in 10" :key="index">
|
<view class="fun_list_item_img">
|
<image src="@/static/uni.png" mode="heightFix"></image>
|
</view>
|
<view class="fun_list_item_info">
|
<view class="fun_list_item_info_top">
|
<text>飞盘之后,新中产又被围炉煮茶割韭菜?飞盘之后,新中产又</text>
|
</view>
|
<view class="fun_list_item_info_bottom">
|
<view class="fun_list_item_info_bottom_left">
|
<text>29</text>
|
<text>咖豆</text>
|
</view>
|
<view class="fun_list_item_info_bottom_right">
|
<text>已兑2389份</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view> -->
|
<!-- 优惠券 -->
|
<view class="bean_yh">
|
<view class="bean_yh_list">
|
<view class="bean_yh_list_item" v-for="(item, index) in 3" :key="index">
|
<view class="bean_yh_list_item_left">
|
<view class="price">
|
<div class="left"></div>
|
<div class="right"></div>
|
<view class="top">
|
<text>¥</text>
|
<text>3</text>
|
</view>
|
<view class="bottom">满3.01元可用</view>
|
</view>
|
<view class="info">
|
<text class="info_a">3元无门槛券</text>
|
<view class="info_b">
|
<view class="info_b_item">300咖豆兑换</view>
|
</view>
|
<text class="info_c">兑换后7日内有效</text>
|
</view>
|
</view>
|
<view class="bean_yh_list_item_btn" @click="openPopup">立即兑换</view>
|
</view>
|
</view>
|
</view>
|
<!-- 温馨提示 -->
|
<uni-popup ref="popup" background-color="#fff">
|
<view class="popup">
|
<view class="popup_title">温馨提示</view>
|
<view class="popup_ipt">
|
<text>确定消耗300咖豆兑换吗?</text>
|
</view>
|
<view class="popup_footer">
|
<view class="popup_footer_close" @click="close">取消</view>
|
<view class="popup_footer_save">保存</view>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
export default {
|
data() {
|
return {
|
i: 0,
|
num: 0,
|
open: false,
|
list: [
|
{
|
name: '每日签到',
|
info: '5咖豆',
|
num: '',
|
btn: '去签到'
|
},
|
{
|
name: '分享资讯',
|
info: '10咖豆',
|
num: '(1/4)',
|
btn: '去分享'
|
},
|
{
|
name: '发布评论',
|
info: '10咖豆',
|
num: '(1/4)',
|
btn: '去评论'
|
},
|
{
|
name: '邀请新用户注册',
|
info: '双方各得100咖豆',
|
num: '',
|
btn: '去邀请'
|
},
|
{
|
name: '分享邀请海报',
|
info: '20咖豆',
|
num: '(0/1)',
|
btn: '去分享'
|
},
|
{
|
name: '咖啡地图消费',
|
info: '25咖豆',
|
num: '',
|
btn: '去消费'
|
}
|
],
|
cateList: [
|
{
|
name: '推荐'
|
},
|
{
|
name: '周边'
|
},
|
{
|
name: '咖啡豆'
|
},
|
{
|
name: '优惠券'
|
}
|
]
|
}
|
},
|
computed: {
|
...mapState(['statusbarHeight', 'navHeight'])
|
},
|
methods: {
|
toDesc() {
|
uni.navigateTo({
|
url: '/pages/details/index?title=咖豆获取规则'
|
});
|
},
|
openPopup() {
|
this.$refs.popup.open('center')
|
},
|
close() {
|
this.$refs.popup.close()
|
}
|
},
|
onPageScroll(e) {
|
switch(e.scrollTop) {
|
case 0:
|
this.num = 0
|
break
|
default:
|
this.num = 1
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.uni-popup__wrapper {
|
border-radius: 32rpx !important;
|
}
|
</style>
|
|
<style lang="scss" scoped>
|
.bean {
|
width: 100%;
|
.container_h {
|
width: 100%;
|
height: auto;
|
position: fixed;
|
top: 0;
|
left: 0;
|
z-index: 9;
|
.container_head {
|
width: 100%;
|
padding: 0 32rpx;
|
box-sizing: border-box;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
background-color: rgba(0, 0, 0, 0);
|
text {
|
font-size: 34rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #26292C;
|
margin-right: 30rpx;
|
}
|
}
|
}
|
.bean_bg {
|
width: 100%;
|
height: 400rpx;
|
padding: 0 32rpx;
|
box-sizing: border-box;
|
position: relative;
|
background: linear-gradient(180deg, rgba(217,90,90,0.74) 0%, rgba(217,217,217,0) 100%);
|
.bean_bg_box {
|
position: absolute;
|
bottom: 30rpx;
|
width: 686rpx;
|
height: 156rpx;
|
background: #FFFFFF;
|
box-shadow: 0rpx 8rpx 12rpx 0rpx rgba(0,0,0,0.02);
|
border-radius: 20rpx;
|
display: flex;
|
align-items: center;
|
padding: 42rpx 28rpx;
|
box-sizing: border-box;
|
.bean_bg_box_left {
|
flex: 1;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.bean_bg_box_item_left {
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
text {
|
&:nth-child(1) {
|
font-size: 36rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
}
|
}
|
.bean_bg_box_item_left_a {
|
display: flex;
|
align-items: center;
|
text {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #666666;
|
margin-top: 12rpx;
|
}
|
}
|
}
|
image {
|
flex-shrink: 0;
|
width: 56rpx;
|
height: 64rpx;
|
}
|
}
|
.x {
|
width: 2rpx;
|
height: 100%;
|
margin: 0 44rpx;
|
background-color: #FAFAFA;
|
}
|
.bean_bg_box_right {
|
flex: 1.5;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.bean_bg_box_item_left {
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
text {
|
&:nth-child(1) {
|
font-size: 36rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
}
|
&:nth-child(2) {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #666666;
|
margin-top: 12rpx;
|
text {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #D20A0A;
|
}
|
}
|
}
|
}
|
image {
|
flex-shrink: 0;
|
width: 56rpx;
|
height: 64rpx;
|
}
|
}
|
}
|
}
|
.bean_box {
|
width: 100%;
|
padding: 0 32rpx;
|
margin-bottom: 28rpx;
|
box-sizing: border-box;
|
.sign_date_rw {
|
width: 100%;
|
padding: 32rpx 28rpx;
|
box-sizing: border-box;
|
background-color: #FFFFFF;
|
box-shadow: 0rpx 8rpx 12rpx 0rpx rgba(0,0,0,0.02);
|
border-radius: 12rpx;
|
margin-top: 18rpx;
|
.title {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
text {
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
}
|
.title_right {
|
display: flex;
|
align-items: center;
|
text {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #999999;
|
}
|
}
|
}
|
.list {
|
display: flex;
|
flex-direction: column;
|
margin-top: 18rpx;
|
.list_item {
|
width: 100%;
|
height: 132rpx;
|
border-bottom: 2rpx solid #F4F5F4;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.list_item_left {
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
.top {
|
display: flex;
|
align-items: center;
|
text {
|
&:nth-child(1) {
|
font-size: 28rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #333333;
|
}
|
&:nth-child(2) {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #999999;
|
}
|
}
|
}
|
text {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #999999;
|
margin-top: 20rpx;
|
}
|
}
|
.list_item_submit {
|
flex-shrink: 0;
|
width: 128rpx;
|
height: 48rpx;
|
line-height: 48rpx;
|
text-align: center;
|
background: linear-gradient(90deg, #D95A5A 0%, #D20A0A 100%);
|
border-radius: 30rpx;
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #FFFFFF;
|
}
|
}
|
}
|
.open {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
margin-top: 28rpx;
|
text {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #999999;
|
}
|
}
|
}
|
}
|
.find_box_search_cate {
|
width: 100%;
|
height: 88rpx;
|
padding: 0 32rpx;
|
box-sizing: border-box;
|
display: flex;
|
align-items: center;
|
margin-bottom: 24rpx;
|
position: sticky;
|
left: 0;
|
.find_box_search_cate_item {
|
display: flex;
|
align-items: center;
|
flex-direction: column;
|
margin-right: 38rpx;
|
text {
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #666666;
|
}
|
.activeColor {
|
font-size: 32rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #333333;
|
}
|
.active {
|
width: 40rpx;
|
height: 4rpx;
|
background: #D20A0A;
|
border-radius: 12rpx;
|
margin-top: 8rpx;
|
}
|
}
|
}
|
.bean_list {
|
width: 100%;
|
padding: 0 32rpx;
|
box-sizing: border-box;
|
display: flex;
|
align-items: center;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
.fun_list_item {
|
width: 332rpx;
|
height: 590rpx;
|
border-radius: 20rpx;
|
background-color: white;
|
overflow: hidden;
|
margin-bottom: 16rpx;
|
.fun_list_item_img {
|
width: 100%;
|
height: 420rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
overflow: hidden;
|
image {
|
height: 100%;
|
}
|
}
|
.fun_list_item_info {
|
width: 100%;
|
padding: 16rpx 12rpx 24rpx 12rpx;
|
box-sizing: border-box;
|
display: flex;
|
flex-direction: column;
|
.fun_list_item_info_top {
|
width: 100%;
|
-webkit-line-clamp: 2;
|
display: -webkit-box;
|
-webkit-box-orient: vertical;
|
text-overflow: ellipsis;
|
overflow: hidden;
|
text {
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #333333;
|
}
|
}
|
.fun_list_item_info_bottom {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-top: 15rpx;
|
.fun_list_item_info_bottom_left {
|
display: flex;
|
align-items: flex-end;
|
// image {
|
// width: 32rpx;
|
// height: 32rpx;
|
// border-radius: 50%;
|
// margin-right: 6rpx;
|
// }
|
text {
|
&:nth-child(1) {
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #D20A0A;
|
}
|
&:nth-child(2) {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #D20A0A;
|
}
|
}
|
}
|
.fun_list_item_info_bottom_right {
|
display: flex;
|
align-items: center;
|
// image {
|
// width: 24rpx;
|
// height: 24rpx;
|
// margin-right: 6rpx;
|
// }
|
text {
|
font-size: 24rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #999999;
|
}
|
}
|
}
|
}
|
}
|
}
|
.bean_yh {
|
width: 100%;
|
padding: 0 28rpx;
|
box-sizing: border-box;
|
.bean_yh_list {
|
width: 100%;
|
padding: 28rpx;
|
box-sizing: border-box;
|
background: #FFFFFF;
|
border-radius: 12rpx;
|
display: flex;
|
flex-direction: column;
|
.bean_yh_list_item {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-bottom: 40rpx;
|
&:last-child {
|
margin-bottom: 0 !important;
|
}
|
.bean_yh_list_item_left {
|
flex: 1;
|
height: 144rpx;
|
display: flex;
|
align-items: center;
|
.price {
|
flex-shrink: 0;
|
width: 152rpx;
|
height: 144rpx;
|
padding: 12rpx 0;
|
margin-right: 20rpx;
|
box-sizing: border-box;
|
background: rgba(217,217,217,0.4);
|
border-radius: 16rpx;
|
position: relative;
|
display: flex;
|
align-items: center;
|
flex-direction: column;
|
justify-content: space-between;
|
.left {
|
position: absolute;
|
top: 80rpx;
|
left: -10rpx;
|
width: 20rpx;
|
height: 20rpx;
|
background-color: #FFFFFF;
|
border-radius: 50%;
|
}
|
.right {
|
position: absolute;
|
top: 80rpx;
|
right: -10rpx;
|
width: 20rpx;
|
height: 20rpx;
|
background-color: #FFFFFF;
|
border-radius: 50%;
|
}
|
.top {
|
display: flex;
|
text {
|
&:nth-child(1) {
|
font-size: 32rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #D20A0A;
|
margin-top: 30rpx;
|
}
|
&:nth-child(2) {
|
font-size: 68rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #D20A0A;
|
}
|
}
|
}
|
.bottom {
|
font-size: 20rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #D20A0A;
|
}
|
}
|
.info {
|
flex: 1;
|
display: flex;
|
height: 100%;
|
flex-direction: column;
|
justify-content: space-between;
|
.info_a {
|
font-size: 32rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #333333;
|
}
|
.info_b {
|
display: flex;
|
align-items: center;
|
.info_b_item {
|
font-size: 24rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #FFFFFF;
|
padding: 8rpx 6rpx;
|
background: #D9D9D9;
|
border-radius: 8rpx;
|
}
|
}
|
.info_c {
|
font-size: 24rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #D9D9D9;
|
}
|
}
|
}
|
.disable {
|
background: #D9D9D9 !important;
|
}
|
.bean_yh_list_item_btn {
|
flex-shrink: 0;
|
width: 144rpx;
|
height: 52rpx;
|
line-height: 52rpx;
|
text-align: center;
|
font-size: 28rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #FFFFFF;
|
background: #D20A0A;
|
border-radius: 30rpx;
|
}
|
}
|
}
|
}
|
.popup {
|
width: 554rpx;
|
padding: 44rpx 32rpx;
|
box-sizing: border-box;
|
background-color: #ffffff;
|
border-radius: 32rpx;
|
.popup_title {
|
width: 100%;
|
text-align: center;
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
}
|
.popup_ipt {
|
padding: 20rpx 0;
|
box-sizing: border-box;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
margin-top: 40rpx;
|
border-bottom: 2rpx solid #F4F5F4;
|
text {
|
font-size: 28rpx;
|
font-family: PingFang SC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #333333;
|
}
|
}
|
.popup_footer {
|
margin-top: 56rpx;
|
display: flex;
|
align-items: center;
|
justify-content: space-around;
|
.popup_footer_close {
|
width: 184rpx;
|
height: 64rpx;
|
line-height: 64rpx;
|
text-align: center;
|
border-radius: 56rpx;
|
border: 2rpx solid #D20A0A;
|
font-size: 28rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #D20A0A;
|
}
|
.popup_footer_save {
|
width: 184rpx;
|
height: 64rpx;
|
height: 64rpx;
|
line-height: 64rpx;
|
text-align: center;
|
background: linear-gradient(90deg, #D95A5A 0%, #D20A0A 100%);
|
border-radius: 56rpx;
|
font-size: 28rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #FFFFFF;
|
}
|
}
|
}
|
}
|
</style>
|