This commit is contained in:
1692762430 2024-02-28 15:19:55 +08:00
parent 5186f4bddf
commit 06f500d974
3 changed files with 88 additions and 4 deletions

View File

@ -7,13 +7,57 @@ Page({
data: {
value: '',
companyShow:false,
usernameShow:false,
cardTypeShow: false,
arriveShow:false,
leaveShow:false,
submitSuccesShow:false,
indexList: ["A", "B", "C", "D"],
scrollTop: 100,
companyColumns:['公司1','公司2','公司3'],
columns: ['身份证', '护照', '通行证'],
fileList: [],
currentDate: new Date().getTime(),
customerList: [
{
firstLetter: "A",
list: [
{ code: "AB01", name: "A1客户" },
{ code: "AB02", name: "A2客户" },
{ code: "AB03", name: "A3客户" },
],
},
{
firstLetter: "B",
list: [
{ code: "BB01", name: "B1客户" },
{ code: "BB02", name: "B2客户" },
{ code: "BB03", name: "B3客户" },
{ code: "BB04", name: "B4客户" },
],
},
{
firstLetter: "C",
list: [
{ code: "CB01", name: "C1客户" },
{ code: "CB02", name: "C2客户" },
{ code: "CB03", name: "C3客户" },
{ code: "CB04", name: "C4客户" },
{ code: "CB05", name: "C5客户" },
],
},
{
firstLetter: "D",
list: [
{ code: "DB01", name: "D1客户" },
{ code: "DB02", name: "D2客户" },
{ code: "DB03", name: "D3客户" },
{ code: "DB04", name: "D4客户" },
{ code: "DB05", name: "D5客户" },
{ code: "DB06", name: "D6客户" },
],
},
],
},
/**
@ -58,6 +102,15 @@ Page({
*/
onShareAppMessage() {
},
getUsernameHandle(){
this.setData({
usernameShow: true
});
wx.navigateTo({
url: 'pages/meeting/accessControl/accessControl'
})
},
getCompanyHandle() {
this.setData({
@ -72,6 +125,7 @@ Page({
confirmHandle(){
this.setData({
companyShow:false,
usernameShow:false,
cardTypeShow: false,
arriveShow: false,
leaveShow:false
@ -80,6 +134,7 @@ Page({
cancelHandle(){
this.setData({
companyShow:false,
usernameShow:false,
cardTypeShow: false,
arriveShow: false,
leaveShow:false
@ -96,6 +151,11 @@ Page({
leaveShow: true
});
},
onClose(){
this.setData({
usernameShow: true
});
},
afterRead(event) {
const { file } = event.detail;
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
@ -117,4 +177,17 @@ Page({
currentDate: event.detail,
});
},
//索引栏发生变化事件
onPageScroll(event) {
this.setData({
scrollTop: event.scrollTop,
});
},
/**选择客户发生事件 */
getCustomer: function (event) {
console.log(event.currentTarget.dataset.id);
console.log(event.currentTarget.dataset.name);
},
})

View File

@ -6,7 +6,9 @@
"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"
"van-dialog": "@vant/weapp/dialog/index",
"van-index-bar": "@vant/weapp/index-bar/index",
"van-index-anchor": "@vant/weapp/index-anchor/index"
}
}

View File

@ -4,8 +4,8 @@
</view>
<view class="inputView">
<van-cell-group>
<van-field label="被访单位" model:value="{{ value }}" is-link required readonly placeholder="请选择" border="{{ true }}" arrow-direction="down" input-align="right" />
<van-field label="被访人姓名" model:value="{{ value }}" placeholder="请输入" border="{{ true }}" input-align="right" />
<van-field label="被访单位" model:value="{{ value }}" is-link required readonly placeholder="请选择" border="{{ true }}" arrow-direction="down" input-align="right" bind:tap="getCompanyHandle" />
<van-field label="被访人姓名" model:value="{{ value }}" is-link required readonly placeholder="请选择" placeholder="请输入" arrow-direction="down" border="{{ true }}" input-align="right" bind:tap="getUsernameHandle" />
<van-field label="被访人电话" model:value="{{ value }}" placeholder="请输入" border="{{ true }}" input-align="right" />
<van-field label="访客姓名" model:value="{{ value }}" required placeholder="请输入" border="{{ true }}" input-align="right" />
<van-field label="手机号码" model:value="{{ value }}" required placeholder="请输入" border="{{ true }}" input-align="right" />
@ -25,7 +25,16 @@
</view>
<!-- 被访单位弹框 -->
<van-popup show="{{ companyShow }}" round position="bottom">
<van-picker show-toolbar title="被访单位" columns="{{ columns }}" bind:confirm="confirmHandle" bind:cancel="cancelHandle" />
<van-picker show-toolbar title="被访单位" columns="{{ companyColumns }}" bind:confirm="confirmHandle" bind:cancel="cancelHandle" />
</van-popup>
<!-- 被访人姓名弹框 -->
<van-popup show="{{ usernameShow }}" round position="bottom" closeable custom-style="height: 100%" bind:close="onClose">
<van-index-bar index-list="{{ indexList }}">
<van-index-anchor wx:for="{{customerList}}" wx:key="index" index="{{item.firstLetter}}" use-slot="{{true}}">
{{item.firstLetter}}
<van-cell wx:for="{{item.list}}" wx:key="index" data-id="{{item.code}}" data-name="{{item.name}}" title="{{item.name}}" bindtap="getCustomer" />
</van-index-anchor>
</van-index-bar>
</van-popup>
<!-- 身份证类型弹框 -->
<van-popup show="{{ cardTypeShow }}" round position="bottom">