1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

add miniprogram

This commit is contained in:
2022-11-05 15:28:03 +08:00
parent a410d97efd
commit 470d332fc2
155 changed files with 5371 additions and 0 deletions

View File

@@ -0,0 +1,105 @@
// pages/visitor/showMyVisitor.js
Page({
/**
* 页面的初始数据
*/
data: {
greenCode: false,
redCode: false,
msg: "请先输入手机号查询您的申请状态",
phone: ''
},
phoneInput: function (e) {
this.setData({
phone: e.detail.value
})
},
submit: function () {
var that = this;
if (this.data.phone == '') {
wx.showToast({
title: "请输入手机号",
icon: 'error',
duration: 2000
})
} else {
wx.request({
url: 'http://127.0.0.1:8080/visitor/showMyVisitor',
data: {
phone: this.data.phone,
},
success: function (d) {
if (d.data == "审批通过") {
that.setData({
greenCode:true,
redCode:false,
msg:d.data
})
}else{
that.setData({
greenCode:false,
redCode:true,
msg:d.data
})
}
}
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,20 @@
<!--pages/visitor/showMyVisitor.wxml-->
<view class="container">
<view class="login-from">
<!--账号-->
<view class="inputView">
<image class="keyImage"></image>
<input class="inputText" placeholder="请输入手机号进行查询" bindinput="phoneInput" />
</view>
<!--按钮-->
<view class="loginBtnView" style="margin-top: 30px;">
<button class="loginBtn" type="primary" bindtap="submit">查询</button>
</view>
<view style="text-align: center;margin-top: 20px;"><h1>{{msg}}</h1></view>
<image src="../../img/greenCode.png" style="margin-top: 30px;margin-left: 25px;" wx:if="{{greenCode}}"></image>
<image src="../../img/redCode.png" style="margin-top: 30px;margin-left: 15px;" wx:if="{{redCode}}"></image>
</view>
</view>

View File

@@ -0,0 +1,75 @@
page{
height: 100%;
}
.container {
height: 100%;
display: flex;
flex-direction: column;
padding: 0;
box-sizing: border-box;
background-color: #f2f2f2
}
/*登录图片*/
.login-icon{
flex: none;
}
.login-img{
margin-top: 50px;
width: 450rpx;
}
/*表单内容*/
.login-from {
margin-top: 20px;
flex: auto;
height:100%;
}
.inputView {
background-color: #fff;
line-height: 44px;
}
/*输入框*/
.nameImage, .keyImage {
width: 14px;
height: 14px
}
.loginLab {
margin: 15px 15px 15px 10px;
color: #545454;
font-size: 14px
}
.inputText {
flex: block;
float: right;
text-align: right;
margin-right: 22px;
margin-top: 11px;
color: #cccccc;
font-size: 14px
}
.line {
width: 100%;
height: 1px;
background-color: #cccccc;
margin-top: 1px;
}
/*按钮*/
.loginBtnView {
width: 100%;
height: auto;
background-color: #f2f2f2;
margin-top: 0px;
margin-bottom: 0px;
padding-bottom: 0px;
}
.loginBtn {
width: 80%;
margin-top: 10px;
}

View File

@@ -0,0 +1,126 @@
// pages/visitor/visitor.js
Page({
/**
* 页面的初始数据
*/
data: {
date:'',
time:'',
phone:'',
issue:'',
meetName:''
},
showMyVisitor: function () {
wx.navigateTo({
url: './showMyVisitor',
success: function () {}, //成功后的回调;
})
},
report: function () {
wx.request({
url: 'http://127.0.0.1:8080/visitor/visitorApply',
data: {
phone: this.data.phone,
issue: this.data.issue,
meet_name: this.data.meetName,
time: this.data.date+" "+this.data.time
},
success:function(d){
if(d.data == "您还有未审批的申请,不能重复申请"){
wx.showToast({
title:'不能重复申请',
icon: 'error',
duration: 2000
})
}else{
wx.showToast({
title: d.data,
icon: 'success',
duration: 2000
})
}
}
})
},
bindDateChange: function(e) {
this.setData({
date: e.detail.value
})
},
bindTimeChange: function(e) {
this.setData({
time: e.detail.value
})
},
phoneChange: function(e) {
this.setData({
phone: e.detail.value
})
},
issueChange: function(e) {
this.setData({
issue: e.detail.value
})
},
meetNameChange: function(e) {
this.setData({
meetName: e.detail.value
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,64 @@
<page-meta root-font-size="system" />
<view>
<view class="weui-form" style="padding:20px 0">
<view class="weui-form__text-area">
<h2 class="weui-form__title">访客入校申请</h2>
<a aria-role="button" class="weui-btn weui-btn_primary" bindtap="showMyVisitor" style="margin-top: 20px;">查看申请进度</a>
</view>
<view class="weui-form__control-area" style="margin-top: 50px;margin-bottom: 0;">
<view class="weui-cells__group weui-cells__group_form">
<view class="weui-cells__title">手机号码</view>
<view class="weui-cell weui-cell_active">
<view class="weui-cell__bd">
<input class="weui-input" placeholder-class="weui-input__placeholder" bindinput='phoneChange' />
</view>
</view>
<view class="weui-cells__title">预约事由</view>
<view class="weui-cell weui-cell_active">
<view class="weui-cell__bd">
<input class="weui-input" placeholder-class="weui-input__placeholder" bindinput='issueChange' />
</view>
</view>
<view class="weui-cells__title">受访人姓名</view>
<view class="weui-cell weui-cell_active">
<view class="weui-cell__bd">
<input class="weui-input" placeholder-class="weui-input__placeholder" bindinput='meetNameChange' />
</view>
</view>
<view class="weui-cell weui-cell_active">
<view class="weui-cell__bd">
<picker mode="date" value="{{date}}" start="2022-3-9" end="2033-3-9" bindchange="bindDateChange">
<view class="picker" style="color: var(--weui-FG-1);">选择入校日期: {{date}}</view>
</picker>
</view>
</view>
<view class="weui-cell weui-cell_active">
<view class="weui-cell__bd">
<picker mode="time" value="{{time}}" start="07:00" end="22:00" bindchange="bindTimeChange">
<view class="picker" style="color: var(--weui-FG-1);">选择入校时间: {{time}}</view>
</picker>
</view>
</view>
</view>
</view>
<view class="weui-form__opr-area" style="margin-bottom: 0;">
<a aria-role="button" class="weui-btn weui-btn_primary" catchtap="report" style="margin-top: 50px;">提交申请</a>
</view>
</view>
</view>
<view class='maskWindow' wx:if="{{isMaskWindowShow}}" catchtap='maskWindowBgClick' catchtouchmove='move'>
<view class='maskWindowContent' catchtap='clickTap'>
<text class="maskWindowTitleText">{{typeTitle}}</text>
<view class='maskWindowList' wx:for='{{maskWindowList}}' wx:for-index='index' wx:if='{{index%2===0}}'>
<view class="maskWindowText {{index == selectIndex? 'maskWindowText_selected' : 'maskWindowText_unselected'}}" catchtap='maskWindowTableSelect' data-window-Index='{{index}}'>{{maskWindowList[index]}}</view>
<view class="maskWindowText {{index + 1 == selectIndex? 'maskWindowText_selected' : 'maskWindowText_unselected'}}" catchtap='maskWindowTableSelect' data-window-Index='{{index+1}}'>{{maskWindowList[index+1]}}</view>
</view>
<view class='maskWindowInputView'>
<input class='maskWindowInput' maxlength='100' placeholder='请输入其他原因' hidden='{{!isMaskWindowInputShow}}' bindinput='maskWindowInput'></input>
</view>
<view class='maskWindowBtnView'>
<view class='maskWindowBtn' catchtap='maskWindowOk'>确定</view>
<view class='maskWindowBtn' catchtap='maskWindowCancel'>取消</view>
</view>
</view>
</view>

View File

@@ -0,0 +1 @@
/* pages/visitor/visitor.wxss */

View File

@@ -0,0 +1,98 @@
// pages/other/feedback.js
Page({
/**
* 页面的初始数据
*/
data: {
List:'',
replay: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
replay:function (event) {
var that = this
wx.request({
url: 'http://127.0.0.1:8080/visitor/visitorChangeState',
data: {
id:event.target.dataset.id,
state:event.target.dataset.replay,
},
success: function (d) {
wx.showToast({
title: d.data,
icon: 'success',
duration: 2000,
success: function () {
that.onShow();
}
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
doReplay: function (e) {
this.setData({
replay: e.detail.value
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var that = this;
wx.request({
url: 'http://127.0.0.1:8080/visitor/showVisitorList',
success: function (d) {
that.setData({
List: d.data.data
})
}
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,15 @@
<view class="perason">
<h2 class="weui-form__title" style="text-align: center;padding-top: 20px;">访客审批</h2>
<view class="issues-panel" wx:for="{{List}}">
<view class="issues-input" bindinput="titleInput" disabled="true">手机号码:{{item.phone}}</view>
<view class="issues-input" bindinput="titleInput" disabled="true">时间:{{item.time}}</view>
<view class="issues-input" bindinput="contentInput" auto-height disabled="true" style="border-bottom: none;">预约事由: {{item.issue}}</view>
<view class="issues-input" bindinput="contentInput" auto-height disabled="true" style="border-bottom: none;">受访人姓名:{{item.meet_name}}</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_input">
<button class="mini-btn" type="primary" size="mini" data-id="{{item.id}}" data-replay="1" bindtap="replay">通过</button>
<button class="mini-btn" type="warn" size="mini" data-id="{{item.id}}" data-replay="2" bindtap="replay">驳回</button>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,115 @@
/**issuse.wxss**/
.perason{
background-color: #f6f6f6;
padding: 30rpx;
padding-top: 0;
font-size: 11pt;
box-sizing: border-box;
position: relative;
min-height: 100%;
display: flex;
flex-direction: column;
padding-bottom: 100rpx;
}
.issues-label{
font-size: 10pt;
line-height: 100%;
color: #999;
margin: 25rpx 20rpx 15rpx;
}
.issues-panel{
margin-top: 30px;
display: flex;
flex-direction: column;
align-items: stretch;
background-color: #fff;
border-top: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
}
.issues-img-panel{
display: flex;
flex-wrap: wrap;
background-color: #fff;
border-top: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
padding: 15rpx 25rpx;
}
.issues-input{
border-bottom: 1px solid #e5e5e5;
padding: 15rpx 25rpx;
}
.issues-textarea{
padding: 25rpx;
min-height: 225rpx;
border-bottom: 1px solid #e5e5e5;
}
.issues-photo-item {
position: relative;
display: flex;
align-items: center;
justify-content: center;
color: #888;
margin: 20rpx;
margin-right: 0;
width: 135rpx;
height: 135rpx;
border: 1rpx solid #e5e5e5;
border-radius: 5rpx;
}
.issues-photo-item:active{
opacity: .8;
}
.issues-photo-item .remind-img{
padding: 0;
}
.issues-photo-item image{
width: 100%;
height: 100%;
}
.add-photo:active {
background: #f0f0f0;
}
.add-photo::before, .add-photo::after{
content: '';
position: absolute;
top: 50%;
left: 50%;
background: #e5e5e5;
}
.add-photo:active::before, .add-photo:active::after{
background: #ddd;
}
.add-photo::before {
width: 10rpx;
height: 80rpx;
margin-top: -40rpx;
margin-left: -5rpx;
}
.add-photo::after {
width: 80rpx;
height: 10rpx;
margin-top: -5rpx;
margin-left: -40rpx;
}
.issues-remind {
flex: 1;
font-size: 9pt;
line-height: 135%;
color: #ccc;
padding: 0 30rpx;
word-break: break-all;
text-indent: 1em;
padding-top: 30rpx;
}
.submit-btn {
display: flex;
align-items: center;
justify-content: center;
margin: 40rpx 3%;
height: 80rpx;
border-radius: 3px;
text-align: center;
background-color: #FF8966;
color: #fff;
font-size: 12pt;
}