正则js文件
This commit is contained in:
@@ -1,88 +0,0 @@
|
||||
// pages/meeting/meeting.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
payProveImage: ''
|
||||
},
|
||||
|
||||
// 上传缴费凭证
|
||||
uploadImage(){
|
||||
const that = this
|
||||
wx.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success (res) {
|
||||
// tempFilePath可以作为img标签的src属性显示图片
|
||||
that.setData({
|
||||
payProveImage: res.tempFilePaths
|
||||
})
|
||||
console.log(that.data.payProveImage)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除缴费凭证
|
||||
delete(){
|
||||
this.setData({
|
||||
payProveImage: ''
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "会议详情",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
<view>
|
||||
<view class="basic-info">
|
||||
<view class="meeting-name">
|
||||
<text>会议名称</text>
|
||||
<text>会议名称会议名称</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>会议类型</text>
|
||||
<text>arff4ds8a3s6651</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>负责人</text>
|
||||
<text>找找</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>召开时间</text>
|
||||
<text>张三</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>召开地点</text>
|
||||
<text>500元</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>会议费用</text>
|
||||
<text>500元</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>年份</text>
|
||||
<text>500元</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>签到时间</text>
|
||||
<text>500元</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>会议费用(VIP)</text>
|
||||
<text>500元</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>会议内容</text>
|
||||
<text>500元</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>备注</text>
|
||||
<text>500元</text>
|
||||
</view>
|
||||
<view class="meeting-files">
|
||||
<text>附件</text>
|
||||
<view class="file-name">
|
||||
<view>
|
||||
<image src="../../assets/images/pdf.png"></image>
|
||||
<text>文件名内阁成员函数的工具包</text>
|
||||
</view>
|
||||
<text class="look-file">查看</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="meeting-files" style="margin-top: 0;">
|
||||
<text>会议文件</text>
|
||||
<view class="warning-text">
|
||||
<image src="../../assets/images/warn.png"></image>
|
||||
<text>单个账号会议文件只可发送五次</text>
|
||||
</view>
|
||||
<view class="file-name">
|
||||
<view>
|
||||
<image src="../../assets/images/pdf.png"></image>
|
||||
<text>文件名内阁成员函数的工具包</text>
|
||||
</view>
|
||||
<text class="look-file">查看</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="basic-info" style="margin-top: 10px;">
|
||||
<view class="title">
|
||||
<text>报名信息</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>参会人1</text>
|
||||
<text>会议名称会议名称</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>参会人2</text>
|
||||
<text>会议名称会议名称</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>缴费方式</text>
|
||||
<text>会议名称会议名称</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>是否需要发票</text>
|
||||
<text>会议名称会议名称</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>邮寄地址</text>
|
||||
<text>会议名称会议名称</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>邮编</text>
|
||||
<text>会议名称会议名称</text>
|
||||
</view>
|
||||
<view class="pay-prove-box">
|
||||
<text>缴费凭证</text>
|
||||
<view class="pay-prove-content">
|
||||
<view class="pay-prove" wx:if="{{payProveImage}}">
|
||||
<image src="{{payProveImage}}" mode="aspectFill"></image>
|
||||
<text class="delete-image" bindtap="delete">×</text>
|
||||
</view>
|
||||
<view class="pay-prove" bindtap="uploadImage">
|
||||
<image src="../../assets/images/uploadImage.png" mode="aspectFill" style="width: 40px; height: 40px;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sign-up-empty"></view>
|
||||
<view class="sign-up">
|
||||
<text>确定</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* 邮箱
|
||||
* @param {*} s
|
||||
* 之前的正则 /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
||||
*/
|
||||
export function isEmail(s) {
|
||||
return /^\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 电话号码 座机
|
||||
* 原正则:/^([0-9]{3,4}-)[0-9]{7,8}$/
|
||||
* 现正则:15位数字、横杠
|
||||
* @param {*} s
|
||||
*/
|
||||
export function isPhone(s) {
|
||||
return /^([0-9-]{0,15})$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* URL地址
|
||||
* @param {*} s
|
||||
*/
|
||||
export function isURL(s) {
|
||||
return /^http[s]?:\/\/.*/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 密码
|
||||
* message: 密码长度至少8位,并包括数字、小写字母、大写字母和特殊符号4类
|
||||
*/
|
||||
export function passwordReg(s) {
|
||||
return /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,30}$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
* */
|
||||
export function phoneReg(s) {
|
||||
return /^((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(17[0135678])|(18[0-9])|(19[8|9])|(16[6]))\d{8}$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 不可输入中文
|
||||
*/
|
||||
export function chineseReg(s) {
|
||||
return /[\u4E00-\u9FA5]/g.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 邮编
|
||||
* @param s
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function postcode(s) {
|
||||
return /^[0-9]\d{5}$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 税号
|
||||
* message:15位、17位、18位、20位数字和大写英文字母
|
||||
* */
|
||||
export function taxNo(s) {
|
||||
return /^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 只能输入数字
|
||||
* @param s
|
||||
*/
|
||||
export function number(s) {
|
||||
return /^[0-9]*$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 金额格式,小数点后两位,整数部分十位
|
||||
* /^[1-9](\d{1,10})?(\.\d{1,2})$|^0\.([1-9](\d{0,1})|\d[1-9])$|^[1-9]\d{1,10}$|^0$/ ---- 最初的正则,能输入十一位整数
|
||||
* @param s
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function money(s) {
|
||||
return /^[0-9](\d{1,9})?(\.\d{1,2})$|^0\.([1-9](\d{0,1})|\d[1-9])$|^[1-9]\d{0,9}$|^0$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 信用代码 15、18位
|
||||
* @param s
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function dutyCode(s) {
|
||||
return /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/.test(s)
|
||||
}
|
||||
Reference in New Issue
Block a user