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

313 lines
7.4 KiB
Vue
Raw Normal View History

2023-05-16 18:22:32 +08:00
<template>
<view class="box">
<view class="box-member">
2023-05-18 18:03:06 +08:00
<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)">
2023-05-16 18:22:32 +08:00
<view class="member-image">
<image src='../../static/images/f.png'></image>
</view>
<view class="member-text">
2023-05-18 18:03:06 +08:00
<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>
2023-05-16 18:22:32 +08:00
</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>
2023-05-17 16:28:31 +08:00
<paymentMember :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :payInfo="payInfo"></paymentMember>
2023-05-17 15:25:16 +08:00
<button class="box-submit" @click="goPay"></button>
2023-05-16 18:22:32 +08:00
</view>
</template>
<script>
2023-05-17 15:25:16 +08:00
import {
memberGradeInfo
} from '@/api/member.js';
2023-05-17 16:28:31 +08:00
import paymentMember from '@/components/paymentMember';
2023-05-18 18:03:06 +08:00
import store from '@/store/index';
2023-05-16 18:22:32 +08:00
export default {
name: "member_application",
2023-05-17 15:25:16 +08:00
components: {
2023-05-17 16:28:31 +08:00
paymentMember
2023-05-17 15:25:16 +08:00
},
2023-05-16 18:22:32 +08:00
data() {
return {
2023-05-18 18:03:06 +08:00
memberData:[],
2023-05-17 16:28:31 +08:00
payInfo:{
userPhone: '',
confirmPhone: '',
orderInfos: []
},
2023-05-17 15:25:16 +08:00
payMode: [{
name: "微信支付",
icon: "icon-weixinzhifu",
2023-05-17 16:28:31 +08:00
value: 'WXPAY',
2023-05-17 15:25:16 +08:00
title: '微信快捷支付'
},
{
2023-05-17 16:28:31 +08:00
name: "支付宝",
icon: "icon-zhifubao",
value: 'ALIPAY',
title: '支付宝快捷支付'
2023-05-17 15:25:16 +08:00
}
],
pay_close: false,
2023-05-18 18:03:06 +08:00
activeIndex:[],
form: {
phone:''
},
2023-05-16 18:22:32 +08:00
2023-05-18 18:03:06 +08:00
};
2023-05-16 18:22:32 +08:00
},
2023-05-17 15:25:16 +08:00
async onLoad() {
const res = await memberGradeInfo()
2023-05-18 18:03:06 +08:00
this.memberData = res.data
2023-05-16 18:22:32 +08:00
},
methods: {
2023-05-18 18:03:06 +08:00
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)
}
},
2023-05-17 15:25:16 +08:00
/**
* 打开支付组件
*
*/
2023-05-17 16:28:31 +08:00
goPay() {
2023-05-18 18:03:06 +08:00
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
}
})
2023-05-17 16:28:31 +08:00
this.payInfo = {
2023-05-18 18:03:06 +08:00
userPhone: store.state.app.userInfo.mobile,
orderInfos
2023-05-17 16:28:31 +08:00
}
2023-05-18 18:03:06 +08:00
}
2023-05-17 15:25:16 +08:00
},
2023-05-17 16:28:31 +08:00
/**
2023-05-17 15:25:16 +08:00
* 事件回调
*
*/
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);
},
2023-05-16 18:22:32 +08:00
}
};
</script>
<style lang="scss" scoped>
.box {
2023-05-18 18:03:06 +08:00
padding: 0 40rpx;
2023-05-16 18:22:32 +08:00
.box-member {
border-radius: 20rpx;
width: 100%;
2023-05-18 18:03:06 +08:00
margin-top: 207rpx;
padding: 83rpx 30rpx 30rpx 30rpx;
background: linear-gradient(#FFD55D,#FD752F);
2023-05-16 18:22:32 +08:00
.member-item {
display: flex;
justify-content: space-between;
background: #fff;
margin-bottom: 20rpx;
2023-05-18 18:03:06 +08:00
padding: 30rpx 20rpx 27rpx 20rpx;
2023-05-16 18:22:32 +08:00
border-radius: 20rpx;
.member-image {
2023-05-18 18:03:06 +08:00
width: 104rpx;
height: 104rpx;
border-radius: 35rpx;
background: linear-gradient(#FFEBB2,#FDCB3B);
2023-05-16 18:22:32 +08:00
padding: 20rpx;
image {
width: 100%;
height: 100%;
}
}
.member-text {
display: flex;
flex-direction: column;
justify-content: space-between;
flex: .9;
.text-title {
2023-05-18 18:03:06 +08:00
margin-top: -14rpx;
font-size: 32rpx;
2023-05-16 18:22:32 +08:00
font-weight: bolder;
transform: skew(-6deg, 0);
2023-05-18 18:03:06 +08:00
display: flex;
justify-content: space-between;
text{
text{
color: #C80D00;
}
}
view{
width: 18rpx;
height: 6rpx;
background: #FEAC49;
border-radius: 3rpx;
}
2023-05-16 18:22:32 +08:00
}
.text-content {
font-size: 24rpx;
2023-05-18 18:03:06 +08:00
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;
2023-05-16 18:22:32 +08:00
}
}
}
}
.box-privilege {
2023-05-18 18:03:06 +08:00
border-radius: 36rpx;
2023-05-16 18:22:32 +08:00
width: 100%;
2023-05-18 18:03:06 +08:00
margin-top: 44rpx;
padding: 84rpx 10rpx 40rpx 10rpx;
background: linear-gradient(#FFD55D,#FD7630);
2023-05-16 18:22:32 +08:00
display: flex;
flex: 1;
.privilege-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
background: #fff;
2023-05-18 18:03:06 +08:00
padding: 16rpx 16rpx;
2023-05-16 18:22:32 +08:00
border-radius: 20rpx;
2023-05-18 18:03:06 +08:00
margin: 0 10rpx;
2023-05-16 18:22:32 +08:00
image {
2023-05-18 18:03:06 +08:00
width: 87rpx;
height: 87rpx;
2023-05-16 18:22:32 +08:00
border-radius: 50%;
2023-05-18 18:03:06 +08:00
margin-bottom: 15rpx;
2023-05-16 18:22:32 +08:00
}
.privilege-text {
2023-05-18 18:03:06 +08:00
color: #000000;
2023-05-16 18:22:32 +08:00
line-height: 36rpx;
text-align: center;
2023-05-18 18:03:06 +08:00
font-size: 26rpx;
2023-05-16 18:22:32 +08:00
}
}
}
.box-submit {
2023-05-18 18:03:06 +08:00
background: linear-gradient(#FFC82B,#FD7A32);
margin-top: 127rpx;
margin-bottom: 75rpx;
2023-05-16 18:22:32 +08:00
display: flex;
justify-content: center;
align-items: center;
2023-05-18 18:03:06 +08:00
height: 87rpx;
border-radius: 44rpx;
2023-05-16 18:22:32 +08:00
color: #fff;
2023-05-18 18:03:06 +08:00
font-size: 32rpx;
2023-05-16 18:22:32 +08:00
}
}
</style>