Files
jjx-web/pages/user/components/yaoqing.vue
T
2023-12-07 15:32:59 +08:00

190 lines
3.9 KiB
Vue

<template>
<view class="yaoqing">
<view class="title">邀请新用户免费兑换会员</view>
<view class="p2">
<view class="item">
<view class="text">共邀请<text class="red">7</text>人</view>
<view class="btn">邀请列表</view>
</view>
<view class="item">
<view class="text">我的邀请码</view>
<text class="red">12456</text>
</view>
</view>
<view class="p3">
<view class="item" v-for="item in huiyuan">
<view class="t">{{item.title}}</view>
<view class="b">{{item.subtitle}}</view>
</view>
</view>
<view class="p4">
<view class="wrapper">
<view class="bg" :style="`width: ${p}%;`"></view>
</view>
<view class="tip" :style="`left: ${p}%;`">已邀请7人</view>
</view>
<view class="btns">
<view class="btn">复制邀请码</view>
<view class="btn red" @click="openDuihuan">兑换会员</view>
</view>
<el-dialog
title="请选择要兑换的会员"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<view class="p3">
<view class="item" v-for="(item,index) in huiyuan" :key="index" :class="index == current ? 'active' : ''" @click="onSelect(index)">
<view class="t">{{item.title}}</view>
<view class="b">{{item.subtitle}}</view>
</view>
</view>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确定兑换</el-button>
</span>
</el-dialog>
</view>
</template>
<script>
export default {
data() {
return {
huiyuan:[
{title:'黄金vip LV1',subtitle:'邀请4人可兑换'},
{title:'铂金vip LV1',subtitle:'邀请6人可兑换'},
{title:'钻石vip LV1',subtitle:'邀请9人可兑换'},
],
p:45,
current: 0,
dialogVisible: false
}
},
methods: {
openDuihuan(){
this.dialogVisible = true
},
handleClose(){
this.dialogVisible = false
},
onSelect(index){
this.current = index
}
}
}
</script>
<style scoped lang="scss">
.yaoqing{
padding: 100upx;
background-color: #fff;
.title{
font-size: 50upx;
color: #A92924;
}
.p2{
margin-top: 80upx;
display: flex;
align-items: center;
.item{
display: flex;align-items: center;
font-size: 30upx;
margin-right: 100upx;
text.red{
color: #A92924;
}
.btn{
margin-left:10upx;
padding: 4upx 10upx;
border-radius: 10upx;
color: #fff;
background-color: #ff8100;
font-size: 24upx;
}
}
}
.p3{
margin-top: 80upx;
display: flex;
justify-content: space-around;
.item{
width: 250upx;
height: 180upx;
border-radius: 10upx;
box-shadow: 1px 1px 5px 1px #A92924;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 24upx;
color: #A92924;
.t{
font-size: 30upx;
}
}
.active{
background-color: #A92924;
color: #ffffff;
}
}
.p4{
margin-top: 80upx;
position: relative;
width: 100%;
.wrapper{
position: relative;
height: 30upx;
border-radius: 15upx;
overflow: hidden;
background-color: #ddd;
}
.bg{
position: absolute;
// width: 50%;
height: 100%;
background-color: #A92924;
}
.tip{
position: absolute;
// left: 45%;
top: -15upx;
transform: translateX(-5%);
padding: 0 20upx;
height: 60upx;
line-height: 60upx;
border-radius: 30upx;
background-color: #A92924;
color: #fff;
font-size: 26upx;
}
}
.btns{
margin-top: 80upx;
display: flex;
.btn{
width: 360upx;
height: 80upx;
display: flex;
justify-content: center;
align-items: center;
font-size: 30upx;
border: 1px solid #A92924;
}
.btn.red{
margin-left: 200upx;
color: #fff;
background-color: #A92924;
}
}
}
.dialog-select{
.item{
}
}
</style>