19 changed files with 911 additions and 325 deletions
After Width: | Height: | Size: 286 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 47 KiB |
@ -1 +1,16 @@ |
|||||
@import '../../wxss/familyInfo.wxss'; |
@import '../../wxss/familyInfo.wxss'; |
||||
|
|
||||
|
|
||||
|
.editbtn{ |
||||
|
margin:100rpx auto; |
||||
|
width:240rpx; |
||||
|
height:80rpx; |
||||
|
line-height:80rpx; |
||||
|
border-radius:40rpx; |
||||
|
text-align:center; |
||||
|
font-size:32rpx; |
||||
|
font-family:Source Han Serif SC; |
||||
|
font-weight:400; |
||||
|
color:#fff; |
||||
|
background-color: #0399d8; |
||||
|
} |
@ -1 +1,3 @@ |
|||||
@import '../../wxss/family.wxss'; |
@import '../../wxss/family.wxss'; |
||||
|
|
||||
|
@import '../../wxss/c-popForm.wxss'; |
@ -1,2 +1,4 @@ |
|||||
<!--subpages/family/pages/noAccess/noAccess.wxml--> |
<view class="no-family"> |
||||
<text>subpages/family/pages/noAccess/noAccess.wxml</text> |
<image src="../../images/no-family.png" mode="widthFix" /> |
||||
|
<view class="no-btn" bind:tap="handleHome">返回首页</view> |
||||
|
</view> |
@ -1 +1,23 @@ |
|||||
/* subpages/family/pages/noAccess/noAccess.wxss */ |
.no-family { |
||||
|
padding-top: 200rpx; |
||||
|
} |
||||
|
.no-family image { |
||||
|
display: block; |
||||
|
width: 506rpx; |
||||
|
margin: 0 auto; |
||||
|
} |
||||
|
.no-family .no-btn { |
||||
|
width: 220rpx; |
||||
|
height: 66rpx; |
||||
|
margin: 60rpx auto 0; |
||||
|
font-size: 32rpx; |
||||
|
color: #fff; |
||||
|
text-align: center; |
||||
|
line-height: 66rpx; |
||||
|
background-image: linear-gradient(90deg, #ca151d 0%, #e11c13 100%); |
||||
|
border-radius: 30rpx; |
||||
|
-webkit-border-radius: 30rpx; |
||||
|
-moz-border-radius: 30rpx; |
||||
|
-ms-border-radius: 30rpx; |
||||
|
-o-border-radius: 30rpx; |
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
import rules from './rules'; |
||||
|
|
||||
|
/** |
||||
|
* 表单验证 |
||||
|
* |
||||
|
* @param {Object} fmData [表单数据] |
||||
|
* @param {Object} opts [参数] |
||||
|
* @return {Object} [descrsiption] |
||||
|
*/ |
||||
|
export default function(fmData, opts){ |
||||
|
let res = { |
||||
|
valid: true, |
||||
|
error: '', |
||||
|
errors: [], |
||||
|
fields: {} |
||||
|
}; |
||||
|
Object.keys(opts).forEach(key => { |
||||
|
|
||||
|
let value = fmData[key], |
||||
|
item = opts[key], |
||||
|
resItem = { |
||||
|
valid: true, |
||||
|
error: '', |
||||
|
errors: [] |
||||
|
}; |
||||
|
|
||||
|
item.forEach(ruleItem => { |
||||
|
let {rule, message, param} = ruleItem; |
||||
|
if (rules[rule]) { |
||||
|
if (!rules[rule].check(value, param)) { |
||||
|
message = message |
||||
|
? message |
||||
|
: rules[rule].message; |
||||
|
if (res.valid) { |
||||
|
res.valid = false; |
||||
|
res.error = message; |
||||
|
} |
||||
|
if (resItem.valid) { |
||||
|
resItem.valid = false; |
||||
|
resItem.error = message; |
||||
|
} |
||||
|
resItem.errors.push(message); |
||||
|
res.errors.push(message); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
res.fields[key] = resItem; |
||||
|
}); |
||||
|
|
||||
|
return res; |
||||
|
} |
@ -0,0 +1,123 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
/** |
||||
|
* 表单验证规则 |
||||
|
*/ |
||||
|
export default { |
||||
|
required: { |
||||
|
message: '该字段必填', |
||||
|
check(v) { |
||||
|
const type = typeof v; |
||||
|
if (type === 'string') { |
||||
|
return v !== ''; |
||||
|
} else if (type === 'array') { |
||||
|
return v.length > 0; |
||||
|
} else if (type === 'boolean') { |
||||
|
return v; |
||||
|
} else if (type === 'number') { |
||||
|
return true; |
||||
|
return v !== 0; |
||||
|
} else if (type === 'object') { |
||||
|
return v !== null && v !== undefined; |
||||
|
} else { |
||||
|
return true; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 最小
|
||||
|
min: { |
||||
|
message: '超过最小限制', |
||||
|
check(v, param) { |
||||
|
return parseFloat(v) >= parseFloat(param) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
// 最大
|
||||
|
max: { |
||||
|
message: '超过最小限制', |
||||
|
check(v, param) { |
||||
|
return parseFloat(v) <= parseFloat(param) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
//只能数字、字母、下划线组合,下划线不能在开头或结尾
|
||||
|
user: { |
||||
|
message: '只能数字、字母、下划线组合,下划线不能在开头或结尾', |
||||
|
check(v) { |
||||
|
return /^(?!_)(?!.*?_$)(\w)*$/.test(v) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
//身份证号
|
||||
|
idCard: { |
||||
|
message: '', |
||||
|
check(v) { |
||||
|
return /^([1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3})$|^([1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx]))$/.test(v) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
// 手机号
|
||||
|
mobile: { |
||||
|
message: '手机号格式不正确', |
||||
|
check(v) { |
||||
|
return /^1[23456789]{1}[0-9]{9}$/.test(v) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
//url地址
|
||||
|
url: { |
||||
|
message: 'url地址格式不正确', |
||||
|
check(v) { |
||||
|
return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(v) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
//汉字
|
||||
|
chinese: { |
||||
|
message: '仅限汉字', |
||||
|
check(v) { |
||||
|
return /^[\u4e00-\u9fa5]*$/.test(v) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
//数字
|
||||
|
number: { |
||||
|
message: '仅限数字', |
||||
|
check(v) { |
||||
|
return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(v) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
//数字或字母
|
||||
|
alphaNum: { |
||||
|
message: '仅限字母或数字', |
||||
|
check(v) { |
||||
|
return /^[A-Za-z0-9]+$/.test(v) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
//整数
|
||||
|
digits: { |
||||
|
message: '仅限整数', |
||||
|
check(v) { |
||||
|
return /^\d+$/.test(v) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
//范围长度
|
||||
|
rangeLength: { |
||||
|
message: '请输入指定范围长度', |
||||
|
check(v, param) { |
||||
|
let length = v.length; |
||||
|
if (Array.isArray(param)) { |
||||
|
return (length >= param[0] && length <= param[1]) || v === ''; |
||||
|
} else { |
||||
|
return length == param || v === ''; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
//范围
|
||||
|
range: { |
||||
|
message: '', |
||||
|
check(v, param) { |
||||
|
return (v >= param[0] && v <= param[1]) || v === ''; |
||||
|
} |
||||
|
}, |
||||
|
//等于
|
||||
|
equal: { |
||||
|
message: '两次输入不一致', |
||||
|
check(v, param) { |
||||
|
return v == param || v === ''; |
||||
|
} |
||||
|
} |
||||
|
}; |
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
|||||
page{background:#fff}.f-top{position:relative;width:100%;height:200rpx;background:#e3271c;border-radius:0 0 30rpx 30rpx;-webkit-border-radius:0 0 30rpx 30rpx;-moz-border-radius:0 0 30rpx 30rpx;-ms-border-radius:0 0 30rpx 30rpx;-o-border-radius:0 0 30rpx 30rpx}.f-top .f-card{position:absolute;left:50%;bottom:-64rpx;display:flex;justify-content:space-between;align-items:center;width:690rpx;height:200rpx;margin-left:-345rpx;box-sizing:border-box;padding:28rpx 30rpx 18rpx;background-color:#fff;box-shadow:0 5rpx 32rpx 0 rgba(184,184,184,.25);border-radius:14rpx;-moz-border-radius:14rpx;-ms-border-radius:14rpx;-o-border-radius:14rpx;-webkit-border-radius:14rpx}.f-top .f-card .card-right{flex-shrink:0;margin-left:30rpx}.f-top .f-card .card-title{height:96rpx;font-family:PingFang-SC-Bold;font-size:34rpx;letter-spacing:1rpx;color:#020202;overflow:hidden}.f-top .f-card .card-num{display:flex;align-items:center;font-family:PingFang-SC-Medium;font-size:28rpx;letter-spacing:1rpx;color:#333}.f-top .f-card .card-num image{width:32rpx;height:18rpx}.f-top .f-card .card-qr{width:120rpx;height:120rpx;border:1rpx solid #eee}.f-top .f-card .card-qr image{display:block;width:100%;height:100%}.f-top .f-card .card-qr-name{margin-top:10rpx;font-family:PingFang-SC-Regular;font-size:22rpx;font-weight:400;font-stretch:normal;letter-spacing:1rpx;color:#333}.f-wr{width:100%;box-sizing:border-box;padding:100rpx 20rpx 0}.title-right,.title-wr{display:flex;align-items:center}.title-wr{justify-content:space-between;padding:28rpx 0;border-bottom:1rpx solid #e7eeee}.title-wr .title-label{position:relative;padding-left:25rpx;font-family:PingFang-SC-Bold;font-size:34rpx;font-weight:400;font-stretch:normal;letter-spacing:0;color:#333}.title-wr .title-label::after{content:'';position:absolute;top:50%;left:0;width:6rpx;height:30rpx;margin-top:-15rpx;background-color:#e60000;border-radius:3rpx;-webkit-border-radius:3rpx;-moz-border-radius:3rpx;-ms-border-radius:3rpx;-o-border-radius:3rpx}.title-wr .title-right-label{font-family:PingFang-SC-Light;font-size:26rpx;font-weight:400;font-stretch:normal;color:#999}.title-wr .right-icon{width:30rpx;height:30rpx}.f-table{background-color:#fbfbfb}.f-table .table-cell{display:flex;align-items:center;padding:26rpx 0;border:solid 1rpx #e3e3e3;border-top:0;font-family:PingFang-SC-Regular;font-size:30rpx;color:#000003}.f-table .table-cell .table-col{flex:1;text-align:center;line-height:1}.f-table .table-cell .table-col-4{color:#dd2a2a}.f-table .table-header{background:#f1f1f1;border:0;font-family:PingFang-SC-Regular;font-size:28rpx;color:#666}.mt40{margin-top:40rpx} |
page{background:#fff;box-sizing:border-box}.f-container{width:100%;box-sizing:border-box}.f-top{position:relative;width:100%;height:200rpx;background:#e3271c;border-radius:0 0 30rpx 30rpx;-webkit-border-radius:0 0 30rpx 30rpx;-moz-border-radius:0 0 30rpx 30rpx;-ms-border-radius:0 0 30rpx 30rpx;-o-border-radius:0 0 30rpx 30rpx}.f-top .flex-view{display:flex;justify-content:space-between;}.f-top .f-card{position:absolute;left:50%;bottom:-64rpx;width:690rpx;height:200rpx;margin-left:-345rpx;background-color:#fff;box-sizing:border-box;padding:28rpx 30rpx 18rpx;box-shadow: rgba(184,184,184,.25) 0px 0px 30px 5px;overflow:hidden;border-radius:14rpx;-moz-border-radius:14rpx;-ms-border-radius:14rpx;-o-border-radius:14rpx;-webkit-border-radius:14rpx}.f-top .f-card .card-right{flex-shrink:0;margin-left:30rpx}.f-top .f-card .card-title{height:96rpx;font-family:PingFang-SC-Bold;font-size:34rpx;letter-spacing:1rpx;color:#333;overflow:hidden}.f-top .f-card .card-num{display:flex;align-items:center;font-family:PingFang-SC-Medium;font-size:28rpx;letter-spacing:1rpx;color:#333;overflow:hidden}.f-top .f-card .card-num image{flex-shrink:0;width:32rpx;height:18rpx}.f-top .f-card .card-qr{width:140rpx;height:140rpx;margin: auto;position: relative;top: -5px;}.f-top .f-card .card-qr image{display:block;width:100%;height:100%;border-radius: 10px;}.f-top .f-card .card-qr-long{width:100rpx;height:100rpx}.f-top .f-card .card-qr-name{font-family:PingFang-SC-Regular;font-size:22rpx;font-weight:400;font-stretch:normal;letter-spacing:1rpx;color:#333}.f-wr{width:100%;box-sizing:border-box;padding:100rpx 20rpx 0}.title-right,.title-wr{display:flex;align-items:center}.title-wr{justify-content:space-between;padding:28rpx 0;border-bottom:1rpx solid #e7eeee}.title-wr .title-label{position:relative;padding-left:25rpx;font-family:PingFang-SC-Bold;font-size:34rpx;font-weight:400;font-stretch:normal;letter-spacing:0;color:#333}.title-wr .title-label::after{content:'';position:absolute;top:50%;left:0;width:6rpx;height:30rpx;margin-top:-15rpx;background-color:#e60000;border-radius:3rpx;-webkit-border-radius:3rpx;-moz-border-radius:3rpx;-ms-border-radius:3rpx;-o-border-radius:3rpx}.title-wr .title-right-label{font-family:PingFang-SC-Light;font-size:26rpx;font-weight:400;font-stretch:normal;color:#999}.title-wr .right-icon{width:30rpx;height:30rpx}.f-table{background-color:#fbfbfb}.f-table .table-cell{display:flex;align-items:center;padding:26rpx 0;border:solid 1rpx #e3e3e3;border-top:0;font-family:PingFang-SC-Regular;font-size:30rpx;color:#000003}.f-table .table-cell .table-col{flex:1;text-align:center;line-height:1}.f-table .table-cell .table-col-4{color:#dd2a2a}.f-table .table-header{background:#f1f1f1;border:0;font-family:PingFang-SC-Regular;font-size:28rpx;color:#666}.f-btns{display:flex;align-items:center;padding:30rpx 0}.f-btns .f-btns-icon{width:30rpx;height:30rpx;font-size:28rpx;color:#dd2a2a;text-align:center;line-height:30rpx;border:1rpx solid #dd2a2a;border-radius:50%;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%}.f-btns .f-btns-label{margin-left:10rpx;font-size:28rpx;color:#dd2a2a}.mt40{margin-top:40rpx}.mt16{margin-top:16rpx}.no-data{font-size:28rpx;color:#999;text-align:center;line-height:300rpx}.m-fm .fm{top:500rpx;width:600rpx;padding:0 0 40rpx 0;background:#fff;overflow:hidden}.m-fm .fm .btn-close{top:27rpx;padding:0 30rpx;font-size:36rpx;color:#fff;line-height:90rpx}.m-fm .fm .btn-close image{display:block;width:36rpx;height:36rpx}.m-fm .fm .fm-btn{width:240rpx;height:54rpx;margin:20rpx auto 0;font-family:PingFang-SC-Medium;font-size:28rpx;font-weight:400;font-stretch:normal;letter-spacing:0;color:#999;text-align:center;line-height:54rpx;border-radius:27rpx;border:solid 1rpx #eee;-webkit-border-radius:27rpx;-moz-border-radius:27rpx;-ms-border-radius:27rpx;-o-border-radius:27rpx}.m-fm .fm-header{width:100%;height:90rpx;margin-bottom:20rpx;text-align:center;line-height:90rpx;font-family:PingFang-SC-Bold;font-size:32rpx;color:#fff;background-image:linear-gradient(90deg,#ca151d 0,#e11c13 100%)}.m-fm .fm-qr{width:400rpx;height:400rpx;box-sizing:border-box;margin:0 auto}.m-fm .fm-qr image{display:block;width:100%;height:100%}.no-family{padding-top:200rpx}.no-family image{display:block;width:506rpx;margin:0 auto}.no-family .no-btn{width:220rpx;height:66rpx;margin:60rpx auto 0;font-size:32rpx;color:#fff;text-align:center;line-height:66rpx;background-image:linear-gradient(90deg,#ca151d 0,#e11c13 100%);border-radius:30rpx;-webkit-border-radius:30rpx;-moz-border-radius:30rpx;-ms-border-radius:30rpx;-o-border-radius:30rpx} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue