swipe

项目--3

旧街凉风 提交于 2019-12-03 04:17:20
1、回顾 2、token校验登录 ---- day06/myapp cnpm i jsonwebtoken -S 安装 token 模块 2.1 当登录成功时 生成token,给前端返回token var jwt = require('jsonwebtoken'); // 实现登陆功能 router.post('/login', (req, res, next) => { // 1、获取表单信息 let { tel, password } = req.body; // 2、依据手机号查询有没有该用户 sql.find(User, { tel }, { _id: 0 }).then(data => { // 2.1 判断有么有该用户 if (data.length === 0) { // 2.2 没有该用户 res.send(utils.unregister) } else { // 2.3 有该用户,验证密码 // 2.3.1 获取数据库中的密码 let pwd = data[0].password; // 2.3.2 比较 输入的 密码和数据库中的密码 var flag = bcrypt.compareSync(password, pwd) // 前为输入,后为数据库 if (flag) { // 2.3.3 密码正确,生成token let userid = data[0]

How to swap views using a swipe gesture XCode

两盒软妹~` 提交于 2019-12-03 03:50:42
I am using XCode to develop a Cocoa touch application for the iOS platform but have had trouble finding out how to get a swipe gesture implemented that would allow the user to swipe their finger left or right to change to a new ViewController (nib/xib file). I have done a swapView IBAction using a button and modal transitioning and I have read about Apple's TouchGestureRecognizer but I don't know how to implement a swipe action that would allow a view change. I do NOT want to use a scroll view, as I have several dozen view controllers, that I want the user to be able to swipe through. Here is

Tinder-Like Swipe Animation for iOS

醉酒当歌 提交于 2019-12-03 03:42:33
I've followed this very helpful tutorial on how to add tinder-like swiping ( http://guti.in/articles/creating-tinder-like-animations/ ); however, I have one problem- when the picture goes away, I want to replace it with another picture. How/where do I do that? I built a simpler and more comprehensive project based on that tutorial. In particular, you could use an array of images and assign each card an image based on the index of the image. Will the images be dynamic or static? Might not help at this point, but here it is anyway: https://github.com/cwRichardKim/TinderSimpleSwipeCards check

Android: How to recreate Action bar when fragment changed

谁说我不能喝 提交于 2019-12-03 03:42:02
问题 I have an activity showing a few fragments. Activity view contains only ViewPager initialized with custom FragmentPagerAdapter. This adapter provide navigation among 3 fragments. All seems to work fine except Action bar. I override onCreateOptionsMenu() method in my fragments to create individual Action bar for any fragment: @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); menu.clear(); //fragment specific menu creation }

Prevent JQuery Mobile swipe event over specific element

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using jquery mobile and I need to prevent swipe event over specific element. Need of doing this is because I am using slider and I don't want the swipe event to be invoked resp. I want it to be prevented when user is manipulating with slider. I was not able to too find any solution so I am asking for help here. This is my javascript code: $( document ).on( "pageinit", "#demo-page", function() { $( document ).on( "swipeleft swiperight", "#demo-page", function( e ) { // We check if there is no open panel on the page because otherwise // a

Adding a swipe gesture to open SplitView Pane

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to add a swipe gesture to the SplitView control (aka "hamburger menu") of UWP, similar to the swipe left/right of a Pivot control. How can I set a gesture to change the Display mode of it? In iOS 8 and later, I can use UISplitViewController and set presentsWithGesture property to do that but there is not a similar thing in WinRT. Now after reading this blog: http://blogs.msdn.com/b/cdndevs/archive/2015/0 7 /10/uwp-new-controls-part-2-splitview.aspx , I realized that there is the DisplayMode property in SplitView control and I

Android Scrollable Tabs + Swipe state when swiping

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to make an application with multiple Tabs. For each tab I'm using different fragments. And when I leaf through tabs the information in them is changing. How can I save the state of each tab when swiping? Code for example: MainActivity.java : package com.tabs.example; import java.util.Locale; import android.graphics.Color; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter;

iPhone / iPad / iPod swipe events javascript

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Im looking for (if possible) javascript libraries/plugins to provide swipe events. However I am not after the simple detection of a swipe, for example what jqTouch provides. I wish to create behavior similar to that of the images viewer on the iPod devices. So for example you drag left or right to go to the next image. You have to drag the image over 50% of the way and let go and it will snap to the next image. If you do not drag 50% of the image, it just snaps back to the original. Any advice appreciated. Thanks. 回答1: I think you

How would I implement a swipe-based circular control like this?

五迷三道 提交于 2019-12-03 02:46:37
问题 I am working on an Android application, and I have a TextView where I display a price (for example 50$). I would like to have a circular control similar to this picture: Swiping a finger clockwise on the dial increases the amount by $1 steps Swiping a finger counter-clockwise on the dial decreases the amount by $1 steps I did some research but couldn't find a working implementation of something to do this. How could you create such a circular control driven by swipes? 回答1: I've modified the

Prevent swipe from triggering ng-click handler

巧了我就是萌 提交于 2019-12-03 02:24:46
I'm working on implementing an iOS-like swipe-to-delete gesture on HTML table rows. For example, a leftwards swipe on Site11 will turn it from a standard row: into a delete-able row: I have this functionality working with the ng-swipe-left directive. However, I also have a ng-click directive on each row that navigates to a different view of the application. Currently, both events are triggered when I perform a swipe on a row, except when the swipe ends on the "Site11" text itself, as opposed to anywhere else within the row. For example, this gesture will trigger both the ng-click and the ng