#1 问卷调查项目合并到master

Open
lyq wants to merge 7 commits from lyq/wenjuan into lyq/master

+ 0 - 0
CONTRIBUTING.md


+ 8 - 0
README.md

@@ -1,5 +1,12 @@
 ## nativescript-demo
 
+[![Version](https://img.shields.io/badge/version-v1.1.0-brightgreen)](https://git.yoqi.me/lyq/nativescript-demo)
+[![Nativescript](https://img.shields.io/badge/Natvescript-v8.1.1-brightgreen?style=plastic)](https://git.yoqi.me/lyq/nativescript-demo)
+
+* gradle 6.4-all
+* build tools 3.6.4
+* 
+
 nativescript类似于uniap,Convorda,实现 js+html 开发,打包为apk,ios等应用。
 
 ## Usage
@@ -28,6 +35,7 @@ ns run android
 ns run <platform> --bundle
 
 ns build android
+# /workspace/mobile/nativescript-demo/platforms/android/app/build/outputs/apk/debug/app-debug.apk
 
 tns plugin remove nativescript-geolocation@4.5.0
 tns plugin add nativescript-geolocation@3.0.1

+ 0 - 7
app/app.js

@@ -1,7 +0,0 @@
-import Vue from 'nativescript-vue'
-
-import App from './components/App'
-
-new Vue({
-  render: (h) => h(App),
-}).$start()

+ 106 - 0
app/main.js

@@ -0,0 +1,106 @@
+import Vue from 'nativescript-vue'
+import App from './components/App'
+
+import * as Sqlite from 'nativescript-sqlite';
+import RadListView from 'nativescript-ui-listview/vue';
+
+let initDb = function (db) {
+  db.execSQL('create table answer_sheet(' +
+      ' `sheetName` text, `questionaireId` int, ' +
+      ' `status` int, `startTime` int, `endTime` int, ' +
+      ' `locationLong` NUMERIC, `locationLat` NUMERIC, ' +
+      ' `answerJson` text,  `dataUploaded` int, ' +
+      ' `hasAudio` int, `audioUploaded` int, ' +
+      ' `userName` text)', function (error) {
+          if (error) {
+              console.error('create table answer_sheet failed', error);
+          } else {
+              console.log('create table answer_sheet success')
+          }
+      });
+  db.execSQL('create table questionaire (`questionaireId` int, `version` int, `status` int, `contentJson` text )',
+      function (error) {
+          if (error) {
+              console.error('create table questionaire failed', error);
+          } else {
+              console.log('create table questionaire success')
+          }
+      });
+
+  db.execSQL('create table version_info (`version_no` float, `description` text)', function (error) {
+      if (error) {
+          console.error('create table version_info failed', error);
+      } else {
+          console.log('create table version_info success')
+      }
+  })
+}
+
+
+let updateDb = function (db) {
+
+}
+
+function getConnectionType() {
+  const connectivityModule = require("@nativescript/core/connectivity");
+  const myConnectionType = connectivityModule.getConnectionType();
+  switch (myConnectionType) {
+      case connectivityModule.connectionType.none:
+          // Denotes no Internet connection.
+          console.log('connection type', "No connection");
+          return 'None';
+          break;
+      case connectivityModule.connectionType.wifi:
+          // Denotes a WiFi connection.
+          console.log('connection type', "WiFi connection");
+          return 'WiFi';
+          break;
+      case connectivityModule.connectionType.mobile:
+          // Denotes a mobile connection, i.e. cellular network or WAN.
+          console.log('connection type', "Mobile connection");
+          return 'Mobile';
+          break;
+      case connectivityModule.connectionType.ethernet:
+          // Denotes a ethernet connection.
+          console.log('connection type', "Ethernet connection");
+          return 'Ethernet';
+          break;
+      case connectivityModule.connectionType.bluetooth:
+          // Denotes a bluetooth connection.
+          console.log('connection type', "Bluetooth connection");
+          return 'Bluetooth';
+          break;
+      default:
+          return 'unknown';
+          break;
+  }
+}
+
+Vue.use(RadListView);
+if (TNS_ENV !== 'production') {
+  Vue.use(VueDevtools)
+}
+// Prints Vue logs when --env.production is *NOT* set while building
+Vue.config.silent = (TNS_ENV === 'production')
+
+// Vue.prototype.$baseUrl = 'http://127.0.0.1:8080/api';
+// Vue.prototype.$baseUrl = 'http://192.168.1.4:8080/api';
+Vue.prototype.$baseUrl = 'http://api.scxbzw.com/api';
+
+console.log('audio path', knownFolders.documents().getFolder('audio').path);
+let dbname = 'my.db';
+let dbExist = Sqlite.exists(dbname);
+console.log('exist db?', Sqlite.exists(dbname));
+new Sqlite(dbname).then(database => {
+  Vue.prototype.$db = database;
+  console.log("db.isOpen()? ", database.isOpen() ? "Yes" : "No");
+  if (!dbExist) {
+      console.log('init db...');
+      initDb(database);
+  }
+
+
+});
+new Vue({
+  render: h => h('frame', [h(App)])
+}).$start()

+ 4 - 0
docs/README.md

@@ -0,0 +1,4 @@
+# docs
+
+nativescript 资料。
+

+ 30 - 0
docs/Summary.md

@@ -0,0 +1,30 @@
+# Summary
+
+* [快速入门](introduction/index.md)
+	* [NativeScript介绍](introduction/introduction.md)
+	* [环境搭建](introduction/environment_build.md)
+	* [Hello World](introduction/tutorials.md)
+
+* [布局](layout/index.md)
+    * [UI设计,布局](layout/design.md)
+	* [组件](layout/comonet.md)
+	* [样式](layout/style.md)
+	* [事件](layout/event.md)
+	* [生命周期](layout/lifezq.md)
+
+* [基础功能](base/index.md)
+    * [数据库](base/database.md)
+	* [网络请求](base/network.md)
+	* [Native硬件](base/native_method.md)
+
+* [ns 包](ns_package/index.md)
+    * [ns 命令行](ns_package/ns_command_line.md)
+	* [ns core包](ns_package/ns_core.md)
+	* [ns 社区包](ns_package/ns_community.md)
+	* [ns 包开发教程](ns_package/ns_package_dev.md)
+
+* [其他](other/index.md)
+    * [关于我们](other/about_us.md)
+	* [常见问题](other/questions.md)
+	* [商务合作](other/coor.md)
+	

+ 7 - 0
docs/base/database.md

@@ -0,0 +1,7 @@
+# docs
+
+nativescript 资料。
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+

+ 0 - 0
docs/base/index.md


+ 7 - 0
docs/base/native_method.md

@@ -0,0 +1,7 @@
+# docs
+
+nativescript 资料。
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+

+ 7 - 0
docs/base/network.md

@@ -0,0 +1,7 @@
+# docs
+
+nativescript 资料。
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+

+ 26 - 0
docs/introduction/environment_build.md

@@ -0,0 +1,26 @@
+# 环境搭建
+
+nativescript 支持在windows,linux,mac多系统搭建开发环境。前提需要安装好:
+
+*   android studio
+*   android sdk
+*   node>10
+
+## windows
+
+
+
+# linux
+
+
+
+
+
+# mac
+
+
+
+# gitpod
+
+此外,可以在 gitpod 配置开发环境,实现云平台开发。
+

+ 6 - 0
docs/introduction/index.md

@@ -0,0 +1,6 @@
+---
+title: 简介
+---
+
+# 简介
+

+ 2 - 0
docs/introduction/introduction.md

@@ -0,0 +1,2 @@
+# 介绍
+

+ 7 - 0
docs/introduction/tutorials.md

@@ -0,0 +1,7 @@
+# docs
+
+nativescript 资料。
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+

+ 7 - 0
docs/layout/comonet.md

@@ -0,0 +1,7 @@
+# docs
+
+nativescript 资料。
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+

+ 7 - 0
docs/layout/design.md

@@ -0,0 +1,7 @@
+# 设计
+
+nativescript 资料。
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+

+ 2 - 0
docs/layout/event.md

@@ -0,0 +1,2 @@
+# 事件
+

+ 4 - 0
docs/layout/index.md

@@ -0,0 +1,4 @@
+---
+s
+---
+

+ 7 - 0
docs/layout/lifezq.md

@@ -0,0 +1,7 @@
+# 生命周期
+
+nativescript 资料。
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+

+ 4 - 0
docs/layout/style.md

@@ -0,0 +1,4 @@
+# 样式
+
+
+

+ 7 - 0
docs/ns_package/index.md

@@ -0,0 +1,7 @@
+---
+s
+
+---
+
+# ns 核心包
+

+ 12 - 0
docs/ns_package/ns_command_line.md

@@ -0,0 +1,12 @@
+# ns 命令行
+
+## create
+
+创建项目,如:
+
+```
+ns create xx
+```
+
+
+

+ 4 - 0
docs/ns_package/ns_community.md

@@ -0,0 +1,4 @@
+# ns 社区包
+
+ns有着非常多的合作公司,在海外很流行。
+

+ 7 - 0
docs/ns_package/ns_core.md

@@ -0,0 +1,7 @@
+# docs
+
+nativescript 资料。
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+

+ 7 - 0
docs/ns_package/ns_package_dev.md

@@ -0,0 +1,7 @@
+# docs
+
+nativescript 资料。
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+

+ 11 - 0
docs/other/about_us.md

@@ -0,0 +1,11 @@
+---
+title: 关于我们
+---
+
+
+
+# 关于我们
+
+
+天问科技成立2015年,开发了多个成熟的**Nativescript** 跨平台App。
+

+ 10 - 0
docs/other/coor.md

@@ -0,0 +1,10 @@
+---
+title: 商务合作
+---
+
+
+
+# 商务合作
+
+企业可以通过邮件或者电话与我们联系。
+

+ 10 - 0
docs/other/index.md

@@ -0,0 +1,10 @@
+---
+title: other
+---
+
+# 其他
+
+ -   [关于我们](other/about_us.md)
+ -   [常见问题](other/questions.md)
+ -   [商务合作](other/coor.md)
+

+ 16 - 0
docs/other/questions.md

@@ -0,0 +1,16 @@
+# 常见问题
+
+下面总结一些开发中常见的问题,以及相关解决方案。
+
+## 版本不兼容
+
+随着安卓,ios版本的更新,导致老版本的nativescript项目运行错误,而更新nativescript又往往需要全部更新其他依赖。导致版本不兼容。
+
+
+
+
+
+更新  "@nativescript/core": "~8.5.1" 依赖,会更新android版本。
+
+
+

+ 7 - 0
mkdocs.yml

@@ -0,0 +1,7 @@
+site_name: 商业分析
+site_description: 商业分析
+site_url: http://business-analysis.yoqi.me/zh/
+theme:
+  name: material
+plugins:
+ - search

File diff suppressed because it is too large
+ 806 - 34
package-lock.json


+ 18 - 7
package.json

@@ -1,16 +1,27 @@
 {
-  "name": "aab",
-  "main": "app/app.js",
+  "name": "nativescript-demo",
+  "author": "liuyuqi <liuyuqi.gov@msn.cn>",
+  "main": "app/main.js",
   "version": "1.0.0",
   "private": true,
+  "scripts": {
+    "build": "npm install && tns build android",
+    "build:ios": "tns build ios --bundle"
+  },
   "dependencies": {
-    "@nativescript/core": "~8.1.1",
-    "@nativescript/theme": "~3.0.1",
-    "nativescript-vue": "~2.9.0"
+    "@nativescript/core": "~8.5.1",
+    "@nativescript/theme": "~3.0.2",
+    "nativescript-vue": "~2.9.3",
+    "axios": "^1.3.6",
+    "nativescript-sqlite": "^2.8.6",
+    "nativescript-toast": "^2.0.0",
+    "nativescript-ui-listview": "^15.2.3",
+    "nativescript-vue-devtools": "^1.5.1",
+    "nativescript-audio": "^6.2.6"
   },
   "devDependencies": {
-    "@nativescript/android": "8.1.1",
+    "@nativescript/android": "8.5.0",
     "@nativescript/webpack": "~5.0.0",
     "nativescript-vue-template-compiler": "~2.9.0"
   }
-}
+}

+ 2 - 0
requirements.txt

@@ -0,0 +1,2 @@
+mkdocs 
+mkdocs-material

Some files were not shown because too many files changed in this diff