添加和删​​除收藏功能的jQuery Mobile的,并查看列表视图分开收藏项目 [英] add and remove to favorite function in jquery mobile and view favorited items in separate listview

查看:227
本文介绍了添加和删​​除收藏功能的jQuery Mobile的,并查看列表视图分开收藏项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用Apache科尔多瓦/ PhoneGap的和jQuery Mobile的,由像女人的鞋子,皮包,衣服等时尚用品的Andr​​oid应用程序......我想添加一个按钮,允许用户添加喜爱的项目和这些添加的项目可以在应用程序本身中的一个单独的列表视图页面中查看并且还用户能够删除这些收藏的物品时,他们鸵鸟政策希望他们为我的最爱了......这是任何应用程序一个非常重要的功能,销售不同类型的产品和用户体验为好。

i am developing an android app using Apache Cordova/Phonegap and Jquery Mobile that consists of fashion items like woman shoes, purses, clothes, etc... and I would like to add a button that allows users to add favorite items and that those added items can be viewed in a separate listview page within the app itself and that also users are able to remove these favorited items when they don´t want them as favorites anymore... This is a very important feature for any app that sell different type of products and for user experience as well.

我添加了什么,我想会是什么,我试图让参考工作流程的几个屏幕截图。如果任何你们都实行这样的功能,请让我知道如何可以去一下......你的帮助会大大AP preciated。

I have added a few screen shots of what I think would be the workflow of what I am trying to get reference on. If any of you guys have implemented such functions, please let know how I can go about it... your help will be greatly appreciated.

项议程APP:

APP菜单:

偏好设置项目页面上APP:

FAVORITES ITEM PAGE ON APP:

项目详细信息视图页面:

ITEM DETAIL VIEW PAGE:

推荐答案

这可以采取任何数目的形式,因为这个问题不明确。

This could take any number of forms, since the question is not clear.

不过,我的猜测是你最好的选择是简单地通过JavaScript标识给定项目作为vbeing喜爱例如值添加到localStorage的:

However, my guess is your best bet would be to simply add a value to localStorage via javascript that identifies the given item as vbeing a favourite eg:

localStorage.Favourites = 'itemID';

您可能会想有超过1最爱(S),所以你应该让这个用分隔符的字符串这样的:

You would probably want to have more than 1 favourite(s) so you should probably make this a string with a delimiter such a:

localSotrage.Favourites += 'itemID,';

然后每个产品的详细信息页面,在分裂的localStorage.Favourites字符串值,并检查当前产品的ID在

Then on each product detail page, split the string value in localStorage.Favourites and check if the id of the current product is in that.

这篇关于添加和删​​除收藏功能的jQuery Mobile的,并查看列表视图分开收藏项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