Commit 733888e0 by fengzhaoyu

点按钮击

parents 0496a620 c183fe36
...@@ -487,7 +487,7 @@ create.Page({ ...@@ -487,7 +487,7 @@ create.Page({
}) })
}, },
// 编辑日程 // 编辑日程
editSchedule(event) { editSchedule: throttle(function (event) {
switch (event.target.dataset.icon) { switch (event.target.dataset.icon) {
case 'iconchongfu': case 'iconchongfu':
dd.navigateTo({ url: `./../repeatMechanism/repeatMechanism` }) dd.navigateTo({ url: `./../repeatMechanism/repeatMechanism` })
...@@ -535,7 +535,7 @@ create.Page({ ...@@ -535,7 +535,7 @@ create.Page({
}) })
break; break;
} }
}, }, 1000),
// 选择终止时间 // 选择终止时间
selectTerminal() { selectTerminal() {
dd.navigateTo(({ url: `./../repetitionTime/repetitionTime` })) dd.navigateTo(({ url: `./../repetitionTime/repetitionTime` }))
......
...@@ -40,6 +40,7 @@ Page({ ...@@ -40,6 +40,7 @@ Page({
const today = new Date() const today = new Date()
const finalDate = new Date(today) const finalDate = new Date(today)
finalDate.setDate(today.getDate() - today.getDay()) finalDate.setDate(today.getDate() - today.getDay())
console.log(finalDate.toLocaleDateString())
that.setData({ that.setData({
scheduleList: scheduleList, scheduleList: scheduleList,
todayStr: finalDate.toLocaleDateString(), todayStr: finalDate.toLocaleDateString(),
......
...@@ -44,10 +44,10 @@ ...@@ -44,10 +44,10 @@
</view> </view>
<view class="reserveRoomNumAndLocation"> <view class="reserveRoomNumAndLocation">
<view class="reserveRoomNum"> <view class="reserveRoomNum">
<text class="locationIcon iconfont icondingwei1"></text>{{item.capacityNum}} <text class="locationIcon iconfont iconcanhuiren"></text>{{item.capacityNum}}
</view> </view>
<view class="reserveRoomLocation"> <view class="reserveRoomLocation">
<text class="locationIcon iconfont iconcanhuiren"></text>{{item.locationName}} <text class="locationIcon iconfont icondingwei1"></text>{{item.locationName}}
</view> </view>
</view> </view>
</view> </view>
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
</view> </view>
<view class="mettingRoomDetail"> <view class="mettingRoomDetail">
<view class="num"> <view class="num">
<text class="numIcon iconfont iconbeifangren"></text> <text class="numIcon iconfont iconcanhuiren"></text>
<text>{{item.capacityNum}}</text> <text>{{item.capacityNum}}</text>
</view> </view>
<view class="equipment"> <view class="equipment" a:if="{{item.equipFacilityLabelList}}">
<text class="numIcon iconfont icondingwei1"></text>
<text a:for="{{item.equipFacilityLabelList}}" a:for-item="equipmentList">{{equipmentList.name}}</text> <text a:for="{{item.equipFacilityLabelList}}" a:for-item="equipmentList">{{equipmentList.name}}</text>
</view> </view>
</view> </view>
......
import create from 'dd-store' import create from 'dd-store'
import exampleStore from '/stores/exampleStore' import exampleStore from '/stores/exampleStore'
import {queryAvailableMeetingRoomByTime} from './../../api/request' import { queryAvailableMeetingRoomByTime } from './../../api/request'
import { throttle } from './../../utils/utils.js'
create.Page({ create.Page({
store: exampleStore, store: exampleStore,
useAll: true, useAll: true,
...@@ -44,7 +46,7 @@ create.Page({ ...@@ -44,7 +46,7 @@ create.Page({
place: event.detail.value place: event.detail.value
}) })
}, },
toRoomList() { toRoomList: throttle(function () {
dd.navigateTo({ url: `./../meetingRoomList/meetingRoomList` }) dd.navigateTo({ url: `./../meetingRoomList/meetingRoomList` })
} }, 1000)
}); });
import create from 'dd-store' import create from 'dd-store'
import exampleStore from '/stores/exampleStore' import exampleStore from '/stores/exampleStore'
import { throttle } from './../../utils/utils.js'
create.Page({ create.Page({
store: exampleStore, store: exampleStore,
useAll: true, useAll: true,
...@@ -40,11 +42,11 @@ create.Page({ ...@@ -40,11 +42,11 @@ create.Page({
saveTime: this.data.saveTime saveTime: this.data.saveTime
}) })
}, },
save() { save: throttle(function () {
this.store.data.aheadTimes = this.data.saveTime this.store.data.aheadTimes = this.data.saveTime
this.update() this.update()
dd.navigateBack({ dd.navigateBack({
delta: 1 delta: 1
}) })
} }, 1000)
}); });
...@@ -222,7 +222,7 @@ create.Page({ ...@@ -222,7 +222,7 @@ create.Page({
}) })
}, },
// 跳转下一页 // 跳转下一页
nextPage(event) { nextPage: throttle(function (event) {
switch (event.target.dataset.nextPage) { switch (event.target.dataset.nextPage) {
case 'participants': case 'participants':
dd.navigateTo({ url: `./../attendingSituation/attendingSituation?userList=${JSON.stringify(this.store.data.userList)}&organizer=${this.data.organizer}` }) dd.navigateTo({ url: `./../attendingSituation/attendingSituation?userList=${JSON.stringify(this.store.data.userList)}&organizer=${this.data.organizer}` })
...@@ -238,7 +238,8 @@ create.Page({ ...@@ -238,7 +238,8 @@ create.Page({
dd.navigateTo({ url: `./../editFile/editFile?file=${JSON.stringify(event.target.dataset.file)}` }) dd.navigateTo({ url: `./../editFile/editFile?file=${JSON.stringify(event.target.dataset.file)}` })
break; break;
} }
},
}, 1000),
// 判断是刚刚 五分钟以内 十分钟以内 正常时间年月日 // 判断是刚刚 五分钟以内 十分钟以内 正常时间年月日
dealFileTime(creatTime) { dealFileTime(creatTime) {
console.log(creatTime, 111111) console.log(creatTime, 111111)
......
...@@ -4,10 +4,10 @@ export function throttle(fn, gapTime) { ...@@ -4,10 +4,10 @@ export function throttle(fn, gapTime) {
gapTime = 1500 gapTime = 1500
} }
let _lastTime = null let _lastTime = null
return function (e) { return function () {
let _nowTime = + new Date() let _nowTime = new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) { if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn(e) fn.apply(this, arguments) //将this和参数传给原函数
_lastTime = _nowTime _lastTime = _nowTime
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment