Giter Club home page Giter Club logo

cnodejs-ionic's Introduction

CNodejs Ionic app

https://cnodejs.org hybird mobile application powered by Ionic Framework 1.x using AngularJS 1.x and Cordova. The development stage powered by Ionic Framework generator.

Demo

Download on the app store

There is another one made by Ionic 3, check it out here https://github.com/lanceli/cnodejs-ionic3

Developing

If you'd like to run it locally, and modify something, you can do so by cloning this repo and running the following commands (assuming that you have Node, NPM, Ionic, Cordova, Grunt and Bower installed).

# Clone and Install dependencies
$ git clone git://github.com/lanceli/cnodejs-ionic.git
$ npm install
$ bower install

# Config api url on development mode
# At line 54 in Gruntfile.js
$ vim Gruntfile.js

# Start the server on localhost:8010 on development mode
# Watches for changes, automatically recompiles files and refreshes the browser
$ grunt serve 

# Start the server on production mode
$ grunt serve:compress

# Add platform target
$ grunt platform:add:ios
$ grunt platform:add:android

# Run on platform target on development mode
$ grunt run:ios
$ grunt run:android

# Run on platform target on production mode
$ grunt build:ios
$ ionic run ios
$ grunt build:android
$ ionic run android

Need more detail? Please chekout Ionic Framework and Ionic Framework generator.

Question

if you have some problem with window system, please follow the blow step may help you fixed it.

grunt-contrib-compass/node_modules/tmp/lib/tmp.js:261
        throw err;
      ^
     Error: cannot read property 'stdout' of undefined
    at compile

see issue: Run grunt serve error

  • Make sure you have installed Ruby tools
  • After you install ruby, use gem to install sass and compass(in cmd):
  1. gem install sass
  2. gem install compass
  • use npm to install modules(in cmd), choose one to install:
  1. npm install cordova ionic
  2. npm install -g cordova ionic

After install all the modules, you may face the child_process error. This is a windows system bug. you can fixed it like this:

grunt-contrib-compass/node_modules/tmp/lib/tmp.js:261
        throw err;
      ^
     Error: spawn ENOENT
    at errnoException (child_process.js:1001:11) 
   at Process.ChildProcess._handle.onexit (child_process.js:802:34)

A solution would be to replace spawn by win-spawn:

  1. npm install win-spawn
  2. Replace the line in the Gruntfile.js:
replace child_process to win-spawn
var spawn = require('child_process').spawn;
to
var spawn = require('win-spawn');

more information about this defect,please see:

have try, it should work now.

Cross-Origin

When you run it locally in browser, CORS is a problem.

Disable web security of chrome

open -a /Applications/Google\ Chrome.app --args --disable-web-security --allow-file-access-from-files

OR Allow cross origin access in nginx

add_header Access-Control-Allow-Origin *;

Checkout this: How do I add Access-Control-Allow-Origin in NGINX?

Release History

See the CHANGELOG.

Contribute

You are welcome to contribute. 🎉

License

MIT

cnodejs-ionic's People

Contributors

alsotang avatar lanceli avatar microlv avatar pluswave avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cnodejs-ionic's Issues

手势操作,滑动返回。

我使用6plus,当我点进贴子的详细,如果要返回列表页的话,想要按到返回按钮很困难,我又不想总是去使用home键,加个swipe事件吧.

本来我是想自己去添加 , 按照你的doc,用浏览器调试时,跨域你是怎么解决的?

github.io 部署

我弱弱地问下程序如何在github.io 上部署?不是只能部署静态的介绍页面么?github.io/www/路径怎么设置?我部署的是访问不到的。。。

点击登录按钮时报错

点击登录按钮报错,下面是chrome的log:
TypeError: Cannot read property 'barcodeScanner' of undefined
at n.b.login (scripts.js:1)
at vendor.js:4
at vendor.js:13
at n.$eval (vendor.js:3)
at n.$apply (vendor.js:3)
at HTMLElement. (vendor.js:13)
at HTMLElement.Ma.c (vendor.js:1)
at c (vendor.js:6)
at b (vendor.js:6)
at HTMLDocument.f (vendor.js:6)

bower install的时候出现的问题。

bower extract ionic#v1.0.0-beta.14 archive.tar.gz
bower invalid-meta ionic is missing "main" entry in bower.json
bower invalid-meta ionic is missing "ignore" entry in bower.json
bower EPERM EPERM, unlink 'C:\Users\ADMINI~1\AppData\Local\Temp\W61-2013
0902QAR-Administrator\bower\ionic-1940-N9zPzr\archive.tar.gz'

Stack trace:
Error: EPERM, unlink 'C:\Users\ADMINI~1\AppData\Local\Temp\W61-20130902QAR-Admin
istrator\bower\ionic-1940-N9zPzr\archive.tar.gz'
请明白的说一下,大概啥意思。

An error occurred while listing Android targets

执行grunt platform:add:android报错了
报错信息如下

~/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while listing Android targets

之前,有一次时可以的。
后来提示sdk需要22版本,故升级了一下,到这一步就不可以了。

使用ionic platform add android可以执行成功,可是 执行grunt build:android,会报找不到资源文件。

没任何反应?

C:\cnodejsIonic>grunt serve --force
Running "serve" task

Running "clean:dist" (clean) task
Cleaning .tmp...OK
Cleaning www/css...OK
Cleaning www/fonts...OK
Cleaning www/img...OK
Cleaning www/index.html...OK
Cleaning www/js...OK
Cleaning www/lib...OK
Cleaning www/templates...OK

Running "clean:server" (clean) task

Running "ngconstant:development" (ngconstant) task
Creating module cnodejs.config at app/js/config.js...OK

Running "wiredep:app" (wiredep) task

Running "wiredep:sass" (wiredep) task

Running "concurrent:server" (concurrent) task

Running "copy:styles" (copy) task

Done, without errors.

Running "copy:vendor" (copy) task

Done, without errors.

Running "copy:fonts" (copy) task

Done, without errors.

Running "compass:server" (compass) task
directory .tmp/css
write .tmp/css/main.css (0.03s)

Done, without errors.

Running "autoprefixer:dist" (autoprefixer) task
Prefixed file ".tmp/css/main.css" created.

Running "newer:copy:app" (newer) task

Running "copy:app" (copy) task
Created 35 directories, copied 250 files

Running "newer-postrun:copy:app:1:C:\java\mygit\cnodejsIonic\node_modules\grunt-newer.cache" (newer-postrun) task

Running "newer:copy:tmp" (newer) task

Running "copy:tmp" (copy) task
Copied 1 files

Running "newer-postrun:copy:tmp:2:C:\java\mygit\cnodejsIonic\node_modules\grunt-newer.cache" (newer-postrun) task

Running "concurrent:ionic" (concurrent) task
Running "watch" taskRunning "ionic:serve" (ionic) task

Waiting...Warning: undefined is not a function Used --force, continuing.

Done, but with warnings.

Execution Time (2015-01-22 10:07:25 UTC)
loading tasks 4ms ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 50%
ionic:serve 4ms ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 50%
Total 8ms

grunt run:ios在模拟器里无法运行

server上运行没有问题
执行 grunt run:ios,返回
** BUILD SUCCEEDED **
--devicetypeid was not specified, using first available device: Apple Watch - 38mm.
An error was encountered processing the command (domain=LaunchServicesError, code=0):
The operation couldn’t be completed. (LaunchServicesError error 0.),好像是运行在AppleWatch模拟器上了,无法解决
试着用xcode7打开,运行后模拟器一直显示在Launch Screen上
log

2015-10-09 11:45:29.326 CNodeJs[17186:131152] Multi-tasking -> Device: YES, App: YES
2015-10-09 11:45:29.332 CNodeJs[17186:131152] Unlimited access to network resources
2015-10-09 11:45:29.335 CNodeJs[17186:131152]

Started backup to iCloud! Please be careful.
Your application might rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines"
You could find it at the following address https://developer.apple.com/icloud/documentation/data-storage/ .

