This commit is contained in:
SelfRidicule 2024-02-28 14:02:28 +08:00
commit ad1c041a8d
4 changed files with 152 additions and 119 deletions

View File

@ -1,74 +1,112 @@
// pages/meeting/visitorIinvitation/visitorIinvitation.js // pages/meeting/visitorIinvitation/visitorIinvitation.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
value: '', value: '',
discountShow:false showCardType: false,
}, arriveShow:false,
leaveShow:false,
submitSuccesShow:false,
columns: ['身份证', '护照', '通行证'],
fileList: [],
currentDate: new Date().getTime(),
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: options.name title: options.name
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面卸载
*/ */
onShow() { onUnload() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onHide() { onPullDownRefresh() {
}, },
onChange(event) {
// event.detail 为当前输入的值
console.log(event.detail);
},
/** /**
* 生命周期函数--监听页面卸载 * 页面上拉触底事件的处理函数
*/ */
onUnload() { onReachBottom() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 用户点击右上角分享
*/ */
onPullDownRefresh() { onShareAppMessage() {
}, },
onChange(event) { getCardTypeHandle() {
// event.detail 为当前输入的值 this.setData({
console.log(event.detail); showCardType: true
}, });
},
confirmHandle(){
this.setData({
showCardType: false,
arriveShow: false,
leaveShow:false
});
},
cancelHandle(){
this.setData({
showCardType: false,
arriveShow: false,
leaveShow:false
});
},
getArriveHandle(){
this.setData({
arriveShow: true
});
/** },
* 页面上拉触底事件的处理函数 getLeaveHandle(){
*/ this.setData({
onReachBottom() { leaveShow: true
});
}, },
afterRead(event) {
/** const { file } = event.detail;
* 用户点击右上角分享 // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
*/ wx.uploadFile({
onShareAppMessage() { url: 'https://example.weixin.qq.com/upload', // 仅为示例,非真实的接口地址
filePath: file.url,
} name: 'file',
formData: { user: 'test' },
success(res) {
// 上传完成需要更新 fileList
const { fileList = [] } = this.data;
fileList.push({ ...file, url: res.data });
this.setData({ fileList });
},
});
},
onInput(event) {
this.setData({
currentDate: event.detail,
});
},
}) })

View File

@ -2,7 +2,11 @@
"usingComponents": { "usingComponents": {
"van-field": "@vant/weapp/field/index", "van-field": "@vant/weapp/field/index",
"van-picker": "@vant/weapp/picker/index", "van-picker": "@vant/weapp/picker/index",
"van-popup": "@vant/weapp/popup/index" "van-popup": "@vant/weapp/popup/index",
"van-uploader": "@vant/weapp/uploader/index",
"van-button": "@vant/weapp/button/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-dialog": "@vant/weapp/dialog/index"
} }
} }

View File

@ -4,66 +4,41 @@
</view> </view>
<view class="inputView"> <view class="inputView">
<van-cell-group> <van-cell-group>
<van-field <van-field label="被访单位" model:value="{{ value }}" placeholder="请输入" border="{{ true }}" input-align="right" />
label="被访人姓名" <van-field label="被访人姓名" model:value="{{ value }}" placeholder="请输入" border="{{ true }}" input-align="right" />
model:value="{{ value }}" <van-field label="被访人电话" model:value="{{ value }}" placeholder="请输入" border="{{ true }}" input-align="right" />
placeholder="请输入"
border="{{ true }}" <van-field label="访客姓名" model:value="{{ value }}" required placeholder="请输入" border="{{ true }}" input-align="right" />
input-align="right" /> <van-field label="手机号码" model:value="{{ value }}" required placeholder="请输入" border="{{ true }}" input-align="right" />
<van-field <van-field label="身份证类型" model:value="{{ value}}" is-link required readonly placeholder="请选择" arrow-direction="down" input-align="right" bind:tap="getCardTypeHandle" />
label="被访人电话" <van-field label="身份证号" model:value="{{ value }}" required placeholder="请输入" border="{{ true }}" input-align="right" />
model:value="{{ value }}" <van-field label="到访时间" model:value="{{ value }}" is-link required readonly placeholder="请选择" border="{{ true }}" arrow-direction="down" input-align="right" bind:tap="getArriveHandle" />
placeholder="请输入" <van-field label="离开时间" model:value="{{ value }}" is-link required readonly placeholder="请选择" border="{{ true }}" arrow-direction="down" input-align="right" bind:tap="getLeaveHandle" />
border="{{ true }}" <van-field label="来访事由" required model:value="{{ value }}" placeholder="请输入" border="{{ true }}" input-align="right" />
input-align="right" /> <view class="uploadImgView">
<van-field <view style="margin-bottom: 20rpx;">访客照片</view>
label="被访单位" <van-uploader file-list="{{ fileList }}" upload-text="点击上传照片" bind:after-read="afterRead" />
model:value="{{ value }}" <view class="tipsView">提示:请保持五官清晰,以方便系统精准识</view>
placeholder="请输入" </view>
border="{{ true }}"
input-align="right" />
<van-field
label="访客姓名"
required
model:value="{{ value }}"
placeholder="请输入"
border="{{ true }}"
input-align="right" />
<van-field
label="手机号码"
required
model:value="{{ value }}"
placeholder="请输入"
border="{{ true }}"
input-align="right" />
<van-field
label="身份证号"
required
model:value="{{ value }}"
placeholder="请输入"
border="{{ true }}"
input-align="right" />
<van-field
label="到访时间"
required
model:value="{{ value }}"
placeholder="请输入"
border="{{ true }}"
input-align="right" />
<van-field
label="离开时间"
required
model:value="{{ value }}"
placeholder="请输入"
border="{{ true }}"
input-align="right" />
<van-field
label="来访事由"
required
model:value="{{ value }}"
placeholder="请输入"
border="{{ true }}"
input-align="right" />
</van-cell-group> </van-cell-group>
<view class="submitBtnView">
<van-button block type="info">提交</van-button>
</view>
<!-- 身份证类型弹框 -->
<van-popup show="{{ showCardType }}" round position="bottom">
<van-picker show-toolbar title="身份证类型" columns="{{ columns }}" bind:confirm="confirmHandle" bind:cancel="cancelHandle" />
</van-popup>
<!-- 到访时间选择弹框 -->
<van-popup show="{{ arriveShow }}" round position="bottom">
<van-datetime-picker type="datetime" value="{{ currentDate }}" bind:input="onInput" bind:confirm="confirmHandle" bind:cancel="cancelHandle"
/>
</van-popup>
<!-- 离开时间弹框 -->
<van-popup show="{{ arriveShow }}" round position="bottom">
<van-datetime-picker type="datetime" value="{{ currentDate }}" bind:input="onInput" bind:confirm="confirmHandle" bind:cancel="cancelHandle"
/>
</van-popup>
<!-- 提交成功弹框 -->
<van-dialog title="标题" message="弹窗内容" show="{{ submitSuccesShow }}" />
</view> </view>
</view> </view>

View File

@ -19,4 +19,20 @@
} }
.inputView{ .inputView{
margin-top: 20rpx; margin-top: 20rpx;
}
.uploadImgView{
padding: 16px;
background-color: #ffffff;
color: #646566;
font-size: 28rpx;
}
.tipsView{
text-align: center;
padding-top: 60rpx;
margin-bottom: 100rpx;
}
.submitBtnView{
width: 96%;
margin:0 auto ;
padding-bottom: 100rpx;
} }