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

201 lines
4.8 KiB
Vue
Raw Normal View History

2023-05-17 15:25:16 +08:00
<template>
<view class="box">
<view class="box-phone">
<u--form :model="form" :rules="rules" ref="uForm" labelWidth="100">
<u-form-item label="手机号" prop="phone">
<u--input v-model="form.phone" maxlength="11" placeholder="请输入您的手机号"></u--input>
</u-form-item>
<u-form-item label="手机号" prop="phone">
<u--input v-model="form.phone" maxlength="11" placeholder="请再次确认您的手机号"></u--input>
</u-form-item>
</u--form>
</view>
<view class="box-member">
<view class="member-item" v-for="(item,index) in 3" :key="index">
<view class="member-image">
<image src='../../static/images/f.png'></image>
</view>
<view class="member-text">
<text class="text-title">办理240得<text style="color: red;">360</text></text>
<text class="text-content">办理档次240可享连续12个月每个月返利30元</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>
<button class="box-submit" @click="submit"></button>
</view>
</template>
<script>
export default {
name: "member_application",
data() {
return {
form: {
phone:''
},
rules: {
phone: [
{
required: true,
message: '手机号不能为空',
// 触发器可以同时用blur和change
trigger: ['change', 'blur']
},
{
pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[1-25-9])\d{8}$/g,
// 正则检验前先将值转为字符串
transform(value) {
return String(value);
},
message: '手机号不正确190.193号段不可充值)',
trigger: ['change', 'blur']
},
]
}
};
},
mounted() {
},
onLoad() {
},
methods: {
submit() {
this.$refs.uForm.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
}
}
};
</script>
<style lang="scss" scoped>
.box {
// position: relative;
padding: 0 24rpx;
.box-phone {
.u-form-item{
margin-bottom: 20rpx;
}
::v-deep .u-form-item__body {
height: 100rpx;
border-radius: 20rpx;
padding: 0 30rpx;
background: #fff;
margin-bottom: 10rpx;
}
}
.box-member {
border-radius: 20rpx;
width: 100%;
margin-top: 40%;
padding: 100rpx 20rpx 30rpx 20rpx;
// position: absolute;
// top: 20%;
// left: 0;
background: rgb(255, 210, 91);
.member-item {
display: flex;
justify-content: space-between;
background: #fff;
margin-bottom: 20rpx;
padding: 30rpx;
border-radius: 20rpx;
.member-image {
width: 120rpx;
height: 120rpx;
border-radius: 34rpx;
background: red;
padding: 20rpx;
image {
width: 100%;
height: 100%;
}
}
.member-text {
display: flex;
flex-direction: column;
justify-content: space-between;
flex: .9;
.text-title {
margin-top: -16rpx;
font-size: 40rpx;
font-weight: bolder;
transform: skew(-6deg, 0);
}
.text-content {
font-size: 24rpx;
color: #aaa;
}
}
}
}
.box-privilege {
border-radius: 20rpx;
width: 100%;
margin-top: 10%;
padding: 100rpx 10rpx 30rpx 10rpx;
background: rgb(255, 210, 91);
display: flex;
flex: 1;
.privilege-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
background: #fff;
padding: 30rpx 20rpx;
border-radius: 20rpx;
margin: 10rpx;
image {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
margin-bottom: 10rpx;
}
.privilege-text {
line-height: 36rpx;
text-align: center;
font-size: 24rpx;
}
}
}
.box-submit {
margin-top: 10%;
margin-bottom: 6%;
display: flex;
justify-content: center;
align-items: center;
height: 90rpx;
border-radius: 60rpx;
background: royalblue;
color: #fff;
}
}
</style>