├── src ├── style │ ├── js │ │ └── my-app.js │ ├── img │ │ ├── face │ │ │ ├── NO.gif │ │ │ ├── OK.gif │ │ │ ├── 乒乓.gif │ │ │ ├── 亲亲.gif │ │ │ ├── 便便.gif │ │ │ ├── 偷笑.gif │ │ │ ├── 傲慢.gif │ │ │ ├── 再见.gif │ │ │ ├── 冷汗.gif │ │ │ ├── 凋谢.gif │ │ │ ├── 刀.gif │ │ │ ├── 勾引.gif │ │ │ ├── 发呆.gif │ │ │ ├── 发怒.gif │ │ │ ├── 可怜.gif │ │ │ ├── 可爱.gif │ │ │ ├── 吐.gif │ │ │ ├── 吓.gif │ │ │ ├── 呲牙.gif │ │ │ ├── 咒骂.gif │ │ │ ├── 咖啡.gif │ │ │ ├── 哈欠.gif │ │ │ ├── 啤酒.gif │ │ │ ├── 嘘.gif │ │ │ ├── 困.gif │ │ │ ├── 坏笑.gif │ │ │ ├── 大兵.gif │ │ │ ├── 大哭.gif │ │ │ ├── 太阳.gif │ │ │ ├── 奋斗.gif │ │ │ ├── 委屈.gif │ │ │ ├── 害羞.gif │ │ │ ├── 尴尬.gif │ │ │ ├── 差劲.gif │ │ │ ├── 弱.gif │ │ │ ├── 强.gif │ │ │ ├── 得意.gif │ │ │ ├── 微笑.gif │ │ │ ├── 心碎.gif │ │ │ ├── 惊恐.gif │ │ │ ├── 惊讶.gif │ │ │ ├── 憨笑.gif │ │ │ ├── 抓狂.gif │ │ │ ├── 折磨.gif │ │ │ ├── 抠鼻.gif │ │ │ ├── 抱拳.gif │ │ │ ├── 拥抱.gif │ │ │ ├── 拳头.gif │ │ │ ├── 握手.gif │ │ │ ├── 撇嘴.gif │ │ │ ├── 擦汗.gif │ │ │ ├── 敲打.gif │ │ │ ├── 晕.gif │ │ │ ├── 月亮.gif │ │ │ ├── 流汗.gif │ │ │ ├── 流泪.gif │ │ │ ├── 炸弹.gif │ │ │ ├── 爱你.gif │ │ │ ├── 爱心.gif │ │ │ ├── 猪头.gif │ │ │ ├── 玫瑰.gif │ │ │ ├── 瓢虫.gif │ │ │ ├── 疑问.gif │ │ │ ├── 白眼.gif │ │ │ ├── 睡.gif │ │ │ ├── 示爱.gif │ │ │ ├── 礼物.gif │ │ │ ├── 篮球.gif │ │ │ ├── 胜利.gif │ │ │ ├── 色.gif │ │ │ ├── 菜刀.gif │ │ │ ├── 蛋糕.gif │ │ │ ├── 衰.gif │ │ │ ├── 西瓜.gif │ │ │ ├── 调皮.gif │ │ │ ├── 足球.gif │ │ │ ├── 鄙视.gif │ │ │ ├── 酷.gif │ │ │ ├── 闪电.gif │ │ │ ├── 闭嘴.gif │ │ │ ├── 阴险.gif │ │ │ ├── 难过.gif │ │ │ ├── 饥饿.gif │ │ │ ├── 饭.gif │ │ │ ├── 骷髅.gif │ │ │ ├── 鼓掌.gif │ │ │ ├── 右哼哼.gif │ │ │ ├── 左哼哼.gif │ │ │ ├── 快哭了.gif │ │ │ └── 糗大了.gif │ │ ├── sprite@2x.png │ │ ├── start_up.png │ │ ├── welcome │ │ │ ├── 1.jpg │ │ │ ├── 2.png │ │ │ ├── 3.jpg │ │ │ └── 4.jpg │ │ ├── hiapp_logo@2x.png │ │ └── image-loading.gif │ ├── fonts │ │ ├── iconfont.eot │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ └── less │ │ ├── mixins.less │ │ ├── app.less │ │ ├── navbar.less │ │ ├── toolbar.less │ │ └── icon.less ├── modules │ ├── comment │ │ ├── comment.less │ │ ├── service.js │ │ ├── comment.tpl.html │ │ ├── commentPopup.tpl.html │ │ └── comment.js │ ├── app │ │ ├── app.less │ │ └── app.js │ ├── contacts │ │ ├── contacts.less │ │ ├── service.js │ │ ├── contacts_checkbox.tpl.html │ │ ├── contacts.tpl.html │ │ └── contacts.js │ ├── about │ │ ├── about.js │ │ └── about.less │ ├── services │ │ └── appService.js │ ├── chat │ │ ├── service.js │ │ ├── chat.less │ │ ├── chat.tpl.html │ │ └── chat.js │ ├── contacts_detail │ │ ├── service.js │ │ ├── detail.less │ │ ├── detail.tpl.html │ │ └── detail.js │ ├── infos │ │ ├── service.js │ │ ├── infos.tpl.html │ │ ├── infos.less │ │ └── infos.js │ ├── language │ │ ├── language.less │ │ └── language.js │ ├── faces │ │ ├── face.tpl.html │ │ ├── face.less │ │ └── face.js │ ├── message │ │ ├── face.tpl.html │ │ ├── message.tpl.html │ │ └── message.less │ ├── tweet │ │ ├── tweet.tpl.html │ │ ├── tweet.less │ │ └── tweet.js │ ├── info │ │ ├── info.tpl.html │ │ ├── info.less │ │ └── info.js │ ├── home │ │ ├── service.js │ │ ├── home.tpl.html │ │ └── home.less │ ├── chat_detail │ │ ├── chat_detail.less │ │ ├── chat_detail.tpl.html │ │ └── chat_detail_group.tpl.html │ ├── components │ │ ├── networkStatus.js │ │ ├── camera.js │ │ └── geolocation.js │ ├── contacts_group │ │ ├── contacts_checkbox.tpl.html │ │ └── contacts_group.js │ ├── user_info │ │ ├── user_info.less │ │ └── user_info.js │ ├── utils │ │ ├── dbHelper.js │ │ ├── localStore.js │ │ ├── helper.js │ │ └── content.js │ ├── feedback │ │ └── feedback.js │ ├── login │ │ ├── forget.tpl.html │ │ ├── login.tpl.html │ │ ├── register.tpl.html │ │ ├── login.less │ │ └── login.js │ ├── db │ │ ├── table.js │ │ └── demo.js │ ├── init.js │ ├── password │ │ └── password.js │ ├── setting │ │ ├── setting.js │ │ ├── setting.tpl.html │ │ └── setting.less │ ├── input │ │ ├── contacts_checkbox.tpl.html │ │ └── input.tpl.html │ ├── lang │ │ ├── en-us.js │ │ └── zh-cn.js │ └── router.js ├── res │ └── icons │ │ └── ios │ │ ├── icon.png │ │ ├── icon-40.png │ │ ├── icon-50.png │ │ ├── icon-60.png │ │ ├── icon-72.png │ │ ├── icon-76.png │ │ ├── icon@2x.png │ │ ├── icon-40@2x.png │ │ ├── icon-50@2x.png │ │ ├── icon-60@2x.png │ │ ├── icon-72@2x.png │ │ ├── icon-76@2x.png │ │ ├── icon-small.png │ │ └── icon-small@2x.png ├── api │ ├── answers.json │ ├── user_login.json │ ├── history_message.json │ ├── more_timeline.json │ ├── comments.json │ ├── message.json │ ├── chat.json │ ├── refresh_timeline.json │ └── contacts.json └── page │ ├── chat_detail.html │ ├── contacts_detail.html │ ├── user_info.html │ ├── feedback.html │ ├── info.html │ ├── tweet.html │ ├── about.html │ ├── contacts_group.html │ ├── language.html │ ├── password.html │ └── message.html ├── res ├── chat.png ├── info.png ├── talk.png ├── comment.png ├── login.png ├── peoples.png ├── setting.png ├── register.png ├── info-content.png └── people-content.png ├── doc └── plan ├── dbtest.js ├── .jshintrc ├── LICENSE.md ├── package.json ├── .gitignore ├── config.xml └── README.md /src/style/js/my-app.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/modules/comment/comment.less: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/modules/app/app.less: -------------------------------------------------------------------------------- 1 | .views { 2 | overflow-y: hidden; 3 | } -------------------------------------------------------------------------------- /res/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/chat.png -------------------------------------------------------------------------------- /res/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/info.png -------------------------------------------------------------------------------- /res/talk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/talk.png -------------------------------------------------------------------------------- /res/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/comment.png -------------------------------------------------------------------------------- /res/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/login.png -------------------------------------------------------------------------------- /res/peoples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/peoples.png -------------------------------------------------------------------------------- /res/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/setting.png -------------------------------------------------------------------------------- /res/register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/register.png -------------------------------------------------------------------------------- /res/info-content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/info-content.png -------------------------------------------------------------------------------- /res/people-content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/res/people-content.png -------------------------------------------------------------------------------- /src/style/img/face/NO.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/NO.gif -------------------------------------------------------------------------------- /src/style/img/face/OK.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/OK.gif -------------------------------------------------------------------------------- /src/style/img/face/乒乓.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/乒乓.gif -------------------------------------------------------------------------------- /src/style/img/face/亲亲.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/亲亲.gif -------------------------------------------------------------------------------- /src/style/img/face/便便.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/便便.gif -------------------------------------------------------------------------------- /src/style/img/face/偷笑.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/偷笑.gif -------------------------------------------------------------------------------- /src/style/img/face/傲慢.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/傲慢.gif -------------------------------------------------------------------------------- /src/style/img/face/再见.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/再见.gif -------------------------------------------------------------------------------- /src/style/img/face/冷汗.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/冷汗.gif -------------------------------------------------------------------------------- /src/style/img/face/凋谢.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/凋谢.gif -------------------------------------------------------------------------------- /src/style/img/face/刀.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/刀.gif -------------------------------------------------------------------------------- /src/style/img/face/勾引.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/勾引.gif -------------------------------------------------------------------------------- /src/style/img/face/发呆.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/发呆.gif -------------------------------------------------------------------------------- /src/style/img/face/发怒.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/发怒.gif -------------------------------------------------------------------------------- /src/style/img/face/可怜.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/可怜.gif -------------------------------------------------------------------------------- /src/style/img/face/可爱.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/可爱.gif -------------------------------------------------------------------------------- /src/style/img/face/吐.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/吐.gif -------------------------------------------------------------------------------- /src/style/img/face/吓.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/吓.gif -------------------------------------------------------------------------------- /src/style/img/face/呲牙.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/呲牙.gif -------------------------------------------------------------------------------- /src/style/img/face/咒骂.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/咒骂.gif -------------------------------------------------------------------------------- /src/style/img/face/咖啡.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/咖啡.gif -------------------------------------------------------------------------------- /src/style/img/face/哈欠.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/哈欠.gif -------------------------------------------------------------------------------- /src/style/img/face/啤酒.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/啤酒.gif -------------------------------------------------------------------------------- /src/style/img/face/嘘.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/嘘.gif -------------------------------------------------------------------------------- /src/style/img/face/困.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/困.gif -------------------------------------------------------------------------------- /src/style/img/face/坏笑.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/坏笑.gif -------------------------------------------------------------------------------- /src/style/img/face/大兵.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/大兵.gif -------------------------------------------------------------------------------- /src/style/img/face/大哭.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/大哭.gif -------------------------------------------------------------------------------- /src/style/img/face/太阳.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/太阳.gif -------------------------------------------------------------------------------- /src/style/img/face/奋斗.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/奋斗.gif -------------------------------------------------------------------------------- /src/style/img/face/委屈.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/委屈.gif -------------------------------------------------------------------------------- /src/style/img/face/害羞.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/害羞.gif -------------------------------------------------------------------------------- /src/style/img/face/尴尬.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/尴尬.gif -------------------------------------------------------------------------------- /src/style/img/face/差劲.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/差劲.gif -------------------------------------------------------------------------------- /src/style/img/face/弱.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/弱.gif -------------------------------------------------------------------------------- /src/style/img/face/强.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/强.gif -------------------------------------------------------------------------------- /src/style/img/face/得意.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/得意.gif -------------------------------------------------------------------------------- /src/style/img/face/微笑.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/微笑.gif -------------------------------------------------------------------------------- /src/style/img/face/心碎.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/心碎.gif -------------------------------------------------------------------------------- /src/style/img/face/惊恐.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/惊恐.gif -------------------------------------------------------------------------------- /src/style/img/face/惊讶.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/惊讶.gif -------------------------------------------------------------------------------- /src/style/img/face/憨笑.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/憨笑.gif -------------------------------------------------------------------------------- /src/style/img/face/抓狂.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/抓狂.gif -------------------------------------------------------------------------------- /src/style/img/face/折磨.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/折磨.gif -------------------------------------------------------------------------------- /src/style/img/face/抠鼻.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/抠鼻.gif -------------------------------------------------------------------------------- /src/style/img/face/抱拳.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/抱拳.gif -------------------------------------------------------------------------------- /src/style/img/face/拥抱.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/拥抱.gif -------------------------------------------------------------------------------- /src/style/img/face/拳头.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/拳头.gif -------------------------------------------------------------------------------- /src/style/img/face/握手.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/握手.gif -------------------------------------------------------------------------------- /src/style/img/face/撇嘴.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/撇嘴.gif -------------------------------------------------------------------------------- /src/style/img/face/擦汗.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/擦汗.gif -------------------------------------------------------------------------------- /src/style/img/face/敲打.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/敲打.gif -------------------------------------------------------------------------------- /src/style/img/face/晕.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/晕.gif -------------------------------------------------------------------------------- /src/style/img/face/月亮.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/月亮.gif -------------------------------------------------------------------------------- /src/style/img/face/流汗.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/流汗.gif -------------------------------------------------------------------------------- /src/style/img/face/流泪.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/流泪.gif -------------------------------------------------------------------------------- /src/style/img/face/炸弹.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/炸弹.gif -------------------------------------------------------------------------------- /src/style/img/face/爱你.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/爱你.gif -------------------------------------------------------------------------------- /src/style/img/face/爱心.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/爱心.gif -------------------------------------------------------------------------------- /src/style/img/face/猪头.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/猪头.gif -------------------------------------------------------------------------------- /src/style/img/face/玫瑰.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/玫瑰.gif -------------------------------------------------------------------------------- /src/style/img/face/瓢虫.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/瓢虫.gif -------------------------------------------------------------------------------- /src/style/img/face/疑问.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/疑问.gif -------------------------------------------------------------------------------- /src/style/img/face/白眼.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/白眼.gif -------------------------------------------------------------------------------- /src/style/img/face/睡.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/睡.gif -------------------------------------------------------------------------------- /src/style/img/face/示爱.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/示爱.gif -------------------------------------------------------------------------------- /src/style/img/face/礼物.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/礼物.gif -------------------------------------------------------------------------------- /src/style/img/face/篮球.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/篮球.gif -------------------------------------------------------------------------------- /src/style/img/face/胜利.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/胜利.gif -------------------------------------------------------------------------------- /src/style/img/face/色.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/色.gif -------------------------------------------------------------------------------- /src/style/img/face/菜刀.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/菜刀.gif -------------------------------------------------------------------------------- /src/style/img/face/蛋糕.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/蛋糕.gif -------------------------------------------------------------------------------- /src/style/img/face/衰.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/衰.gif -------------------------------------------------------------------------------- /src/style/img/face/西瓜.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/西瓜.gif -------------------------------------------------------------------------------- /src/style/img/face/调皮.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/调皮.gif -------------------------------------------------------------------------------- /src/style/img/face/足球.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/足球.gif -------------------------------------------------------------------------------- /src/style/img/face/鄙视.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/鄙视.gif -------------------------------------------------------------------------------- /src/style/img/face/酷.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/酷.gif -------------------------------------------------------------------------------- /src/style/img/face/闪电.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/闪电.gif -------------------------------------------------------------------------------- /src/style/img/face/闭嘴.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/闭嘴.gif -------------------------------------------------------------------------------- /src/style/img/face/阴险.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/阴险.gif -------------------------------------------------------------------------------- /src/style/img/face/难过.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/难过.gif -------------------------------------------------------------------------------- /src/style/img/face/饥饿.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/饥饿.gif -------------------------------------------------------------------------------- /src/style/img/face/饭.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/饭.gif -------------------------------------------------------------------------------- /src/style/img/face/骷髅.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/骷髅.gif -------------------------------------------------------------------------------- /src/style/img/face/鼓掌.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/鼓掌.gif -------------------------------------------------------------------------------- /src/res/icons/ios/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon.png -------------------------------------------------------------------------------- /src/style/img/face/右哼哼.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/右哼哼.gif -------------------------------------------------------------------------------- /src/style/img/face/左哼哼.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/左哼哼.gif -------------------------------------------------------------------------------- /src/style/img/face/快哭了.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/快哭了.gif -------------------------------------------------------------------------------- /src/style/img/face/糗大了.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/face/糗大了.gif -------------------------------------------------------------------------------- /src/style/img/sprite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/sprite@2x.png -------------------------------------------------------------------------------- /src/style/img/start_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/start_up.png -------------------------------------------------------------------------------- /src/style/img/welcome/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/welcome/1.jpg -------------------------------------------------------------------------------- /src/style/img/welcome/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/welcome/2.png -------------------------------------------------------------------------------- /src/style/img/welcome/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/welcome/3.jpg -------------------------------------------------------------------------------- /src/style/img/welcome/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/welcome/4.jpg -------------------------------------------------------------------------------- /src/res/icons/ios/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-40.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-50.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-60.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-72.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-76.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon@2x.png -------------------------------------------------------------------------------- /src/style/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/fonts/iconfont.eot -------------------------------------------------------------------------------- /src/style/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/fonts/iconfont.ttf -------------------------------------------------------------------------------- /src/style/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/fonts/iconfont.woff -------------------------------------------------------------------------------- /src/res/icons/ios/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-40@2x.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-50@2x.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-60@2x.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-72@2x.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-76@2x.png -------------------------------------------------------------------------------- /src/res/icons/ios/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-small.png -------------------------------------------------------------------------------- /src/style/img/hiapp_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/hiapp_logo@2x.png -------------------------------------------------------------------------------- /src/style/img/image-loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/style/img/image-loading.gif -------------------------------------------------------------------------------- /src/res/icons/ios/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hubs/hiapp/master/src/res/icons/ios/icon-small@2x.png -------------------------------------------------------------------------------- /src/modules/contacts/contacts.less: -------------------------------------------------------------------------------- 1 | .contacts-list{ 2 | margin: 20px 0; 3 | } 4 | .page[data-page="contacts_group"] { 5 | 6 | } -------------------------------------------------------------------------------- /doc/plan: -------------------------------------------------------------------------------- 1 | #未完成项 2 | 1,NeDB封装. 3 | 2016-8-23 OK 4 | 2,登录,注册,找回密码功能. 5 | 3,Socket封装(JS封装) 6 | 2016-8-23 :初步OK 7 | 4,登录同步数据. 8 | 5,发送与接收服务器数据. 9 | -------------------------------------------------------------------------------- /src/style/less/mixins.less: -------------------------------------------------------------------------------- 1 | /*Base Style*/ 2 | @imgBaseUrl: "../img"; 3 | @fontBaseUrl:"../fonts"; 4 | @mainColor:#ff9630; 5 | @urlColor: #507daf; 6 | -------------------------------------------------------------------------------- /src/modules/about/about.js: -------------------------------------------------------------------------------- 1 | require('./about.less'); 2 | 3 | var appFunc = require('../utils/appFunc'); 4 | 5 | module.exports = { 6 | init: function(){ 7 | appFunc.hideToolbar(); 8 | } 9 | }; -------------------------------------------------------------------------------- /src/modules/services/appService.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | getLocal: function(){ 3 | return localStorage.getItem('lang') || 'zh-cn'; 4 | }, 5 | setLocal: function(lang){ 6 | localStorage.setItem('lang', lang); 7 | } 8 | }; -------------------------------------------------------------------------------- /src/modules/chat/service.js: -------------------------------------------------------------------------------- 1 | var xhr = require('../utils/xhr'); 2 | 3 | module.exports = { 4 | loadChatHistory: function(callback) { 5 | xhr.simpleCall({ 6 | func: 'chat' 7 | }, function (res) { 8 | callback(res.data); 9 | }); 10 | } 11 | }; -------------------------------------------------------------------------------- /src/modules/contacts_detail/service.js: -------------------------------------------------------------------------------- 1 | var xhr = require('../utils/xhr'); 2 | 3 | module.exports = { 4 | loadContacts: function(callback) { 5 | xhr.simpleCall({ 6 | func: 'contacts' 7 | }, function (res) { 8 | callback(res.data); 9 | }); 10 | } 11 | }; -------------------------------------------------------------------------------- /src/modules/infos/service.js: -------------------------------------------------------------------------------- 1 | var db = require("../db/db"); 2 | var table = require("../db/table"); 3 | module.exports = { 4 | getDatas: function(where,callback){ 5 | db.dbFind(table.T_ARTICLE,where,function(err,docs){ 6 | return callback(db.returnComm(err,docs)); 7 | }); 8 | } 9 | }; -------------------------------------------------------------------------------- /src/modules/language/language.less: -------------------------------------------------------------------------------- 1 | @import "../../style/less/mixins"; 2 | 3 | .language-page{ 4 | .list-block{ 5 | margin: 35px 0; 6 | background-color: #ffffff; 7 | 8 | label.label-checkbox input[type="radio"]:checked + .item-media i.icon-form-checkbox{ 9 | background-color: @mainColor; 10 | } 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /src/style/less/app.less: -------------------------------------------------------------------------------- 1 | @import "~framework7/dist/css/framework7.ios.css"; 2 | @import "~framework7/dist/css/framework7.ios.colors.css"; 3 | //@import "~framework7/dist/css/framework7.material.css"; 4 | //@import "~framework7/dist/css/framework7.material.colors.css"; 5 | @import "mixins"; 6 | @import "icon"; 7 | @import "navbar"; 8 | @import "toolbar"; 9 | @import "my-app"; -------------------------------------------------------------------------------- /src/modules/contacts/service.js: -------------------------------------------------------------------------------- 1 | var db = require("../db/db"); 2 | var table = require("../db/table"); 3 | 4 | module.exports = { 5 | 6 | loadContacts: function(where,callback){ 7 | db.dbFindAll(table.T_MEMBER,where,function(err,docs){ 8 | return callback(db.returnComm(err,docs)); 9 | },{"spell":1,'username':1}); 10 | } 11 | }; -------------------------------------------------------------------------------- /src/modules/faces/face.tpl.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | {{#each faces}} 4 |
5 | {{#each this}} 6 |
7 | 8 |
9 | {{/each}} 10 |
11 | {{/each}} 12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /src/modules/message/face.tpl.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | {{#each faces}} 4 |
5 | {{#each this}} 6 |
7 | 8 |
9 | {{/each}} 10 |
11 | {{/each}} 12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /src/api/answers.json: -------------------------------------------------------------------------------- 1 | { 2 | "err_code": 0, 3 | "err_msg": "success", 4 | "data": [ 5 | "Yes!", 6 | "No", 7 | "Hm...", 8 | "I am not sure", 9 | "And what about you?", 10 | "May be ;)", 11 | "Lorem ipsum dolor sit amet, consectetur", 12 | "What?", 13 | "Are you sure?", 14 | "Of course", 15 | "Need to think about it", 16 | "Amazing!!!" 17 | ] 18 | } -------------------------------------------------------------------------------- /src/modules/comment/service.js: -------------------------------------------------------------------------------- 1 | var db = require("../db/db"); 2 | var table = require("../db/table"); 3 | var appFunc = require("../utils/appFunc"); 4 | module.exports = { 5 | getComments: function(params,callback) { 6 | db.dbFind(table.T_COMMENTS,{type:appFunc.parseInt(params.type),mark_id:appFunc.parseInt(params.mark_id)},function(err,docs){ 7 | return callback(db.returnComm(err,docs)); 8 | },'',0,'',500); 9 | } 10 | }; -------------------------------------------------------------------------------- /src/api/user_login.json: -------------------------------------------------------------------------------- 1 | { 2 | "err_code": 0, 3 | "err_msg": "success", 4 | "data": { 5 | "sid": "e651771fe37dc17c17421331a87721", 6 | "user": { 7 | "id": "10001", 8 | "loginName": "hiapp@gmail.com", 9 | "nickName": "HiApp", 10 | "points": "267", 11 | "avatarUrl": "style/img/avatar/avatar01.jpg", 12 | "gender": "m", 13 | "location": "China" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /dbtest.js: -------------------------------------------------------------------------------- 1 | var sqlite3 = require('sqlite3'); 2 | var db = new sqlite3.Database('1.db',function() { 3 | db.run("create table test(name varchar(15))",function(){ 4 | db.run("insert into test values('hello,world')",function(){ 5 | db.all("select * from test",function(err,res){ 6 | if(!err) 7 | console.log(JSON.stringify(res)); 8 | else 9 | console.log(err); 10 | }); 11 | }) 12 | }); 13 | }); -------------------------------------------------------------------------------- /src/modules/infos/infos.tpl.html: -------------------------------------------------------------------------------- 1 | {{#datas}} 2 |
3 |
{{title}}
4 |
5 |
6 |

{{title}} {{format_ymd create_time}}

7 |
8 |
9 |
10 | {{/datas}} 11 | 12 | -------------------------------------------------------------------------------- /src/modules/tweet/tweet.tpl.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
{{get_username add_uid}}
5 |
{{format_ymd create_time}}
6 |
7 |
8 |
9 |

{{matchUrl content}}

10 | {{img_tag imgs}} 11 |
12 |
13 |
-------------------------------------------------------------------------------- /src/modules/info/info.tpl.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
{{add_username}}
5 |
{{format_ymd create_time}}
6 |
7 |
8 |
9 |

{{title}}

10 |

{{content}}

11 |
12 |
13 |
-------------------------------------------------------------------------------- /src/page/chat_detail.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | -------------------------------------------------------------------------------- /src/api/history_message.json: -------------------------------------------------------------------------------- 1 | { 2 | "err_code": 0, 3 | "err_msg": "success", 4 | "data": [ 5 | 6 | { 7 | "date":"Sunday, Feb 9, 12:58", 8 | "text": "Hi, Kate", 9 | "from": "sent" 10 | }, 11 | { 12 | "text": "How are you?", 13 | "from": "sent" 14 | }, 15 | { 16 | "text": "Hi, i am good", 17 | "from": "received" 18 | }, 19 | { 20 | "text": "Hi there, I am also fine, thanks! And how are you?", 21 | "from": "received" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /src/style/less/navbar.less: -------------------------------------------------------------------------------- 1 | @import "mixins"; 2 | 3 | .navbar{ 4 | i{ 5 | &.icon { 6 | font-size: 25px; 7 | } 8 | 9 | &.compose-outline { 10 | font-size: 30px; 11 | } 12 | 13 | &.arrow-thin-left { 14 | font-size: 32px; 15 | } 16 | 17 | } 18 | 19 | a{ 20 | &.link { 21 | color: #333; 22 | &.color-orange{ 23 | color: @mainColor; 24 | } 25 | } 26 | } 27 | 28 | a, 29 | div{ 30 | &.link:active{ 31 | opacity: 1; 32 | color: @mainColor 33 | } 34 | } 35 | 36 | .text-navbar { 37 | font-size: 15px; 38 | } 39 | } -------------------------------------------------------------------------------- /src/page/contacts_detail.html: -------------------------------------------------------------------------------- 1 | 14 | 21 | -------------------------------------------------------------------------------- /src/modules/contacts/contacts_checkbox.tpl.html: -------------------------------------------------------------------------------- 1 | {{#contacts}} 2 | {{#if spell}} 3 |
  • {{spell}}
  • 4 | {{/if}} 5 |
  • 6 |
    7 |
    8 |
    9 |
    10 |
    {{get_username uid}}
    11 |
    12 |
    13 | 14 |
    15 |
  • 16 | {{/contacts}} -------------------------------------------------------------------------------- /src/modules/home/service.js: -------------------------------------------------------------------------------- 1 | 2 | var db = require("../db/db"); 3 | var table = require("../db/table"); 4 | var appFunc = require("../utils/appFunc"); 5 | 6 | module.exports = { 7 | getTimeline: function(where,callback){ 8 | db.dbFind(table.T_TALK,where,function(err,docs){ 9 | return callback(db.returnComm(err,docs)); 10 | }); 11 | }, 12 | //newestId:最新的ID 13 | refreshTimeline: function(newestId,callback){ 14 | db.dbFind(table.T_TALK,{id: { $gt: appFunc.parseInt(newestId) }},function(err,docs){ 15 | return callback(db.returnComm(err,docs)); 16 | }); 17 | } 18 | }; -------------------------------------------------------------------------------- /src/modules/contacts/contacts.tpl.html: -------------------------------------------------------------------------------- 1 | {{#contacts}} 2 | {{#if spell}} 3 |
  • {{spell}}
  • 4 | {{/if}} 5 |
  • 6 | 7 |
    8 |
    9 |
    10 |
    11 |
    {{get_username id}}
    12 |
    13 |
    14 |
    15 |
    16 |
  • 17 | {{/contacts}} -------------------------------------------------------------------------------- /src/modules/chat_detail/chat_detail.less: -------------------------------------------------------------------------------- 1 | .page[data-page="chat_detail"] { 2 | .list-block { 3 | margin: 25px 0; 4 | } 5 | .btn-exit{ 6 | margin: 15px 10px; 7 | } 8 | .tr{ 9 | text-align: right; 10 | } 11 | .content-block{ 12 | margin: 0; 13 | .row{ 14 | .col-25{ 15 | text-align: center; 16 | .badge{ 17 | margin-left: -10px; 18 | line-height: 16px; 19 | height: 16px; 20 | } 21 | } 22 | .chat-icon-f45{ 23 | font-size: 50px; 24 | padding-bottom: 20px; 25 | } 26 | } 27 | } 28 | .item-input{ 29 | img{max-height: 45px;max-width: 45px;} 30 | } 31 | } -------------------------------------------------------------------------------- /src/modules/components/networkStatus.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 3 | checkConnection: function () { 4 | var networkState = navigator.connection.type; 5 | 6 | var states = {}; 7 | states[Connection.UNKNOWN] = 'UNKNOWN'; 8 | states[Connection.ETHERNET] = 'ETHERNET'; 9 | states[Connection.WIFI] = 'WIFI'; 10 | states[Connection.CELL_2G] = 'CELL_2G'; 11 | states[Connection.CELL_3G] = 'CELL_3G'; 12 | states[Connection.CELL_4G] = 'CELL_4G'; 13 | states[Connection.CELL] = 'CELL'; 14 | states[Connection.NONE] = 'NoNetwork'; 15 | 16 | return states[networkState]; 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /src/style/less/toolbar.less: -------------------------------------------------------------------------------- 1 | .toolbar{ 2 | i{ 3 | &.icon { 4 | font-size: 25px; 5 | line-height: 24px; 6 | } 7 | } 8 | //=>.toolbar i.icon 9 | 10 | .active{ 11 | .home-outline{ 12 | &:before { 13 | content: "\e619"; 14 | } 15 | } 16 | 17 | .chatbubble-outline{ 18 | &:before { 19 | content: "\e61b"; 20 | } 21 | } 22 | 23 | .gear-outline{ 24 | &:before { 25 | content: "\e60c"; 26 | } 27 | } 28 | } 29 | 30 | a{ 31 | &.active { 32 | color: @mainColor; 33 | } 34 | } 35 | 36 | span{ 37 | &.tabbar-label { 38 | font-size: 12px; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/modules/message/message.tpl.html: -------------------------------------------------------------------------------- 1 | {{#each message}} 2 | {{#if show_time}} 3 |
    {{format_chat_time create_time}}
    4 | {{/if}} 5 | {{#if image}} 6 |
    7 |
    8 |
    9 | {{else}} 10 |
    11 |
    {{face_text msg}}
    12 |
    13 |
    14 | {{/if}} 15 | {{/each}} 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/modules/contacts_group/contacts_checkbox.tpl.html: -------------------------------------------------------------------------------- 1 | {{#contacts}} 2 | {{#if spell}} 3 |
  • {{spell}}
  • 4 | {{/if}} 5 | 6 |
  • 7 | 17 |
  • 18 | {{/contacts}} -------------------------------------------------------------------------------- /src/modules/comment/comment.tpl.html: -------------------------------------------------------------------------------- 1 | {{#each comments}} 2 |
  • 3 |
    4 | {{url_filename add_uid}} 5 |
    6 |
    7 |
    {{url_username add_uid}}: {{at pid}} {{matchUrl add_content}}
    8 |
    {{format_how_long create_time}}
    9 | 10 | 11 | 12 | 13 |
    14 |
  • 15 | {{else}} 16 |
    17 | 18 |

    {{t i18n="i18n.comment.empty_comment"}}

    19 |
    20 | {{/each}} -------------------------------------------------------------------------------- /src/page/user_info.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | -------------------------------------------------------------------------------- /src/modules/user_info/user_info.less: -------------------------------------------------------------------------------- 1 | .page[data-page="user_info"] { 2 | .list-block { 3 | margin: 25px 0; 4 | } 5 | input,textarea{ 6 | border: 1px solid #ebe9e9; 7 | padding-left: 5px; 8 | } 9 | 10 | .file { 11 | position: relative; 12 | display: inline-block; 13 | background: #f7f7f7; 14 | border: 1px solid #ebe9e9; 15 | border-radius: 4px; 16 | padding: 4px 12px; 17 | overflow: hidden; 18 | color: #393939; 19 | text-decoration: none; 20 | text-indent: 0; 21 | line-height: 20px; 22 | } 23 | .file input { 24 | position: absolute; 25 | font-size: 100px; 26 | right: 0; 27 | top: 0; 28 | opacity: 0; 29 | } 30 | .file:hover { 31 | background: #ddd; 32 | border-color: #ebe9e9; 33 | color: #333; 34 | text-decoration: none; 35 | } 36 | .item-input img{ 37 | width: 85px; 38 | } 39 | } -------------------------------------------------------------------------------- /src/modules/about/about.less: -------------------------------------------------------------------------------- 1 | .about-page{ 2 | .content-block{ 3 | color: #666; 4 | } 5 | 6 | .logo { 7 | width: 90px; 8 | height: 90px; 9 | background: url("../../style/img/hiapp_logo@2x.png") center no-repeat #fff; 10 | background-size: 83%; 11 | text-indent: -9999px; 12 | border-radius: 5px; 13 | margin: 0 auto; 14 | border: 1px solid #dfdfdf; 15 | } 16 | 17 | .my-product{ 18 | text-align: center; 19 | margin-top: -20px; 20 | 21 | .name{ 22 | font-size: 20px; 23 | } 24 | } 25 | 26 | .contact-list{ 27 | margin: 0 auto; 28 | width: 230px; 29 | 30 | > p{ 31 | margin: 8px 0; 32 | } 33 | } 34 | 35 | .about-copyright{ 36 | position: absolute; 37 | left: 0; 38 | text-align: center; 39 | bottom: 0; 40 | font-size: 10px; 41 | color: #9C9C9C; 42 | width: 100%; 43 | padding: 0; 44 | } 45 | } -------------------------------------------------------------------------------- /src/modules/utils/dbHelper.js: -------------------------------------------------------------------------------- 1 | var store = require("../utils/localStore"), 2 | db = require("../db/db"), 3 | table = require("../db/table"), 4 | appFunc = require("../utils/appFunc") 5 | 6 | ; 7 | var pack = { 8 | 9 | dbUpdateUsername:function(new_username,uid){ 10 | store.setSyncStorageValue("username",new_username); 11 | //更改评论名字 12 | var _uid = uid||store.getStorageIntVal("uid"); 13 | db.dbUpdate(table.T_COMMENTS,{id:_uid},{add_username:new_username}); 14 | db.dbUpdate(table.T_TALK,{add_uid:_uid},{add_username:new_username}); 15 | appFunc.setUsernameByUid(_uid,new_username); 16 | }, 17 | 18 | dbUpdateFilename:function(new_filename){ 19 | store.setSyncStorageValue("filename",new_filename); 20 | appFunc.setFilenameByUid(store.getStorageIntVal("uid"),new_filename); 21 | }, 22 | }; 23 | module.exports = pack; -------------------------------------------------------------------------------- /src/modules/chat/chat.less: -------------------------------------------------------------------------------- 1 | .page[data-page="chatView"] { 2 | .chat-list { 3 | .contacts-list { 4 | margin: 20px 0; 5 | } 6 | .list-block { 7 | margin-top: 0; 8 | } 9 | .item-content .item-before { 10 | padding-right: 15px; 11 | } 12 | .item-content .item-media { 13 | width: 40px; 14 | height: 40px; 15 | } 16 | 17 | .media-list li { 18 | border-bottom: 1px solid #ddd; 19 | } 20 | .list-block .item-inner:after { 21 | background-color: #fff; 22 | } 23 | .list-block .item-after { 24 | font-size: 12px; 25 | } 26 | .item-link .item-title-row { 27 | background-image: none !important; 28 | } 29 | 30 | .modal-buttons-vertical .modal-button { 31 | text-align: left; 32 | padding-left: 20px; 33 | color: #000 34 | } 35 | 36 | .item-subtitle { 37 | color: #888; 38 | } 39 | } 40 | .list-block { 41 | margin: 0; 42 | } 43 | } -------------------------------------------------------------------------------- /src/modules/language/language.js: -------------------------------------------------------------------------------- 1 | require('./language.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | appService = require('../services/appService'); 5 | 6 | module.exports = { 7 | init: function(){ 8 | appFunc.hideToolbar(); 9 | 10 | this.bindEvents(); 11 | this.setDefaultLanguage(); 12 | }, 13 | setDefaultLanguage: function(){ 14 | var lang = appService.getLocal(); 15 | $$('.language-page .language-radio[data-lang="' + lang + '"]').attr('checked','checked'); 16 | }, 17 | switchLanguage: function(){ 18 | var lang = $$('.language-page .language-radio:checked').data('lang'); 19 | appService.setLocal(lang); 20 | window.location.reload(); 21 | }, 22 | bindEvents: function(){ 23 | var bindings = [{ 24 | element: '.set-language', 25 | event: 'click', 26 | handler: this.switchLanguage 27 | }]; 28 | appFunc.bindEvents(bindings); 29 | } 30 | }; -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "-W003" : true, 3 | "-W030" : true, 4 | "node" : true, 5 | "browser" : true, 6 | "esnext" : true, 7 | "bitwise" : false, 8 | "curly" : false, 9 | "eqeqeq" : true, 10 | "eqnull" : true, 11 | "immed" : true, 12 | "latedef" : true, 13 | "newcap" : true, 14 | "noarg" : true, 15 | "undef" : true, 16 | "strict" : false, 17 | "trailing" : true, 18 | "smarttabs" : true, 19 | "quotmark" : "single", 20 | "indent" : 4, 21 | "white" : true, 22 | "globals":{ 23 | "window": true, 24 | "Dom7": true, 25 | "$$": true, 26 | "Template7": true, 27 | "Framework7": true, 28 | "homeF7View": true, 29 | "i18n": true, 30 | "hiApp": true, 31 | "define": true, 32 | "Connection": true, 33 | "Camera": true, 34 | "FileTransfer": true 35 | } 36 | } -------------------------------------------------------------------------------- /src/page/feedback.html: -------------------------------------------------------------------------------- 1 | 17 | 34 | 35 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 BelinChung 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /src/modules/chat/chat.tpl.html: -------------------------------------------------------------------------------- 1 |
    2 | 22 |
    23 | -------------------------------------------------------------------------------- /src/modules/infos/infos.less: -------------------------------------------------------------------------------- 1 | @import "../../style/less/mixins"; 2 | 3 | .load-result{ 4 | width: 100%; 5 | height: 30px; 6 | position: absolute; 7 | bottom: 50px; 8 | left: 0; 9 | background-color: @mainColor; 10 | color: #ffffff; 11 | z-index: 1000; 12 | text-align: center; 13 | line-height: 30px; 14 | opacity: 0; 15 | } 16 | .home-timeline { 17 | padding-bottom: 15px; 18 | } 19 | .ks-facebook-card { 20 | .card-header { 21 | display: block; 22 | padding: 10px; 23 | } 24 | .ks-facebook-avatar { 25 | float: left; 26 | } 27 | .ks-facebook-name { 28 | margin-left: 44px; 29 | font-size: 14px; 30 | font-weight: 500; 31 | color: @mainColor; 32 | } 33 | .ks-facebook-date { 34 | margin-left: 44px; 35 | font-size: 13px; 36 | color: #8e8e93; 37 | } 38 | .card-footer { 39 | background: #fafafa; 40 | a { 41 | color: #81848b; 42 | font-weight: 500; 43 | } 44 | img { 45 | display: block; 46 | } 47 | } 48 | .card-content-inner { 49 | padding: 15px 10px; 50 | } 51 | } -------------------------------------------------------------------------------- /src/page/info.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | -------------------------------------------------------------------------------- /src/modules/feedback/feedback.js: -------------------------------------------------------------------------------- 1 | var appFunc = require('../utils/appFunc'), 2 | socket = require('../socket/socket'), 3 | store = require("../utils/localStore") 4 | ; 5 | 6 | module.exports = { 7 | init: function(){ 8 | appFunc.hideToolbar(); 9 | 10 | this.bindEvents(); 11 | }, 12 | sendFeedback: function(){ 13 | var text = $$("#feedbackMessageText").val(); 14 | if(appFunc.getCharLength(text) < 4){ 15 | hiApp.alert(i18n.index.err_text_too_short); 16 | return false; 17 | } 18 | 19 | hiApp.showPreloader(i18n.index.sending); 20 | socket.sys_feedBack({ 21 | username : store.getStorageValue("username"), 22 | content : text 23 | },function(info){ 24 | hiApp.hidePreloader(); 25 | appFunc.hiAlert(info); 26 | $$("#feedbackMessageText").val(""); 27 | }); 28 | 29 | }, 30 | bindEvents: function(){ 31 | var bindings = [{ 32 | element: '.send-feedback', 33 | event: 'click', 34 | handler: this.sendFeedback 35 | }]; 36 | 37 | appFunc.bindEvents(bindings); 38 | } 39 | }; -------------------------------------------------------------------------------- /src/modules/home/home.tpl.html: -------------------------------------------------------------------------------- 1 | {{#timeline}} 2 |
    3 |
    4 |
    5 | {{url_filename add_uid}} 6 |
    7 |
    {{url_username add_uid}}
    8 |
    {{format_ymd create_time}}
    9 |
    10 |
    11 |
    12 |

    {{matchUrl content}}

    13 | {{img_tag imgs}} 14 |
    15 |
    16 | 20 |
    21 |
    22 |
    23 |
    24 |
    25 | 28 |
    29 | 31 |
    32 | {{/timeline}} -------------------------------------------------------------------------------- /src/page/tweet.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | -------------------------------------------------------------------------------- /src/page/about.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | -------------------------------------------------------------------------------- /src/api/more_timeline.json: -------------------------------------------------------------------------------- 1 | { 2 | "err_code": 0, 3 | "err_msg": "success", 4 | "data": [ 5 | { 6 | "id" : "22", 7 | "add_username" : "Bottom", 8 | "content" : "Behind every successful man there's a lot u unsuccessful years. http://goo.gl/", 9 | "imgs" : "[\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\",\"http://pic.sc.chinaz.com/files/pic/pic9/201508/apic14052.jpg\"]", 10 | "cool_num" : "", 11 | "comment_num" : "", 12 | "filename" : "http://lorempixel.com/68/68/people/1/", 13 | "create_time" : "1404709434" 14 | }, 15 | 16 | { 17 | "id" : "21", 18 | "add_username" : "Hello Bottom", 19 | "content" : "Hello Eventy! Behind every successful man there's a lot u unsuccessful years. http://goo.gl/", 20 | "imgs" : "[\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\"]", 21 | "cool_num" : "", 22 | "comment_num" : "", 23 | "filename" : "http://lorempixel.com/68/68/people/1/", 24 | "create_time" : "1404709434" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /src/api/comments.json: -------------------------------------------------------------------------------- 1 | { 2 | "err_code": 0, 3 | "err_msg": "success", 4 | "data": [ 5 | { 6 | "id" :1, 7 | "add_username" : "Cory Bergman", 8 | "add_content" : "wow that's some serious chat action", 9 | "create_time" : "1404705240", 10 | "type" : 1, 11 | "avatar" :"1" 12 | },{ 13 | "id" : 2, 14 | "add_username" : "Cory Bergman", 15 | "add_content" : "wow that's some serious chat action", 16 | "create_time" : "1404705240", 17 | "type" : 1, 18 | "avatar" : "2" 19 | },{ 20 | "id" : 3, 21 | "add_username" : "Cory Bergman", 22 | "add_content" : "wow that's some serious chat action", 23 | "create_time" : "1404705240", 24 | "type" : 1, 25 | "avatar" : "3" 26 | },{ 27 | "id" : 4, 28 | "add_username" : "Cory Bergman", 29 | "add_content" : "wow that's some serious chat action", 30 | "create_time" : "1404705240", 31 | "type" : 1, 32 | "avatar" : "4" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /src/modules/login/forget.tpl.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /src/modules/utils/localStore.js: -------------------------------------------------------------------------------- 1 | 2 | var localStore = { 3 | 4 | setValue:function(key,value){ 5 | localStorage.setItem(key,value); 6 | }, 7 | 8 | 9 | getValue:function(key){ 10 | return localStorage.getItem(key); 11 | }, 12 | 13 | getIntValue:function(key){ 14 | var val = localStore.getValue(key); 15 | if(val){ 16 | return parseInt(val); 17 | } 18 | return 0; 19 | }, 20 | 21 | setStorageValue:function(key,value){ 22 | localStore.setValue(localStore._getStoragePre()+key,value); 23 | }, 24 | 25 | getStorageValue:function(key){ 26 | return localStore.getValue(localStore._getStoragePre()+key); 27 | }, 28 | getStorageIntVal:function(key){ 29 | return localStore.getIntValue(localStore._getStoragePre()+key); 30 | }, 31 | _getStoragePre : function(){ 32 | return localStore.getValue("uid")+"_"+localStore.getValue("storage")+"_"; 33 | }, 34 | 35 | //现在有二种存储方式:webSQLStorage,asyncStorage 36 | setSyncStorageValue:function(key,value){ 37 | var _uid = localStore.getValue("uid"); 38 | if(_uid){ 39 | localStore.setValue(_uid+"_webSQLStorage_"+key,value); 40 | localStore.setValue(_uid+"_asyncStorage_"+key,value); 41 | } 42 | } 43 | }; 44 | 45 | module.exports = localStore; -------------------------------------------------------------------------------- /src/modules/db/table.js: -------------------------------------------------------------------------------- 1 | var TABLE = { 2 | T_ACTIVITY : 'activity', //活动表 3 | T_ACTIVITY_DETAILS : 'activity_details', //活动详细表 4 | T_ARTICLE : 'article', //文章表 5 | T_CHAT : 'chat', //聊天表 6 | T_CHAT_GROUP : 'chat_group', //群聊表 7 | T_CHAT_GROUP_DENY : 'chat_group_deny', //消息免打扰表 8 | T_CHAT_GROUP_MEMBER : 'chat_group_member', //群会员表 9 | T_COMMENTS : 'comments', //评论表 10 | T_MEMBER : 'member', //会员表 11 | T_MEMBER_COLLECT : 'member_collect', //会员点赞集合表 12 | T_MEMBER_DENY : 'member_deny', //会员拒绝聊天设置表 13 | T_TALK : 'talk', //说说表 14 | T_TALK_DENY : 'talk_deny', //说说拒绝表 15 | T_VOTE : 'vote', //投票表 16 | T_VOTE_DETAILS : 'vote_details', //投票详细表 17 | T_VOTE_MEMBER : 'vote_member', //投票人员统计表 18 | T_DEMO : 'demo', //CURD测试表 19 | T_CHAT_SETTING : 'chat_setting' //2016-9-24 add ,会员设置 20 | }; 21 | module.exports = TABLE; 22 | 23 | /** 24 | chat_panel:表结构 1:add_uid: 25 | 2:mark_id :群或个人ID 26 | 3:type 类型:1:个人,2:群聊 27 | 4:num 聊天数 28 | 5,date 时间 29 | 6,isTop 显否置顶. 30 | 7,status :0 隐藏 .1.显示 31 | */ -------------------------------------------------------------------------------- /src/modules/init.js: -------------------------------------------------------------------------------- 1 | var socket = require("./socket/socket"), 2 | db = require("./db/db"), 3 | localforage = require('localforage'), 4 | store = require("./utils/localStore"), 5 | infoView = require("./infos/infos"), 6 | appFunc = require("./utils/appFunc") 7 | ; 8 | //初始化页面 9 | module.exports = { 10 | init: function () { 11 | db.init(); 12 | socket.init(); 13 | //由于有二种驱动保存前辍 14 | var _driver = localforage.driver(); 15 | if(_driver!=store.getValue("storage")){ 16 | store.setValue("storage",_driver); 17 | //如果是已登录了,则需要同步一下数据 18 | if(socket.getLoginStatus()){ 19 | socket.base_get_offline_msg(); 20 | } 21 | } 22 | //增加欢迎界面 23 | this._check_show_welcome(); 24 | return true; 25 | }, 26 | _check_show_welcome:function(){ 27 | if(store.getStorageValue("welcome_skip")=='true') { 28 | $$("#footer").show(); 29 | }else{ 30 | $$("#welcome-page").show(); 31 | hiApp.swiper('.welcome-swiper-container', { 32 | pagination:'.swiper-pagination' 33 | }); 34 | $$(".welcomescreen-closebtn").click(function(){ 35 | console.log("skip!"); 36 | store.setStorageValue("welcome_skip",true); 37 | $$("#welcome-page").hide(); 38 | $$("#footer").show(); 39 | infoView.init(); 40 | }); 41 | } 42 | } 43 | }; -------------------------------------------------------------------------------- /src/page/contacts_group.html: -------------------------------------------------------------------------------- 1 | 17 | 43 | -------------------------------------------------------------------------------- /src/modules/comment/commentPopup.tpl.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/modules/chat_detail/chat_detail.tpl.html: -------------------------------------------------------------------------------- 1 |
    2 | 15 |
    16 | 17 |
    18 | 42 |
    -------------------------------------------------------------------------------- /src/modules/faces/face.less: -------------------------------------------------------------------------------- 1 | .bar-actions 2 | { 3 | margin-top: 20px; 4 | margin-left:20px; 5 | } 6 | .bar-action 7 | { 8 | float : left; 9 | width : 50px; 10 | color : #636669; 11 | .action-icon, 12 | .action-text 13 | { 14 | display : block; 15 | } 16 | .action-icon 17 | { 18 | border-radius : 5px; 19 | margin : auto; 20 | width : 48px; 21 | height : 48px; 22 | line-height : 48px; 23 | font-size : 36px; 24 | text-align : center; 25 | } 26 | .action-text 27 | { 28 | padding-top : 5px; 29 | font-size : 12px; 30 | text-align : center; 31 | line-height : 20px; 32 | } 33 | } 34 | 35 | .bar-aface{ 36 | height: 50px; 37 | } 38 | 39 | .toolbar-inner{ 40 | a{ 41 | color:#636669 ; 42 | } 43 | } 44 | .button { 45 | border: 1px solid #636669; 46 | } 47 | 48 | 49 | .swiper-wrapper { 50 | margin-bottom: 20px; 51 | } 52 | 53 | 54 | //iPhone 5 竖屏 55 | @media only screen 56 | and (min-device-width : 320px) 57 | and (max-device-width : 568px) 58 | and (orientation : portrait) { 59 | .bar-action{ 60 | margin-right : 0px; 61 | } 62 | } 63 | //ipone 6 64 | @media only screen 65 | and (min-device-width : 375px) 66 | and (max-device-width : 627px) 67 | and (orientation : portrait) { 68 | .bar-action{ 69 | margin-right : 8px; 70 | } 71 | } 72 | 73 | //iphone 6s 74 | @media only screen 75 | and (min-device-width : 412px) 76 | and (max-device-width : 736px) 77 | and (orientation : portrait) { 78 | .bar-action{ 79 | margin-right : 15px; 80 | } 81 | } 82 | 83 | .show{ 84 | display: block; 85 | } 86 | .hide{ 87 | display: none; 88 | } -------------------------------------------------------------------------------- /src/modules/home/home.less: -------------------------------------------------------------------------------- 1 | @import "../../style/less/mixins"; 2 | 3 | 4 | 5 | /* .navbar-through .page-content, .navbar-fixed .page-content { 6 | padding-top: 20px; 7 | }*/ 8 | .page[data-page="homeView"] { 9 | .load-result{ 10 | width: 100%; 11 | height: 30px; 12 | position: absolute; 13 | bottom: 50px; 14 | left: 0; 15 | background-color: @mainColor; 16 | color: #ffffff; 17 | z-index: 1000; 18 | text-align: center; 19 | line-height: 30px; 20 | opacity: 0; 21 | } 22 | .home-timeline { 23 | padding-bottom: 15px; 24 | } 25 | .ks-facebook-card { 26 | .card-header { 27 | display: block; 28 | padding: 10px; 29 | } 30 | .ks-facebook-avatar { 31 | float: left; 32 | } 33 | .ks-facebook-name { 34 | margin-left: 44px; 35 | font-size: 14px; 36 | font-weight: 500; 37 | color: @mainColor; 38 | } 39 | .ks-facebook-date { 40 | margin-left: 44px; 41 | font-size: 13px; 42 | color: #8e8e93; 43 | } 44 | .card-footer { 45 | background: #fafafa; 46 | a { 47 | color: #81848b; 48 | font-weight: 500; 49 | } 50 | img { 51 | display: block; 52 | } 53 | } 54 | .card-content-inner { 55 | padding: 15px 10px; 56 | } 57 | } 58 | 59 | 60 | .icon{ 61 | font-size: 22px; 62 | } 63 | .cool-ok{ 64 | color: #ff9500; 65 | } 66 | .content-block-inner { 67 | background: #f7f7f7; 68 | margin-top: -6px; 69 | } 70 | .content-block { 71 | margin: 0; 72 | } 73 | .icon-heart { 74 | font-size: 13px; 75 | } 76 | .comments-content { 77 | border: 0; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "HiApp", 3 | "description": "A web app made with Framework7.With PhoneGap you can easily convert it to native iOS app.", 4 | "version": "2.1.0", 5 | "author": "BelinChung", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "git@github.com:BelinChung/HiApp.git" 10 | }, 11 | "scripts": { 12 | "clean": "rm -fr ./www", 13 | "dev": "webpack --config build/webpack/development.js --progress --watch", 14 | "devPro": "webpack-dashboard -- webpack --config build/webpack/development.js --progress --watch", 15 | "build": "NODE_ENV=production npm run clean && webpack --config build/webpack/production.js --progress", 16 | "build_with_source_map": "npm run build --devtool source-map" 17 | }, 18 | "devDependencies": { 19 | "brfs": "^1.4.3", 20 | "browser-sync": "^2.11.1", 21 | "browser-sync-webpack-plugin": "^1.0.1", 22 | "copy-webpack-plugin": "^1.1.1", 23 | "css-loader": "^0.23.1", 24 | "extract-text-webpack-plugin": "^1.0.1", 25 | "file-loader": "^0.8.5", 26 | "gulp-livereload": "^3.8.1", 27 | "gulp-server-livereload": "^1.8.1", 28 | "html-loader": "^0.4.0", 29 | "html-webpack-plugin": "^2.7.1", 30 | "ignore-styles": "^4.0.0", 31 | "json-loader": "^0.5.4", 32 | "less": "^2.5.3", 33 | "less-loader": "^2.2.2", 34 | "style-loader": "^0.13.0", 35 | "transform-loader": "^0.2.3", 36 | "url-loader": "^0.5.7", 37 | "webpack": "^1.13.1", 38 | "webpack-dashboard": "^0.1.8" 39 | }, 40 | "dependencies": { 41 | "crypto-js": "^3.1.6", 42 | "framework7": "~1.4.2", 43 | "install": "^0.8.1", 44 | "memory-cache": "^0.1.6", 45 | "nedb": "^1.8.0", 46 | "socket.io-client": "^1.4.8" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/modules/login/login.tpl.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 4 |
    5 |
    6 |
    7 |
      8 |
    • 9 |
      10 |
      11 |
      12 | 13 |
      14 |
      15 |
      16 |
    • 17 |
    • 18 |
      19 |
      20 |
      21 | 22 |
      23 |
      24 |
      25 |
    • 26 |
    27 |
    28 |
    29 | 34 |
    35 |
    36 |
    -------------------------------------------------------------------------------- /src/modules/password/password.js: -------------------------------------------------------------------------------- 1 | var appFunc = require('../utils/appFunc'), 2 | socket = require('../socket/socket'), 3 | store = require("../utils/localStore") 4 | ; 5 | 6 | module.exports = { 7 | init: function(){ 8 | appFunc.hideToolbar(); 9 | 10 | this.bindEvents(); 11 | }, 12 | changPassword: function(){ 13 | var _old_pass = $$("#old-password").val().trim(); 14 | var _new_pass = $$("#new-password").val().trim(); 15 | var _new_ag_pass= $$("#new-ag-password").val().trim(); 16 | 17 | if(_old_pass==''){ 18 | hiApp.alert(i18n.password.old_not_null); 19 | return false; 20 | } 21 | 22 | if(_new_pass==''){ 23 | hiApp.alert(i18n.password.new_not_null); 24 | return false; 25 | } 26 | 27 | if(_new_ag_pass!=_new_pass){ 28 | hiApp.alert(i18n.password.new_not_eq); 29 | return false; 30 | } 31 | 32 | hiApp.showPreloader(i18n.index.sending); 33 | socket.base_edit_password({ 34 | oldPass :_old_pass, 35 | newPass :_new_pass, 36 | newPassAgain:_new_ag_pass 37 | },function(info){ 38 | hiApp.hidePreloader(); 39 | appFunc.hiAlert(info); 40 | $$("#old-password").val(""); 41 | $$("#new-password").val(""); 42 | $$("#new-ag-password").val(""); 43 | store.setSyncStorageValue("password",appFunc.encrypt(_new_pass)); 44 | }); 45 | }, 46 | bindEvents: function(){ 47 | var bindings = [{ 48 | element: '.chang-password', 49 | event: 'click', 50 | handler: this.changPassword 51 | }]; 52 | 53 | appFunc.bindEvents(bindings); 54 | } 55 | }; -------------------------------------------------------------------------------- /src/modules/setting/setting.js: -------------------------------------------------------------------------------- 1 | require('./setting.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | template = require('./setting.tpl.html'), 5 | socket = require('../socket/socket'), 6 | store = require("../utils/localStore") 7 | ; 8 | 9 | var settingView = { 10 | init: function(){ 11 | settingView.bindEvents(); 12 | }, 13 | renderSetting: function(){ 14 | //if($$('#settingView .page-content')[0]) return; 15 | 16 | hiApp.showIndicator(); 17 | 18 | var renderData = { 19 | filename : store.getStorageValue("filename"), 20 | username : store.getStorageValue("username"), 21 | chat_name : store.getStorageValue("tel") 22 | }; 23 | 24 | console.log(renderData); 25 | 26 | var output = appFunc.renderTpl(template, renderData); 27 | $$('#settingView .page[data-page="setting"]').html(output); 28 | 29 | hiApp.hideIndicator(); 30 | }, 31 | logOut: function(){ 32 | hiApp.confirm(i18n.setting.confirm_logout,function(){ 33 | socket.base_logut(); 34 | }); 35 | }, 36 | bindEvents: function(){ 37 | var bindings = [{ 38 | element: '#settingView', 39 | event: 'show', 40 | handler: settingView.renderSetting 41 | },{ 42 | element: '#settingView', 43 | selector: '.logout-button', 44 | event: 'click', 45 | handler: settingView.logOut 46 | },{ 47 | element: '#settingView', 48 | selector: '.update-button', 49 | event: 'click', 50 | //handler: settingView.checkVersion 51 | }]; 52 | appFunc.bindEvents(bindings); 53 | } 54 | }; 55 | 56 | module.exports = settingView; -------------------------------------------------------------------------------- /src/modules/app/app.js: -------------------------------------------------------------------------------- 1 | require('./app.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | infosView = require('../infos/infos'), 5 | homeView = require('../home/home'), 6 | contactsView = require('../contacts/contacts'), 7 | chatView = require('../chat/chat'), 8 | settingView = require('../setting/setting'), 9 | loginView = require("../login/login") 10 | ; 11 | 12 | 13 | //初始化页面 14 | module.exports = { 15 | init: function(){ 16 | this.i18next(''); 17 | appFunc.checkIsChangeDb(); 18 | loginView.init(); 19 | infosView.init(); 20 | homeView.init(); 21 | contactsView.init(); 22 | settingView.init(); 23 | chatView.init(); 24 | }, 25 | 26 | i18next: function(content){ 27 | var that = this; 28 | 29 | var renderData = {}; 30 | 31 | var output = appFunc.renderTpl(content,renderData); 32 | 33 | $$('.views .i18n').each(function(){ 34 | var value; 35 | var i18nKey = $$(this).data('i18n'); 36 | var handle = i18nKey.split(']'); 37 | if(handle.length > 1 ){ 38 | var attr = handle[0].replace('[',''); 39 | value = that.i18nValue(handle[1]); 40 | $$(this).attr(attr,value); 41 | }else{ 42 | value = that.i18nValue(i18nKey); 43 | $$(this).html(value); 44 | } 45 | }); 46 | 47 | return output; 48 | }, 49 | 50 | i18nValue: function(key){ 51 | 52 | var keys = key.split('.'); 53 | 54 | var value; 55 | for (var idx = 0, size = keys.length; idx < size; idx++) 56 | { 57 | if (value != null) 58 | { 59 | value = value[keys[idx]]; 60 | } else { 61 | value = i18n[keys[idx]]; 62 | } 63 | 64 | } 65 | return value; 66 | } 67 | }; -------------------------------------------------------------------------------- /src/modules/components/camera.js: -------------------------------------------------------------------------------- 1 | var appFunc = require('../utils/appFunc'), 2 | networkStatus = require('./networkStatus'); 3 | 4 | var camera = { 5 | getPicture: function(){ 6 | 7 | if(!appFunc.isPhonegap()){ 8 | hiApp.alert(i18n.error.phonegap_only); 9 | return false; 10 | } 11 | 12 | var $this = $$(this); 13 | 14 | var netStatus = networkStatus.checkConnection(); 15 | 16 | var quality, sourceType; 17 | if(netStatus === 'WIFI'){ 18 | quality = 80; 19 | }else{ 20 | quality = 50; 21 | } 22 | 23 | if(!$this.hasClass('camera')){ 24 | sourceType = Camera.PictureSourceType.PHOTOLIBRARY; 25 | }else{ 26 | sourceType = Camera.PictureSourceType.CAMERA; 27 | } 28 | 29 | var cameraOptions = { 30 | quality: quality, 31 | allowEdit: false, 32 | sourceType : sourceType, 33 | mediaType: Camera.MediaType.PICTURE, 34 | targetWidth: 1280, 35 | targetHeight: 1920 36 | }; 37 | 38 | navigator.camera.getPicture(camera.cameraSuccess,camera.cameraError,cameraOptions); 39 | 40 | }, 41 | 42 | cameraSuccess: function(fileUrl){ 43 | console.log("log image count = "+$$('#uploadPicPreview>img').length); 44 | if($$('#uploadPicPreview>img').length>9){ 45 | appFunc.hiAlert("最多可上传9张图片."); 46 | return false; 47 | } 48 | $$('#uploadPicPreview').append(''); 49 | $$('#uploadPicPreview').show(); 50 | 51 | }, 52 | 53 | cameraError: function(message){ 54 | setTimeout(function(){ 55 | if(message !== 'no image selected'){ 56 | hiApp.alert(message); 57 | } 58 | },500); 59 | }, 60 | 61 | clearCache: function(){ 62 | navigator.camera.cleanup(); 63 | } 64 | }; 65 | 66 | module.exports = camera; -------------------------------------------------------------------------------- /src/page/language.html: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by http://www.gitignore.io 2 | 3 | ### OSX ### 4 | .DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | 8 | # Icon must end with two \r 9 | Icon 10 | 11 | 12 | # Thumbnails 13 | ._* 14 | 15 | # Files that might appear on external disk 16 | .Spotlight-V100 17 | .Trashes 18 | 19 | # Directories potentially created on remote AFP share 20 | .AppleDB 21 | .AppleDesktop 22 | Network Trash Folder 23 | Temporary Items 24 | .apdisk 25 | 26 | 27 | ### WebStorm ### 28 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 29 | 30 | ## Directory-based project format 31 | .idea/ 32 | # if you remove the above rule, at least ignore user-specific stuff: 33 | # .idea/workspace.xml 34 | # .idea/tasks.xml 35 | # and these sensitive or high-churn files: 36 | # .idea/dataSources.ids 37 | # .idea/dataSources.xml 38 | # .idea/sqlDataSources.xml 39 | # .idea/dynamic.xml 40 | 41 | ## File-based project format 42 | *.ipr 43 | *.iws 44 | *.iml 45 | 46 | ## Additional for IntelliJ 47 | out/ 48 | 49 | # generated by mpeltonen/sbt-idea plugin 50 | .idea_modules/ 51 | 52 | # generated by JIRA plugin 53 | atlassian-ide-plugin.xml 54 | 55 | # generated by Crashlytics plugin (for Android Studio and Intellij) 56 | com_crashlytics_export_strings.xml 57 | 58 | 59 | ### Node ### 60 | # Logs 61 | logs 62 | *.log 63 | 64 | # Runtime data 65 | pids 66 | *.pid 67 | *.seed 68 | 69 | # Directory for instrumented libs generated by jscoverage/JSCover 70 | lib-cov 71 | 72 | # Coverage directory used by tools like istanbul 73 | coverage 74 | 75 | # Compiled binary addons (http://nodejs.org/api/addons.html) 76 | build/Release 77 | 78 | # Dependency directory 79 | # Commenting this out is preferred by some people, see 80 | # https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git 81 | node_modules 82 | 83 | # Users Environment Variables 84 | .lock-wscript 85 | 86 | # Bower 87 | bower_components 88 | .bower-cache 89 | .bower-registry 90 | .bower-tmp 91 | 92 | # project 93 | www/ 94 | plugins/ 95 | hooks/ 96 | cordova/ 97 | platforms/ 98 | -------------------------------------------------------------------------------- /src/modules/utils/helper.js: -------------------------------------------------------------------------------- 1 | var appFunc = require('../utils/appFunc'); 2 | 3 | Template7.registerHelper('format_ymd', function (create_time){ 4 | return appFunc.format_how_long(create_time); 5 | }); 6 | Template7.registerHelper('format_how_long', function (create_time){ 7 | return appFunc.format_how_long(create_time); 8 | }); 9 | Template7.registerHelper('matchUrl', function (content){ 10 | return content?(appFunc.matchUrl(appFunc.replace_smile(content))):""; 11 | }); 12 | 13 | Template7.registerHelper('img_tag', function (imgs){ 14 | if(!imgs) { 15 | return ''; 16 | } 17 | var _imgs = appFunc.parseJson(imgs); 18 | var _width = "100"; 19 | var _len = _imgs.length; 20 | if(_len==1){ 21 | _width = "100"; 22 | }else if(_len==2){ 23 | _width = '48'; 24 | }else { 25 | _width = "30"; 26 | } 27 | var ret = '
    '; 28 | $$.each(_imgs, function (index, value) { 29 | ret+=''; 30 | }); 31 | ret+='
    '; 32 | return ret; 33 | }); 34 | 35 | Template7.registerHelper('format_chat_time', function (create_time,options){ 36 | return create_time?appFunc.format_chat_time(create_time,options.hash.show_time):""; 37 | }); 38 | Template7.registerHelper('face_text', function (text){ 39 | return appFunc.replace_smile(text); 40 | }); 41 | 42 | //获取用户名 43 | Template7.registerHelper('url_username', function (uid){ 44 | return appFunc.getUsernameByUidForUrl(uid); 45 | }); 46 | 47 | Template7.registerHelper('get_username', function (uid){ 48 | return appFunc.getUsernameByUid(uid); 49 | }); 50 | //获取头像 51 | Template7.registerHelper('get_filename', function (uid){ 52 | return appFunc.getFilenameByUid(uid); 53 | }); 54 | Template7.registerHelper('url_filename', function (uid,lazy){ 55 | return appFunc.getFilenameByUidForUrl(uid,lazy); 56 | }); 57 | 58 | Template7.registerHelper('at', function (uid){ 59 | return appFunc.atUser(uid); 60 | }); 61 | 62 | -------------------------------------------------------------------------------- /src/modules/db/demo.js: -------------------------------------------------------------------------------- 1 | var db = require("./db"); 2 | const TABLE_DEMO = "talk"; 3 | db.init(); 4 | 5 | 6 | 7 | db.dbCount(TABLE_DEMO,'',function(err,res){ 8 | console.log("dbCount "); 9 | console.log(res); 10 | }); 11 | db.dbFind(TABLE_DEMO,{},function(err,res){ 12 | console.log("dbFind "); 13 | console.log(res); 14 | }); 15 | 16 | 17 | 18 | 19 | /* 20 | var ReadWriteLock = require('rwlock'); 21 | 22 | 23 | var lock = new ReadWriteLock(); 24 | 25 | 26 | lock.readLock('lock1', function (release) { 27 | console.log('readLock 1...'); 28 | var _username = lock.readLock('lock2', function (release) { 29 | console.log('readLock 2...'); 30 | _usename = db.dbFindOne(TABLE_DEMO,{add_uid:1},function(err,res){ 31 | console.log("inner username = "+res.add_username); 32 | return res.add_username; 33 | }); 34 | release(); 35 | return _username; 36 | }); 37 | release(); 38 | console.log('done 1.'); 39 | console.log("username2 = "+_username); 40 | }); 41 | */ 42 | 43 | 44 | 45 | /* 46 | db.dbCount(TABLE_DEMO,{key:"hello 2"},function(err,count){ 47 | console.log("dbCount "); 48 | console.log(db.returnComm(err,count)); 49 | }); 50 | db.dbFind(TABLE_DEMO,{key:"hello"},function(err,doc){ 51 | console.log("dbFind "); 52 | console.log(db.returnComm(err,doc)); 53 | }); 54 | 55 | db.dbUpdate(TABLE_DEMO,{key:"hello"},{key:"hello 3"},function(err,res){ 56 | console.log("dbUpdate "); 57 | console.log(db.returnComm(err,res)); 58 | }); 59 | 60 | db.dbFind(TABLE_DEMO,{value:"would"},function(err,res){ 61 | console.log("dbFind "); 62 | console.log(db.returnComm(err,res)); 63 | }); 64 | 65 | db.dbDel(TABLE_DEMO,{key:"two"},function(err,res){ 66 | console.log("dbDel "); 67 | console.log(db.returnComm(err,res)); 68 | }); 69 | 70 | db.dbInsert(TABLE_DEMO,{key:"three"},function(err,res){ 71 | console.log("dbInsert "); 72 | console.log(db.returnComm(err,res)); 73 | }); 74 | 75 | db.dbCount(TABLE_DEMO,'',function(err,res){ 76 | console.log("dbCount "); 77 | console.log(db.returnComm(err,res)); 78 | }); 79 | */ 80 | -------------------------------------------------------------------------------- /src/modules/login/register.tpl.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /src/api/message.json: -------------------------------------------------------------------------------- 1 | { 2 | "err_code": 0, 3 | "err_msg": "success", 4 | "data": [ 5 | { 6 | "create_time" : "1469072662", 7 | "msg" : "你好[:撇嘴][:撇嘴][:撇嘴]", 8 | "msg_type" : "1", 9 | "remark" : "", 10 | "from_uid" : "2", 11 | "filename" : "http://lorempixel.com/output/people-q-c-100-100-9.jpg" 12 | }, 13 | { 14 | "create_time" : "1469072762", 15 | "msg" : "什么事?", 16 | "msg_type" : "1", 17 | "remark" : "", 18 | "from_uid" : "3", 19 | "filename" : "http://lorempixel.com/output/people-q-c-100-100-9.jpg" 20 | }, 21 | { 22 | "create_time" : "1398250549", 23 | "msg" : "没事,无聊", 24 | "msg_type" : "1", 25 | "remark" : "", 26 | "from_uid" : "2", 27 | "filename" : "http://lorempixel.com/output/people-q-c-100-100-9.jpg" 28 | }, 29 | { 30 | "create_time" : "14690721062", 31 | "msg" : "http://scimg.jb51.net/allimg/160618/77-16061Q44U6444.jpg", 32 | "msg_type" : "2", 33 | "remark" : "http://scimg.jb51.net/allimg/160618/77-16061Q44U6444.jpg", 34 | "from_uid" : "2", 35 | "filename" : "http://lorempixel.com/output/people-q-c-100-100-9.jpg" 36 | }, 37 | { 38 | "create_time" : "1469073662", 39 | "msg" : "你发的是什么鬼?", 40 | "msg_type" : "1", 41 | "remark" : "", 42 | "from_uid" : "3", 43 | "filename" : "http://lorempixel.com/output/people-q-c-100-100-9.jpg" 44 | }, 45 | { 46 | "create_time" : "1469074662", 47 | "msg" : "你好", 48 | "msg_type" : "2", 49 | "remark" : "http://scimg.jb51.net/allimg/160618/77-16061Q44U6444.jpg", 50 | "from_uid" : "3", 51 | "filename" : "http://lorempixel.com/output/people-q-c-100-100-9.jpg" 52 | } 53 | ] 54 | } -------------------------------------------------------------------------------- /src/modules/faces/face.js: -------------------------------------------------------------------------------- 1 | require('./face.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | service = require('../message/service'), 5 | faceTemplate = require("./face.tpl.html") 6 | ; 7 | 8 | var pack = { 9 | _renderFaces:function(){ 10 | service.getFaces(function(res){ 11 | var _width = $$(".theme-cyan").width(); 12 | var _chunk = 0; 13 | if(_width>600){ 14 | _chunk = 42; 15 | }else{ 16 | _chunk = 18; 17 | } 18 | var i,j,temparray=[]; 19 | for (i=0,j=res.length; ii').removeClass('location-outline').addClass('preloader'); 9 | $$('#geoInfo .location>span').html(i18n.geo.loading_geo); 10 | 11 | GlobalLat = null; 12 | GlobalLong = null; 13 | }, 14 | 15 | catchGeoInfo: function(){ 16 | $$('#geoInfo').addClass('show').show(); 17 | if (navigator.geolocation){ 18 | navigator.geolocation.getCurrentPosition(geolocation.showPosition,geolocation.showGeoError); 19 | }else{ 20 | $$('#geoInfo .location').html(i18n.geo.position_unavailable); 21 | } 22 | }, 23 | 24 | showPosition: function(position){ 25 | var lat = position.coords.latitude; 26 | var long = position.coords.longitude; 27 | console.log(position.coords); 28 | 29 | $$('#geoInfo .location>i').removeClass('preloader').addClass('location-outline'); 30 | $$('#geoInfo .location>span').html(( Math.round(lat * 10000)/10000) + '/' + ( Math.round(long * 10000)/10000) ); 31 | 32 | GlobalLat = lat; 33 | GlobalLong = long; 34 | }, 35 | 36 | showGeoError: function(error){ 37 | switch(error.code) 38 | { 39 | case error.PERMISSION_DENIED: 40 | $$('#geoInfo .location').html(i18n.geo.permission_denied); 41 | break; 42 | case error.POSITION_UNAVAILABLE: 43 | $$('#geoInfo .location').html(i18n.geo.position_unavailable); 44 | break; 45 | case error.TIMEOUT: 46 | $$('#geoInfo .location').html(i18n.geo.timeout); 47 | break; 48 | case error.UNKNOWN_ERROR: 49 | $$('#geoInfo .location').html(i18n.error.unknown_error); 50 | break; 51 | } 52 | }, 53 | 54 | getGeo: function(){ 55 | return { 56 | lat:GlobalLat, 57 | long:GlobalLong 58 | }; 59 | }, 60 | 61 | cleanGeo: function(){ 62 | hiApp.confirm(i18n.geo.confirm_clean_geo,geolocation.initGeo); 63 | } 64 | }; 65 | 66 | module.exports = geolocation; 67 | -------------------------------------------------------------------------------- /src/modules/contacts_detail/detail.less: -------------------------------------------------------------------------------- 1 | .page[data-page="contacts_detail"] { 2 | 3 | .details-page { 4 | margin-top: 15px; 5 | 6 | .spring { 7 | background: url("../../style/img/sprite@2x.png") no-repeat; 8 | background-size: 200%; 9 | } 10 | 11 | > ul { 12 | background-color: transparent; 13 | 14 | .item-link { 15 | &:active { 16 | .item-content { 17 | transition-duration: 0ms; 18 | background-color: #e9e9e9 !important; 19 | } 20 | } 21 | } 22 | .item-content { 23 | margin: 0; 24 | margin-top: 10px; 25 | background: #ffffff; 26 | box-shadow: 0 2px 2px rgba(0, 0, 0, .05); 27 | padding: 0; 28 | padding-left: 10px; 29 | border: 1px solid #EBE9E9; 30 | .item-title { 31 | font-size: 14px; 32 | } 33 | .pl20 { 34 | padding-left: 20px; 35 | } 36 | .pr20 { 37 | margin-right: 20px; 38 | } 39 | .item-inner { 40 | border: 0; 41 | background-image: none; 42 | &:after { 43 | background-color: transparent; 44 | } 45 | } 46 | } 47 | .p_5 { 48 | margin-top: 5px; 49 | } 50 | .item-media { 51 | width: 30px; 52 | height: 30px; 53 | color: #ffffff; 54 | font-size: 28px; 55 | text-align: center; 56 | padding: 0; 57 | } 58 | 59 | .update { 60 | background-color: #fca405; 61 | background-position: 0 -30px; 62 | } 63 | 64 | .user-info { 65 | padding: 10px 10px 10px 0 !important; 66 | position: relative; 67 | 68 | .avatar, .avatar > img { 69 | width: 55px; 70 | height: 55px; 71 | } 72 | 73 | .user-detail { 74 | position: absolute; 75 | margin-left: 80px; 76 | line-height: 26px; 77 | 78 | .name { 79 | font-size: 14px; 80 | } 81 | 82 | .point { 83 | font-size: 13px; 84 | color: #818080; 85 | } 86 | 87 | .icon { 88 | vertical-align: inherit !important; 89 | } 90 | } 91 | } 92 | } 93 | .send-info { 94 | margin: 15px 10px; 95 | } 96 | } 97 | 98 | } -------------------------------------------------------------------------------- /src/modules/tweet/tweet.less: -------------------------------------------------------------------------------- 1 | .comments-content { 2 | background: #f7f7f7; 3 | border: 1px solid #EBE9E9; 4 | color: #6d6d72; 5 | margin: 10px; 6 | 7 | .comment-title { 8 | height: 30px; 9 | background-color: #ffffff; 10 | line-height: 30px; 11 | font-size: 11px; 12 | padding-left: 10px; 13 | border-bottom: 1px solid #EBE9E9; 14 | position: relative; 15 | 16 | .tip { 17 | position: absolute; 18 | width: 0; 19 | height: 0; 20 | top: 13px; 21 | left: 48px; 22 | border: 9px solid rgba(255, 255, 255, 0); 23 | border-bottom: 9px solid #f7f7f7; 24 | } 25 | } 26 | 27 | .comments-list { 28 | padding: 0 5px; 29 | margin: 0; 30 | 31 | .none-comment { 32 | text-align: center; 33 | margin-top: 10px; 34 | color: #DBDBDB; 35 | 36 | > i { 37 | display: block; 38 | font-size: 75px; 39 | margin-left: -15px; 40 | 41 | } 42 | } 43 | 44 | .loading { 45 | text-align: center; 46 | padding: 20px 0; 47 | } 48 | 49 | > li { 50 | overflow: hidden; 51 | padding: 10px 0; 52 | border-bottom: 1px solid #EBE9E9; 53 | position: relative; 54 | 55 | &:active{ 56 | transition-duration: 0ms; 57 | background-color: #e9e9e9 !important; 58 | } 59 | } 60 | 61 | .avatar{ 62 | float: left; 63 | height: 35px; 64 | width: 35px; 65 | border-radius: 3px; 66 | 67 | > img{ 68 | height: 35px; 69 | width: 35px; 70 | border-radius: 3px; 71 | } 72 | } 73 | 74 | .comment-detail { 75 | margin-left: 47px; 76 | 77 | .name { 78 | font-size: 12px; 79 | margin-top: -2px; 80 | } 81 | 82 | .text { 83 | word-break: break-all; 84 | line-height: 14px; 85 | } 86 | 87 | .time { 88 | color: #B6B6B6; 89 | font-size: 10px; 90 | margin-top: 5px; 91 | } 92 | } 93 | 94 | .reply { 95 | width: 18px; 96 | height: 12px; 97 | border: 1px solid #A3A0A0; 98 | line-height: 13px; 99 | text-align: center; 100 | font-size: 20px; 101 | color: #A3A0A0; 102 | border-radius: 3px; 103 | position: absolute; 104 | top: 8px; 105 | right: 2px; 106 | } 107 | } 108 | } -------------------------------------------------------------------------------- /src/modules/login/login.less: -------------------------------------------------------------------------------- 1 | .page[data-page="login"] { 2 | .login-screen-content { 3 | background-color: #3190e8; 4 | padding: 0 10px; 5 | } 6 | 7 | .btn { 8 | position: relative; 9 | background-color: #5cacf7; 10 | color: #fff; 11 | } 12 | .list-button { 13 | display: inline-block; 14 | box-sizing: border-box; 15 | border: none; 16 | margin: 0; 17 | border-radius: 4px; 18 | padding: 7px 10px; 19 | font-size: 16px; 20 | line-height: 30px; 21 | height: 44px; 22 | text-align: center; 23 | color: #fff; 24 | width: 100%; 25 | margin-top: 20px; 26 | } 27 | 28 | .list { 29 | padding-left: 0; 30 | border: none; 31 | border-radius: 4px; 32 | overflow: hidden; 33 | margin-bottom: 15px; 34 | background-color: #fff; 35 | border-top: 1px solid #ddd; 36 | border-bottom: 1px solid #ddd; 37 | } 38 | .list .list-item { 39 | line-height: 30px; 40 | font-size: 14px; 41 | border-top: 1px solid #ddd; 42 | } 43 | .list .list-item:first-child { 44 | border-top: none; 45 | } 46 | 47 | .item-input { 48 | width: 100%; 49 | box-sizing: border-box; 50 | padding: 7px 0; 51 | background-color: #fff; 52 | } 53 | 54 | .login-screen-title{ 55 | height: 100px; 56 | line-height: 100px; 57 | } 58 | 59 | .list-block input[type="text"],.list-block input[type="password"]{ 60 | //font-size: inherit; 61 | font-size: 14px; 62 | } 63 | 64 | .logo { 65 | transition: transform 0.8s; 66 | -webkit-transition: -webkit-transform 0.8s; 67 | -webkit-transform: translate3d(0, 0, 0); 68 | transform: translate3d(0, 0, 0); 69 | margin: auto; 70 | font-size: 50px; 71 | font-family: 'ionic'; 72 | text-align: center; 73 | color: #fff; 74 | } 75 | 76 | /** 77 | register 78 | */ 79 | .navbar{ 80 | color: #fff; 81 | background-color: #3190e8; 82 | font-size: 16px; 83 | } 84 | .navbar a.link { 85 | color: #fff; 86 | } 87 | .button.button-fill { 88 | color: #fff; 89 | background: #3190e8; 90 | border: none; 91 | margin: 0 10px; 92 | } 93 | .list-block { 94 | margin: 0; 95 | font-size: inherit; 96 | } 97 | .login-screen-content .login-screen-title, .login-screen-content .list-block, .login-screen-content .content-block, .login-screen-content .list-block-label{ 98 | max-width: none; 99 | } 100 | } -------------------------------------------------------------------------------- /src/page/password.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | -------------------------------------------------------------------------------- /src/modules/chat/chat.js: -------------------------------------------------------------------------------- 1 | require('./chat.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | service = require('./service'), 5 | template = require('./chat.tpl.html'), 6 | content = require("../utils/content") 7 | 8 | ; 9 | var pack = { 10 | init: function(){ 11 | console.log("chat module init"); 12 | pack.bindEvents(); 13 | pack.getDatas(); 14 | }, 15 | getDatas: function(){ 16 | var that = this; 17 | service.loadChatHistory(function(tl){ 18 | that.renderDatas(tl); 19 | }); 20 | appFunc.removeBadge(content.BADGE_CHAT); 21 | }, 22 | renderDatas: function(tl){ 23 | $$.each(tl,function(index,val){ 24 | //1:文本,2:图片,3:语音 25 | if(val.msg_type==1){ 26 | val.text = val.msg; 27 | }else if(val.msg_type==2){ 28 | val.text = "[图片]"; 29 | }else if(val.msg_type==3){ 30 | val.text = "[语音]"; 31 | } 32 | }); 33 | var renderData = { 34 | chatHistorys: tl 35 | }; 36 | var output = appFunc.renderTpl(template, renderData); 37 | $$('#chatView').find('.chat-list').html(output); 38 | 39 | appFunc.lazyImg(); 40 | }, 41 | 42 | chatListClick:function(){ 43 | console.log("hello click 11"); 44 | hiApp.modal({ 45 | verticalButtons: true, 46 | buttons: [ 47 | { 48 | text: '置顶聊天', 49 | onClick: function() { 50 | hiApp.alert('You clicked first button!') 51 | } 52 | }, 53 | { 54 | text: '删除该聊天', 55 | onClick: function() { 56 | hiApp.alert('You clicked second button!') 57 | } 58 | }, 59 | { 60 | text: '关闭', 61 | bold: true, 62 | close: true 63 | } 64 | ] 65 | }) 66 | }, 67 | 68 | bindEvents: function(){ 69 | var bindings = [{ 70 | element: '#chatView', 71 | selector: '.item-content', 72 | event: 'taphold', 73 | handler: this.chatListClick 74 | },{ 75 | element: '#chatView', 76 | event: 'show', 77 | handler: this.init 78 | }]; 79 | 80 | appFunc.bindEvents(bindings); 81 | } 82 | }; 83 | module.exports = pack; 84 | -------------------------------------------------------------------------------- /src/modules/setting/setting.tpl.html: -------------------------------------------------------------------------------- 1 |
    2 | 58 |
    -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HiApp 4 | 5 | A hybrid app made with Framework7.With PhoneGap you can easily convert it to native iOS app. 6 | 7 | 8 | BelinChung 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/modules/setting/setting.less: -------------------------------------------------------------------------------- 1 | @import "../../style/less/mixins"; 2 | 3 | .setting-page{ 4 | margin: 0 5px 15px; 5 | 6 | .spring { 7 | background: url("../../style/img/sprite@2x.png") no-repeat; 8 | background-size: 200%; 9 | } 10 | 11 | >ul { 12 | background-color: transparent; 13 | 14 | .item-link { 15 | &:active { 16 | .item-content { 17 | transition-duration: 0ms; 18 | background-color: #e9e9e9 !important; 19 | } 20 | } 21 | } 22 | .item-content { 23 | margin: 0; 24 | margin-top: 10px; 25 | background: #ffffff; 26 | box-shadow: 0 2px 2px rgba(0, 0, 0, .05); 27 | padding: 0; 28 | padding-left: 10px; 29 | border: 1px solid #EBE9E9; 30 | .item-title { 31 | font-size: 14px; 32 | } 33 | .item-inner { 34 | border: 0; 35 | &:after{ 36 | background-color: transparent; 37 | } 38 | } 39 | } 40 | 41 | .item-media { 42 | width: 30px; 43 | height: 30px; 44 | color: #ffffff; 45 | font-size: 28px; 46 | text-align: center; 47 | padding: 0; 48 | } 49 | 50 | .update { 51 | background-color: #fca405; 52 | background-position: 0 -30px; 53 | } 54 | 55 | .language { 56 | background-color: #9b59b6; 57 | 58 | > i { 59 | font-size: 24px; 60 | position: absolute; 61 | top: 7px; 62 | left: 14px; 63 | } 64 | } 65 | 66 | .password { 67 | background-color: #9b59b6; 68 | 69 | >i{ 70 | font-size: 20px; 71 | position: absolute; 72 | top: 8px; 73 | left: 15px; 74 | } 75 | } 76 | 77 | .feedback { 78 | background-color: #38b57f; 79 | background-position: 0 0; 80 | } 81 | 82 | .about { 83 | background-color: #5999f3; 84 | background-position: -30px 0; 85 | } 86 | 87 | .user-info { 88 | padding: 10px 10px 10px 0 !important; 89 | position: relative; 90 | 91 | .avatar, .avatar > img { 92 | width: 55px; 93 | height: 55px; 94 | } 95 | 96 | .user-detail { 97 | position: absolute; 98 | margin-left: 70px; 99 | line-height: 26px; 100 | 101 | .name { 102 | font-size: 14px; 103 | } 104 | 105 | .point { 106 | font-size: 13px; 107 | color: #818080; 108 | } 109 | } 110 | } 111 | } 112 | .logout-button { 113 | margin-top: 15px; 114 | } 115 | } -------------------------------------------------------------------------------- /src/modules/info/info.less: -------------------------------------------------------------------------------- 1 | .page[data-page="info"] { 2 | .comments-content { 3 | background: #f7f7f7; 4 | border: 1px solid #EBE9E9; 5 | color: #6d6d72; 6 | margin: 10px; 7 | 8 | .comment-title { 9 | height: 30px; 10 | background-color: #ffffff; 11 | line-height: 30px; 12 | font-size: 11px; 13 | padding-left: 10px; 14 | border-bottom: 1px solid #EBE9E9; 15 | position: relative; 16 | 17 | .tip { 18 | position: absolute; 19 | width: 0; 20 | height: 0; 21 | top: 13px; 22 | left: 48px; 23 | border: 9px solid rgba(255, 255, 255, 0); 24 | border-bottom: 9px solid #f7f7f7; 25 | } 26 | } 27 | 28 | .comments-list { 29 | padding: 0 5px; 30 | margin: 0; 31 | 32 | .none-comment { 33 | text-align: center; 34 | margin-top: 10px; 35 | color: #DBDBDB; 36 | 37 | > i { 38 | display: block; 39 | font-size: 75px; 40 | margin-left: -15px; 41 | 42 | } 43 | } 44 | 45 | .loading { 46 | text-align: center; 47 | padding: 20px 0; 48 | } 49 | 50 | > li { 51 | overflow: hidden; 52 | padding: 10px 0; 53 | border-bottom: 1px solid #EBE9E9; 54 | position: relative; 55 | 56 | &:active{ 57 | transition-duration: 0ms; 58 | background-color: #e9e9e9 !important; 59 | } 60 | } 61 | 62 | .avatar{ 63 | float: left; 64 | height: 35px; 65 | width: 35px; 66 | border-radius: 3px; 67 | 68 | > img{ 69 | height: 35px; 70 | width: 35px; 71 | border-radius: 3px; 72 | } 73 | } 74 | 75 | .comment-detail { 76 | 77 | .name { 78 | font-size: 12px; 79 | margin-top: -2px; 80 | } 81 | .time { 82 | margin-top: 5px; 83 | } 84 | } 85 | 86 | .reply { 87 | width: 18px; 88 | height: 12px; 89 | border: 1px solid #A3A0A0; 90 | line-height: 13px; 91 | text-align: center; 92 | font-size: 20px; 93 | color: #A3A0A0; 94 | border-radius: 3px; 95 | position: absolute; 96 | top: 8px; 97 | right: 2px; 98 | } 99 | } 100 | } 101 | 102 | .card-content-inner{ 103 | >.title{ 104 | font-weight: bold; 105 | font-size: 16px; 106 | text-align: center; 107 | color: #393939; 108 | } 109 | >.content{ 110 | text-indent: 2em; 111 | } 112 | } 113 | } -------------------------------------------------------------------------------- /src/api/refresh_timeline.json: -------------------------------------------------------------------------------- 1 | { 2 | "err_code": 0, 3 | "err_msg": "success", 4 | "data": [ 5 | { 6 | "id" : "42", 7 | "add_username" : "Bob Brown", 8 | "content" : "Behind every successful man there's a lot u unsuccessful years. http://goo.gl/", 9 | "imgs" : "[\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\",\"http://pic.sc.chinaz.com/files/pic/pic9/201508/apic14052.jpg\"]", 10 | "cool_num" : "", 11 | "comment_num" : "", 12 | "filename" : "http://lorempixel.com/68/68/people/1/", 13 | "create_time" : "1404709434" 14 | }, 15 | 16 | { 17 | "id" : "43", 18 | "add_username" : "Bob Brown", 19 | "content" : "Hello Eventy! Behind every successful man there's a lot u unsuccessful years. http://goo.gl/", 20 | "imgs" : "[\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\"]", 21 | "cool_num" : "", 22 | "comment_num" : "", 23 | "filename" : "http://lorempixel.com/68/68/people/1/", 24 | "create_time" : "1404709434" 25 | }, 26 | 27 | { 28 | "id" : "44", 29 | "add_username" : "Jean Brown", 30 | "content" : "I think success has no rules, but you can learn a lot from failure.", 31 | "imgs" : "[\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\",\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\",\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\"]", 32 | "cool_num" : "", 33 | "comment_num" : "", 34 | "filename" : "http://lorempixel.com/68/68/people/7/", 35 | "create_time" : "1404708544" 36 | }, 37 | { 38 | "id" : "45", 39 | "add_username" : "Colin L. Powell", 40 | "content" : "There are no secrets to success. It is the result of preparation, hard work, and learning from failure. www.youtube.com", 41 | "imgs" : "[\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\",\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\",\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\",\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\"]", 42 | "cool_num" : "", 43 | "comment_num" : "", 44 | "filename" : "http://lorempixel.com/68/68/people/3/", 45 | "create_time" : "1404708455" 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /src/modules/input/contacts_checkbox.tpl.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/modules/tweet/tweet.js: -------------------------------------------------------------------------------- 1 | require('./tweet.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | commentModule = require('../comment/comment'), 5 | homeModule = require('../home/home'), 6 | template = require('./tweet.tpl.html'); 7 | 8 | var id; 9 | 10 | var tweetModule = { 11 | init: function(query){ 12 | id = query.id; 13 | appFunc.hideToolbar(); 14 | 15 | this.bindEvents(); 16 | 17 | // render tweet card 18 | this.getTweet(); 19 | 20 | // init comment module 21 | commentModule.init({id:id,type:2}); 22 | 23 | }, 24 | getTweet: function(){ 25 | 26 | var item = { 27 | "id" : "22", 28 | "add_username" : "Bob Brown", 29 | "content" : "价值性

    小说的价值本质是以时间为序列、以某一人物或几个人物为主线的,非常详细地、全面地反映社会生活中各种角色的价值关系(政治关系、经济关系和文化关系)的产生、发展与消亡过程。非常细致地、综合地展示各种价值关系的相互作用。

    容量性

    与其他文学样式相比,小说的容量较大,它可以细致地展现人物性格和人物命运,可以表现错综复杂的矛盾冲突,同时还可以描述人物所处的社会生活环境。小说的优势是可以提供整体的、广阔的社会生活。

    情节性

    小说主要是通过故事情节来展现人物性格、表现中心的。故事来源于生活,但它通过整理、提炼和安排,就比现实生活中发生的真实实例更加集中,更加完整,更具有代表性。

    环境性

    小说的环境描写和人物的塑造与中心思想有极其重要的关系。在环境描写中,社会环境是重点,它揭示了种种复杂的社会关系,如人物的身份、地位、成长的历史背景等等。自然环境包括人物活动的地点、时间、季节、气候以及景物等等。自然环境描写对表达人物的心情、渲染环境气氛都有不少的作用。

    发展性

    小说是随着时代的发展而发展的:魏晋南北朝,文人的笔记小说,是中国古代小说的雏形;唐代传奇的出现,尤其是三大爱情传奇,标志着古典小说的正式形成;宋元两代,随着商品经济和市井文化的发展,出现了话本小说,为小说的成熟奠定了坚实的基础;明清小说是中国古代小说发展的高峰,至今在古典小说领域内,没有可超越者,四大名著皆发于此。

    纯粹性

    纯文学中的小说体裁讲究纯粹性。“谎言去尽之谓纯。”(出自墨人钢《就是》创刊题词)便是所谓的“纯”。也就是说,小说在构思及写作的过程中能去尽政治谎言、道德谎言、商业谎言、维护阶级权贵谎言、愚民谎言等谎言,使呈现出来的小说成品具备纯粹的艺术性。小说的纯粹性是阅读者最重要的审美期待之一。随着时代的发展,不光是小说,整个文学的纯粹性逾来逾成为整个世界对文学审美的一个重要核心。

    ", 30 | "imgs" : "[\"http://pic14.nipic.com/20110427/2944718_000916112196_2.jpg\",\"http://pic.sc.chinaz.com/files/pic/pic9/201508/apic14052.jpg\"]", 31 | "cool_num" : "", 32 | "comment_num" : "", 33 | "filename" : "http://lorempixel.com/68/68/people/1/", 34 | "create_time" : "1404709434" 35 | }; 36 | 37 | var output = appFunc.renderTpl(template, item); 38 | 39 | $$('#itemContent').html(output); 40 | $$('#comment-cool').attr("data-id",22);//点击赞 41 | }, 42 | bindEvents: function(){ 43 | var bindings = [{ 44 | element: '#commentContent', 45 | selector: '.comment-item', 46 | event: 'click', 47 | handler: commentModule.createActionSheet 48 | },{ 49 | element: '#homeView .item-comment-btn', 50 | event: 'click', 51 | handler: homeModule.commentItem 52 | },{ 53 | element: '.comment-title .cool', 54 | event: 'click', 55 | handler: homeModule.coolItem //点赞 56 | }]; 57 | 58 | appFunc.bindEvents(bindings); 59 | } 60 | }; 61 | 62 | module.exports = tweetModule; -------------------------------------------------------------------------------- /src/modules/input/input.tpl.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/api/contacts.json: -------------------------------------------------------------------------------- 1 | { 2 | "err_code": 0, 3 | "err_msg": "success", 4 | "data": [ 5 | {"uid":1,"username":"张三","filename":"http://lorempixel.com/68/68/people/1/","spell":"☆"}, 6 | {"uid":2,"username":"张四","filename":"http://lorempixel.com/68/68/people/2/","spell":"☆"}, 7 | {"uid":3,"username":"张五","filename":"http://lorempixel.com/68/68/people/3/","spell":"☆"}, 8 | {"uid":4,"username":"张六","filename":"http://lorempixel.com/68/68/people/4/","spell":"☆"}, 9 | {"uid":5,"username":"张七","filename":"http://lorempixel.com/68/68/people/5/","spell":"☆"}, 10 | {"uid":6,"username":"张俆","filename":"http://lorempixel.com/68/68/people/6/","spell":"☆"}, 11 | {"uid":7,"username":"张九","filename":"http://lorempixel.com/68/68/people/7/","spell":"☆"}, 12 | {"uid":8,"username":"张十","filename":"http://lorempixel.com/68/68/people/8/","spell":"☆"}, 13 | {"uid":9,"username":"Alex Clack","filename":"http://lorempixel.com/68/68/people/8/","spell":"A"}, 14 | {"uid":10,"username":"Alex Black","filename":"http://lorempixel.com/68/68/people/5/","spell":"A"}, 15 | {"uid":11,"username":"Alex Proti","filename":"http://lorempixel.com/68/68/people/3/","spell":"A"}, 16 | {"uid":12,"username":"Andrew Smith","filename":"http://lorempixel.com/68/68/people/5/","spell":"A"}, 17 | {"uid":13,"username":"Ann Ryder","filename":"http://lorempixel.com/68/68/people/5/","spell":"A"}, 18 | {"uid":14,"username":"Daniel Ricci","filename":"http://lorempixel.com/68/68/people/5/","spell":"D"}, 19 | {"uid":15,"username":"Ivan Ivanov","filename":"http://lorempixel.com/68/68/people/3/","spell":"I"}, 20 | {"uid":16,"username":"Ivan Black","filename":"http://lorempixel.com/68/68/people/6/","spell":"I"}, 21 | {"uid":17,"username":"Kate Lebedeva","filename":"http://lorempixel.com/68/68/people/3/","spell":"K"}, 22 | {"uid":18,"username":"Kate Shy","filename":"http://lorempixel.com/68/68/people/6/","spell":"K"}, 23 | {"uid":19,"username":"Michael Fold","filename":"http://lorempixel.com/68/68/people/6/","spell":"M"}, 24 | {"uid":20,"username":"Michael Black","filename":"http://lorempixel.com/68/68/people/3/","spell":"M"}, 25 | {"uid":21,"username":"Nadya Black","filename":"http://lorempixel.com/68/68/people/3/","spell":"N"}, 26 | {"uid":22,"username":"Nadya Price","filename":"http://lorempixel.com/68/68/people/8/","spell":"N"}, 27 | {"uid":23,"username":"Nadya Oleg","filename":"http://lorempixel.com/68/68/people/3/","spell":"N"}, 28 | {"uid":24,"username":"Oleg Black","filename":"http://lorempixel.com/68/68/people/3/","spell":"O"}, 29 | {"uid":25,"username":"Oleg Price","filename":"http://lorempixel.com/68/68/people/6/","spell":"O"}, 30 | {"uid":26,"username":"Oleg Oleg","filename":"http://lorempixel.com/68/68/people/3/","spell":"O"}, 31 | {"uid":27,"username":"Svetlana Kot","avatar":"http://lorempixel.com/68/68/people/10/","spell":"S"} 32 | 33 | 34 | ] 35 | } -------------------------------------------------------------------------------- /src/modules/contacts_detail/detail.tpl.html: -------------------------------------------------------------------------------- 1 |
    2 | 62 | 63 | {{t i18n="userinfo.send_info"}} 64 |
    -------------------------------------------------------------------------------- /src/modules/contacts/contacts.js: -------------------------------------------------------------------------------- 1 | require('./contacts.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | service = require('./service'), 5 | template = require('./contacts.tpl.html'), 6 | store = require("../utils/localStore"), 7 | content = require("../utils/content"), 8 | cache = require('memory-cache') 9 | ; 10 | var _cache_contacts = 'cache_loadContacts'; 11 | var contacts = { 12 | init: function(){ 13 | contacts.bindEvents(); 14 | console.log("init"); 15 | }, 16 | loadContacts: function(){ 17 | console.log("loadContacts"); 18 | hiApp.showIndicator(); 19 | if(contacts.beforeLoadContacts()) { 20 | hiApp.searchbar('#contactView .searchbar',{ 21 | searchList: '.contacts-list', 22 | searchIn: '.item-title' 23 | }); 24 | 25 | service.loadContacts({ $not: { id: store.getStorageIntVal("uid")}},function(res){ 26 | if(res.status){ 27 | var _spell = ''; 28 | var _datas = res.msg; 29 | $$.each(_datas,function(index,val){ 30 | var _val_spell = val.spell; 31 | if(_spell != _val_spell){ 32 | _spell = _val_spell; 33 | }else{ 34 | val.spell=''; 35 | } 36 | }); 37 | var renderData = { 38 | contacts: _datas 39 | }; 40 | var output = appFunc.renderTpl(template, renderData); 41 | $$('#contactView .contacts-list ul').html(output); 42 | 43 | cache.put(_cache_contacts, 'disappear',300000 );//缓存5分钟 300000 44 | }else{ 45 | hiApp.hiAlert(res.msg); 46 | } 47 | }); 48 | 49 | } 50 | appFunc.lazyImg(); 51 | hiApp.hideIndicator(); 52 | appFunc.removeBadge(content.BADGE_MEMBER); 53 | }, 54 | beforeLoadContacts: function(){ 55 | if($$('#contactView .contacts-list .list-group .contact-item').length > 0&&cache.get(_cache_contacts)) { 56 | return false; 57 | }else { 58 | return true; 59 | } 60 | }, 61 | 62 | addMemberToGroup:function(){ 63 | console.log("addMemberToGroup"); 64 | contactF7View.router.loadPage('page/contacts_group.html?group_id=0'); 65 | hiApp.closeModal() 66 | }, 67 | bindEvents: function(){ 68 | var bindings = [{ 69 | element: '#contactView', 70 | event: 'show', 71 | handler: contacts.loadContacts 72 | },{ 73 | element: ".contact-group-add", 74 | event: 'click', 75 | handler: this.addMemberToGroup 76 | }]; 77 | 78 | appFunc.bindEvents(bindings); 79 | } 80 | }; 81 | 82 | module.exports = contacts; 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | HiApp 2 | ===== 3 | 此项目想在(HiApp)[https://github.com/BelinChung/HiApp]基础上实现实现聊天功能,感谢HiApp 4 | 5 | 后端通过(netty-socket)[https://github.com/mrniko/netty-socketio]搭建 6 | 7 | ## 界面 8 | ![](https://github.com/hubs/hiapp/blob/master/res/register.png) 9 | ![](https://github.com/hubs/hiapp/blob/master/res/login.png) 10 | ![](https://github.com/hubs/hiapp/blob/master/res/info.png) 11 | ![](https://github.com/hubs/hiapp/blob/master/res/info-content.png) 12 | ![](https://github.com/hubs/hiapp/blob/master/res/chat.png) 13 | ![](https://github.com/hubs/hiapp/blob/master/res/comment.png) 14 | ![](https://github.com/hubs/hiapp/blob/master/res/peoples.png) 15 | ![](https://github.com/hubs/hiapp/blob/master/res/people-content.png) 16 | ![](https://github.com/hubs/hiapp/blob/master/res/setting.png) 17 | ![](https://github.com/hubs/hiapp/blob/master/res/talk.png) 18 | ##Requirements 19 | 20 | * cordova `^5.0.0` 21 | * framework7 `^1.4.0` 22 | 23 | ## Dependencies 24 | 25 | HiApp use `npm` to manage third-party packages now. 26 | 27 | Then install all dependencies, in repo's root: 28 | 29 | ``` 30 | $ npm install 31 | ``` 32 | 33 | ## PhoneGap App Guides 34 | 35 | Install the cordova module using npm utility of Node.js. 36 | 37 | ``` 38 | $ npm install -g cordova 39 | ``` 40 | 41 | ### Create App 42 | 43 | Go to the directory where you maintain your source code, and run a command such as the following: 44 | 45 | ``` 46 | $ cordova create hiapp com.hiapp.hiapp HiApp 47 | ``` 48 | 49 | 50 | ### Add Platforms 51 | 52 | Before you can build the project, you need to specify a set of target platforms. 53 | 54 | ``` 55 | $ cordova platform add ios 56 | ``` 57 | 58 | ### Add Plugins 59 | 60 | You need to add plugins that provide access to core Cordova APIs. 61 | 62 | ``` 63 | $ cordova plugin add cordova-plugin-whitelist cordova-plugin-camera cordova-plugin-geolocation cordova-plugin-file-transfer cordova-plugin-inappbrowser cordova-plugin-network-information 64 | ``` 65 | 66 | ### Build the App 67 | 68 | Run the following command to iteratively build the project: 69 | 70 | ``` 71 | $ cordova build ios 72 | ``` 73 | 74 | ### Test the App on an iOS Device with Xcode 75 | 76 | Double-click to open the `platforms/ios/HiApp.xcodeproj` file 77 | 78 | Press the `Run` button to deploy the application in the emulator 79 | 80 | ## Web App Preview 81 | 82 | HiApp use webpack browser sync server to develop, Just run it in repo's root: 83 | 84 | ``` 85 | $ npm run dev 86 | ``` 87 | 88 | WebApp will be available on `http://localhost:3000/` 89 | 90 | ## Web App Release / PhoneGap App Release 91 | 92 | ``` 93 | $ npm run build 94 | ``` 95 | 96 | The result is available in `www/` folder. 97 | 98 | ## Demo 99 | 100 | [http://hi.dearb.me/] 101 | 102 | [![App Store](http://dearb.u.qiniudn.com/appstore-button.png)](https://itunes.apple.com/us/app/hi-liao-gao-xiao-shu-dong/id917320045?mt=8) 103 | 104 | ## License 105 | 106 | Copyright (c) 2014-2016 Belin Chung. MIT Licensed, see [LICENSE] for details. 107 | 108 | [http://hi.dearb.me/]: http://hi.dearb.me/ 109 | [LICENSE]:https://github.com/BelinChung/HiApp/blob/master/LICENSE.md -------------------------------------------------------------------------------- /src/modules/lang/en-us.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | app: { 3 | name: 'HiApp' 4 | }, 5 | global: { 6 | cancel: 'Cancel', 7 | send: 'Send', 8 | back:'Back', 9 | done:'Done', 10 | search:'Search', 11 | modal_title: 'System', 12 | modal_button_ok: 'OK', 13 | minute_ago:' mins ago', 14 | hour_ago:' hours ago', 15 | day_ago:' days ago', 16 | just_now:'Just now', 17 | language:'Language', 18 | switch_language:'Switching languages' 19 | }, 20 | index: { 21 | nothing_found: 'No matching results', 22 | nothing_loaded:'Nothing loaded', 23 | tweet: 'Tweet', 24 | contacts: 'Contacts', 25 | setting: 'Setting', 26 | sen_tweet: 'New Tweet', 27 | send_placeholder: 'What is new with you.', 28 | sending:'Submitting...', 29 | err_text_too_short:'Ah,Content is too short', 30 | infos:'information' 31 | }, 32 | setting: { 33 | feed_back: 'Feedback', 34 | feed_back_placeholder:'Hi,Any suggestions to tell us?', 35 | feed_back_result:'Thank you for your feedback', 36 | check_update: 'Update', 37 | about: 'About', 38 | login_out: 'Log out', 39 | nickname: 'Name', 40 | points: 'Points', 41 | confirm_logout:'Are you sure to log out?', 42 | current_version:'The current version is ' 43 | }, 44 | login: { 45 | loginname_placeholder: 'Email/Username', 46 | password_placeholder: 'Password', 47 | login_btn: 'Sign In', 48 | sign_up: 'Sign Up', 49 | forgot_pwd: 'Forgot password', 50 | err_empty_input: 'Please enter login name and password', 51 | err_illegal_email: 'Username must be Email', 52 | login: 'Loading, please wait...' 53 | }, 54 | timeline:{ 55 | forward:'Forward', 56 | comment:'Comment', 57 | like:'Like' 58 | }, 59 | item:{ 60 | title:'Tweet' 61 | }, 62 | comment:{ 63 | reply:'Reply', 64 | reply_comment:'Reply', 65 | copy_comment:'Copy', 66 | placeholder:'Write a comment ...', 67 | empty_comment:'No one comments', 68 | commenting:'Submitting...' 69 | }, 70 | chat:{ 71 | title:'Message', 72 | chatPlaceholder:'Message' 73 | }, 74 | geo:{ 75 | loading_geo:'Getting your geo info...', 76 | permission_denied:'Permission denied', 77 | position_unavailable:'Position unavailable', 78 | timeout:'Getting timeout', 79 | confirm_clean_geo:'You will clear geo info' 80 | }, 81 | camera:{ 82 | image_uploading: 'Uploading pictures', 83 | confirm_clear_image: 'Are you sure clear the selected pictures?', 84 | file_not_found_err: 'Upload file not found', 85 | invalid_url_err: 'Invalid url', 86 | connection_err: 'Connection error', 87 | abort_err: 'Abort upload', 88 | not_modified_err: 'Not modified' 89 | }, 90 | error:{ 91 | unknown_error:'Unknown error', 92 | no_network:'No network connection', 93 | phonegap_only:'PhoneGap Only' 94 | } 95 | }; -------------------------------------------------------------------------------- /src/modules/contacts_group/contacts_group.js: -------------------------------------------------------------------------------- 1 | require('../contacts/contacts.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | service = require('../contacts/service'), 5 | template = require('./contacts_checkbox.tpl.html'); 6 | 7 | var _group_id = 0; 8 | module.exports = { 9 | init: function(query){ 10 | console.log("contacts_group init"); 11 | _group_id = query.group_id; 12 | this.bindEvents(); 13 | this.loadContacts(); 14 | 15 | }, 16 | loadContacts: function(){ 17 | console.log("contacts_group loadContacts"); 18 | if(this.beforeLoadContacts()) { 19 | hiApp.searchbar('.contacts-group-cls .searchbar',{ 20 | searchList: '.contacts-list', 21 | searchIn: '.item-title' 22 | }); 23 | 24 | service.loadContacts(function(c){ 25 | setTimeout(function(){ 26 | var _spell = ''; 27 | $$.each(c,function(index,val){ 28 | var _val_spell = val.spell; 29 | if(_spell!=_val_spell){ 30 | _spell = _val_spell; 31 | }else{ 32 | val.spell=''; 33 | } 34 | }); 35 | var renderData = { 36 | contacts: c 37 | }; 38 | 39 | var output = appFunc.renderTpl(template, renderData); 40 | $$('.contacts-group-cls .contacts-list ul').html(output); 41 | hiApp.hideIndicator(); 42 | 43 | appFunc.lazyImg(); 44 | 45 | },500); 46 | }); 47 | } 48 | }, 49 | beforeLoadContacts: function(){ 50 | if($$('.contacts-group-cls .contacts-list .list-group .contact-item').length > 0) { 51 | return false; 52 | }else { 53 | hiApp.showIndicator(); 54 | return true; 55 | } 56 | }, 57 | 58 | checkBoxSelect:function(){ 59 | var _len = $$("input[type=checkbox]:checked").length; 60 | console.log("len = "+_len); 61 | if(_len<1){ 62 | $$(".btn-load-member-to-group").html("确定").attr("disabled","disabled"); 63 | }else{ 64 | $$(".btn-load-member-to-group").removeAttr("disabled").html("确定("+_len+")"); 65 | } 66 | }, 67 | 68 | createGroup:function(){ 69 | console.log("group_id = "+_group_id); 70 | var _len = $$("input[type=checkbox]:checked").length; 71 | if(_len<1){ 72 | hiApp.alert("请选择群员."); 73 | return false; 74 | } 75 | $$("input[type=checkbox]:checked").each(function(index,val){ 76 | var _uid = $$(this).val(); 77 | }); 78 | 79 | 80 | }, 81 | 82 | bindEvents: function(){ 83 | var bindings = [{ 84 | element: '#contactView', 85 | event: 'show', 86 | handler: this.loadContacts 87 | },{ 88 | element: '.list-group', 89 | selector: 'li.contact-item', 90 | event:'change', 91 | handler:this.checkBoxSelect 92 | },{ 93 | element: '.btn-load-member-to-group', 94 | event:'click', 95 | handler:this.createGroup 96 | }]; 97 | 98 | appFunc.bindEvents(bindings); 99 | } 100 | }; 101 | -------------------------------------------------------------------------------- /src/modules/infos/infos.js: -------------------------------------------------------------------------------- 1 | var service = require('./service'), 2 | appFunc = require('../utils/appFunc'), 3 | template = require('./infos.tpl.html'), 4 | content = require("../utils/content"), 5 | store = require("../utils/localStore") 6 | ; 7 | 8 | var pack = { 9 | init: function(){ 10 | console.log("info init"); 11 | pack.getDatas(); 12 | pack.bindEvent(); 13 | }, 14 | getDatas: function(){ 15 | 16 | console.log("UID="+store.getStorageValue("uid")+" token = "+store.getStorageValue("token")); 17 | console.log("infos get datas"); 18 | var that = this; 19 | hiApp.showIndicator(); 20 | service.getDatas({},function(tl){ 21 | if(tl.status){ 22 | that.renderDatas(tl.msg); 23 | }else{ 24 | appFunc.hiAlert(tl.msg); 25 | } 26 | hiApp.hideIndicator(); 27 | }); 28 | appFunc.removeBadge(content.BADGE_INFO); 29 | }, 30 | 31 | renderDatas: function(tl, type){ 32 | var renderData = { 33 | datas: tl 34 | }; 35 | var output = appFunc.renderTpl(template, renderData); 36 | //下面是下拉刷新之类的(没用到) 37 | if(type === 'prepend'){ 38 | $$('#infosView').find('.home-infos').prepend(output); 39 | }else if(type === 'append') { 40 | $$('#infosView').find('.home-infos').append(output); 41 | }else { 42 | $$('#infosView').find('.home-infos').html(output); 43 | } 44 | appFunc.lazyImg(); 45 | }, 46 | //查看详情 47 | openItemPage: function(e){ 48 | if(e.target.nodeName === 'A' || e.target.nodeName === 'IMG'){ 49 | return false; 50 | } 51 | var itemId = $$(this).data('id'); 52 | infoF7View.router.loadPage('page/info.html?id=' + itemId); 53 | }, 54 | 55 | //上拉刷新 56 | infiniteTimeline: function(){ 57 | var $this = $$(this); 58 | //显示加载条 59 | hiApp.showIndicator(); 60 | 61 | //获取最后一条数据的ID 62 | var items = $this.find('.home-infos .card'); 63 | var length = items.length; 64 | var _last_id = appFunc.parseInt(items.eq(length - 1).data('id')); 65 | 66 | service.getDatas({id:{$lt:_last_id}},function(res){ 67 | //如果是正在滚动,则直接返回 68 | var status = $this.data('scrollLoading'); 69 | if (status === 'loading') return; 70 | 71 | //更新状态 72 | $this.data('scrollLoading','loading'); 73 | 74 | if(res.status){ 75 | $this.data('scrollLoading','unloading'); 76 | pack.renderDatas(res.msg, 'append'); 77 | }else{ 78 | hiApp.detachInfiniteScroll($this);// 从指定的HTML元素容器删除无限滚动事件监听器 79 | } 80 | hiApp.hideIndicator(); 81 | appFunc.lazyImg(); 82 | }); 83 | }, 84 | bindEvent: function(){ 85 | var bindings = [{ 86 | element: '#infosView', 87 | selector: '.home-infos .card-header-pic', 88 | event: 'click', 89 | handler: this.openItemPage 90 | },{//下拉刷新 91 | element: '#infosView', 92 | selector: '.infinite-scroll', 93 | event: 'infinite',//下拉 94 | handler: this.infiniteTimeline 95 | },{ 96 | element: '#infosView', 97 | event: 'show', 98 | handler: this.init 99 | }]; 100 | appFunc.bindEvents(bindings); 101 | } 102 | }; 103 | 104 | module.exports = pack; -------------------------------------------------------------------------------- /src/page/message.html: -------------------------------------------------------------------------------- 1 | 22 | -------------------------------------------------------------------------------- /src/modules/message/message.less: -------------------------------------------------------------------------------- 1 | .page[data-page="message"]{ 2 | .page-content { 3 | padding-bottom: 44px; 4 | } 5 | 6 | .message{ 7 | margin-top: 5px; 8 | } 9 | 10 | .toolbar { 11 | -webkit-transform: none; 12 | -moz-transform: none; 13 | -ms-transform: none; 14 | -o-transform: none; 15 | transform: none; 16 | } 17 | 18 | .ks-messages-input { 19 | -webkit-appearance: none; 20 | -moz-appearance: none; 21 | -ms-appearance: none; 22 | appearance: none; 23 | -webkit-box-sizing: border-box; 24 | -moz-box-sizing: border-box; 25 | box-sizing: border-box; 26 | border: 1px solid #c8c8cd; 27 | background: #fff; 28 | border-radius: 5px; 29 | box-shadow: none; 30 | display: block; 31 | padding: 0px 8px 0px; 32 | margin: 0; 33 | width: 100%; 34 | height: 28px; 35 | color: #000; 36 | font-size: 17px; 37 | margin-right: 8px; 38 | font-family: inherit; 39 | } 40 | 41 | .ks-send-message { 42 | -webkit-flex-shrink: 0; 43 | -moz-flex-shrink: 0; 44 | -ms-flex-shrink: 0; 45 | flex-shrink: 0; 46 | } 47 | 48 | .link-voice,.link-more{ 49 | width: 32px; 50 | padding-right: 8px; 51 | } 52 | .link-smile{ 53 | width: 32px; 54 | padding-right: 15px; 55 | line-height: 22px; 56 | } 57 | .link-keydown{ 58 | width:75%; 59 | } 60 | 61 | 62 | 63 | .bar-actions 64 | { 65 | margin-top: 50px; 66 | margin-left:20px; 67 | } 68 | .bar-action 69 | { 70 | float : left; 71 | width : 50px; 72 | color : #636669; 73 | .action-icon, 74 | .action-text 75 | { 76 | display : block; 77 | } 78 | .action-icon 79 | { 80 | border-radius : 5px; 81 | margin : auto; 82 | width : 48px; 83 | height : 48px; 84 | line-height : 48px; 85 | font-size : 36px; 86 | text-align : center; 87 | } 88 | .action-text 89 | { 90 | padding-top : 5px; 91 | font-size : 12px; 92 | text-align : center; 93 | line-height : 20px; 94 | } 95 | } 96 | 97 | .bar-aface{ 98 | height: 50px; 99 | } 100 | 101 | .toolbar-inner{ 102 | a{ 103 | color:#636669 ; 104 | } 105 | } 106 | .button { 107 | border: 1px solid #636669; 108 | } 109 | 110 | 111 | .swiper-wrapper { 112 | margin-bottom: 20px; 113 | } 114 | 115 | 116 | //iPhone 5 竖屏 117 | @media only screen 118 | and (min-device-width : 320px) 119 | and (max-device-width : 568px) 120 | and (orientation : portrait) { 121 | .bar-action{ 122 | margin-right : 0px; 123 | } 124 | } 125 | //ipone 6 126 | @media only screen 127 | and (min-device-width : 375px) 128 | and (max-device-width : 627px) 129 | and (orientation : portrait) { 130 | .bar-action{ 131 | margin-right : 8px; 132 | } 133 | } 134 | 135 | //iphone 6s 136 | @media only screen 137 | and (min-device-width : 412px) 138 | and (max-device-width : 736px) 139 | and (orientation : portrait) { 140 | .bar-action{ 141 | margin-right : 15px; 142 | } 143 | } 144 | 145 | .message-text{ 146 | padding: 6px 16px 9px; 147 | padding-right: 22px; 148 | font-size: 15px; 149 | img{ 150 | background: url("../../style/img/image-loading.gif") center no-repeat; 151 | } 152 | } 153 | .message-sent{ 154 | .message-text{ 155 | background-color: #00d449; 156 | } 157 | } 158 | 159 | .message-received{ 160 | .message-text{ 161 | background-color: none; 162 | } 163 | } 164 | .messages-auto-layout .message-avatar { 165 | opacity: 1; 166 | } 167 | 168 | } -------------------------------------------------------------------------------- /src/modules/chat_detail/chat_detail_group.tpl.html: -------------------------------------------------------------------------------- 1 |
    2 | 29 |
    30 | 31 |
    32 | 55 |
    56 |
    57 | 81 |
    82 | 97 | 98 | {{t i18n="message.del_and_exit"}} -------------------------------------------------------------------------------- /src/modules/router.js: -------------------------------------------------------------------------------- 1 | var 2 | appFunc = require('./utils/appFunc'), 3 | tweetModule = require('./tweet/tweet'),//动态 4 | feedbackModule = require('./feedback/feedback'),//反馈 5 | aboutModule = require('./about/about'),//关于我们 6 | languageModule = require('./language/language'),//语言选择 7 | messageModule = require('./message/message'),//聊天消息页 8 | userModule = require('./user_info/user_info'),//修改个人信息 9 | passwordModule = require('./password/password'),//密码 10 | contactsDetailModule = require('./contacts_detail/detail'),//点击查看用户详情 11 | chatDetailModule = require("./chat_detail/chat_detail"),//聊天操作界面 12 | infoModule = require('./info/info'), 13 | chatView = require('./chat/chat'), 14 | infoViews = require("./infos/infos"), 15 | contactGroupModule = require('./contacts_group/contacts_group'),//创建群 16 | socket = require("./socket/socket") 17 | ; 18 | 19 | 20 | module.exports = { 21 | init: function() { 22 | var that = this; 23 | $$(document).on('pageBeforeInit', function (e) { 24 | var page = e.detail.page;//获取当前的page 页面 25 | that.pageBeforeInit(page);//开始处理不同的页面 26 | }); 27 | 28 | $$(document).on('pageAfterAnimation', function (e) { 29 | var page = e.detail.page; 30 | that.pageAfterAnimation(page);//处理完的动画 31 | }); 32 | }, 33 | pageAfterAnimation: function(page){ 34 | var name = page.name; 35 | var from = page.from;//当前页面从哪个方向加载进来。如果是新加载的页面,则为"right",如果是返回上一步的页面,则为"left" 36 | console.log("pageAfterAnimation = "+name+" = "+from); 37 | if(name === 'homeView' || name === 'contactView' || name === 'setting' ||name==='infosView'||"chatView"){ 38 | if(from === 'left'){ 39 | if(name==='message') { //chat->message 从message界面返回时,不显示showToolBar 40 | return; 41 | } 42 | if(name==='chatView'){ 43 | chatView.init(); 44 | } 45 | if(name==='infosView'){ 46 | infoViews.init(); 47 | } 48 | appFunc.showToolbar(); 49 | } 50 | } 51 | }, 52 | pageBeforeInit: function(page) { 53 | var name = page.name; //就是 data-page 设定的名称 54 | var query = page.query;//当前页面的get参数,是一个对象。假设你的页面URL是 "about.html?id=10&count=20&color=blue",那么query就是: {id: '10', count: '20', color: 'blue'} 55 | console.log(query); 56 | console.log("name = "+name); 57 | switch (name) { 58 | case 'about'://关于我们 59 | aboutModule.init(); 60 | break; 61 | case 'feedback'://反馈 62 | feedbackModule.init(); 63 | break; 64 | case 'item'://说说详情页面 65 | tweetModule.init(query); 66 | break; 67 | case 'message'://聊天页面 68 | messageModule.init(query); 69 | break; 70 | case 'language'://语文选择页面 71 | languageModule.init(); 72 | break; 73 | case 'info': 74 | infoModule.init(query); 75 | break; 76 | case 'user_info'://修改个人信息 77 | userModule.init(); 78 | break; 79 | case 'password': 80 | passwordModule.init(); 81 | break; 82 | case 'contacts_detail': 83 | contactsDetailModule.init(query); 84 | break; 85 | case 'chat_detail': 86 | chatDetailModule.init(query); 87 | break; 88 | case 'contacts_group': 89 | contactGroupModule.init(query); 90 | break; 91 | } 92 | } 93 | }; -------------------------------------------------------------------------------- /src/style/less/icon.less: -------------------------------------------------------------------------------- 1 | 2 | 3 | @font-face { 4 | font-family: 'iconfont'; 5 | src: 6 | url('@{fontBaseUrl}/iconfont.woff') format('woff'),///* chrome、firefox */ 7 | url('@{fontBaseUrl}/iconfont.ttf') format('truetype'), 8 | url('@{fontBaseUrl}/iconfont.eot'), 9 | url('@{fontBaseUrl}/iconfont.eot') format('embedded-opentype'), 10 | url('@{fontBaseUrl}/iconfont.svg') format('svg') /* iOS 4.1- */ 11 | ;///* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ 12 | } 13 | 14 | 15 | .icon { 16 | font-family:"iconfont" !important; 17 | font-size:16px; 18 | font-style:normal; 19 | -webkit-font-smoothing: antialiased; 20 | -webkit-text-stroke-width: 0.2px; 21 | -moz-osx-font-smoothing: grayscale; 22 | } 23 | 24 | .reloading ,.icon-load-a { 25 | -webkit-animation: spin 1s infinite linear; 26 | -moz-animation: spin 1s infinite linear; 27 | -o-animation: spin 1s infinite linear; 28 | animation: spin 1s infinite linear; 29 | } 30 | 31 | @-moz-keyframes spin { 32 | 0% { 33 | -moz-transform: rotate(0deg); } 34 | 35 | 100% { 36 | -moz-transform: rotate(359deg); } } 37 | 38 | @-webkit-keyframes spin { 39 | 0% { 40 | -webkit-transform: rotate(0deg); } 41 | 42 | 100% { 43 | -webkit-transform: rotate(359deg); } } 44 | 45 | @-o-keyframes spin { 46 | 0% { 47 | -o-transform: rotate(0deg); } 48 | 49 | 100% { 50 | -o-transform: rotate(359deg); } } 51 | 52 | @-ms-keyframes spin { 53 | 0% { 54 | -ms-transform: rotate(0deg); } 55 | 56 | 100% { 57 | -ms-transform: rotate(359deg); } } 58 | 59 | @keyframes spin { 60 | 0% { 61 | transform: rotate(0deg); } 62 | 63 | 100% { 64 | transform: rotate(359deg); } } 65 | 66 | 67 | 68 | 69 | 70 | .icon-nan:before { content: "\e623"; } 71 | .icon-home:before { content: "\e600"; } 72 | .icon-guanbi:before { content: "\e601"; } 73 | .icon-cameras:before { content: "\e602"; } 74 | .icon-yuyin:before { content: "\e620"; } 75 | .icon-filing:before { content: "\e603"; } 76 | .icon-gear:before { content: "\e604"; } 77 | .icon-paper:before { content: "\e605"; } 78 | .icon-icon:before { content: "\e606"; } 79 | .icon-alarm:before { content: "\e607"; } 80 | .icon-heart:before { content: "\e608"; } 81 | .icon-location:before { content: "\e609"; } 82 | .icon-quxiao:before { content: "\e61e"; } 83 | .icon-reload:before { content: "\e60a"; } 84 | .icon-ioschatboxesoutline:before { content: "\e60b"; } 85 | .icon-jia:before { content: "\e625"; } 86 | .icon-at:before { content: "\e60c"; } 87 | .icon-mima:before { content: "\e61b"; } 88 | .icon-nv:before { content: "\e624"; } 89 | .icon-gear1:before { content: "\e60d"; } 90 | .icon-quxiao1:before { content: "\e61f"; } 91 | .icon-redo:before { content: "\e60e"; } 92 | .icon-people:before { content: "\e60f"; } 93 | .icon-arrow:before { content: "\e610"; } 94 | .icon-iconfontdingxiang:before { content: "\e611"; } 95 | .icon-world:before { content: "\e612"; } 96 | .icon-jinyanjinliao206:before { content: "\e626"; } 97 | .icon-news:before { content: "\e613"; } 98 | .icon-save:before { content: "\e61c"; } 99 | .icon-pinglun:before { content: "\e621"; } 100 | .icon-add:before { content: "\e62a"; } 101 | .icon-jianpan:before { content: "\e627"; } 102 | .icon-save1:before { content: "\e61d"; } 103 | .icon-people1:before { content: "\e614"; } 104 | .icon-pinglun1:before { content: "\e622"; } 105 | .icon-emotion:before { content: "\e615"; } 106 | .icon-jianqu:before { content: "\e628"; } 107 | .icon-compose:before { content: "\e616"; } 108 | .icon-person:before { content: "\e617"; } 109 | .icon-ioschatbubbleoutline:before { content: "\e618"; } 110 | .icon-iosarrowthinleft:before { content: "\e61a"; } 111 | .icon-load:before { content: "\e619"; } 112 | .icon-jia1:before { content: "\e629"; } 113 | .icon-zan:before { content: "\e62b"; } 114 | .icon-zanzan-copy-copy:before { content: "\e62c"; } -------------------------------------------------------------------------------- /src/modules/contacts_detail/detail.js: -------------------------------------------------------------------------------- 1 | require('./detail.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | service = require('./service'), 5 | template = require('./detail.tpl.html'), 6 | db = require("../db/db"), 7 | table = require("../db/table"), 8 | Content = require("../utils/content"), 9 | socket = require("../socket/socket"), 10 | dbHelper = require("../utils/dbHelper") 11 | 12 | ; 13 | 14 | var pack = { 15 | init: function(query){ 16 | 17 | appFunc.hideToolbar(); 18 | 19 | var _uid = appFunc.parseInt(query.uid); 20 | console.log("_uid = "+_uid); 21 | db.dbFindOne(table.T_MEMBER,{id:_uid},function(err,doc){ 22 | if(err){ 23 | appFunc.hiAlert(err); 24 | return; 25 | } 26 | if(doc==null){ 27 | return; 28 | } 29 | console.log(doc); 30 | 31 | /** 32 | * member_id : '',//需要查看会员的最新信息 33 | * update_time : '',//本地会员最后更新的时间 34 | * token : '' 35 | * fromUid : '', 36 | */ 37 | socket.chat_get_member({ 38 | member_id : _uid, 39 | update_time : doc.update_time,//每次都获取最新的算了 40 | },function(res){ 41 | res = appFunc.parseJson(res); 42 | socket._pri_update_data(table.T_MEMBER,res); 43 | pack._get_member_info(res); 44 | var output = appFunc.renderTpl(template, {obj:res}); 45 | 46 | if(res.username!=doc.username){ 47 | dbHelper.dbUpdateUsername(res.username,res.id); 48 | } 49 | 50 | if(res.filename!=doc.filename){ 51 | appFunc.setFilenameByUid(res.id,res.filename); 52 | } 53 | 54 | $$('.contact-detail-page').html(output); 55 | }); 56 | 57 | pack._get_member_info(doc); 58 | var output = appFunc.renderTpl(template, {obj:doc}); 59 | $$('.contact-detail-page').html(output); 60 | 61 | console.log("redner end"); 62 | }); 63 | this.bindEvents(); 64 | }, 65 | 66 | _get_member_info:function(doc){ 67 | doc.filename = Content.IMAGE_URL+doc.filename; 68 | doc.sex = doc.sex=='1'?'icon-nan':'icon-nv'; 69 | doc.lastTalk = db.dbFindOne(table.T_TALK,{add_uid:doc.id},function(err,res){ 70 | console.log("talk = "); 71 | console.log(res); 72 | if(res!=null) { 73 | return $$(".lastTalk").html(res.content); 74 | } 75 | }); 76 | }, 77 | 78 | beforeLoadContacts: function(){ 79 | if($$('#contactView .contacts-list .list-group .contact-item').length > 0) { 80 | return false; 81 | }else { 82 | hiApp.showIndicator(); 83 | return true; 84 | } 85 | }, 86 | showTelAction:function(){ 87 | var buttons1 = [ 88 | { 89 | text: '操作', 90 | label: true 91 | }, 92 | { 93 | text: '拨打电话', 94 | bold: true 95 | }, 96 | { 97 | text: '发送信息', 98 | } 99 | ]; 100 | var buttons2 = [ 101 | { 102 | text: '取消', 103 | color: 'red' 104 | } 105 | ]; 106 | var groups = [buttons1, buttons2]; 107 | hiApp.actions(groups); 108 | console.log("call tel"); 109 | }, 110 | bindEvents: function(){ 111 | var bindings = [{ 112 | element: '.contact-detail-page', 113 | selector: '.detail-tel', 114 | event: 'click', 115 | handler: this.showTelAction 116 | 117 | }]; 118 | 119 | appFunc.bindEvents(bindings); 120 | } 121 | }; 122 | 123 | module.exports = pack; 124 | -------------------------------------------------------------------------------- /src/modules/user_info/user_info.js: -------------------------------------------------------------------------------- 1 | require('./user_info.less'); 2 | var appFunc = require('../utils/appFunc'), 3 | template = require('./user_info.tpl.html'), 4 | socket = require('../socket/socket'), 5 | db = require("../db/db"), 6 | table = require("../db/table"), 7 | store = require("../utils/localStore"), 8 | Content = require("../utils/content"), 9 | dbHelper = require("../utils/dbHelper") 10 | ; 11 | 12 | var pack = { 13 | init: function(){ 14 | appFunc.hideToolbar(); 15 | 16 | db.dbFindOne(table.T_MEMBER,{id:store.getStorageIntVal("uid")},function(err,doc){ 17 |  if(err){ 18 | appFunc.hiAlert(err); 19 | return; 20 |  } 21 | console.log(doc); 22 | doc.filename = Content.IMAGE_URL+doc.filename; 23 | var output = appFunc.renderTpl(template, {obj:doc}); 24 | if(appFunc.isUndefined(store.getStorageValue("tel"))){ 25 | store.setSyncStorageValue("tel",doc.tel); 26 | } 27 | $$('#user-info-content').html(output); 28 | pack.bindEvents(); 29 | }); 30 | 31 | }, 32 | //更新 33 | updateUser: function(){ 34 | hiApp.showPreloader(i18n.index.sending); 35 | var _username = $$("#input_username").val(); 36 | socket.sys_edit_member({ 37 | username : _username, 38 | email : $$("#email").val(), 39 | hobby : $$("#hobby").val(), 40 | duties : $$("#duties").val(), 41 | company : $$("#company").val(), 42 | sex : $$("#sex").val(), 43 | remark : $$("#remark").val() 44 | },function(info){ 45 | hiApp.hidePreloader(); 46 | appFunc.hiAlert(info); 47 | store.setSyncStorageValue("update_time",appFunc.now_time()); 48 | if(_username!=store.getStorageValue("username")){ 49 | dbHelper.dbUpdateUsername(_username); 50 | } 51 | 52 | }); 53 | }, 54 | 55 | //默认选中 56 | selectText: function(){ 57 | $$(this).focus().val($$(this).val());//将光标移到文字后面 58 | }, 59 | updateImg:function(event){ 60 | var files = event.target.files; 61 | $$.each(files, function(i, file) { 62 | console.log(file); 63 | if(!/image.*/.test(file.type)){ 64 | appFunc.hiAlert("只支持图片上传."); 65 | return true; 66 | } 67 | var reader = new FileReader(); 68 | reader.onload = function(e) { 69 | socket.sys_edit_img({ 70 | msg : e.target.result, 71 | type : 1, //1:头像,2:背影 72 | msg_ext : appFunc.fileExt(file.name) //后辍名 73 | },function(url){ 74 | $$(".user_filename").attr("src",Content.IMAGE_URL+url); 75 | dbHelper.dbUpdateFilename(url); 76 | }); 77 | }; 78 | reader.readAsArrayBuffer(file); 79 | }); 80 | }, 81 | /** 82 | * fix Uncaught InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string. 83 | * http://stackoverflow.com/questions/29720794/jquery-select-input-file-and-also-set-it-to-another-input 84 | */ 85 | updateImgBlur:function(){ 86 | $$('#file-field').val(''); // won't work 87 | }, 88 | bindEvents: function(){ 89 | var bindings = [{ 90 | element: '.update-user', 91 | event: 'click', 92 | handler: this.updateUser 93 | },{ 94 | element: '.item-input input', 95 | event: 'click', 96 | handler: this.selectText 97 | },{ 98 | element: '#file-field', 99 | event: 'change', 100 | handler: this.updateImg 101 | },{ 102 | element: '#file-field', 103 | event: 'blur', 104 | handler: this.updateImgBlur 105 | }]; 106 | 107 | 108 | appFunc.bindEvents(bindings); 109 | } 110 | }; 111 | module.exports = pack; -------------------------------------------------------------------------------- /src/modules/utils/content.js: -------------------------------------------------------------------------------- 1 | var CONTENT = { 2 | SERVER_URL : 'ws://localhost:9998',//连接的服务器地址 3 | 4 | IMAGE_URL : "http://7xvucw.com1.z0.glb.clouddn.com/", 5 | 6 | //methods 7 | METHOD_POST : 'post', 8 | METHOD_GET : 'get', 9 | 10 | //Socket EVENT 11 | //base 12 | EVENT_BASE_REGISTER : "base_register", //注册 13 | EVENT_BASE_LOGIN : "base_login", //登录 14 | EVENT_BASE_LOGOUT : "base_logout", //退出 15 | EVENT_BASE_OFFLINE_MSG : "base_getOfflineMsg", //获取离线消息 16 | EVENT_BASE_CLIENT_RECEIVE : "base_receive", //客户端接收消息 17 | EVENT_BASE_GET_PASS : "base_password", //找回密码 18 | EVENT_BASE_EDIT_PASSWORD : "base_edit_password", //修改密码 19 | 20 | //资讯 21 | EVENT_INFO_GET_INFO : "info_get_comment", //点击资讯详情获取资讯评论与点赞数 22 | EVENT_INFO_GET_VOTE : "info_get_vote", //获取最新的投票数 23 | EVENT_INFO_GET_ACTIVITY : "info_get_activity", //获取最新的参数报名人数 24 | EVENT_INFO_COMMENT : "info_comment", //评论 25 | EVENT_INFO_COLLECT : "info_collect", //赞和收藏 26 | EVENT_INFO_VOTE : "info_vote", //投票 27 | EVENT_INFO_ACTIVITY : "info_activity", //参加活动 28 | 29 | EVENT_NEWS_INFO : "news_info", //新的资讯 30 | 31 | //聊天 32 | EVENT_CHAT : "chat", //会话事件 33 | EVENT_CHAT_CREATE_GROUP : "chat_createGroup", //创建群事件 34 | EVENT_CHAT_USER : "chat_user", ////A->B,这里是推荐给B,B收到后返回一个ack 35 | EVENT_CHAT_GROUP : "chat_group", //A->G(群),推荐给所有在线的群友 36 | EVENT_CHAT_GROUP_RENAME : "chat_group_rename", //群名更改 37 | EVENT_CHAT_GET_MEMBER : "chat_get_member_info", //点击会员进入详情,此时加载会员最新信息 38 | 39 | //2016-9-29 add 40 | EVENT_CHAT_SETTING : "chat_setting", //消息免打扰 41 | EVENT_GROUP_OPT_MEM : "chat_group_opt_member", //退群操作 42 | 43 | //说说 44 | EVENT_TALK : "talk", //发表说说 45 | 46 | //系统与更新用户信息 47 | EVENT_SYS_EDIT_MEMBER : "sys_editMember", //会员修改信息 48 | EVENT_SYS_FEEDBACK : "sys_feedback", //反馈 49 | EVENT_SYS_EDIT_IMG : "sys_editImg", //会员修改头像或背景图 50 | 51 | 52 | //状态常量 53 | SEND_ERROR : 0 ,//错误 54 | SEND_SUCCESS : 1 ,//成功 55 | SEND_INFO : 2 ,//消息 56 | SEND_DENY : 3 ,//被限定 57 | SEND_REPLY : 4 ,//需要重新登录 58 | SEND_NONE : 5 ,//直接忽略的信息 59 | 60 | 61 | //客户端接收服务端的信息 62 | EVENT_TYPE_GROUP : 1,//创建群消息 63 | EVENT_TYPE_TALK : 2,//创建了新的说说 64 | EVENT_TYPE_NEW_COMMENT : 3,//有新的评论,通知发布者 65 | EVENT_TYPE_NEW_COOL : 4,//有新的赞 66 | EVENT_TYPE_GROUP_INVATE : 5,//群邀请 67 | 68 | //服务端进行推送 69 | EVENT_TYPE_NEW_INFO : 7,//新的资讯 70 | EVENT_TYPE_NEW_MEMBER : 8,//新的会员 71 | 72 | 73 | //收藏点赞 74 | COLLECT_INFO : 1,//资讯收藏 75 | COLLECT_INFO_COOL : 2,//资讯点赞 76 | COLLECT_TALK : 3,//说说收藏 77 | COLLECT_TALK_COOL : 4,//说说点赞 78 | 79 | 80 | //评论类型 1:资讯评论,2:说说评论 81 | COMMENT_TYPE_INFO : 1,//资讯评论 82 | COMMENT_TYPE_TALK : 2,//说说评论 83 | 84 | CHAT_TYPE_PERSON : 1,//个人 85 | CHAT_TYPE_GROUP : 2,//群 86 | 87 | 88 | //徽章 89 | BADGE_TALK : 'badge_talk', 90 | BADGE_INFO : 'badge_info', 91 | BADGE_CHAT : 'badge_chat', 92 | BADGE_MEMBER : 'badge_member', 93 | 94 | //评论类型 95 | CHAT_TYPE_TEXT : 1,//文本 96 | CHAT_TYPE_IMG : 2,//图片 97 | CHAT_TYPE_VIDEO : 3,//语音 98 | 99 | //邀请/删除/退群 //1:增加会员,2:删除会员,3: 退群 2016-9-30 100 | 101 | EVENT_GROUP_ADD : 11,//增加会员 102 | EVENT_GROUP_DEL : 12,//删除会员 103 | EVENT_GROUP_EXIT : 13,//退群 104 | EVENT_GROUP_CLEAR: 14,//解散 105 | EVENT_GROUP_DEL_NOTIFY: 15,////删除会员,通知群友 106 | EVENT_GROUP_EXIT_NOTIFY:16,//退群,通知群友 107 | 108 | EVENT_GROUP_NEWS : "chat_get_group_news" //获取最新的群信息 109 | 110 | 111 | }; 112 | 113 | module.exports = CONTENT; -------------------------------------------------------------------------------- /src/modules/comment/comment.js: -------------------------------------------------------------------------------- 1 | var appFunc = require('../utils/appFunc'), 2 | service = require('./service'), 3 | template = require('./comment.tpl.html'), 4 | popupTpl = require('./commentPopup.tpl.html'), 5 | socket = require("../socket/socket"), 6 | store = require("../utils/localStore"), 7 | face = require("../faces/face") 8 | 9 | 10 | ; 11 | 12 | var comment_params; 13 | var fn_method; 14 | var pack = { 15 | /** 16 | * @param id : comment 表的mark_id 17 | * @param type : 1:资讯评论,2:说说评论 18 | */ 19 | init: function(params){ 20 | comment_params = params; 21 | }, 22 | //详情列表显示 23 | getComments: function(params){ 24 | service.getComments(params,function(res){ 25 | var renderData = { 26 | comments: res.msg 27 | }; 28 | var output = appFunc.renderTpl(template, renderData); 29 | $$('#commentContent').html(output); 30 | }); 31 | }, 32 | 33 | //弹出评论窗 34 | commentPopup: function(params,fn){ 35 | console.log(params); 36 | var renderData = { 37 | comment: i18n.timeline.comment 38 | }; 39 | //如果是回复TA的,就传name进来 40 | if(params.name){ 41 | renderData.title = i18n.comment.reply_comment; 42 | renderData.placeholder = i18n.comment.reply + '@' + params.name + ':'; 43 | }else { 44 | renderData.title = i18n.timeline.comment; 45 | renderData.placeholder = i18n.comment.placeholder; 46 | } 47 | 48 | renderData.mark_id = params.mark_id||comment_params.mark_id; 49 | renderData.type = params.type||comment_params.type; 50 | renderData.pid = params.uid||0; 51 | 52 | fn_method = fn; 53 | 54 | var output = appFunc.renderTpl(popupTpl, renderData); 55 | hiApp.popup(output); 56 | 57 | var bindings = [{ 58 | element:'#commentBtn', 59 | event: 'click', 60 | handler: pack.sendComment 61 | },{ 62 | element:".icon-emotion", 63 | event: 'click', 64 | handler: face.renderFace 65 | }]; 66 | 67 | appFunc.bindEvents(bindings); 68 | }, 69 | 70 | //发送评论 71 | sendComment: function(){ 72 | var text = $$('#contentText').val(); 73 | if(appFunc.getCharLength(text) < 4){ 74 | hiApp.alert(i18n.index.err_text_too_short); 75 | return false; 76 | } 77 | 78 | hiApp.showPreloader(i18n.comment.commenting); 79 | var _mark_id = $$('#mark_id').val(); 80 | var _type = $$('#type').val(); 81 | var _pid = $$("#pid").val(); 82 | socket.info_set_comment({ 83 | mark_id : _mark_id, 84 | username : store.getStorageValue("username"), 85 | content : text, 86 | type : _type, 87 | pid : _pid 88 | },function(_reId){ 89 | hiApp.hidePreloader(); 90 | hiApp.closeModal('.comment-popup'); 91 | console.log("fn_method = > "+fn_method); 92 | (typeof(fn_method) === 'function') ? fn_method(text,_reId,_pid) : ''; 93 | appFunc.hiAlert("评论成功."); 94 | }); 95 | }, 96 | //底部弹出 97 | createActionSheet: function(_this,fn){ 98 | var replyName = _this.find('.comment-detail .name').html(); 99 | var _uid = _this.find('.comment-detail .uid').val(); 100 | var _type = _this.find('.comment-detail .type').val(); 101 | var _mark_id = _this.find(".comment-detail .mark_id").val(); 102 | var buttons1 = [ 103 | { 104 | text: i18n.comment.reply_comment, 105 | bold: true, 106 | onClick:function(){ 107 | pack.commentPopup({uid:_uid,type:_type,name:replyName,mark_id:_mark_id},fn); 108 | } 109 | } 110 | 111 | ]; 112 | var buttons2 = [ 113 | { 114 | text: i18n.global.cancel, 115 | color: 'red' 116 | } 117 | ]; 118 | var groups = [buttons1, buttons2]; 119 | hiApp.actions(groups); 120 | } 121 | }; 122 | 123 | module.exports = pack; -------------------------------------------------------------------------------- /src/modules/info/info.js: -------------------------------------------------------------------------------- 1 | require('./info.less'); 2 | var appFunc = require('../utils/appFunc'), 3 | commentModule = require('../comment/comment'), 4 | template = require('./info.tpl.html'), 5 | db = require("../db/db"), 6 | table = require("../db/table"), 7 | socket = require("../socket/socket"), 8 | content = require("../utils/content"), 9 | store = require("../utils/localStore") 10 | ; 11 | 12 | var pack = { 13 | init: function(query){ 14 | var _id = appFunc.parseInt(query.id); 15 | appFunc.hideToolbar(); 16 | 17 | this.bindEvents(); 18 | 19 | // render tweet card 20 | this.getData(_id); 21 | 22 | //初始化评论 23 | commentModule.init({mark_id:_id,type:content.COMMENT_TYPE_INFO}); 24 | }, 25 | //每次加载从服务端获取最新数据 26 | getCommentFromServer:function(_params){ 27 | /** 28 | * mark_id : '',//资讯ID 29 | * comment_num : ''//客户端本地的评论数 30 | * mark_update_time : ''//资讯的最后更新时间 31 | */ 32 | socket.info_get_info( 33 | _params, 34 | function(row){ 35 | var _res = appFunc.parseJson(row); 36 | var _obj = _res.data.obj; 37 | var _appends = _res.data.appends; 38 | 39 | //如果被更改过,则更新  40 | if(_obj){ 41 | db.dbUpdate(table.T_ARTICLE,{id:_obj.id},_obj); 42 | } 43 | if(_appends){ 44 | $$.each(_appends,function(index,res){ 45 | socket._pri_update_data(table.T_COMMENTS,res); 46 | }); 47 | } 48 | 49 | //获取评论 50 | commentModule.getComments({mark_id:_params.mark_id,type:content.COMMENT_TYPE_INFO}); 51 | } 52 | ); 53 | 54 | 55 | }, 56 | 57 | getData: function(_id){ 58 | db.dbFindOne(table.T_ARTICLE,{id:_id},function(err,row){ 59 | var output = appFunc.renderTpl(template, row); 60 | $$('#infoContent').html(output); 61 | 62 | pack.getCommentFromServer({ 63 | mark_id : _id, 64 | comment_num : row.comment_num, 65 | mark_update_time : row.update_time 66 | }); 67 | }); 68 | 69 | }, 70 | //评论 71 | commentItem:function(){ 72 | commentModule.commentPopup({},function(text,mark_id){pack._rederComment(text,mark_id,pid)}); 73 | }, 74 | //追加! 75 | _rederComment:function(text,mark_id,pid){ 76 | var _uid = store.getStorageIntVal("uid"); 77 | var _template = '
  • '+ 78 | '
    '+appFunc.getFilenameByUidForUrl(_uid)+'
    '+ 79 | '
    '+ 80 | '
    '+appFunc.getUsernameByUidForUrl(_uid)+': '+appFunc.atUser(pid)+appFunc.replace_smile(text)+'
    '+ 81 | '
    刚刚
    '+ 82 | ''+ 83 | ''+ 84 | ''+ 85 | '
    '+ 86 | '
  • '; 87 | $$('#info-page-list #commentContent').prepend(_template); 88 | $$("#info-page-list #commentContent .none-comment").hide(); 89 | }, 90 | //jump comment page 91 | jumpCommentPage:function(e){ 92 | if(e.target.nodeName === 'A' || e.target.nodeName === 'IMG'){ 93 | return false; 94 | } 95 | commentModule.createActionSheet($$(this),function(text,mark_id){pack._rederComment(text,mark_id,pid)}); 96 | }, 97 | 98 | bindEvents: function(){ 99 | 100 | //点击弹出回复 101 | var bindings = [{ 102 | element: '#infosView .item-comment-btn', 103 | event: 'click', 104 | handler: this.commentItem 105 | },{ 106 | element: '#commentContent', 107 | selector: '.comment-item', 108 | event: 'click', 109 | handler: this.jumpCommentPage //:会员回复,先不弄先,如果加了估计还要加提醒功能 110 | }]; 111 | 112 | appFunc.bindEvents(bindings); 113 | } 114 | }; 115 | 116 | module.exports = pack; -------------------------------------------------------------------------------- /src/modules/login/login.js: -------------------------------------------------------------------------------- 1 | require('./login.less'); 2 | 3 | var appFunc = require('../utils/appFunc'), 4 | template = require('./login.tpl.html'), 5 | socket = require("../socket/socket"), 6 | registerTemp = require("./register.tpl.html"), 7 | forgetTemp = require("./forget.tpl.html") 8 | 9 | ; 10 | 11 | var loginPack = { 12 | init: function(){ 13 | loginPack.bindEvents(); 14 | this.renderIndex(); 15 | }, 16 | renderIndex: function(){ 17 | var output = appFunc.renderTpl(template); 18 | $$('#loginView .page[data-page="login"]').html(output); 19 | hiApp.hideIndicator(); 20 | }, 21 | 22 | //登录操作 23 | login:function(){ 24 | var _tel = $$("#username").val(); 25 | var _password = $$("#password").val(); 26 | if(!_tel){ 27 | appFunc.hiAlert("手机号不能空."); 28 | return; 29 | } 30 | if(!appFunc.isMobile(_tel)){ 31 | appFunc.hiAlert("手机号格式不正确."); 32 | return; 33 | } 34 | 35 | if(!_password){ 36 | appFunc.hiAlert("登录密码不能空."); 37 | return false; 38 | } 39 | hiApp.showPreloader(i18n.login.login); 40 | socket.base_login({username:_tel,password:_password},function(){ 41 | hiApp.hidePreloader(); 42 | }); 43 | }, 44 | 45 | //注册操作 46 | register:function(){ 47 | var output = appFunc.renderTpl(registerTemp); 48 | $$('#loginView .page[data-page="login"]').html(output); 49 | }, 50 | 51 | //忘记密码 52 | forget:function(){ 53 | var output = appFunc.renderTpl(forgetTemp); 54 | $$('#loginView .page[data-page="login"]').html(output); 55 | }, 56 | 57 | registerSubmit:function(){ 58 | var _tel = $$("#tel").val(); 59 | var _username = $$("#username").val(); 60 | var _password = $$("#password").val(); 61 | if(!_tel){ 62 | appFunc.hiAlert("手机号不能空."); 63 | return; 64 | } 65 | if(!appFunc.isMobile(_tel)){ 66 | appFunc.hiAlert("手机号格式不正确."); 67 | return; 68 | } 69 | if(!_username){ 70 | appFunc.hiAlert("用户名不能空."); 71 | return; 72 | } 73 | if(!_password){ 74 | appFunc.hiAlert("登录密码不能空."); 75 | return false; 76 | } 77 | $$(this).text("正在提交..."); 78 | socket.base_register({ 79 | username : _username, 80 | tel : _tel, 81 | password : _password 82 | },function(data){ 83 | $$(this).text("注册"); 84 | loginPack.renderIndex(); 85 | }); 86 | }, 87 | forgetSubmit:function(){ 88 | var _tel = $$("#tel").val(); 89 | if(!_tel){ 90 | appFunc.hiAlert("手机号不能空."); 91 | return; 92 | } 93 | if(!appFunc.isMobile(_tel)){ 94 | appFunc.hiAlert("手机号格式不正确."); 95 | return; 96 | } 97 | $$(this).text("正在提交..."); 98 | socket.base_get_pass({ 99 | tel : _tel 100 | },function(data){ 101 | $$(this).text("提交"); 102 | loginPack.renderIndex(); 103 | }); 104 | 105 | }, 106 | bindEvents: function(){ 107 | var bindings = [{ 108 | element: '#loginView', 109 | selector: '.btn-login', 110 | event: 'click', 111 | handler: loginPack.login 112 | },{ 113 | element: '#loginView', 114 | selector: '.btn-register', 115 | event: 'click', 116 | handler: loginPack.register 117 | },{ 118 | element: '#loginView', 119 | selector: '.btn-forget', 120 | event: 'click', 121 | handler: loginPack.forget 122 | },{ 123 | element: '#loginView', 124 | selector: '.back', 125 | event: 'click', 126 | handler: loginPack.renderIndex 127 | },{ 128 | element: '#loginView', 129 | selector: '.register-submit', 130 | event: 'click', 131 | handler: loginPack.registerSubmit 132 | },{ 133 | element: '#loginView', 134 | selector: '.forget-submit', 135 | event: 'click', 136 | handler: loginPack.forgetSubmit 137 | }]; 138 | appFunc.bindEvents(bindings); 139 | } 140 | }; 141 | 142 | module.exports = loginPack; -------------------------------------------------------------------------------- /src/modules/lang/zh-cn.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | app: { 3 | name: 'HiApp' 4 | }, 5 | global: { 6 | cancel: '取消', 7 | send: '发送', 8 | back:'返回', 9 | done:'完成', 10 | search:'搜索', 11 | modal_title: '系统消息', 12 | modal_button_ok: '确定', 13 | minute_ago:'天前', 14 | hour_ago:'小时前', 15 | day_ago:'天前', 16 | just_now:'刚刚', 17 | language:'切换语言', 18 | switch_language:'切换语言', 19 | vodieSend:"按住 说话" 20 | }, 21 | index: { 22 | nothing_found: '未有匹配结果', 23 | nothing_loaded:'没有加载到新动态', 24 | tweet: '动态', 25 | contacts: '联系人', 26 | setting: '设置', 27 | sen_tweet: '发动态', 28 | send_placeholder: '呃...说点什么吧?', 29 | sending:'正在发送中...', 30 | err_text_too_short:'Er,内容有点短哦,再写点吧...', 31 | infos:'资讯', 32 | chat:'聊天' 33 | }, 34 | setting: { 35 | feed_back: '意见反馈', 36 | feed_back_placeholder:'Hi,有什么开心的不开心的告诉我们吧...', 37 | feed_back_result:'感谢您的反馈,我们将尽快与您联系!', 38 | check_update: '检测更新', 39 | about: '关于我们', 40 | login_out: '退出', 41 | nickname: '用户名', 42 | confirm_logout:'你确定要退出登录吗?', 43 | current_version:'当前版本为', 44 | chat_name:"手机号", 45 | setting_name:"设置", 46 | user_info:"个人信息", 47 | 48 | password_name:"修改密码" 49 | }, 50 | login: { 51 | loginname_placeholder: '请输入账号', 52 | password_placeholder: '请输入密码', 53 | login_btn: '登录', 54 | sign_up: '注册', 55 | forgot_pwd: '忘记密码', 56 | err_empty_input: '账户或密码不能为空', 57 | err_illegal_email: '登录账户必须是Email', 58 | login: '正在登录...' 59 | }, 60 | timeline:{ 61 | forward:'转发', 62 | comment:'评论', 63 | like:'喜欢', 64 | cool:'赞' 65 | }, 66 | item:{ 67 | title:'正文' 68 | }, 69 | comment:{ 70 | reply:'回复', 71 | reply_comment:'回复评论', 72 | copy_comment:'复制评论', 73 | placeholder:'Er,评论..', 74 | empty_comment:'暂时还没有评论', 75 | commenting:'评论中...' 76 | }, 77 | chat:{ 78 | title:'聊天', 79 | chatPlaceholder:'说点什么' 80 | }, 81 | geo:{ 82 | loading_geo:'正在获取您所在的位置...', 83 | permission_denied:'您拒绝了系统定位的权限申请', 84 | position_unavailable:'无法获取到您所在的地理位置信息', 85 | timeout:'获取地理位置信息超时', 86 | confirm_clean_geo:'您将清除定位的地理信息' 87 | }, 88 | camera:{ 89 | image_uploading: '正在上传图片...', 90 | confirm_clear_image: '你确定要取消选择的图片吗?', 91 | file_not_found_err: '未找到需要上传的文件', 92 | invalid_url_err: '无效的上传服务器指向', 93 | connection_err: '与网络断开或请求超时', 94 | abort_err: '已经取消图片的上传', 95 | not_modified_err: '没有修改' 96 | }, 97 | error:{ 98 | unknown_error:'未知错误', 99 | no_network:'无网络连接', 100 | phonegap_only:'该模块只支持在PhoneGap中使用' 101 | }, 102 | password:{ 103 | password_name : "修改密码", 104 | passwrod_old : "原始密码", 105 | password_new : "新密码", 106 | password_new_ag : "确认新密码", 107 | password_place : "请输入原始密码", 108 | password_new_place: "请输入新密码", 109 | old_not_null : "原始密码不能空.", 110 | new_not_null : '新密码不能空.', 111 | new_not_eq : "二次输入的新密码不一致." 112 | }, 113 | userinfo:{ 114 | avatar : "头像", 115 | username : "昵称", 116 | chat_name : "微号", 117 | tel : "电话", 118 | email : "邮箱", 119 | hobby : "爱好", 120 | duties : "职务", 121 | company : "公司", 122 | sex : "性别", 123 | address : "地址", 124 | remark : "自我介绍", 125 | member_info : "会员信息", 126 | send_info : "发消息", 127 | member_talk : "个人动态" 128 | }, 129 | message:{ 130 | camera : '拍照', 131 | pic : '相册', 132 | geo : '位置', 133 | chat_detail : "聊天信息", 134 | 135 | group_nums : "全部群员", 136 | group_name : "群名", 137 | group_info : "公告", 138 | 139 | switch_info : "消息免打扰", 140 | switch_top : "置顶聊天", 141 | group_my_name : "我在本群昵称", 142 | del_and_exit : "删除并退出", 143 | 144 | contact_group : "发起群聊" 145 | } 146 | }; --------------------------------------------------------------------------------