Commit 4262a513 by 匡雅琴

页面样式

1 parent 02645b96
......@@ -10,8 +10,9 @@ Page({
accountForm: {
applyName: '',
telphone: '',
enterpriseName: '',
concerContent: ''
concerContent: '',
bussinessName: '',
province: []
}
},
......@@ -19,32 +20,69 @@ Page({
// 表单验证规则
initValidate() {
const rules = {
nickName: {
required: true,
minlength: 2
}
applyName: {
required: true
},
telphone: {
required: true
},
bussinessName: {
required: true
},
province: {
required: true
}
}
const messages = {
nickName: {
required: '请填写姓名',
minlength: '请输入正确的名称'
}
const messages = {
applyName: {
required: '请填写申请人名称',
},
telphone: {
required: '请填写联系电话'
},
bussinessName: {
required: '请填写企业/门店名称'
},
province: {
required: '请选择省市'
}
}
this.WxValidate = new WxValidate(rules, messages)
},
//报错
showModal(error) {
wx.showModal({
content: error.msg,
showCancel: false,
})
},
// 提交表单
submitAccount(e) {
console.log(e);
const params = e.detail.value
// 校验表单
if(!this.WxValidate.checkForm(params)) {
const error = this.WxValidate.errorList[0]
this.showModal(error)
return false
}
this.showModal({
msg: '提交成功'
})
},
// 选择省市
bindRegionChange(e) {
console.log(e.detail.value);
this.setData({
"accountForm.province": e.detail.value
})
},
/**
* 生命周期函数--监听页面加载
*/
......
<!--pages/applicationAccount/applicationAccount.wxml-->
<view class="apply-account">
<view>
top
</view>
<view>
</view>
<view class="contact-inline">
</view>
<view class="apply-top">
<image class="apply-background" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/apply-background.png" bindload="imgSuccess" data-name="logo"></image>
<view class="apply-title">免费申请体验账号</view>
<button class="add-btn" plain="true">
<image class="apply-code" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/OR-code.png" bindload="imgSuccess" data-name="logo"></image>
添加体验专员
</button>
</view>
<form class="apply-box" bindsubmit="submitAccount">
<view class="apply-info">
<view class='info-list'>
<text class="info-lable">申请人<text class="require"> *</text></text>
<input name="applyName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的姓名' value="{{parternerForm.applyName}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">联系电话<text class="require"> *</text></text>
<input name="telphone" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的联系电话' value="{{parternerForm.telphone}}"></input>
</view>
<picker mode="region" value="{{accountForm.province}}" bindchange="bindRegionChange">
<view class='info-list'>
<text class="info-lable">所在省市<text class="require"> *</text></text>
<block wx:if="{{!accountForm.province.length}}">
<view class="province-placeholder">请选择</view>
</block>
<block wx:else>
<view>{{accountForm.province}}</view>
</block>
</view>
</picker>
<view class='info-list'>
<text class="info-lable">企业名称<text class="require"> *</text></text>
<input name="bussinessName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的企业/门店名称' value="{{parternerForm.bussinessName}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">关注内容</text>
<textarea name="concerContent" class="concer-content" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您关注的内容(选填)' maxlength="200" value="{{parternerForm.concerContent}}"></textarea>
</view>
</view>
<button class="submit-btn" form-type="submit">
提交申请
</button>
</form>
<view class="contact-inline">
</view>
</view>
......@@ -3,6 +3,112 @@
position: relative;
}
.apply-top {
position: relative;
text-align: center;
}
.apply-background {
width: 100%;
}
.apply-title {
font-family: AlibabaPuHuiTiB;
font-weight: 600;
font-size: 56rpx;
color: #2D2D33;
position: absolute;
top: 128rpx;
left: 182rpx;
}
.apply-code {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
}
.add-btn {
width: 260rpx;
height: 72rpx;
border: 2rpx solid #5850FF !important;
border-radius: 8rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #5850FF !important;
padding-left: 14rpx;
padding-right: 14rpx;
position: absolute;
top: 252rpx;
left: 244rpx;
}
.apply-box {
width: 702rpx;
height: 864rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 rgba(202,211,230,0.40);
border-radius: 12rpx;
margin: 0 auto;
margin-bottom: 30rpx;
position: absolute;
top: 420rpx;
left: 24rpx;
}
.apply-info {
padding: 0 32rpx;
}
.info-list {
background: #fff;
display: flex;
align-content: center;
padding: 36rpx 0;
border-bottom: 1rpx solid #eee;
}
.info-lable {
width: 176rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #2D2D33;
}
.require {
color: #EB4E4E;
}
.concer-content {
height: 170rpx;
overflow: auto;
}
textarea {
width: 475rpx !important;
}
.province-placeholder {
font-size:28rpx;
color: #9E9EA8;
}
.submit-btn {
width: 622rpx;
height: 80rpx;
background: #5850FF;
border-radius: 8rpx;
margin-top: 40rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
font-family: PingFangSC-Medium;
line-height: 80rpx;
}
.contact-inline {
width: 50rpx;
height: 50rpx;
......
// pages/applicationPartener/applicationPartener.js
import WxValidate from "../../utils/WxValidate"
Page({
/**
* 页面的初始数据
*/
data: {
parternerForm: {
applyName: '',
telphone: '',
concerContent: ''
}
},
// 表单验证规则
initValidate() {
const rules = {
applyName: {
required: true
},
telphone: {
required: true
}
}
const messages = {
applyName: {
required: '请填写申请人名称',
},
telphone: {
required: '请填写联系电话'
}
}
this.WxValidate = new WxValidate(rules, messages)
},
//报错
showModal(error) {
wx.showModal({
content: error.msg,
showCancel: false,
})
},
// 提交表单
submitParterner(e) {
console.log(e);
const params = e.detail.value
// 校验表单
if(!this.WxValidate.checkForm(params)) {
const error = this.WxValidate.errorList[0]
this.showModal(error)
return false
}
this.showModal({
msg: '提交成功'
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// 初始化验证规则函数
this.initValidate()
},
/**
......
<!--pages/applicationPartener/applicationPartener.wxml-->
<view class="apply-partener">
<view>
top
</view>
<view>
</view>
<view class="contact-inline">
</view>
</view>
<view class="apply-top">
<image class="apply-background" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/apply-background.png" bindload="imgSuccess" data-name="logo"></image>
<view class="apply-title">申请城市合伙人</view>
<button class="add-btn" plain="true">
<image class="apply-code" mode="widthFix" webp src="https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/home/OR-code.png" bindload="imgSuccess" data-name="logo"></image>
添加合伙人专员
</button>
</view>
<form class="apply-box" bindsubmit="submitParterner">
<view class="apply-info">
<view class='info-list'>
<text class="info-lable">申请人<text class="require"> *</text></text>
<input name="applyName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的姓名' value="{{parternerForm.applyName}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">联系电话<text class="require"> *</text></text>
<input name="telphone" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您的联系电话' value="{{parternerForm.telphone}}"></input>
</view>
<view class='info-list'>
<text class="info-lable">关注内容</text>
<textarea name="concerContent" class="concer-content" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='您关注的内容(选填)' maxlength="200" value="{{parternerForm.concerContent}}"></textarea>
</view>
</view>
<button class="submit-btn" form-type="submit">
提交申请
</button>
</form>
<view class="contact-inline">
</view>
</view>
\ No newline at end of file
......@@ -3,6 +3,107 @@
position: relative;
}
.apply-top {
position: relative;
text-align: center;
}
.apply-background {
width: 100%;
}
.apply-title {
font-family: AlibabaPuHuiTiB;
font-weight: 600;
font-size: 56rpx;
color: #2D2D33;
position: absolute;
top: 128rpx;
left: 182rpx;
}
.apply-code {
width: 28rpx;
height: 28rpx;
vertical-align: middle;
}
.add-btn {
width: 284rpx;
height: 72rpx;
border: 2rpx solid #5850FF !important;
border-radius: 8rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #5850FF !important;
padding-left: 14rpx;
padding-right: 14rpx;
position: absolute;
top: 252rpx;
left: 232rpx;
}
.apply-box {
width: 702rpx;
height: 640rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 rgba(202,211,230,0.40);
border-radius: 12rpx;
margin: 0 auto;
margin-bottom: 30rpx;
position: absolute;
top: 420rpx;
left: 24rpx;
}
.apply-info {
padding: 0 32rpx;
}
.info-list {
background: #fff;
display: flex;
align-content: center;
padding: 36rpx 0;
border-bottom: 1rpx solid #eee;
}
.info-lable {
width: 176rpx;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 28rpx;
color: #2D2D33;
}
.require {
color: #EB4E4E;
}
.concer-content {
height: 170rpx;
overflow: auto;
}
textarea {
width: 475rpx !important;
}
.submit-btn {
width: 622rpx;
height: 80rpx;
background: #5850FF;
border-radius: 8rpx;
margin-top: 40rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
font-weight: 500;
font-family: PingFangSC-Medium;
line-height: 80rpx;
}
.contact-inline {
width: 50rpx;
height: 50rpx;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!