2015-10-09 11:45:29.643 CNodeJs[17186:131152] [CDVTimer][splashscreen] 198.056996ms
2015-10-09 11:45:29.652 CNodeJs[17186:131152] [CDVTimer][statusbar] 8.543968ms
2015-10-09 11:45:29.652 CNodeJs[17186:131152] [CDVTimer][keyboard] 0.155985ms
2015-10-09 11:45:29.652 CNodeJs[17186:131152] [CDVTimer][TotalPluginStartup] 207.367003ms
2015-10-09 11:45:29.688 CNodeJs[17186:131152] Resetting plugins due to page load.
2015-10-09 11:45:29.844 CNodeJs[17186:131152] Finished load of: file:///Users/abc/Library/Developer/CoreSimulator/Devices/BF30782A-A87F-4D5A-8A4E-1B63DA3EA5A5/data/Containers/Bundle/Application/644AAA9F-72AF-4FE6-8ECF-C1AD0ED15A10/CNodeJs.app/www/index.html#/topics/all
2015-10-09 11:45:30.252 CNodeJs[17186:131152] CDVPlugin class CDVDevice (pluginName: Device) does not exist.
2015-10-09 11:45:30.252 CNodeJs[17186:131152] ERROR: Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2015-10-09 11:45:30.252 CNodeJs[17186:131152] -[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [
"Device174012649",
"Device",
"getDeviceInfo",
[

]
]

点赞别人的回复后,再次点赞 按钮label有问题

当点赞一次别人的回复后,再此点击那个回复,弹出的ActionSheet上的按钮上还是显示”赞“,应该显示”已赞“。也就说 下面的已赞逻辑永远走不到
//cnodejs-ionic/app/js/controllers/topic.js

 $log.debug('action reply:', reply);
    var upLabel = '赞';
    // detect if current user already do up
    if (reply.ups.indexOf(currentUser.id) !== -1) {
      upLabel = '已赞';
    }
    var replyContent = '@' + reply.author.loginname;
    $ionicActionSheet.show({

原因好像是reply.ups.push('') 应该push(currentUser.id)
//cnodejs-ionic/app/js/services/topic.js

upReply: function(replyId) {
      var currentUser = User.getCurrentUser();
      return resource.upReply({
        replyId: replyId,
        accesstoken: currentUser.accesstoken
      }, null, function(response) {
        if (response.success) {
          angular.forEach(topic.replies, function(reply, key) {
            if (reply.id === replyId) {
              if (response.action === 'up') {
                reply.ups.push('');
              } else {
                reply.ups.pop();
              }

grunt platform:add:android时报错

Installing "cordova-plugin-badge" for android

Failed to install 'cordova-plugin-badge':CordovaError: Plugin doesn't support this project's cordova-android version. cordova-android: 3.5.1, failed version requirement: >=4
at checkEngines (/home/lenzhao/dev/ionic/cnodejs-ionic/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:117:29)
at _fulfilled (/home/lenzhao/dev/ionic/cnodejs-ionic/node_modules/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/lenzhao/dev/ionic/cnodejs-ionic/node_modules/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/lenzhao/dev/ionic/cnodejs-ionic/node_modules/cordova/node_modules/q/q.js:760:13)
at /home/lenzhao/dev/ionic/cnodejs-ionic/node_modules/cordova/node_modules/q/q.js:574:44
at flush (/home/lenzhao/dev/ionic/cnodejs-ionic/node_modules/cordova/node_modules/q/q.js:108:17)
at nextTickCallbackWith0Args (node.js:415:9)
at process._tickCallback (node.js:344:13)
Plugin doesn't support this project's cordova-android version. cordova-android: 3.5.1, failed version requirement: >=4
Warning: Task "platform:add:android" failed. Use --force to continue.

Aborted due to warnings.

npm install 时报错

image

见上图,是否是nodejs和npm版本过高,已经安装好了Node, NPM, Ionic, Cordova, Grunt and Bower。

去掉【收藏】有关的功能

之后我们社区不打算提供的收藏功能,麻烦应用检查一下是否有接触到相关的功能,如果有的话,可以全部去掉。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.