自定义头部
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
// pages/meeting/meeting.js
|
||||
import MeetingApi from '../../assets/js/http/meetingApi'
|
||||
import UserApi from '../../assets/js/http/userApi'
|
||||
import {isLogin} from '../../assets/js/common'
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'],
|
||||
searchParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
@@ -33,6 +36,48 @@ Page({
|
||||
// 是哪个筛选条件
|
||||
index: -1
|
||||
},
|
||||
goBack(){
|
||||
wx.navigateBack()
|
||||
},
|
||||
// 扫码签到
|
||||
signUp(){
|
||||
isLogin(() => {
|
||||
wx.scanCode({
|
||||
onlyFromCamera: false,
|
||||
scanType: [],
|
||||
success: (result) => {
|
||||
if (result.result.indexOf("scanSign") > -1) { // 证明是签到二维码
|
||||
let meetingId = result.result.split("=")[1] // 会议Id
|
||||
// let meetingId = result.result // 会议Id
|
||||
// 成功扫码的回调
|
||||
UserApi.scanCode({
|
||||
meetingId
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
let result = JSON.stringify(res.result)
|
||||
wx.navigateTo({ // 已报名
|
||||
url: `../scanSign/scanSign?signed=1&meeting=${result}`,
|
||||
})
|
||||
} else {
|
||||
let result = JSON.stringify(res.result)
|
||||
// 未查到报名信息
|
||||
wx.navigateTo({ // 未报名
|
||||
url: `../scanSign/scanSign?signed=0&meeting=${result}`,
|
||||
})
|
||||
}
|
||||
}).catch(err => {})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '此二维码不是签到码',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 会议状态筛选
|
||||
bindStatusChange(e) {
|
||||
this.data.searchParams.pageNo = 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "会议",
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"popup": "../../components/popup/popup",
|
||||
"dateMonth": "../../components/dateMonth/dateMonth"
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<!--pages/meeting/meeting.wxml首页会议活动-->
|
||||
<!-- 自定义头部start -->
|
||||
<view class="custom flex_center" style="padding-top:{{statusBarHeight}}px">
|
||||
<image src="../../assets/images/back.png" bindtap="goBack"></image>
|
||||
<image src="../../assets/images/signEntran.png" bindtap="signUp"></image>
|
||||
<text>会议</text>
|
||||
</view>
|
||||
<view class="empty_custom" style="padding-top:{{statusBarHeight}}px"></view><!-- 空view用来填充自定义头部的padding-top -->
|
||||
<!-- 自定义头部end -->
|
||||
<view class="select-list">
|
||||
<view class="select-item">
|
||||
<picker bindchange="bindStatusChange" range="{{meetingStatus}}">
|
||||
|
||||
Reference in New Issue
Block a user