Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
Support
提交反馈
为 GitLab 提交贡献
登录
切换导航
琼
琼台博物馆小程序Web端
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
刘英杰
琼台博物馆小程序Web端
提交
25d0e644
提交
25d0e644
编写于
10月 25, 2023
作者:
刘英杰
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1025小程序代码
上级
025909f3
变更
21
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
976 行增加
和
207 行删除
+976
-207
app.js
app.js
+5
-0
app.json
app.json
+2
-3
home.png
images/home.png
+0
-0
index.js
pages/index/index.js
+97
-18
index.json
pages/index/index.json
+2
-1
index.wxml
pages/index/index.wxml
+18
-10
index.wxss
pages/index/index.wxss
+5
-0
login.js
pages/login/login.js
+13
-6
login.json
pages/login/login.json
+2
-1
login.wxml
pages/login/login.wxml
+1
-2
record.js
pages/record/record.js
+233
-15
record.json
pages/record/record.json
+11
-1
record.wxml
pages/record/record.wxml
+96
-12
record.wxss
pages/record/record.wxss
+34
-0
showQRcode.wxml
pages/showQRcode/showQRcode.wxml
+2
-1
subscribe.js
pages/subscribe/subscribe.js
+302
-86
subscribe.json
pages/subscribe/subscribe.json
+2
-1
subscribe.wxml
pages/subscribe/subscribe.wxml
+29
-23
subscribe.wxss
pages/subscribe/subscribe.wxss
+4
-0
config.js
utils/config.js
+2
-0
http.js
utils/http.js
+116
-27
未找到文件。
app.js
浏览文件 @
25d0e644
// app.js
App
({
onHide
(){
wx
.
setStorageSync
(
'
dialog
'
,
'
切换到后台
'
)
console
.
log
(
'
整个小程序
'
);
},
onLaunch
()
{
// 展示本地存储能力
const
logs
=
wx
.
getStorageSync
(
'
logs
'
)
||
[]
...
...
@@ -21,5 +25,6 @@ App({
statusBarHeight
:
wx
.
getSystemInfoSync
().
statusBarHeight
,
pageHeight
:
wx
.
getSystemInfoSync
().
screenHeight
-
wx
.
getSystemInfoSync
().
statusBarHeight
-
48
,
menuHeigth
:(
wx
.
getMenuButtonBoundingClientRect
().
top
-
wx
.
getSystemInfoSync
().
statusBarHeight
)
*
2
+
wx
.
getMenuButtonBoundingClientRect
().
height
,
currentAppointmentId
:
''
,
// 全局变量
}
})
app.json
浏览文件 @
25d0e644
...
...
@@ -2,11 +2,10 @@
"pages"
:
[
"pages/index/index"
,
"pages/login/login"
,
"pages/showQRcode/showQRcode"
,
"pages/subscribe/subscribe"
,
"pages/record/record"
"pages/record/record"
,
"pages/teamAppointmentForm/teamAppointmentForm"
],
"window"
:
{
"backgroundTextStyle"
:
"light"
,
...
...
images/home.png
已删除
100644 → 0
浏览文件 @
025909f3
540.5 KB
pages/index/index.js
浏览文件 @
25d0e644
// index.js
var
config
=
require
(
'
../../utils/config
'
)
var
http
=
require
(
'
../../utils/http.js
'
)
var
WxParse
=
require
(
'
../../plugins/wxParse/wxParse.js
'
);
import
Toast
from
'
@vant/weapp/toast/toast
'
;
// 获取应用实例
const
app
=
getApp
()
...
...
@@ -12,13 +12,25 @@ Page({
statusBarHeight
:
app
.
globalData
.
statusBarHeight
,
show
:
false
,
countdown
:
0
,
initInfo
:{}
initInfo
:{},
hight
:
null
,
//高度参数
backgroungImageArray
:[],
imageProtocolHost
:
config
.
imageProtocolHost
,
},
ewm
(){
wx
.
scanCode
({
scanType
:[
'
qrCode
'
],
success
(
res
)
{
console
.
log
(
res
)
}
})
},
//同意入馆须知
agreeGo
(){
wx
.
setStorageSync
(
'
isAgreeGo
'
,
true
)
this
.
setData
({
show
:
false
});
wx
.
removeStorageSync
(
'
dialog
'
)
},
//获取博物馆初始化配置
...
...
@@ -46,6 +58,27 @@ Page({
false
)
},
// 获取小程序主页背景图片
getInitImageList
(){
var
that
=
this
http
.
postData
(
'
/Carousel/GetUseCarouselList
'
,
// 请求参数
{},
function
(
res
)
{
if
(
res
.
code
==
1
)
{
let
initInfo
=
res
.
response
;
that
.
setData
({
backgroungImageArray
:
initInfo
})
}
},
function
(
err
)
{
console
.
log
(
'
请求失败:
'
+
err
);
},
false
)
},
//展开入馆须知
onClickShow
()
{
...
...
@@ -55,33 +88,79 @@ Page({
//路由跳转
navigateToSubscribe
(
e
)
{
// console.log("ttttt",e.currentTarget.dataset.url)
// if(wx.getStorage('token')){
// }
wx
.
navigateTo
({
url
:
e
.
currentTarget
.
dataset
.
url
})
},
onLoad
()
{
wx
.
login
({
success
:
(
res
)
=>
{
console
.
log
(
'
rs
'
,
res
)
},
})
var
that
=
this
;
var
winHeight
=
wx
.
getSystemInfoSync
().
windowHeight
//设置变量存放屏幕高度值
console
.
log
(
winHeight
)
//打印屏幕高度
winHeight
=
winHeight
-
winHeight
*
0.6
this
.
setData
({
hight
:
winHeight
//传递值
})
that
.
getInitInfo
()
//请求初始化数据
//第一步,启动时判断是否打开入馆须知
let
isAgreeGo
=
wx
.
getStorageSync
(
'
isAgreeGo
'
)
//判断是否同意
if
(
!
isAgreeGo
){
//如果没同意过,打开并启动倒计时5秒
this
.
setData
({
show
:
true
,
countdown
:
5
});
let
clock
=
setInterval
(()
=>
{
if
(
that
.
data
.
countdown
===
0
)
{
clearInterval
(
clock
);
//清除周期
}
else
{
that
.
data
.
countdown
--
that
.
setData
({
countdown
:
that
.
data
.
countdown
})
}
},
1000
);
//
if(!isAgreeGo){
//
//如果没同意过,打开并启动倒计时5秒
//
this.setData({ show: true,countdown:5 });
//
let clock = setInterval(() => {
//
if(that.data.countdown === 0) {
//
clearInterval(clock);//清除周期
//
}else {
//
that.data.countdown--
//
that.setData({countdown: that.data.countdown})
//
}
//
}, 1000);
}
// }
if
(
!
wx
.
getStorageSync
(
'
dialog
'
)){
this
.
setData
({
show
:
true
,
countdown
:
5
});
let
clock
=
setInterval
(()
=>
{
if
(
that
.
data
.
countdown
===
0
)
{
clearInterval
(
clock
);
//清除周期
}
else
{
that
.
data
.
countdown
--
that
.
setData
({
countdown
:
that
.
data
.
countdown
})
}
},
1000
);
}
// WxParse.wxParse('content', 'html', that.data.content, that, 10);
// WxParse.wxParse('jianjie', 'html', that.data.jianjie, that, 10);
},
onShow
(){
var
that
=
this
;
if
(
wx
.
getStorageSync
(
'
dialog
'
)){
this
.
setData
({
show
:
true
,
countdown
:
5
});
let
clock
=
setInterval
(()
=>
{
if
(
that
.
data
.
countdown
===
0
)
{
clearInterval
(
clock
);
//清除周期
}
else
{
that
.
data
.
countdown
--
that
.
setData
({
countdown
:
that
.
data
.
countdown
})
}
},
1000
);
}
that
.
getInitImageList
()
//请求初始化swiper 图片数组
},
onShareAppMessage
(){
return
{
title
:
'
琼台博物馆预约
'
,
path
:
"
pages/index/index
"
,
}
}
})
pages/index/index.json
浏览文件 @
25d0e644
...
...
@@ -3,7 +3,8 @@
"van-overlay"
:
"@vant/weapp/overlay/index"
,
"van-divider"
:
"@vant/weapp/divider/index"
,
"van-icon"
:
"@vant/weapp/icon/index"
,
"van-button"
:
"@vant/weapp/button/index"
"van-button"
:
"@vant/weapp/button/index"
,
"van-toast"
:
"@vant/weapp/toast/index"
},
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"琼台师范学院博物馆"
...
...
pages/index/index.wxml
浏览文件 @
25d0e644
<!--index.wxml-->
<import src="../../plugins/wxParse/wxParse.wxml" />
<view class="home-container">
<view class="top">
<image mode="widthFix" src="../../images/home.png" />
<!-- 多张 轮播 -->
<swiper autoplay="{{true}}" circular="{{true}}" style="height: {{hight}}px;width: 100%;" wx:if="{{backgroungImageArray.length>1}}">
<swiper-item wx:for="{{backgroungImageArray}}" wx:for-item="item">
<image mode="widthFix" src="{{imageProtocolHost+item.path}}" />
</swiper-item>
</swiper>
<!-- 一张 不轮播 -->
<image wx:if="{{backgroungImageArray.length===1}}" mode="widthFix" wx:for="{{backgroungImageArray}}" wx:for-item="item" src="{{imageProtocolHost+item.path}}" />
<view class="home-logo" style="top:{{statusBarHeight}}px">
<!-- (menu.top - sysInfo.statusBarHeight) * 2 + menu.height -->
<!-- style="height:{{menuHeigth}}px" -->
<image mode="widthFix" src="../../images/logo.png" />
</view>
</view>
<view class="box">
<view class='bg-img'>
<image src="../../images/home-bg.png" />
</view>
<view class="box-content">
<view class="intro">
<view class="intro-title">
...
...
@@ -32,11 +37,13 @@
</view>
</view>
<van-toast id="van-toast" />
<view class="inner">
<!-- 散客预约 -->
<view class="item" bindtap="navigateToSubscribe" data-url="../subscribe/subscribe?subscribeType=0&title=散客预约">
<view class='item-bg-img'>
<image mode="widthFix" src="../../images/
view-bg
.png" />
<image mode="widthFix" src="../../images/
newsktd
.png" />
</view>
<view class="item-content">
<view class="item-title">散客预约</view>
...
...
@@ -48,7 +55,7 @@
<!-- 团队预约 -->
<view class="item" bindtap="navigateToSubscribe" data-url="../subscribe/subscribe?subscribeType=1&title=团队预约">
<view class='item-bg-img'>
<image mode="widthFix" src="../../images/
view-bg
.png" />
<image mode="widthFix" src="../../images/
newsktd
.png" />
</view>
<view class="item-content">
<view class="item-title">团队预约</view>
...
...
@@ -60,7 +67,7 @@
<!-- 公务接待预约 -->
<view class="long-item" bindtap="navigateToSubscribe" data-url="../subscribe/subscribe?subscribeType=2&title=公务接待预约">
<view class='item-bg-img'>
<image mode="widthFix" src="../../images/
long-view-bg1
.png" />
<image mode="widthFix" src="../../images/
newgwjd
.png" />
</view>
<view class="item-content">
<view class="item-title">公务接待预约</view>
...
...
@@ -73,7 +80,7 @@
<!-- 预约记录 -->
<view class="long-item" bindtap="navigateToSubscribe" data-url="../record/record?title=预约记录">
<view class='item-bg-img'>
<image mode="widthFix" src="../../images/
long-view-bg2
.png" />
<image mode="widthFix" src="../../images/
newyyjl
.png" />
</view>
<view class="item-content">
<view class="item-title">预约记录</view>
...
...
@@ -82,7 +89,8 @@
</view>
</view>
</view>
<view>{{token}}</view>
<!-- <button bindtap="ewm">测</button> -->
</view>
</view>
...
...
pages/index/index.wxss
浏览文件 @
25d0e644
.swiper{
height: 350px;
width: 100%;
}
@import "../../plugins/wxParse/wxParse.wxss";
::-webkit-scrollbar{
...
...
pages/login/login.js
浏览文件 @
25d0e644
// pages/login/login.js
var
http
=
require
(
'
../../utils/http.js
'
)
import
Toast
from
'
@vant/weapp/toast/toast
'
;
Page
({
/**
...
...
@@ -11,20 +13,20 @@ Page({
codePhone
:
"
无
"
,
codeLogin
:
"
无
"
},
getRealtimePhoneNumber
(
e
)
{
getRealtimePhoneNumber
(
e
)
{
var
that
=
this
console
.
log
(
"
code:
"
,
e
.
detail
.
code
)
wx
.
login
({
success
(
loginRes
)
{
``
if
(
loginRes
.
code
)
{
console
.
log
(
"
wx.loginCode
"
,
loginRes
.
code
)
that
.
setData
({
codePhone
:
e
.
detail
.
code
,
codeLogin
:
loginRes
.
code
})
codeLogin
:
loginRes
.
code
,
})
//发起网络请求
http
.
getData
(
'
Login/api/Login/GetMiNiprogramToken
'
,
...
...
@@ -39,9 +41,12 @@ Page({
const
loginInfo
=
res
.
response
;
wx
.
setStorageSync
(
'
token
'
,
loginInfo
.
access_token
.
token_content
)
wx
.
setStorageSync
(
'
refreshToken
'
,
loginInfo
.
refresh_token
.
token_content
);
// wx.setStorageSync('Token', loginRes.code)
wx
.
navigateBack
({
delta
:
1
})
}
},
function
(
err
)
{
...
...
@@ -49,6 +54,7 @@ Page({
},
false
)
}
else
{
console
.
log
(
'
登录失败!
'
,
loginRes
)
wx
.
showToast
({
...
...
@@ -59,6 +65,7 @@ Page({
}
}
})
},
// getRealtimePhoneNumber(){
// console.log("111111111111111111")
...
...
pages/login/login.json
浏览文件 @
25d0e644
{
"usingComponents"
:
{
"van-button"
:
"@vant/weapp/button/index"
,
"van-checkbox"
:
"@vant/weapp/checkbox/index"
"van-checkbox"
:
"@vant/weapp/checkbox/index"
,
"van-toast"
:
"@vant/weapp/toast/index"
},
"navigationBarTitleText"
:
"登录"
}
\ No newline at end of file
pages/login/login.wxml
浏览文件 @
25d0e644
...
...
@@ -13,10 +13,9 @@
<van-checkbox value="{{ checked }}" icon-size="32rpx" shape="square" bind:change="onChange" />
<text style="color: #999;">已阅读并同意<text class="tip-text">《隐私权政策》</text><text class="tip-text">《用户协议》</text></text>
</view>
<!-- <text style="margin-top: 50px;" selectable>{{codePhone}}</text>
<text style="margin-top: 50px;" selectable>{{codeLogin}}</text> -->
<van-toast id="van-toast" />
</view>
</view>
\ No newline at end of file
pages/record/record.js
浏览文件 @
25d0e644
// pages/record/record.js
var
http
=
require
(
'
../../utils/http.js
'
)
const
app
=
getApp
()
import
Dialog
from
'
@vant/weapp/dialog/dialog
'
;
import
Toast
from
'
@vant/weapp/toast/toast
'
;
Page
({
/**
...
...
@@ -13,10 +16,189 @@ Page({
pageIndex
:
1
,
//页
recordList
:
[],
//预约记录
employ_state
:
1
,
currentAppointmentId
:
''
,
// 当前分享的组队id
awaitSubmitList
:
false
,
// 待提交列表
list
:
[],
result
:
[],
teamId
:
''
,
type
:
''
,
arrayLengthzero
:
''
,
timer
:
''
,
},
// 弹窗
modal
(
res
){
if
(
res
.
code
!==
1
){
Toast
.
fail
(
'
异常:
'
+
res
.
code
);
}
else
{
Toast
.
success
(
'
操作成功!
'
);
}
},
//同意申请
consentApplication
(){
const
_this
=
this
if
(
_this
.
data
.
result
.
length
!==
0
){
http
.
postData
(
'
ChangeCommit/api/changeCommit/BatchInserAppointment
'
,
_this
.
data
.
result
,
function
(
res
)
{
_this
.
modal
(
res
)
_this
.
setData
({
result
:[]
})
},
function
(
err
)
{
_this
.
modal
(
err
)
},
true
)
_this
.
awaitSubmitListFunction
()
}
else
if
(
_this
.
data
.
result
.
length
===
0
){
Toast
.
fail
(
'
数据为空!
'
);
}
},
//拒绝申请(删除)
daleteInfoMap
(){
const
_this
=
this
if
(
_this
.
data
.
result
.
length
!==
0
){
_this
.
data
.
result
.
forEach
((
curent
,
index
)
=>
{
_this
.
daleteInfo
(
curent
)
})
setTimeout
(()
=>
{
_this
.
awaitSubmitListFunction
()
},
50
)
}
else
if
(
_this
.
data
.
result
.
length
===
0
){
Toast
.
fail
(
'
数据为空!
'
)
}
},
daleteInfo
(
e
){
const
_this
=
this
console
.
log
(
_this
.
data
.
result
);
http
.
getData
(
'
ChangeCommit/api/changeCommit/ChangeCommitDelete
'
,
{
changeCommitId
:
e
},
function
(
res
)
{
_this
.
modal
(
res
)
_this
.
setData
({
result
:[]
})
},
function
(
err
)
{
console
.
log
(
err
);
},
true
)
},
//获取同行人视图选中记录Id
onChangeCheckbox
(
event
)
{
const
_this
=
this
_this
.
setData
({
result
:
event
.
detail
,
});
},
// 多选事件
toggle
(
event
)
{
console
.
log
(
event
,
'
toggle
'
);
const
{
index
}
=
event
.
currentTarget
.
dataset
;
const
checkbox
=
this
.
selectComponent
(
`.checkboxes-
${
index
}
`
);
checkbox
.
toggle
();
},
//待提交列表显隐
onClickShow
()
{
this
.
setData
({
awaitSubmitList
:
true
});
},
//待提交列表显隐
onClickHide
()
{
this
.
setData
({
awaitSubmitList
:
false
});
this
.
getSubcsribeInfo
()
},
//待提交列表按钮(初始化列表)
awaitSubmitListFunction
(
e
=
''
){
const
_this
=
this
if
(
e
){
_this
.
setData
({
teamId
:
e
.
currentTarget
.
dataset
.
appointmentid
,
type
:
e
.
currentTarget
.
dataset
.
type
})
http
.
getData
(
'
ChangeCommit/api/changeCommit/GetChangeCommitList
'
,
{
appointmentId
:
_this
.
data
.
teamId
,
page_index
:
1
,
page_size
:
20
},
function
(
res
){
console
.
log
(
res
.
response
.
data
);
_this
.
setData
({
list
:
res
.
response
.
data
})
},
function
(
err
){
console
.
log
(
err
);
},
true
)
}
else
if
(
e
===
''
){
http
.
getData
(
'
ChangeCommit/api/changeCommit/GetChangeCommitList
'
,
{
appointmentId
:
_this
.
data
.
teamId
,
page_index
:
1
,
page_size
:
20
},
function
(
res
){
console
.
log
(
res
.
response
.
data
,
'
res.response.data
'
);
_this
.
setData
({
list
:
res
.
response
.
data
})
},
function
(
err
){
console
.
log
(
err
);
},
true
)
}
_this
.
setData
({
awaitSubmitList
:
true
})
},
//预约分享获取id
openShareFromFunction
(
e
){
let
_this
=
this
_this
.
setData
({
currentAppointmentId
:
e
.
currentTarget
.
dataset
.
appointmentid
})
},
// 取消预约按钮事件
cancelAppointment
(
e
){
let
_this
=
this
Dialog
.
confirm
({
title
:
'
取消预约
'
,
message
:
'
是否确认取消此次预约?
'
,
}).
then
((
res
)
=>
{
http
.
getData
(
'
Background/api/guest/AppointmentCancel
'
,
{
"
appointmentid
"
:
e
.
currentTarget
.
dataset
.
appointmentid
},
function
(
res
){
Toast
.
success
(
res
.
msg
)
},
function
(
err
){
console
.
log
(
err
);
}
,
true
)
_this
.
getSubcsribeInfo
()
})
.
catch
((
err
)
=>
{
console
.
log
(
err
,
2
);
})
},
onChange
(
event
)
{
console
.
log
(
event
.
detail
)
console
.
log
(
event
.
detail
,
'
event.detail
'
)
//employ_state 1-待使用 2-已使用 3-预约变更 4-预约过期
let
employ_state
=
1
if
(
event
.
detail
.
title
)
{
...
...
@@ -43,13 +225,18 @@ Page({
},
navigateToSubscribe
(
e
)
{
console
.
log
(
'
12312
'
,
e
);
var
that
=
this
// console.log("ttttt",e.currentTarget.dataset.url)
wx
.
navigateTo
({
url
:
e
.
currentTarget
.
dataset
.
url
})
clearTimeout
(
that
.
timer
)
that
.
timer
=
setTimeout
(()
=>
{
wx
.
navigateTo
({
url
:
e
.
currentTarget
.
dataset
.
url
})
},
500
)
},
//获取预约记录
//获取预约记录
url, getData, doSuccess, doFail, needToken
getSubcsribeInfo
()
{
var
that
=
this
http
.
getData
(
...
...
@@ -62,8 +249,32 @@ Page({
},
function
(
res
)
{
console
.
log
(
"
res
"
,
res
)
if
(
res
.
code
==
1
)
{
var
recordList
=
that
.
data
.
recordList
.
concat
(
res
.
response
.
data
)
if
(
res
.
code
===
1
)
{
var
recordList
if
(
that
.
data
.
employ_state
===
1
){
that
.
setData
({
recordList
:
[],
})
}
if
(
that
.
data
.
employ_state
===
2
){
// recordList.forEach((cur,index)=>{
// if(! !!recordList.length){
// // that.arrayLengthzero = !!recordList.length
// }
// recordList.splice(index, 1);
// })
that
.
setData
({
recordList
:
[],
})
}
recordList
=
that
.
data
.
recordList
.
concat
(
res
.
response
.
data
)
console
.
log
(
recordList
,
'
recordList
'
);
var
flag
var
pageIndex
=
that
.
data
.
pageIndex
if
(
recordList
.
length
<
res
.
response
.
data_count
)
{
...
...
@@ -105,9 +316,11 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
onLoad
()
{
// this.getSubcsribeInfo()
// try {
// wx.setNavigationBarTitle({
// title: options.title
...
...
@@ -121,7 +334,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{
},
/**
...
...
@@ -158,11 +371,16 @@ Page({
onReachBottom
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
onShareAppMessage
(
e
)
{
return
{
title
:
'
同行人预约填写
'
,
path
:
`pages/teamAppointmentForm/teamAppointmentForm?currentAppointmentObject=
${
JSON
.
stringify
(
e
.
target
.
dataset
.
detail
)}
`
,
}
// }, 30);
}
})
\ No newline at end of file
})
//?currentAppointmentId=${_this.data.currentAppointmentId}
\ No newline at end of file
pages/record/record.json
浏览文件 @
25d0e644
...
...
@@ -2,7 +2,17 @@
"usingComponents"
:
{
"van-tab"
:
"@vant/weapp/tab/index"
,
"van-tabs"
:
"@vant/weapp/tabs/index"
,
"van-empty"
:
"@vant/weapp/empty/index"
"van-empty"
:
"@vant/weapp/empty/index"
,
"van-button"
:
"@vant/weapp/button/index"
,
"van-dialog"
:
"@vant/weapp/dialog/index"
,
"van-overlay"
:
"@vant/weapp/overlay/index"
,
"van-checkbox"
:
"@vant/weapp/checkbox/index"
,
"van-checkbox-group"
:
"@vant/weapp/checkbox-group/index"
,
"van-cell"
:
"@vant/weapp/cell/index"
,
"van-cell-group"
:
"@vant/weapp/cell-group/index"
,
"van-popup"
:
"@vant/weapp/popup/index"
,
"van-toast"
:
"@vant/weapp/toast/index"
,
"van-submit-bar"
:
"@vant/weapp/submit-bar/index"
},
"navigationBarTitleText"
:
"预约记录"
}
\ No newline at end of file
pages/record/record.wxml
浏览文件 @
25d0e644
<wxs src="../../wxs/tools.wxs" module="tools" />
<view class="record-container">
<van-tabs active="{{ active }}" color="#d59171" title-active-color="#d59171" bind:change="onChange">
<van-tab title="待使用">
<van-tab title="待使用"
>
<scroll-view wx:if="{{recordList.length>0}}" scroll-y="true" style="height: {{windowHeight -60}}px;" bindscrolltolower="loadMore">
<!-- 一条表单记录 -->
<view wx:for="{{recordList}}" wx:for-item="recordItem" class="record-item" bindtap="navigateToSubscribe" data-url="../showQRcode/showQRcode?appointmentid={{recordItem.appointmentid}}&title={{recordItem.type==1?'团队预约':recordItem.type==2?'公务接待预约':'散客预约'}}" >
<!-- 标题 -->
<view class="record-title-box">
{{recordItem.type==1?'团队预约':recordItem.type==2?'公务接待预约':'散客预约'}}
<view wx:for="{{recordList}}" wx:for-item="recordItem" class="record-item" >
<!-- 记录内容部分 -->
<view bindtap="navigateToSubscribe" data-url="../showQRcode/showQRcode?appointmentid={{recordItem.appointmentid}}&title={{recordItem.type===1?'团队预约':recordItem.type===2?'公务接待预约':'散客预约'}}">
<!-- 标题 -->
<view class="record-title-box">
{{recordItem.type===1?'团队预约':recordItem.type===2?'公务接待预约':'散客预约'}}
</view>
<!-- 预约详情 -->
<view class="record-content-box">
<!-- -->
<view class="record-content-item">
<view class="info-item-label">参观日期</view>
<view class="info-item-value"> {{tools.formatTimeToDate(recordItem.museum_date, 'Y年M月D日')}} <text>{{recordItem.moment==1?'上午':'下午'}}</text></view>
<view class="info-item-value"> {{tools.formatTimeToDate(recordItem.museum_date, 'Y年M月D日')}} <text>{{recordItem.moment==
=
1?'上午':'下午'}}</text></view>
</view>
<!-- -->
<view class="record-content-item">
<view class="info-item-label">预约时间</view>
<view class="info-item-value"> {{tools.formatTimeToDate(recordItem.createtime, 'Y-M-D h:m:s')}}</view>
<!-- <view class="info-item-value"> {{tools.formatTimeToDate(recordItem.createtime, 'Y-M-D h:m:s')}}</view> -->
<view class="info-item-value"> {{tools.formatTimeToDate(recordItem.createtime, 'Y-M-D')}}</view>
</view>
<!-- -->
<view class="record-content-item">
<view class="info-item-label">人数</view>
<view class="info-item-value">{{recordItem.num}}人</view>
</view>
</view>
</view>
</view>
<!-- 取消预约 -->
<view class="record-content-item">
<view class="info-item-label"></view>
<view class="info-item-value">
<!-- 待提交列表 -->
<van-button wx:if="{{recordItem.type === 1 || recordItem.type === 2}}" color="#D59171" size="small" bind:tap="awaitSubmitListFunction" data-type="{{recordItem.type}}" data-appointmentid="{{recordItem.appointmentid}}" style=" margin-right: 10px;" type="danger">待提交列表</van-button>
<!-- 预约分享 -->
<van-button wx:if="{{recordItem.type === 1 || recordItem.type === 2}}" color="#D59171" size="small" dataset="{{recordItem}}" open-type="share" bind:tap="openShareFromFunction" data-appointmentid="{{recordItem.appointmentid}}" style=" margin-right: 10px;" type="danger">预约分享</van-button>
<!-- 通行凭证 -->
<van-button style="margin-right: 10px;" color="#D59171" size="small" bindtap="navigateToSubscribe" data-url="../showQRcode/showQRcode?appointmentid={{recordItem.appointmentid}}&title={{recordItem.type===1?'团队预约':recordItem.type===2?'公务接待预约':'散客预约'}}">通行凭证</van-button>
<!-- 取消预约 -->
<van-button color="#D59171" size="small" bind:tap="cancelAppointment" data-appointmentid="{{recordItem.appointmentid}}" type="danger">取消预约</van-button>
</view>
</view>
<!-- <van-button type="primary" bind:click="onClickShow">嵌入内容</van-button> -->
<van-overlay z-index="1" show="{{awaitSubmitList}}" >
<view class="wrapper" >
<van-empty description="暂无数据" wx:if="{{list.length === 0}}"/>
<view class="block" wx:if="{{list.length !== 0}}" >
<scroll-view style="height: 100%;" scroll-y type="list" >
<view style="padding: 20px 20px; display: flex; justify-content: center;">待提交列表</view>
<van-checkbox-group value="{{ result }}" bind:change="onChangeCheckbox" >
<van-cell-group>
<van-cell
wx:for="{{ list }}"
wx:key="index"
value-class="value-class"
clickable
data-index="{{ index }}"
bind:click="toggle"
>
<view slot="title">
<view class="van-cell-text" style="width: 30%;">{{item.name}}</view>
<view class="van-cell-text" style="width: 70%;" wx:if="{{type === 1}}">{{item.identity_num}}</view>
<view class="van-cell-text" style="width: 70%;" wx:if="{{type === 2}}">{{item.position}}</view>
</view>
<van-checkbox
class="checkboxes-{{ index }}"
name="{{item.id}}"
/>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</scroll-view>
<view class="listCustomTabbar">
<van-button color="#D59171" bind:click="onClickHide" size="small" type="warning">关闭界面</van-button>
<van-button color="#D59171" bind:click="daleteInfoMap" size="small" type="warning">删除</van-button>
<van-button color="#D59171" bind:click="consentApplication" size="small" type="warning">同意</van-button>
</view>
</view>
</view>
</van-overlay>
<van-toast id="van-toast" />
<van-dialog id="van-dialog" confirm-button-color="#D59171"/>
<van-toast id="van-toast" />
</view>
</scroll-view>
<view wx:else>
<van-empty description="暂无记录" />
</view>
</van-tab>
<van-tab title="已使用">
<van-tab title="已使用"
>
<scroll-view wx:if="{{recordList.length>0}}" scroll-y="true" style="height: {{windowHeight -60}}px;" bindscrolltolower="loadMore">
<!-- 一条表单记录 -->
<view wx:for="{{recordList}}" wx:for-item="recordItem" class="record-item" data-url="../showQRcode/showQRcode?appointmentid={{recordItem.appointmentid}}&title={{recordItem.type==1?'团队预约':recordItem.type==2?'公务接待预约':'散客预约'}}" >
<view bindtap="navigateToSubscribe" wx:for="{{recordList}}" wx:for-item="recordItem" class="record-item" data-url="../showQRcode/showQRcode?appointmentid={{recordItem.appointmentid}}&title={{recordItem.type==1?'团队预约':recordItem.type==2?'公务接待预约':'散客预约'}}" >
<!-- <view bindtap="navigateToSubscribe" data-url="../showQRcode/showQRcode?appointmentid={{recordItem.appointmentid}}&title={{recordItem.type===1?'团队预约':recordItem.type===2?'公务接待预约':'散客预约'}}"></view> -->
<!-- 标题 -->
<view class="record-title-box">
{{recordItem.type==1?'团队预约':recordItem.type==2?'公务接待预约':'散客预约'}}
...
...
@@ -48,13 +126,19 @@
</view>
<view class="record-content-item">
<view class="info-item-label">预约时间</view>
<view class="info-item-value"> {{tools.formatTimeToDate(recordItem.createtime, 'Y-M-D h:m:s')}}</view>
<!-- <view class="info-item-value"> {{tools.formatTimeToDate(recordItem.createtime, 'Y-M-D h:m:s')}}</view> -->
<view class="info-item-value"> {{tools.formatTimeToDate(recordItem.createtime, 'Y-M-D ')}}</view>
</view>
<view class="record-content-item">
<view class="info-item-label">人数</view>
<view class="info-item-value">{{recordItem.num}}人</view>
</view>
<view style="display: flex;justify-content: flex-end;">
<!-- 通行凭证 -->
<van-button color="#D59171" size="small" bindtap="navigateToSubscribe" data-url="../showQRcode/showQRcode?appointmentid={{recordItem.appointmentid}}&title={{recordItem.type===1?'团队预约':recordItem.type===2?'公务接待预约':'散客预约'}}">通行凭证</van-button>
</view>
</view>
</view>
</scroll-view>
...
...
@@ -64,7 +148,7 @@
</view>
</van-tab>
<van-tab title="预约过期">
<van-tab title="预约过期"
>
<scroll-view wx:if="{{recordList.length>0}}" scroll-y="true" style="height: {{windowHeight -60}}px;" bindscrolltolower="loadMore">
<!-- 一条表单记录 -->
<view wx:for="{{recordList}}" wx:for-item="recordItem" class="record-item" data-url="../showQRcode/showQRcode?appointmentid={{recordItem.appointmentid}}&title={{recordItem.type==1?'团队预约':recordItem.type==2?'公务接待预约':'散客预约'}}" >
...
...
pages/record/record.wxss
浏览文件 @
25d0e644
...
...
@@ -53,4 +53,38 @@
padding: 15rpx 0;
font-size: 28rpx;
}
.wrapper {
display: flex;
/* align-items: center; */
justify-content: center;
height: 100%;
/* opacity:1; */
background-color: #fff;
/* background-color:#ffc993 ; */
}
.block {
width: 100%;
height:90%;
background-color: #fff;
/* background-image: url(../../images/home.jpg); */
}
.listCustomTabbar{
height: 11%;
background-color: #f2eee9;
display: flex ;
justify-content: space-around;
align-items: center;
}
.value-class {
flex: none !important;
}
\ No newline at end of file
pages/showQRcode/showQRcode.wxml
浏览文件 @
25d0e644
...
...
@@ -18,7 +18,8 @@
</view>
<view class="record-content-item">
<view class="info-item-label">预约时间</view>
<view class="info-item-value">{{tools.formatTimeToDate(record.createtime, 'Y-M-D h:m:s')}}</view>
<!-- <view class="info-item-value">{{tools.formatTimeToDate(record.createtime, 'Y-M-D h:m:s')}}</view> -->
<view class="info-item-value">{{tools.formatTimeToDate(record.createtime, 'Y-M-D')}}</view>
</view>
<view class="record-content-item">
<view class="info-item-label">人数</view>
...
...
pages/subscribe/subscribe.js
浏览文件 @
25d0e644
...
...
@@ -2,13 +2,14 @@
var
http
=
require
(
'
../../utils/http.js
'
)
var
app
=
getApp
()
import
Toast
from
'
@vant/weapp/toast/toast
'
;
Page
({
/**
* 页面的初始数据
*/
data
:
{
teamNum
:
false
,
// 团队总计显隐
windowHeight
:
app
.
globalData
.
windowHeight
,
subscribeType
:
0
,
dateShow
:
false
,
...
...
@@ -21,16 +22,20 @@ Page({
minDate
:
""
,
//最小日期
maxDate
:
""
,
//最大日期
personNum
:
1
,
//人数
showVisitDateList
:
[],
//前三个
visitFromList
:
[{
name
:
''
,
idCode
:
""
,
phoneCode
:
''
,
},
],
visitLeaderist
:
[{
name
:
''
,
work
:
""
},
],
visitFromListTeam
:[],
//团队同行人列表
// visitFromList:[],
// visitLeaderist: [{
// name: '',
// position: ""
// }, ],
visitLeaderist
:[],
visitTeamFrom
:
{
unit
:
""
,
name
:
""
,
...
...
@@ -48,15 +53,38 @@ Page({
personNum
:
null
,
},
formatter
:
null
,
flag
:
false
,
txrFormFlag
:
false
,
teamRequestFlag
:
true
,
},
//预提交Flag
preSubmission
(){
const
_this
=
this
_this
.
setData
({
teamRequestFlag
:
false
})
},
//立即预约Flag
makeAnAppointmentNow
(){
const
_this
=
this
_this
.
setData
({
teamRequestFlag
:
true
})
if
(
wx
.
getStorage
(
'
token
'
)){
}
},
// 加
plus
(){
const
_this
=
this
console
.
log
(
_this
.
data
.
visitFromList
.
length
);
},
//减
minus
(){
console
.
log
(
'
minus
'
);
},
//获取博物馆访问日历初始化
getInitWeek
()
{
...
...
@@ -92,7 +120,6 @@ Page({
});
let
formatter
=
function
(
day
)
{
// const month = day.date.getMonth() + 1;
// const date = day.date.getDate();
//判断visitDateList中的state,0:可订,1:停售
...
...
@@ -101,7 +128,6 @@ Page({
// console.log("刷新选中的时间", that.data.defaultDate)
return
day
;
}
that
.
setData
({
formatter
:
formatter
})
...
...
@@ -281,27 +307,32 @@ Page({
//人数变化
onSteChange
(
event
)
{
console
.
log
(
event
.
detail
);
// if(this.data.subscribeType==2){
// this.addPerson()
// }
console
.
log
(
event
.
detail
);
this
.
setData
({
teamNum
:
true
,
personNum
:
event
.
detail
})
},
//添加参观人员
addPerson
(
e
)
{
let
that
=
this
;
that
.
setData
({
txrFormFlag
:
true
})
console
.
log
(
e
.
detail
.
target
.
dataset
.
type
)
if
(
e
.
detail
.
target
.
dataset
.
type
==
1
){
if
(
that
.
data
.
subscribeType
==
0
||
that
.
data
.
subscribeType
==
1
)
{
let
visitFromList
=
that
.
data
.
visitFromList
if
(
that
.
data
.
subscribeType
==
0
){
let
visitFromList
=
that
.
data
.
visitFromList
let
userList
=
[];
//(因为数据不是双向绑定的)将页面上输入框的值全部保存起来
for
(
let
i
=
0
;
i
<
visitFromList
.
length
;
i
++
)
{
...
...
@@ -311,17 +342,67 @@ Page({
phoneCode
:
e
.
detail
.
value
[
"
phoneCode
"
+
(
i
+
1
)],
})
}
//添加一个空的人员信息项
//
//添加一个空的人员信息项
userList
.
push
({
name
:
''
,
idCode
:
""
,
phoneCode
:
''
,
})
that
.
setData
({
that
.
setData
({
visitFromList
:
userList
,
personNum
:
userList
.
length
})
}
else
{
let
visitFromListTeam
=
that
.
data
.
visitFromListTeam
let
userList
=
[];
//(因为数据不是双向绑定的)将页面上输入框的值全部保存起来
for
(
let
i
=
0
;
i
<
visitFromListTeam
.
length
;
i
++
)
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
idCode
:
e
.
detail
.
value
[
"
idCode
"
+
(
i
+
1
)],
phoneCode
:
e
.
detail
.
value
[
"
phoneCode
"
+
(
i
+
1
)],
})
}
// //添加一个空的人员信息项
userList
.
push
({
name
:
''
,
idCode
:
""
,
phoneCode
:
''
,
})
that
.
setData
({
visitFromListTeam
:
userList
,
// personNum:userList.length+1
})
}
// 原
// let visitFromList = that.data.visitFromList
// let userList = [];
// //(因为数据不是双向绑定的)将页面上输入框的值全部保存起来
// for (let i = 0; i < visitFromList.length; i++) {
// userList.push({
// name: e.detail.value["name" + (i + 1)],
// idCode: e.detail.value["idCode" + (i + 1)],
// phoneCode: e.detail.value["phoneCode" + (i + 1)],
// })
// }
// //添加一个空的人员信息项
// userList.push({
// name: '',
// idCode: "",
// phoneCode:'',
// })
// if(that.data.subscribeType == 0 ){
// that.setData({
// visitFromList: userList,
// personNum:userList.length
// })
// }else{
// that.setData({
// visitFromList: userList,
// personNum:userList.length+1
// })
// }
// 原
}
else
if
(
that
.
data
.
subscribeType
==
2
)
{
...
...
@@ -331,18 +412,18 @@ Page({
for
(
let
i
=
0
;
i
<
visitLeaderist
.
length
;
i
++
)
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
work
:
e
.
detail
.
value
[
"
work
"
+
(
i
+
1
)],
position
:
e
.
detail
.
value
[
"
position
"
+
(
i
+
1
)],
})
}
userList
.
push
({
name
:
''
,
work
:
""
position
:
""
})
that
.
setData
({
visitLeaderist
:
userList
,
personNum
:
userList
.
length
// personNum:userList.length+1 添加领导人 按钮 计数
})
}
...
...
@@ -358,9 +439,10 @@ Page({
let
index
=
e
.
detail
.
target
.
dataset
.
index
// let index = e.currentTarget.dataset.index
if
(
that
.
data
.
subscribeType
==
0
||
that
.
data
.
subscribeType
==
1
)
{
let
visitFromList
=
that
.
data
.
visitFromList
if
(
that
.
data
.
subscribeType
==
0
){
let
visitFromList
=
that
.
data
.
visitFromList
let
userList
=
[];
//(因为数据不是双向绑定的)将页面上输入框的值全部保存起来
//
(因为数据不是双向绑定的)将页面上输入框的值全部保存起来
for
(
let
i
=
0
;
i
<
visitFromList
.
length
;
i
++
)
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
...
...
@@ -374,6 +456,52 @@ Page({
visitFromList
:
userList
,
personNum
:
userList
.
length
})
}
else
{
let
visitFromListTeam
=
that
.
data
.
visitFromListTeam
let
userList
=
[];
// (因为数据不是双向绑定的)将页面上输入框的值全部保存起来
for
(
let
i
=
0
;
i
<
visitFromListTeam
.
length
;
i
++
)
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
idCode
:
e
.
detail
.
value
[
"
idCode
"
+
(
i
+
1
)],
phoneCode
:
e
.
detail
.
value
[
"
phoneCode
"
+
(
i
+
1
)]
})
}
userList
.
splice
(
index
,
1
)
that
.
setData
({
visitFromListTeam
:
userList
,
// personNum:userList.length+1 团队 添加同行人 总计 +1
})
}
//原
// let visitFromList = that.data.visitFromList
// let userList = [];
//(因为数据不是双向绑定的)将页面上输入框的值全部保存起来
// for (let i = 0; i < visitFromList.length; i++) {
// userList.push({
// name: e.detail.value["name" + (i + 1)],
// idCode: e.detail.value["idCode" + (i + 1)],
// phoneCode: e.detail.value["phoneCode" + (i + 1)]
// })
// }
// // userList.splice(index, 1)
// // that.setData({
// // visitFromList: userList,
// // personNum:userList.length+1
// // })
// if(that.data.subscribeType == 0 ){
// that.setData({
// visitFromList: userList,
// personNum:userList.length
// })
// }else{
// that.setData({
// visitFromList: userList,
// personNum:userList.length+1
// })
// }
}
else
if
(
that
.
data
.
subscribeType
==
2
)
{
let
visitLeaderist
=
that
.
data
.
visitLeaderist
...
...
@@ -382,25 +510,38 @@ Page({
for
(
let
i
=
0
;
i
<
visitLeaderist
.
length
;
i
++
)
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
work
:
e
.
detail
.
value
[
"
work
"
+
(
i
+
1
)]
position
:
e
.
detail
.
value
[
"
position
"
+
(
i
+
1
)]
})
}
userList
.
splice
(
index
,
1
)
that
.
setData
({
visitLeaderist
:
userList
,
personNum
:
userList
.
length
// personNum:userList.length+1
})
}
},
//提交预约信息
onSubscribe
(
e
)
{
const
that
=
this
;
console
.
log
(
e
,
'
=================================
'
);
console
.
log
(
"
onSubscribe
"
,
e
.
detail
.
value
)
// if(wx.getStorage('token')){
wx
.
requestSubscribeMessage
({
tmplIds
:
[
'
i8mE4RkFO6ts_AINt3v_RHGuwUJf8N3dGUFkKvTAd6M
'
,
'
XnR_tKEGS8C7vKoeY5501sZxT5I7ymMGG-nt3kIOrzM
'
],
success
:
function
(
res
)
{
// Toast.success('推送授权成功')
console
.
log
(
'
推送授权成功
'
);
},
fail
:
function
(
err
)
{
// Toast.fail('接口调用失败')
console
.
log
(
'
接口调用失败
'
);
}
})
// }
if
(
that
.
data
.
checkDate
&&
that
.
data
.
checkSession
)
{
console
.
log
(
"
不为空
"
)
let
data
=
{};
...
...
@@ -434,16 +575,102 @@ Page({
users
:
userList
,
//用户列表
num
:
that
.
data
.
personNum
,
//人数
}
}
else
if
(
that
.
data
.
subscribeType
==
1
)
{
console
.
log
(
'
同行人
'
,
that
.
data
.
visitFromListTeam
.
length
,
'
总人数
'
,
that
.
data
.
personNum
);
// &&visitFromList.length >=10
if
(
that
.
data
.
visitFromListTeam
.
length
+
1
<=
that
.
data
.
personNum
&&
that
.
data
.
personNum
>=
10
&&
that
.
data
.
teamRequestFlag
===
true
){
postUrl
=
"
Background/api/guest/TeamOrOfficialCreate
"
;
let
length
=
that
.
data
.
visitFromListTeam
.
length
let
userList
=
[];
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)]
&&
e
.
detail
.
value
[
"
idCode
"
+
(
i
+
1
)])
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
identity_num
:
e
.
detail
.
value
[
"
idCode
"
+
(
i
+
1
)]
})
}
else
{
wx
.
showToast
({
title
:
"
请完善参观人员资料
"
,
icon
:
'
error
'
,
duration
:
1000
})
return
;
}
}
//团队预约
data
=
{
museum_date
:
that
.
data
.
checkDate
,
//日期
moment
:
that
.
data
.
checkSession
,
//场次
unit
:
e
.
detail
.
value
.
unit
,
//单位名称
name
:
e
.
detail
.
value
.
name
,
//姓名
identity_num
:
e
.
detail
.
value
.
idCode
,
//身份证号
mobile
:
e
.
detail
.
value
.
phone
,
//手机号
plate_number
:
e
.
detail
.
value
.
carCode
,
//车俩信息
num
:
e
.
detail
.
value
.
personNum
,
//人数
reason
:
e
.
detail
.
value
.
reason
,
//参观事由
users
:
userList
,
//拜访用户信息
type
:
1
,
//团队:1,公务:2
}
}
else
if
(
that
.
data
.
visitFromListTeam
.
length
+
1
<=
that
.
data
.
personNum
&&!
that
.
data
.
teamRequestFlag
===
true
){
postUrl
=
"
Background/api/guest/TeamOrOfficialCreate
"
;
let
length
=
that
.
data
.
visitFromListTeam
.
length
let
userList
=
[];
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)]
&&
e
.
detail
.
value
[
"
idCode
"
+
(
i
+
1
)])
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
identity_num
:
e
.
detail
.
value
[
"
idCode
"
+
(
i
+
1
)]
})
}
else
{
wx
.
showToast
({
title
:
"
请完善参观人员资料
"
,
icon
:
'
error
'
,
duration
:
1000
})
return
;
}
}
//团队预约
data
=
{
museum_date
:
that
.
data
.
checkDate
,
//日期
moment
:
that
.
data
.
checkSession
,
//场次
unit
:
e
.
detail
.
value
.
unit
,
//单位名称
name
:
e
.
detail
.
value
.
name
,
//姓名
identity_num
:
e
.
detail
.
value
.
idCode
,
//身份证号
mobile
:
e
.
detail
.
value
.
phone
,
//手机号
plate_number
:
e
.
detail
.
value
.
carCode
,
//车俩信息
num
:
e
.
detail
.
value
.
personNum
,
//人数
reason
:
e
.
detail
.
value
.
reason
,
//参观事由
users
:
userList
,
//拜访用户信息
type
:
1
,
//团队:1,公务:2
}
}
else
{
Toast
.
fail
(
`领队与同行人数量大于总计人数`
)
}
}
else
if
(
that
.
data
.
subscribeType
==
2
)
{
console
.
log
(
'
同行人数量
'
,
that
.
data
.
visitLeaderist
.
length
,
that
.
data
.
personNum
,
'
总数
'
);
if
(
that
.
data
.
visitLeaderist
.
length
+
1
<=
that
.
data
.
personNum
)
{
postUrl
=
"
Background/api/guest/TeamOrOfficialCreate
"
;
let
length
=
that
.
data
.
visit
FromL
ist
.
length
let
length
=
that
.
data
.
visit
Leader
ist
.
length
let
userList
=
[];
console
.
log
(
e
.
detail
.
value
)
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)]
&&
e
.
detail
.
value
[
"
idCode
"
+
(
i
+
1
)])
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
identity_num
:
e
.
detail
.
value
[
"
idCode
"
+
(
i
+
1
)]
})
// userList.push({
// name: e.detail.value["name" + (i + 1)],
// position: e.detail.value["position" + (i + 1)]
// })
if
(
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)]
&&
e
.
detail
.
value
[
"
position
"
+
(
i
+
1
)])
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
position
:
e
.
detail
.
value
[
"
position
"
+
(
i
+
1
)]
})
}
else
{
wx
.
showToast
({
title
:
"
请完善参观人员资料
"
,
...
...
@@ -452,35 +679,8 @@ Page({
})
return
;
}
}
//团队预约
data
=
{
museum_date
:
that
.
data
.
checkDate
,
//日期
moment
:
that
.
data
.
checkSession
,
//场次
unit
:
e
.
detail
.
value
.
unit
,
//单位名称
name
:
e
.
detail
.
value
.
name
,
//姓名
identity_num
:
e
.
detail
.
value
.
idCode
,
//身份证号
mobile
:
e
.
detail
.
value
.
phone
,
//手机号
plate_number
:
e
.
detail
.
value
.
carCode
,
//车俩信息
num
:
e
.
detail
.
value
.
personNum
,
//人数
reason
:
e
.
detail
.
value
.
reason
,
//参观事由
users
:
userList
,
//拜访用户信息
type
:
1
,
//团队:1,公务:2
}
}
else
if
(
that
.
data
.
subscribeType
==
2
)
{
postUrl
=
"
Background/api/guest/TeamOrOfficialCreate
"
;
let
length
=
that
.
data
.
visitLeaderist
.
length
let
userList
=
[];
console
.
log
(
e
.
detail
.
value
)
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
userList
.
push
({
name
:
e
.
detail
.
value
[
"
name
"
+
(
i
+
1
)],
work
:
e
.
detail
.
value
[
"
work
"
+
(
i
+
1
)]
})
}
//公务
data
=
{
museum_date
:
that
.
data
.
checkDate
,
//日期
moment
:
that
.
data
.
checkSession
,
//场次
...
...
@@ -494,9 +694,14 @@ Page({
users
:
userList
,
//拜访用户信息
type
:
2
,
//团队:1,公务:2
}
}
else
{
// Toast.fail('填写人数大于总计人数')
Toast
.
fail
(
`填写人数大于总计人数,填写人数(
${
that
.
data
.
visitLeaderist
.
length
+
1
}
),总人数(
${
that
.
data
.
personNum
}
)`
)
}
}
http
.
postData
(
postUrl
,
// 请求参数
...
...
@@ -515,18 +720,25 @@ Page({
wx
.
navigateTo
({
url
:
'
../record/record
'
,
})
}
else
{
}
else
if
(
res
.
code
!==
1
){
//请求失败
wx
.
showToast
({
title
:
res
.
code
+
"
:
"
+
res
.
msg
,
icon
:
'
error
'
,
duration
:
1000
})
Toast
.
fail
(
res
.
msg_detail
)
// wx.showToast({
// title: res.msg_detail,
// icon: 'error',
// duration: 1000
// })
}
else
{
Toast
.
fail
(
res
.
msg
)
// wx.showToast({
// title: res.msg,
// icon: 'error',
// duration: 1000
// })
}
},
function
(
err
)
{
console
.
log
(
'
请求失败:
'
+
err
);
wx
.
showToast
({
title
:
err
,
icon
:
'
error
'
,
...
...
@@ -537,25 +749,14 @@ Page({
)
}
else
{
wx
.
showToast
({
title
:
'
请选择预约的场次
'
,
icon
:
'
none
'
,
duration
:
1000
})
}
// console.log("data111111111111111111", data)
},
...
...
@@ -576,7 +777,7 @@ Page({
if
(
that
.
data
.
subscribeType
==
1
)
{
that
.
setData
({
personNum
:
1
0
personNum
:
1
});
}
...
...
@@ -594,8 +795,20 @@ Page({
// console.log(that.getWeek("2023-07-18"))//
// console.log(that.getMonthDay("2023-01-31"))//
},
// aaa(){
// console.log(1123);
// wx.showShareImageMenu({
// path : "pages/teamAppointmentForm/teamAppointmentForm",
// })
// },
/**
* 生命周期函数--监听页面初次渲染完成
...
...
@@ -642,7 +855,10 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
onShareAppMessage
(){
return
{
title
:
'
琼台博物馆预约
'
,
path
:
"
pages/index/index
"
,
}
}
})
\ No newline at end of file
pages/subscribe/subscribe.json
浏览文件 @
25d0e644
...
...
@@ -4,7 +4,8 @@
"van-button"
:
"@vant/weapp/button/index"
,
"van-stepper"
:
"@vant/weapp/stepper/index"
,
"van-calendar"
:
"@vant/weapp/calendar/index"
,
"van-field"
:
"@vant/weapp/field/index"
"van-field"
:
"@vant/weapp/field/index"
,
"van-toast"
:
"@vant/weapp/toast/index"
},
"navigationBarTitleText"
:
"散客预约"
}
\ No newline at end of file
pages/subscribe/subscribe.wxml
浏览文件 @
25d0e644
...
...
@@ -9,7 +9,8 @@
</van-calendar>
<!-- 参观日期及场次 -->
<view class="time-box">
<view class="time-box" >
<!-- style="width: 684rpx; height: 545rpx; display: block; box-sizing: border-box" -->
<view class="time-title">
琼台书院博物馆
</view>
...
...
@@ -90,7 +91,7 @@
上午
</view>
</view>
<view bindtap="onSelectSession" data-session="2" data-undisabled="{{currentSession.aftestate==0}}" class="time-select-item {{currentSession.aftestate==0?'checked-item':'disabled-item'}}">
<view
bindtap="onSelectSession" data-session="2" data-undisabled="{{currentSession.aftestate==0}}" class="time-select-item {{currentSession.aftestate==0?'checked-item':'disabled-item'}}">
<view class="item-checked-state {{currentSession.aftestate==0?'select-checked':''}}">
<van-icon name="success" wx:if="{{checkSession==2}}"/>
{{checkSession==2?"":currentSession.aftestate==0?'可订':'停售'}}
...
...
@@ -116,16 +117,16 @@
</view>
<form bindsubmit='onSubscribe'>
<!-- style="width: 684rpx; height: 459rpx; display: block; box-sizing: content-box" -->
<!-- 参观人员 散客 -->
<view class="person-container" wx:if="{{subscribeType==0}}">
<view class="person-container" wx:if="{{subscribeType==0}}" >
<!-- style="width: 674rpx; height: 723rpx; display: block; box-sizing: border-box" -->
<form bindsubmit="addPerson">
<view class="person-box" wx:for="{{visitFromList}}" wx:for-item="visitItem" wx:key="index">
<view class="person-title">参观人员{{index+1}}</view>
<view class="person-info-box">
<view class="person-info-del" wx:if="{{visitFromList.length>1}}">
<!-- <view class="person-info-del" > -->
<van-button color="#d89a7c" icon="cross" round formType="submit" data-type="2" data-index="{{index}}" />
<!-- <van-icon name="cross" /> -->
</view>
...
...
@@ -147,8 +148,6 @@
</view>
</view>
<view class="add-person-button">
<van-button icon="plus" color="#f4ece6" formType="submit" data-type="1" block>添加同行人员</van-button>
</view>
...
...
@@ -194,10 +193,11 @@
<form bindsubmit="addPerson" bindreset="delPerson">
<view class="person-box" wx:for="{{visitFromList}}" wx:for-item="visitItem" wx:key="index">
<view class="person-box" wx:for="{{visitFromList
Team
}}" wx:for-item="visitItem" wx:key="index">
<view class="person-title">参观人员{{index+1}}</view>
<view class="person-info-box">
<view class="person-info-del" data-index="{{index}}" wx:if="{{visitFromList.length>1}}">
<!-- <view class="person-info-del" data-index="{{index}}" wx:if="{{visitFromList.length>1}}"> -->
<view class="person-info-del" data-index="{{index}}" >
<van-button color="#d89a7c" icon="cross" round formType="submit" data-type="2" data-index="{{index}}" />
<!-- <van-icon name="cross" /> -->
</view>
...
...
@@ -215,7 +215,7 @@
</view>
<view class="add-person-button">
<van-button icon="plus" color="#f4ece6" formType="submit" data-type="1" block>添加同行人员</van-button>
</view>
...
...
@@ -235,8 +235,6 @@
<van-field type="text" name="name" value="{{ visitBusinessFrom.name }}" placeholder="请输入姓名" border="{{ false }}" />
</view>
<view class="person-info-item">
<view class="info-item-label">身份证号</view>
...
...
@@ -254,16 +252,18 @@
<view class="person-info-item">
<view class="info-item-label">人数</view>
<!-- <view class="info-item-value info-placeholder"></view> -->
<van-stepper bind:change="onSteChange" name="personNum" input-width="50px" value="{{ personNum }}" min="1" />
<van-stepper bind:
plus="plus" bind:minus="minus" bind:
change="onSteChange" name="personNum" input-width="50px" value="{{ personNum }}" min="1" />
</view>
</view>
</view>
<form bindsubmit="addPerson">
<view class="person-box" wx:for="{{visitLeaderist}}" wx:for-item="visitItem">
<form
bindsubmit="addPerson">
<view
class="person-box" wx:for="{{visitLeaderist}}" wx:for-item="visitItem">
<view class="person-title">领导信息{{index+1}}</view>
<view class="person-info-box">
<view class="person-info-del" data-index="{{index}}" wx:if="{{visitLeaderist.length>1}}">
<!-- <view class="person-info-del" data-index="{{index}}" wx:if="{{visitLeaderist.length>1}}"> -->
<view class="person-info-del" data-index="{{index}}" >
<!-- X -->
<van-button color="#d89a7c" icon="cross" round formType="submit" data-type="2" data-index="{{index}}" />
<!-- <van-icon name="cross" /> -->
</view>
...
...
@@ -273,16 +273,15 @@
</view>
<view class="person-info-item">
<view class="info-item-label">职务</view>
<van-field type="text" name="
work{{index+1}}" value="{{ visitItem.work
}}" placeholder="请输入职务" border="{{ false }}" />
<van-field type="text" name="
position{{index+1}}" value="{{ visitItem.position
}}" placeholder="请输入职务" border="{{ false }}" />
</view>
</view>
</view>
<view class="add-person-button">
<van-button icon="plus" color="#f4ece6" formType="submit" data-type="1" block>添加领导</van-button>
<van-button icon="plus"
color="#f4ece6" formType="submit" data-type="1" block>添加领导</van-button>
</view>
</form>
...
...
@@ -303,13 +302,20 @@
</view>
<!-- 底部导航栏 -->
<view class=" subscribe-footer">
<view class="footer-text">总计 <text class="person-num">{{personNum}}</text> 人</view>
<!-- 团队 -->
<view class="footer-text" wx:if="{{subscribeType === 1 && teamNum === true}}">总计 <text class="person-num">{{personNum}}</text> 人</view>
<view class="footer-text" wx:if="{{subscribeType == 1 && teamNum == false }}">总计 <text class="person-num">10</text> 人</view>
<!-- 散客、公务 -->
<view class="footer-text" wx:else>总计 <text class="person-num">{{personNum}}</text> 人</view>
<view class="footer-button">
<van-button formType="submit" color="#d79a7d" size="small">立即预定</van-button>
<van-button wx:if="{{subscribeType == 1}}" bind:click="preSubmission" style="margin-right: 10px;" formType="submit" color="#d79a7d" size="small">预提交<view style="font-size: 10px;">(无需满全员)</view></van-button>
<van-button bind:click="makeAnAppointmentNow" style="margin-right: 10px;" formType="submit" color="#d79a7d" size="small">立即预约<view wx:if="{{subscribeType == 1}}" style="font-size: 10px;">(需满全员)</view></van-button>
</view>
</view>
<van-toast id="van-toast" />
</form>
</view>
\ No newline at end of file
pages/subscribe/subscribe.wxss
浏览文件 @
25d0e644
...
...
@@ -128,6 +128,8 @@
border-radius: 16rpx;
padding: 30rpx;
padding-top: 20rpx;
}
.person-box {
...
...
@@ -224,6 +226,8 @@
border: 1px solid #d5c4b9;
overflow: hidden;
box-sizing: border-box;
-webkit-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
}
.add-person-button .van-button__text {
...
...
utils/config.js
浏览文件 @
25d0e644
module
.
exports
=
{
API_URL
:
"
https://asc.hnasct.cn/museumAppointment/api/
"
,
// API_URL: "https://ehall.qtnu.edu.cn/museumAppointment/api/",
imageProtocolHost
:
'
https://asc.hnasct.cn/
'
}
utils/http.js
浏览文件 @
25d0e644
...
...
@@ -8,6 +8,8 @@
const
config
=
require
(
'
./config.js
'
)
const
host
=
config
.
API_URL
;
// 服务器baseUrl
/**
* POST请求,
* URL:接口
...
...
@@ -21,14 +23,31 @@ function postData(url, postData, doSuccess, doFail, needToken) {
mask
:
true
})
if
(
needToken
)
{
var
token
=
wx
.
getStorageSync
(
'
token
'
);
if
(
token
==
""
)
{
console
.
log
(
"
token为空,跳转至登录页
"
)
//
console.log("token为空,跳转至登录页")
wx
.
hideLoading
()
wx
.
navigateTo
({
url
:
'
../login/login
'
,
})
// wx.navigateTo({
// url: '../login/login',
// })
wx
.
showModal
({
title
:
'
提示
'
,
content
:
'
当前未登录,是否登录?
'
,
complete
:
(
res
)
=>
{
if
(
res
.
cancel
)
{
wx
.
showToast
({
title
:
'
用户取消登录
'
,
})
}
if
(
res
.
confirm
)
{
wx
.
navigateTo
({
url
:
'
../login/login
'
,
})
}
}
})
}
else
{
wx
.
request
({
...
...
@@ -53,24 +72,41 @@ function postData(url, postData, doSuccess, doFail, needToken) {
doSuccess
(
res
.
data
);
}
// else if (res.statusCode == 401) {
// wx.showToast({
// title: '登录过期,请重新登录',
// icon: 'none',
// duration: 2000
// })
// wx.navigateTo({
// url: '../login/login',
// })
// }
else
{
console
.
log
(
"
其他状态码
"
,
res
)
else
if
(
res
.
statusCode
==
401
)
{
wx
.
showToast
({
title
:
res
.
statusCode
+
"
:
"
+
res
.
data
.
msg
,
title
:
'
登录过期,请重新登录
'
,
icon
:
'
none
'
,
duration
:
4
000
duration
:
2
000
})
wx
.
showModal
({
title
:
'
提示
'
,
content
:
'
当前未登录,是否登录?
'
,
complete
:
(
res
)
=>
{
if
(
res
.
cancel
)
{
wx
.
showToast
({
title
:
'
用户取消登录
'
,
})
}
if
(
res
.
confirm
)
{
wx
.
navigateTo
({
url
:
'
../login/login
'
,
})
}
}
})
// wx.navigateTo({
// url: '../login/login',
// })
}
else
{
console
.
log
(
"
其他状态码
"
,
res
)
// wx.showToast({
// title: res.statusCode + " : " + res.data.msg,
// icon: 'none',
// duration: 4000
// })
}
...
...
@@ -109,8 +145,25 @@ function postData(url, postData, doSuccess, doFail, needToken) {
icon
:
'
none
'
,
duration
:
2000
})
wx
.
navigateTo
({
url
:
'
../login/login
'
,
// wx.navigateTo({
// url: '../login/login',
// })
wx
.
showModal
({
title
:
'
提示
'
,
content
:
'
登录令牌过期,是否登录?
'
,
complete
:
(
res
)
=>
{
if
(
res
.
cancel
)
{
wx
.
showToast
({
title
:
'
用户取消登录
'
,
})
}
if
(
res
.
confirm
)
{
wx
.
navigateTo
({
url
:
'
../login/login
'
,
})
}
}
})
}
else
{
...
...
@@ -151,8 +204,25 @@ function getData(url, getData, doSuccess, doFail, needToken) {
if
(
token
==
""
)
{
console
.
log
(
"
token为空,跳转至登录页
"
)
wx
.
hideLoading
()
wx
.
navigateTo
({
url
:
'
../login/login
'
,
// wx.navigateTo({
// url: '../login/login',
// })
wx
.
showModal
({
title
:
'
提示
'
,
content
:
'
当前未登录,是否登录?
'
,
complete
:
(
res
)
=>
{
if
(
res
.
cancel
)
{
wx
.
showToast
({
title
:
'
用户取消登录
'
,
})
}
if
(
res
.
confirm
)
{
wx
.
navigateTo
({
url
:
'
../login/login
'
,
})
}
}
})
}
else
{
// console.log("token",token)
...
...
@@ -178,8 +248,25 @@ function getData(url, getData, doSuccess, doFail, needToken) {
icon
:
'
none
'
,
duration
:
2000
})
wx
.
navigateTo
({
url
:
'
../login/login
'
,
// wx.navigateTo({
// url: '../login/login',
// })
wx
.
showModal
({
title
:
'
提示
'
,
content
:
'
登录令牌过期,是否登录?
'
,
complete
:
(
res
)
=>
{
if
(
res
.
cancel
)
{
wx
.
showToast
({
title
:
'
用户取消登录
'
,
})
}
if
(
res
.
confirm
)
{
wx
.
navigateTo
({
url
:
'
../login/login
'
,
})
}
}
})
}
else
{
...
...
@@ -216,6 +303,7 @@ function getData(url, getData, doSuccess, doFail, needToken) {
doSuccess
(
res
.
data
);
}
else
{
// console.log("其他状态码")
wx
.
showToast
({
title
:
res
.
statusCode
+
"
:
"
+
res
.
data
.
msg
,
icon
:
'
none
'
,
...
...
@@ -248,4 +336,5 @@ function getData(url, getData, doSuccess, doFail, needToken) {
// )
// }
module
.
exports
.
postData
=
postData
;
module
.
exports
.
getData
=
getData
;
\ No newline at end of file
module
.
exports
.
getData
=
getData
;
// module.exports.cancelAppointmentRequest = cancelAppointmentRequest;
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录