Commit b6426068 authored by 不吃草的咩's avatar 不吃草的咩

增加验证,重置数据

parent 8e7ca8f1
...@@ -4,6 +4,7 @@ import { colorUISdk } from './config/mp-sdk' ...@@ -4,6 +4,7 @@ import { colorUISdk } from './config/mp-sdk'
App({ App({
colorUI,//挂载到app上 colorUI,//挂载到app上
colorUISdk, colorUISdk,
information:{},
onLaunch() { onLaunch() {
//console.log(colorUISdk.isRandom.getRandom(6)) //console.log(colorUISdk.isRandom.getRandom(6))
//console.log(colorUISdk.version) //console.log(colorUISdk.version)
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
"pages/demo/login/login", "pages/demo/login/login",
"pages/demo/set/set", "pages/demo/set/set",
"pages/signup/signup", "pages/signup/signup",
"pages/uploadcard/uploadcard" "pages/uploadcard/uploadcard",
"pages/seeSignup/seeSignup"
], ],
"subpackages": [ "subpackages": [
{ {
...@@ -129,7 +130,6 @@ ...@@ -129,7 +130,6 @@
"van-col": "/vantPackage/col/index", "van-col": "/vantPackage/col/index",
"van-nav-bar": "/vantPackage/nav-bar/index", "van-nav-bar": "/vantPackage/nav-bar/index",
"van-toast": "/vantPackage/toast/index" "van-toast": "/vantPackage/toast/index"
}, },
"tabBar": { "tabBar": {
"color": "#aaaaaa", "color": "#aaaaaa",
......
// pages/document/subsign/subsign.js // pages/document/subsign/subsign.js
import Toast from '../../../vantPackage/toast/toast';
const app = getApp();
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
username:'', //姓名
card:'',
phone:'',
company:'',
beizhu:'',
isShow:false, isShow:false,
isShowStudy:false, isShowStudy:false,
isShowHomework:false, isShowHomework:false,
...@@ -20,7 +27,8 @@ Page({ ...@@ -20,7 +27,8 @@ Page({
homework:'', //作业类别 homework:'', //作业类别
zige:'', //资格类型 zige:'', //资格类型
peixun:'', //培训类型 peixun:'', //培训类型
beizhu:'' //备注 beizhu:'', //备注
price:'' //价格
}, },
popup:{ popup:{
genderText:'点击选择性别', genderText:'点击选择性别',
...@@ -33,30 +41,37 @@ Page({ ...@@ -33,30 +41,37 @@ Page({
{ text: '', type:0 }, { text: '', type:0 },
{ text: '' ,type:1}, { text: '' ,type:1},
], ],
// columnsStudy:[
// {text:'初中',index:1},
// {text:'高中',index:2},
// {text:'中专',index:3},
// {text:'专科',index:4},
// {text:'本科',index:5},
// {text:'研究生及以上',index:6},
// ],
columnsStudy:[ columnsStudy:[
{text:'初中',index:0}, '初中',
{text:'高中',index:1}, '高中',
{text:'中专',index:2}, '中专',
{text:'专科',index:3}, '专科',
{text:'本科',index:4}, '本科','研究生及以上'
{text:'研究生及以上',index:5},
], ],
columnsHomework:[ columnsHomework:['电工作业','焊接与热切割作业','高处作业','制冷与空调作业','金属与非金属矿山作业','危险化学品作业'],
{text:'电工作业',index:0}, // columnsHomework:[
{text:'焊接与热切割作业',index:1}, // {text:'电工作业',index:1},
{text:'高处作业',index:2}, // {text:'焊接与热切割作业',index:2},
{text:'制冷与空调作业',index:3}, // {text:'高处作业',index:3},
{text:'金属与非金属矿山作业',index:4}, // {text:'制冷与空调作业',index:4},
{text:'危险化学品作业',index:5}, // {text:'金属与非金属矿山作业',index:5},
], // {text:'危险化学品作业',index:6},
columnsZige:[ // ],
{text:'职业资格',index:0} columnsZige:['职业资格'],
], columnsPeixun:['新办','复审','换证']
columnsPeixun:[ // columnsPeixun:[
{text:'新办',index:0}, // {text:'新办',index:1},
{text:'复审',index:1}, // {text:'复审',index:2},
{text:'换证',index:2}, // {text:'换证',index:3},
] // ]
}, },
onDisplay(){ onDisplay(){
...@@ -95,40 +110,109 @@ Page({ ...@@ -95,40 +110,109 @@ Page({
}, },
onConfirmStudy(event){ onConfirmStudy(event){
const { picker, value, index } = event.detail; const { picker, value, index } = event.detail;
this.setData({["fromDate.studyhigh"]:value.index,["popup.studyText"]:value.text,isShowStudy:false}) this.setData({["fromDate.studyhigh"]:value,["popup.studyText"]:value,isShowStudy:false})
}, },
onConfirmHomework(event){ onConfirmHomework(event){
const { picker, value, index } = event.detail; const { picker, value, index } = event.detail;
this.setData({["fromDate.homework"]:value.index,["popup.homeworkText"]:value.text,isShowHomework:false}) this.setData({["fromDate.homework"]:value,["popup.homeworkText"]:value,isShowHomework:false})
}, },
onConfirmPeixun(event){ onConfirmPeixun(event){
const { picker, value, index } = event.detail; const { picker, value, index } = event.detail;
this.setData({["fromDate.peixun"]:value.index,["popup.peixunTypeText"]:value.text,isShowPeixun:false}) this.setData({["fromDate.peixun"]:value,["popup.peixunTypeText"]:value,isShowPeixun:false})
}, },
onConfirmZige(event){ onConfirmZige(event){
const { picker, value, index } = event.detail; const { picker, value, index } = event.detail;
this.setData({["fromDate.zige"]:value.index,["popup.zigeTypeText"]:value.text,isShowZige:false}) this.setData({["fromDate.zige"]:value,["popup.zigeTypeText"]:value,isShowZige:false})
},
nextCard(){
//bug问题 重新赋值
this.setData({
["fromDate.username"]:this.data.username,
["fromDate.card"]:this.data.card,
["fromDate.phone"]:this.data.phone,
["fromDate.company"]:this.data.company,
["fromDate.beizhu"]:this.data.beizhu
});
let params = this.data.fromDate;
let gender = '';
if(params.gender !== ''){
gender = this.data.fromDate.gender == 0 ? '' :''
}
let reg = /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/;
let phonereg = /^(?:(?:\+|00)86)?1\d{10}$/
if(params.username == ''){
Toast('姓名不能为空');
return;
}else if(gender == ''){
Toast('请选择您的性别');
return;
}else if(!(reg.test(params.card))){
Toast('身份证号不正确');
return;
}else if(!(phonereg.test(params.phone))){
Toast('手机号格式不正确');
return;
}else if(params.homework == ''){
Toast('请选择作业类别');
return;
}else if(params.zige == ''){
Toast('请选择资格类型');
return;
}else if(params.peixun == ''){
Toast('请选择培训类型');
return;
}
app.information = this.data.fromDate;
wx.navigateTo({
url: '/pages/uploadcard/uploadcard',
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// let price = 0;
// if(options.price == null || options.price == undefined){
// price =
// }
this.setData({
["fromDate.price"]:options.price
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
//有一个不为空说明已经有数据就回显数据
if(app.information.username != undefined){
this.setData({
fromDate:app.information,
username:app.information.username,
card:app.information.card,
phone:app.information.phone,
company:app.information.company,
beizhu:app.information.beizhu,
["popup.genderText"]:app.information.gender == "0" ? '':'',
["popup.studyText"]:app.information.studyhigh == '' ? '点击选择文化程度' : app.information.studyhigh,
["popup.homeworkText"]:app.information.homework == '' ? '点击选择作业类别':app.information.homework,
["popup.zigeTypeText"]:app.information.zige == '' ? '点击选择资格类型' : app.information.zige,
["popup.peixunTypeText"]:app.information.peixun == '' ? '点击选择培训类型' : app.information.peixun
});
}
},
onClickLeft(){
wx.switchTab({
url: '/pages/signup/signup',
})
}, },
/** /**
......
...@@ -38,4 +38,7 @@ ...@@ -38,4 +38,7 @@
color: brown; color: brown;
} }
}
.van-nav-bar{
padding-top: 0px !important;
} }
\ No newline at end of file
<!-- 个人&&企业报名 --> <!-- 个人&&企业报名 -->
<ui-sys> <ui-sys>
<ui-navbar backtext="返回" isCenter> <ui-navbar isSlot>
<text slot="center">在线培训</text> <view style="width: 100%;height: 100%;">
<van-nav-bar
title="在线培训"
left-text="返回"
left-arrow
border="{{false}}"
bind:click-left="onClickLeft"
/>
</view>
</ui-navbar> </ui-navbar>
<view class="box"> <view class="box">
<van-cell-group> <van-cell-group>
<van-cell center> <van-cell center>
<view slot="title" class="txt"><text class="req">* </text><text>姓名</text></view> <view slot="title" class="txt"><text class="req">* </text><text>姓名</text></view>
<van-field model:value="{{ fromDate.username }}" placeholder-style="place" custom-style="placeholder" placeholder="请输入用户名" input-align="right" border="{{ false }}" /> <van-field model:value="{{username}}" placeholder-style="place" custom-style="placeholder" placeholder="请输入用户名" input-align="right" border="{{ false }}" />
</van-cell> </van-cell>
<van-cell center value="{{popup.genderText}}" bind:click="onDisplay" value-class="placeholder"> <van-cell center value="{{popup.genderText}}" bind:click="onDisplay" value-class="placeholder">
<view slot="title" class="txt"><text class="req">* </text><text>性别</text></view> <view slot="title" class="txt"><text class="req">* </text><text>性别</text></view>
</van-cell> </van-cell>
<van-cell center> <van-cell center>
<view slot="title" class="txt"><text class="req">* </text><text>身份证号</text></view> <view slot="title" class="txt"><text class="req">* </text><text>身份证号</text></view>
<van-field model:value="{{ fromDate.card }}" placeholder="请输入您的身份证号" input-align="right" border="{{ false }}" /> <van-field model:value="{{ card }}" placeholder="请输入您的身份证号" input-align="right" border="{{ false }}" />
</van-cell> </van-cell>
<van-cell center value="{{popup.studyText}}" bind:click="onDisplayStudy" value-class="placeholder"> <van-cell center value="{{popup.studyText}}" bind:click="onDisplayStudy" value-class="placeholder">
<view slot="title" class="txt"><text>文化程度</text></view> <view slot="title" class="txt"><text>文化程度</text></view>
</van-cell> </van-cell>
<van-cell center> <van-cell center>
<view slot="title" class="txt"><text class="req">* </text><text>手机号</text></view> <view slot="title" class="txt"><text class="req">* </text><text>手机号</text></view>
<van-field model:value="{{ fromDate.phone }}" placeholder="请输入您的手机号" input-align="right" border="{{ false }}" /> <van-field model:value="{{ phone }}" placeholder="请输入您的手机号" input-align="right" border="{{ false }}" />
</van-cell> </van-cell>
<van-cell center> <van-cell center>
<view slot="title" class="txt"><text>单位名称</text></view> <view slot="title" class="txt"><text>单位名称</text></view>
<van-field model:value="{{ fromDate.company }}" placeholder="请输入您的单位名称" input-align="right" border="{{ false }}" /> <van-field model:value="{{ company }}" placeholder="请输入您的单位名称" input-align="right" border="{{ false }}" />
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
</view> </view>
...@@ -43,7 +51,7 @@ ...@@ -43,7 +51,7 @@
<van-cell center> <van-cell center>
<view slot="title" class="txt"><text>留言</text></view> <view slot="title" class="txt"><text>留言</text></view>
<van-field placeholder-style="placeholder" <van-field placeholder-style="placeholder"
value="{{ fromDate.beizhu }}" model:value="{{ beizhu }}"
type="textarea" type="textarea"
show-word-limit show-word-limit
placeholder="请输入备注信息" placeholder="请输入备注信息"
...@@ -54,10 +62,13 @@ ...@@ -54,10 +62,13 @@
/> />
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
<view class="price"><text class="tit">培训费用</text><text class="pri">¥812元</text></view> <view class="price"><text class="tit">培训费用</text><text class="pri">¥{{fromDate.price}}元</text></view>
<view class="price"><text class="tit">审核后需支付费用</text><text class="pri">¥812元</text></view> <view class="price"><text class="tit">审核后需支付费用</text><text class="pri">¥{{fromDate.price}}元</text></view>
<view class="price"><van-button type="default" block color="#1989fa">下一步,上传资料</van-button></view> <view class="price">
<van-button type="default" block color="#1989fa" bind:click="nextCard">下一步,上传资料</van-button>
</view>
</view> </view>
<van-toast id="van-toast" />
</ui-sys> </ui-sys>
<van-popup show="{{ isShow }}" bind:close="onClose" position="bottom" round> <van-popup show="{{ isShow }}" bind:close="onClose" position="bottom" round>
<van-picker columns="{{ columns }}" bind:cancel="onClose" bind:confirm="onConfirm" show-toolbar /> <van-picker columns="{{ columns }}" bind:cancel="onClose" bind:confirm="onConfirm" show-toolbar />
...@@ -74,6 +85,6 @@ ...@@ -74,6 +85,6 @@
<van-picker columns="{{ columnsZige }}" bind:cancel="onCloseZige" bind:confirm="onConfirmZige" show-toolbar /> <van-picker columns="{{ columnsZige }}" bind:cancel="onCloseZige" bind:confirm="onConfirmZige" show-toolbar />
</van-popup> </van-popup>
<!-- 培训类型 --> <!-- 培训类型 -->
<van-popup show="{{ isShowStudy }}" bind:close="onClosePeixun" position="bottom" round> <van-popup show="{{isShowPeixun}}" bind:close="onClosePeixun" position="bottom" round>
<van-picker columns="{{ columnsPeixun }}" bind:cancel="onClosePeixun" bind:confirm="onConfirmPeixun" show-toolbar /> <van-picker columns="{{ columnsPeixun }}" bind:cancel="onClosePeixun" bind:confirm="onConfirmPeixun" show-toolbar />
</van-popup> </van-popup>
\ No newline at end of file
.van-cell-group--inset{
margin: 0 !important;
}
\ No newline at end of file
...@@ -4,24 +4,14 @@ ...@@ -4,24 +4,14 @@
</ui-navbar> </ui-navbar>
<view class="ui-container"> <view class="ui-container">
<view class="flex-bar my-4" data-url="/pages/demo/login/login" bindtap="tapToUrl"> <view class="flex-bar my-4" data-url="/pages/demo/login/login" bindtap="tapToUrl">
<ui-avatar ui="xxl ellipse" src="/static/logo.png"/> <ui-avatar ui="xxl ellipse" src="/static/logo.png" />
<view class="flex-sub pl-3"> <view class="flex-sub pl-3">
<view class="text-xl">登录,享受更多服务。</view> <view class="text-xl">登录,享受更多服务。</view>
</view> </view>
</view> </view>
<ui-menu ui="mt-5 radius border"> <van-cell-group inset>
<ui-menu-item arrow title="当前版本:V{{version}}" icon="cicon-title"/> <van-cell title="我的报名" isLink url="/pages/seeSignup/seeSignup"/>
<ui-menu-item arrow title="ColorUI Github" icon="cicon-github" <van-cell title="设置" isLink url=""/>
data-value="https://github.com/weilanwl/coloruiBeta" bindtap="tapCopy"/> </van-cell-group>
<ui-menu-item arrow title="MP-CU Github" icon="cicon-github-circle"
data-value="https://github.com/Color-UI/MP-CU" bindtap="tapCopy"/>
<ui-menu-item arrow title="在线文档" isIcon isAction
data-value="http://mp.color-ui.com" bindtap="tapCopy">
<image slot="icon" src="/static/logo.png" mode="aspectFill" class="ui-menu-item-image"/>
<text slot="action">mp.color-ui.com</text>
</ui-menu-item>
<ui-menu-item arrow title="设置" icon="cicon-set" data-url="/pages/demo/set/set" bindtap="tapToUrl"/>
</ui-menu>
</view> </view>
</ui-sys> </ui-sys>
\ No newline at end of file
// pages/seeSignup/seeSignup.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/seeSignup/seeSignup.wxml-->
<text>pages/seeSignup/seeSignup.wxml</text>
/* pages/seeSignup/seeSignup.wxss */
\ No newline at end of file
...@@ -36,14 +36,14 @@ Page({ ...@@ -36,14 +36,14 @@ Page({
console.log(res.data.records) console.log(res.data.records)
}).catch(err=>{ }).catch(err=>{
console.log(err) console.log(err)
}) });
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
app.information = {};
}, },
/** /**
......
// pages/uploadcard/uploadcard.js // pages/uploadcard/uploadcard.js
import Toast from '../../vantPackage/toast/toast'; import Toast from '../../vantPackage/toast/toast';
const app = getApp();
Page({ Page({
/** /**
...@@ -14,8 +15,8 @@ Page({ ...@@ -14,8 +15,8 @@ Page({
}, },
}, },
onClickLeft(){ onClickLeft(){
wx.navigateBack({ wx.navigateTo({
delta: 1, url: '/pages/document/subsign/subsign',
}) })
}, },
beforeRead(event){ beforeRead(event){
...@@ -127,8 +128,7 @@ Page({ ...@@ -127,8 +128,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
const { diploma = [] } = this.data.fileList; console.log(app.information);
console.log(diploma);
}, },
/** /**
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": true,
"lazyloadPlaceholderEnable": false, "lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true, "useMultiFrameRuntime": true,
"useApiHook": true, "useApiHook": true,
...@@ -33,15 +33,15 @@ ...@@ -33,15 +33,15 @@
"enableEngineNative": false, "enableEngineNative": false,
"useIsolateContext": false, "useIsolateContext": false,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true, "minifyWXSS": true,
"disableUseStrict": false, "disableUseStrict": false,
"minifyWXML": true, "minifyWXML": true,
"showES6CompileOption": false, "showES6CompileOption": false,
"useCompilerPlugins": [ "useCompilerPlugins": [
"sass" "sass"
], ]
"packNpmManually": false,
"packNpmRelationList": []
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.21.3", "libVersion": "2.21.3",
......
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