Commit 8d4cdedf by zhangzhen

页面完善

parent 9e44c986
......@@ -15,49 +15,106 @@
<text>会员超值购</text>
</view>
<view class="line">
</view>
</view>
<view class="xx">
<image :src="assetsPath+'/xx.png'" mode="widthFix"></image>
</view>
</view>
<view class="flex-between">
<view class="part-left">
<text>充值会员</text>
<view class="flex-between action-box-list">
<view class="part part-left" @tap="onTabChange(1)">
<image v-if="tabIndex ==1" :src="assetsPath+'/vip/btn_2_a.png'" class="active"
mode="widthFix"></image>
<image v-else :src="assetsPath+'/vip/btn_2.png'" class="unactive" mode="widthFix"></image>
</view>
<view class="part-right">
<text>权益会员</text>
<view class="part part-right" @tap="onTabChange(2)">
<image v-if="tabIndex ==2" :src="assetsPath+'/vip/btn_1_a.png'" class="active"
mode="widthFix"></image>
<image v-else :src="assetsPath+'/vip/btn_1.png'" class="unactive" mode="widthFix"></image>
</view>
</view>
<view class="list-box">
<view v-if="tabIndex ==1" class="list-box">
<view v-for="(item,k) in rechargeConfList" :key="k" class="flex-col item">
<view v-if="item.giveType.includes('1')" class="">
<text>{{item.giveAmount}}小时</text>
</view>
<view v-else-if="item.giveType.includes('2')" class="">
<text>{{item.giveDuration}}小时</text>
</view>
<view class="line">
<image class="amount-bg" :src="assetsPath+'/vip/amount_bg.png'" mode="widthFix"></image>
<view class="flex-col item-content">
<view v-if="item.giveType.includes('1')" class="preferential">
<text>{{item.giveAmount}}小时</text>
</view>
<view v-else-if="item.giveType.includes('2')" class="preferential">
<text>{{item.giveDuration}}小时</text>
</view>
<view class="line"></view>
<view class="flex-col part-bottom">
<view class="part-amount">
<view class="flex-row amount">
<text class="symbol"></text>
<text class="num">1000</text>
<!-- <text class="num">{{item.rechargeAmount}}</text> -->
</view>
</view>
<view class="tip-text">
<text>充值送时长,多充多送</text>
</view>
</view>
</view>
<view class="flex-row">
<text></text><text>{{item.rechargeAmount}}</text>
</view>
</view>
<view v-if="tabIndex ==2" class="flex-col list-box-2">
<view class="flex-row part-1">
<view class="text-bg-1">
<text>特惠</text>
</view>
<view class="tip-text">
<text>充值送时长,多充多送</text>
<text class="text-2">独享专属福利!</text>
<text class="text-3">(更多充值方案,供您选择)</text>
</view>
<view class="part-2">
<image class="img-bg" :src="assetsPath+'/vip/qy_bg_1.png'" mode="widthFix"></image>
<view class="absolute">
<view class="flex-5">
<view class="flex-row">
<text class="text-1">权益</text>
<text class="text-2">会员 优惠享不停</text>
</view>
<text class="text-3">有效期:领取后1年内有效</text>
</view>
<view class="flex-3">
<view class="flex-row">
<text class="text-1"></text>
<text class="text-2">99.</text>
<text class="text-3">00</text>
</view>
<view class="cu-btn-box">
<button class="cu-btn">立即开通</button>
</view>
</view>
</view>
</view>
<view class="rule-tip">
<checkbox-group @change="onRuleTipChange">
<checkbox class='round yellow' :class="checked?'checked':''" :checked="checked" value="checked" style="transform: scale(0.6);"></checkbox>
</checkbox-group>
<text>我已阅读</text><text class="text-pink">用户充值协议</text><text>, 并同意协议内容</text>
</view>
</view>
</view>
</view>
<view v-if="tabIndex ==1" class="flex-col">
<button class="cu-btn confirm-btn" @tap="onNavToRecharge">
<text>立即充值</text>
</button>
<view class="rule-tip">
<checkbox-group @change="onRuleTipChange">
<checkbox class='round yellow' :class="checked?'checked':''" :checked="checked" value="checked" style="transform: scale(0.6);"></checkbox>
</checkbox-group>
<text>我已阅读</text><text class="text-pink">用户充值协议</text><text>, 并同意协议内容</text>
</view>
</view>
</view>
<f-tabbar></f-tabbar>
</view>
......@@ -65,19 +122,27 @@
<script>
import fTabbar from '@/components/module/f-tabbar/f-tabbar';
import {equityMembersList,createEquityMembers} from "@/api/uerInfo.js";
import {rechargeConf,createRecharge} from "@/api/recharge.js";
import {
equityMembersList,
createEquityMembers
} from "@/api/uerInfo.js";
import {
rechargeConf,
createRecharge
} from "@/api/recharge.js";
import config from "@/config/index.config";
export default {
components: {
fTabbar
fTabbar
},
data() {
return {
checked: false,
assetsPath: config.assetsPath,
list:[],
rechargeConfList:[],
list: [],
rechargeConfList: [],
tabIndex: 1,
index: 0
};
},
......@@ -86,34 +151,52 @@
this.onGetRechargeConf();
this.onLoading();
},
methods:{
onLoading(){
methods: {
onRuleTipChange(e){
console.log(e,99999)
this.checked = e.detail.value.includes("checked")
},
onNavToRecharge(){
console.log(this.checked,9999);
if(!this.checked){
uni.showToast({
icon:"none",
title:"请先阅读充值协议并同意"
})
return;
}
},
onLoading() {
equityMembersList().then(res => {
console.log(res,999999)
if(res.data.code == 200 && res.data.rows){
console.log(res, 999999)
if (res.data.code == 200 && res.data.rows) {
this.list = res.data.rows
}
})
},
onGetRechargeConf(){
rechargeConf().then(res =>{
if(res.data.code == 200 && res.data.rows){
this.rechargeConfList = res.data.rows.map(item=>{
onGetRechargeConf() {
rechargeConf().then(res => {
if (res.data.code == 200 && res.data.rows) {
this.rechargeConfList = res.data.rows.map(item => {
return {
...item,
giveType: item.giveType?item.giveType.split(","):[]
giveType: item.giveType ? item.giveType.split(",") : []
}
})
console.log(this.rechargeConfList,9999)
console.log(this.rechargeConfList, 9999)
}
})
},
onSubmit(){
onTabChange(val) {
if (this.tabIndex == val) return;
this.tabIndex = val;
},
onSubmit() {
createEquityMembers({
payType:1,
equityMembersConfigId:this.list[this.index].id
}).then(res =>{
console.log(res,9999)
payType: 1,
equityMembersConfigId: this.list[this.index].id
}).then(res => {
console.log(res, 9999)
if (res.data.data.jsConfig) {
wx.requestPayment({
"timeStamp": res.data.data.jsConfig.timeStamp,
......@@ -142,15 +225,15 @@
}
});
}
})
},
onSubmit2(){
onSubmit2() {
createRecharge({
payType:1,
rechargeConfId:this.rechargeConfList[0].id
}).then(res =>{
console.log(res,9999)
payType: 1,
rechargeConfId: this.rechargeConfList[0].id
}).then(res => {
console.log(res, 9999)
if (res.data.data.jsConfig) {
wx.requestPayment({
"timeStamp": res.data.data.jsConfig.timeStamp,
......@@ -164,7 +247,7 @@
icon: "success",
title: "下单成功",
success: () => {
}
})
},
......@@ -179,7 +262,7 @@
}
});
}
})
}
}
......@@ -187,114 +270,399 @@
</script>
<style lang="scss" scoped>
.vip-create{
display: flex;
flex-direction: column;
width: 100%;
min-height: 100vh;
justify-content: center;
.bg-header{
display: block;
image{
display: block;
width: 100%;
}
}
.content{
.vip-create {
display: flex;
flex-direction: column;
width: 100%;
background-color: #FFEABF;
min-height: 100vh;
justify-content: center;
padding-bottom: 60upx;
.bg-box-1{
.bg-header {
display: block;
image {
display: block;
width: 100%;
}
}
.content {
display: flex;
justify-content: center;
flex: 1;
flex-direction: column;
width: 100%;
background-color: #FFEABF;
align-items: center;
width: 690upx;
min-height: 596upx;
background: #FFCA7E;
border-radius: 32upx;
padding: 10upx 0;
.bg-box-2{
padding-bottom: 60upx;
.bg-box-1 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
width: 668upx;
background: linear-gradient(-42deg, #FFF5CB, #FFFFFF);
width: 690upx;
min-height: 596upx;
background: #FFCA7E;
border-radius: 32upx;
.title-content{
margin-top: 34upx;
.title-text{
padding: 6px 0;
.bg-box-2 {
display: flex;
flex: 1;
flex-direction: column;
align-items: center;
width: 668upx;
background: linear-gradient(-42deg, #FFF5CB, #FFFFFF);
border-radius: 32upx;
.title-content {
margin-top: 34upx;
.title-text {
display: flex;
justify-content: center;
position: relative;
margin: 0 20upx;
.text {
position: relative;
font-weight: normal;
font-size: 48rpx;
color: #000000;
background: linear-gradient(-90deg, #FF7800 0%, #FF0000 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
z-index: 2;
}
.line {
position: absolute;
bottom: 0;
width: 110%;
height: 15upx;
background: #FFEABF;
border-radius: 8upx;
}
}
.xx {
width: 30upx;
image {
width: 100%;
max-height: 34upx;
}
}
}
}
}
.action-box-list {
display: flex;
justify-content: center;
width: 100%;
margin: 40upx 0 20upx;
.part {
display: flex;
justify-content: center;
width: 48%;
image {
width: 290upx;
height: 116upx;
border-radius: 25upx;
}
.unactive {
border: 1px solid rgba(184, 182, 172, 0.3);
box-shadow: -2upx 10upx 20upx 0upx rgba(162, 68, 3, 0);
}
.active {
border: 1px solid rgba(255, 255, 255, 0.3);
box-shadow: -2upx 10upx 20upx 0upx rgba(162, 68, 3, 0.52);
}
}
}
.list-box {
display: flex;
flex: 1;
width: 100%;
padding: 0 1%;
justify-content: center;
align-items: center;
.item {
position: relative;
display: flex;
align-items: center;
width: 30%;
margin: 0 2%;
background: linear-gradient(-39deg, #FFEABF, #FFFFFF);
border-radius: 10rpx 28rpx 28rpx 28rpx;
.amount-bg {
display: block;
width: 100%;
}
.item-content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.line {
width: 80%;
height: 1rpx;
border-bottom: 1px dashed #FA541D;
}
.preferential {
display: flex;
justify-content: center;
position: relative;
margin: 0 20upx;
.text{
position: relative;
align-items: center;
width: 100%;
height: 33%;
text {
font-weight: normal;
font-size: 48rpx;
font-size: 32upx;
color: #000000;
background: linear-gradient(-90deg, #FF7800 0%, #FF0000 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
z-index: 2;
}
.line{
position: absolute;
bottom: 0;
width: 110%;
height: 15upx;
background: #FFEABF;
border-radius: 8upx;
}
.part-bottom {
display: flex;
flex: 1;
flex-direction: column;
width: 100%;
}
.part-amount {
display: flex;
flex: 1;
width: 100%;
align-items: center;
justify-content: center;
}
.amount {
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: center;
.symbol {
font-weight: 400;
font-size: 29upx;
color: #FE3F00;
margin-bottom: 10upx;
}
.num {
font-weight: 400;
font-size: 64upx;
color: #FE3F00;
}
}
.xx{
width: 30upx;
image{
width: 100%;
max-height: 34upx;
.tip-text {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 50upx;
background: linear-gradient(-90deg, #FCD25B, #FA541D);
border-radius: 0 0 23upx 23upx;
text {
font-size: 19upx;
color: #ffffff;
}
}
}
}
}
.list-box{
display: flex;
width: 100%;
padding: 0 1%;
justify-content: center;
.item{
display: flex;
.list-box-2{
width: 100%;
align-items: center;
width: 31%;
margin: 0 1%;
background: linear-gradient(-39deg, #FFEABF, #FFFFFF);
border-radius: 10rpx 28rpx 28rpx 28rpx;
border: 1px solid #FF4D05;
.line{
.part-1{
display: flex;
align-items: center;
width: 90%;
height: 1rpx;
border: 1px solid #FA541D;
margin-top: 24upx;
.text-bg-1{
display: flex;
justify-content: center;
align-items: center;
padding: 0 12upx;
height: 28rpx;
background: linear-gradient(90deg, #FCD25B 0%, #FA541D 100%);
border-radius: 14rpx;
margin-right: 10upx;
text{
font-weight: normal;
font-size: 20rpx;
color: #FFFFFF;
font-style: italic;
}
}
.text-2{
font-weight: normal;
font-size: 32rpx;
color: #FA561E;
font-style: italic;
background: linear-gradient(-90deg, #FF7800 0%, #FF0000 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.text-3{
font-weight: 400;
font-size: 20rpx;
color: #999999;
font-style: italic;
}
}
.part-2{
position: relative;
width: 90%;
margin-top: 24upx;
.img-bg{
display: block;
width: 100%;
}
.absolute{
display: flex;
flex-direction: row;
.flex-5{
display: flex;
flex-direction: column;
justify-content: center;
width: 67%;
height: 100%;
padding-left: 24upx;
.flex-row{
align-items: flex-end;
font-weight: bold;
.text-1{
color: #FE2E2E;
font-size: 42upx;
}
.text-2{
color: #333333;
font-size: 34upx;
margin-bottom: 2upx;
}
}
.text-3{
font-weight: 400;
font-size: 24rpx;
color: #A59079;
margin-top: 12upx;
}
}
.flex-3{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex: 1;
height: 100%;
.flex-row{
align-items: flex-end;
.text-1{
color: #D27E1F;
font-size: 32upx;
margin-bottom: 6upx;
}
.text-2{
color: #D27E1F;
font-size: 56upx;
font-weight: bold;
}
.text-3{
color: #D27E1F;
font-size: 32upx;
margin-bottom: 6upx;
}
}
.cu-btn-box{
margin-top: 10upx;
.cu-btn{
padding: 0 20upx;
height: 40upx;
background: #FA561E;
border-radius: 20upx;
font-size: 24upx;
color: #ffffff;
}
}
}
}
}
.rule-tip{
margin: 24upx 0 20upx;
}
.tip-text{
font-size: 16upx;
}
.confirm-btn {
width: 486upx;
height: 88upx;
background: linear-gradient(-90deg, #FCD25B, #FA541D);
box-shadow: -1upx 8upx 3upx 0upx rgba(250, 142, 2, 0.27), 10rpx 1rpx 26rpx 0rpx rgba(255, 255, 255, 0.32);
border-radius: 44rpx;
margin-top: 30upx;
text {
font-weight: 400;
font-size: 46upx;
color: #FFFFFF;
font-style: italic;
}
}
.rule-tip {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 34upx;
text {
font-weight: normal;
font-size: 24rpx;
color: #777777;
}
.text-pink {
margin: 0 6upx;
font-size: 24rpx;
color: #000000;
background: linear-gradient(-90deg, #FF7800 0%, #FF0000 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
}
}
.footer-box{
position: absolute;
left: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
padding: 30upx;
}
</style>
.footer-box {
position: absolute;
left: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
padding: 30upx;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment