From 636fd5f5b5f7fe13df003b9ab7e9f5c44e470ab4 Mon Sep 17 00:00:00 2001 From: 1692762430 <1692762430@qq.com> Date: Wed, 28 Feb 2024 13:43:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BF=E5=AE=A2=E9=A2=84=E7=BA=A6=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visitorIinvitation/visitorIinvitation.js | 154 +++++++++++------- .../visitorIinvitation.json | 6 +- .../visitorIinvitation.wxml | 95 ++++------- .../visitorIinvitation.wxss | 16 ++ 4 files changed, 152 insertions(+), 119 deletions(-) diff --git a/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.js b/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.js index a5f02bb..9c58891 100644 --- a/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.js +++ b/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.js @@ -1,74 +1,112 @@ // pages/meeting/visitorIinvitation/visitorIinvitation.js Page({ - /** - * 页面的初始数据 - */ - data: { - value: '', - discountShow:false - }, + /** + * 页面的初始数据 + */ + data: { + value: '', + showCardType: false, + arriveShow:false, + leaveShow:false, + submitSuccesShow:false, + columns: ['身份证', '护照', '通行证'], + fileList: [], + currentDate: new Date().getTime(), + }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - // 页面初始化 options为页面跳转所带来的参数 - wx.setNavigationBarTitle({ - title: options.name - }) - }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // 页面初始化 options为页面跳转所带来的参数 + wx.setNavigationBarTitle({ + title: options.name + }) + }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - }, - /** - * 生命周期函数--监听页面显示 - */ - onShow() { + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { - }, + }, - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { - }, + }, + onChange(event) { + // event.detail 为当前输入的值 + console.log(event.detail); + }, - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { - }, + }, - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { - }, - onChange(event) { - // event.detail 为当前输入的值 - console.log(event.detail); - }, + }, + getCardTypeHandle() { + this.setData({ + 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 + }); - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } + }, + getLeaveHandle(){ + this.setData({ + leaveShow: true + }); + }, + afterRead(event) { + const { file } = event.detail; + // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式 + wx.uploadFile({ + 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, + }); + }, }) \ No newline at end of file diff --git a/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.json b/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.json index 5419482..1de4f96 100644 --- a/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.json +++ b/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.json @@ -2,7 +2,11 @@ "usingComponents": { "van-field": "@vant/weapp/field/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" } } diff --git a/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.wxml b/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.wxml index 572ee96..6d66efd 100644 --- a/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.wxml +++ b/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.wxml @@ -4,66 +4,41 @@ - - - - - - - - - + + + + + + + + + + + + + 访客照片 + + 提示:请保持五官清晰,以方便系统精准识 + + + 提交 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.wxss b/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.wxss index 9265c8b..34d5f9e 100644 --- a/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.wxss +++ b/miniprogram/pages/meeting/visitorIinvitation/visitorIinvitation.wxss @@ -19,4 +19,20 @@ } .inputView{ 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; } \ No newline at end of file