cyywl_server/yudao-ui-app/pages/member_application/index.vue

313 lines
7.4 KiB
Vue

<template>
<view class="box">
<view class="box-member">
<view :class="[activeIndex.includes(index) && 'member-active',!!parseInt(item.isExist) && 'member-disbled', 'member-item']" v-for="(item,index) in memberData" :key="index" @click="handleMember(item,index)">
<view class="member-image">
<image src='../../static/images/f.png'></image>
</view>
<view class="member-text">
<view class="text-title">
<text>{{item.name.split('得')[0]}}<text>得{{item.name.split('得')[1]}}</text></text>
<view></view>
</view>
<text class="text-content">{{item.gearRemarks}}</text>
</view>
</view>
</view>
<view class="box-privilege">
<view class="privilege-item" v-for="(item,index) in 4" :key="index">
<image src='../../static/images/f.png'></image>
<text class="privilege-text">
开通立享大额话费返送。
</text>
</view>
</view>
<paymentMember :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :payInfo="payInfo"></paymentMember>
<button class="box-submit" @click="goPay"></button>
</view>
</template>
<script>
import {
memberGradeInfo
} from '@/api/member.js';
import paymentMember from '@/components/paymentMember';
import store from '@/store/index';
export default {
name: "member_application",
components: {
paymentMember
},
data() {
return {
memberData:[],
payInfo:{
userPhone: '',
confirmPhone: '',
orderInfos: []
},
payMode: [{
name: "微信支付",
icon: "icon-weixinzhifu",
value: 'WXPAY',
title: '微信快捷支付'
},
{
name: "支付宝",
icon: "icon-zhifubao",
value: 'ALIPAY',
title: '支付宝快捷支付'
}
],
pay_close: false,
activeIndex:[],
form: {
phone:''
},
};
},
async onLoad() {
const res = await memberGradeInfo()
this.memberData = res.data
},
methods: {
handleMember(value,index){
if(!!parseInt(value.isExist)) return
if(this.activeIndex.includes(index)){
this.activeIndex = this.activeIndex.filter(item => item !== index)
}else{
this.activeIndex.push(index)
}
},
/**
* 打开支付组件
*
*/
goPay() {
if(this.activeIndex.length){
this.$set(this, 'pay_close', true);
const orderInfos = this.activeIndex.map((item) => {
return {
...this.memberData[item],
gearId:this.memberData[item].id
}
})
this.payInfo = {
userPhone: store.state.app.userInfo.mobile,
orderInfos
}
}
},
/**
* 事件回调
*
*/
onChangeFun: function(e) {
let opt = e;
let action = opt.action || null;
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
/**
* 关闭支付组件
*
*/
payClose: function() {
this.pay_close = false;
},
/**
* 支付成功回调
*
*/
pay_complete: function() {
this.status = false;
this.page = 1;
this.$set(this, 'bargain', []);
this.$set(this, 'pay_close', false);
this.getBargainUserList();
},
/**
* 支付失败回调
*
*/
pay_fail: function() {
this.pay_close = false;
},
onChangeFun: function(e) {
let opt = e;
let action = opt.action || null;
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
}
};
</script>
<style lang="scss" scoped>
.box {
padding: 0 40rpx;
.box-member {
border-radius: 20rpx;
width: 100%;
margin-top: 207rpx;
padding: 83rpx 30rpx 30rpx 30rpx;
background: linear-gradient(#FFD55D,#FD752F);
.member-item {
display: flex;
justify-content: space-between;
background: #fff;
margin-bottom: 20rpx;
padding: 30rpx 20rpx 27rpx 20rpx;
border-radius: 20rpx;
.member-image {
width: 104rpx;
height: 104rpx;
border-radius: 35rpx;
background: linear-gradient(#FFEBB2,#FDCB3B);
padding: 20rpx;
image {
width: 100%;
height: 100%;
}
}
.member-text {
display: flex;
flex-direction: column;
justify-content: space-between;
flex: .9;
.text-title {
margin-top: -14rpx;
font-size: 32rpx;
font-weight: bolder;
transform: skew(-6deg, 0);
display: flex;
justify-content: space-between;
text{
text{
color: #C80D00;
}
}
view{
width: 18rpx;
height: 6rpx;
background: #FEAC49;
border-radius: 3rpx;
}
}
.text-content {
font-size: 24rpx;
color: #747474;
}
}
}
.member-active{
transition: .3s;
background: linear-gradient(#FF995F,#DA0E00);
.member-image {
background: linear-gradient(#FF995F,#DA0E00);
}
.member-text {
.text-title {
text{
color: #fff;
text{
color: rgb(223,208,42);
}
}
view{
background: #fff;
}
}
.text-content {
color: #fff;
}
}
}
.member-disbled{
transition: .3s;
background: linear-gradient(#EFEFEF,#BCBCBC);
.member-image {
background: linear-gradient(#AAAAAA,#989898);
}
.member-text {
.text-title {
text{
color: #868585;
text{
color: #868585;
}
}
view{
background: #fff;
}
}
.text-content {
color: #5C5C5C;
}
}
}
}
.box-privilege {
border-radius: 36rpx;
width: 100%;
margin-top: 44rpx;
padding: 84rpx 10rpx 40rpx 10rpx;
background: linear-gradient(#FFD55D,#FD7630);
display: flex;
flex: 1;
.privilege-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
background: #fff;
padding: 16rpx 16rpx;
border-radius: 20rpx;
margin: 0 10rpx;
image {
width: 87rpx;
height: 87rpx;
border-radius: 50%;
margin-bottom: 15rpx;
}
.privilege-text {
color: #000000;
line-height: 36rpx;
text-align: center;
font-size: 26rpx;
}
}
}
.box-submit {
background: linear-gradient(#FFC82B,#FD7A32);
margin-top: 127rpx;
margin-bottom: 75rpx;
display: flex;
justify-content: center;
align-items: center;
height: 87rpx;
border-radius: 44rpx;
color: #fff;
font-size: 32rpx;
}
}
</style>