dai-vue-temp-m
更改列表
.babelrc 4(+4 -0)
.gitignore 2(+2 -0)
.prettierrc 16(+16 -0)
build/build.js 3(+3 -0)
build/config.js 18(+18 -0)
build/dev.js 3(+3 -0)
desktop.ini 6(+6 -0)
main/config/config.js 28(+28 -0)
main/config/config.pro.js 14(+14 -0)
main/config/config.test.js 10(+10 -0)
main/favicon.ico 0(+0 -0)
main/index.html 22(+22 -0)
main/index.js 39(+39 -0)
main/interceptor.js 62(+62 -0)
main/modules.js 2(+2 -0)
main/store.js 21(+21 -0)
main/style.less 2(+2 -0)
package.json 14(+14 -0)
types/type.d.ts 154(+154 -0)
详细信息
.babelrc 4(+4 -0)
diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..3364bf8
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,4 @@
+{
+ "presets": ["@babel/preset-env"],
+ "plugins": ["@babel/plugin-transform-runtime", "@babel/plugin-proposal-class-properties"]
+}
.gitignore 2(+2 -0)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..04c01ba
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+node_modules/
+dist/
\ No newline at end of file
.prettierrc 16(+16 -0)
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..6c1a4ff
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,16 @@
+{
+ "printWidth": 120,
+ "tabWidth": 4,
+ "semi": true,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "bracketSpacing": true,
+ "jsxBracketSameLine": false,
+ "arrowParens": "always",
+ "requirePragma": false,
+ "proseWrap": "preserve",
+ "stylelintIntegration": true,
+ "stylelint.config": {
+ "indentation": 2
+ }
+}
build/build.js 3(+3 -0)
diff --git a/build/build.js b/build/build.js
new file mode 100644
index 0000000..1619b98
--- /dev/null
+++ b/build/build.js
@@ -0,0 +1,3 @@
+var webpackBuild = require('dai-vue/src/build/webpack.build.js');
+var config = require('./config.js');
+webpackBuild(config);
build/config.js 18(+18 -0)
diff --git a/build/config.js b/build/config.js
new file mode 100644
index 0000000..f953db5
--- /dev/null
+++ b/build/config.js
@@ -0,0 +1,18 @@
+module.exports = config = {
+ //打包目标目录
+ buildPath: './dist/',
+ copy: [
+ // {
+ // //源目录/文件
+ // from: './html',
+ // //目标目录/文件
+ // to: '../../../web-dist/web-zi-mobile/dist/html'
+ // },
+ {
+ //源目录/文件
+ from: '../../../web-dist/web-zi-mobile',
+ //目标目录/文件
+ to: '../web-zi-uniapp/hybrid/html'
+ }
+ ]
+};
build/dev.js 3(+3 -0)
diff --git a/build/dev.js b/build/dev.js
new file mode 100644
index 0000000..8313d6a
--- /dev/null
+++ b/build/dev.js
@@ -0,0 +1,3 @@
+var webpackDev = require('dai-vue/src/build/webpack.dev.js');
+var config = require('./config.js');
+webpackDev(config);
desktop.ini 6(+6 -0)
diff --git a/desktop.ini b/desktop.ini
new file mode 100644
index 0000000..84805f1
--- /dev/null
+++ b/desktop.ini
@@ -0,0 +1,6 @@
+[.ShellClassInfo]
+InfoTip=DaiVue �IJ�����Ŀ
+[ViewState]
+Mode=
+Vid=
+FolderType=Generic
main/config/config.js 28(+28 -0)
diff --git a/main/config/config.js b/main/config/config.js
new file mode 100644
index 0000000..2991c37
--- /dev/null
+++ b/main/config/config.js
@@ -0,0 +1,28 @@
+import extend from 'extend2';
+import configTest from './config.test.js';
+import configPro from './config.pro.js';
+/**默认的开发设置 测试及生产请单独设置 */
+var configDefault = {
+ //是否开发模式
+ isDev: true,
+ domain: 'http://localhost:8881',
+ //必须要有的
+ version: '1.0.1',
+ //服务器配置
+ server: {},
+ //接口服务配置
+ service: {
+ default: 'http://192.168.88.88:8010'
+ }
+};
+//根据环境合并
+var config = {};
+if (process.env.NODE_ENV == 'development') {
+} else if (process.env.NODE_ENV == 'test') {
+ config = extend(true, {}, configDefault, configTest);
+ config.isDev = true;
+} else {
+ config = extend(true, {}, configDefault, configPro);
+ config.isDev = false;
+}
+export default config;
main/config/config.pro.js 14(+14 -0)
diff --git a/main/config/config.pro.js b/main/config/config.pro.js
new file mode 100644
index 0000000..fcc1a29
--- /dev/null
+++ b/main/config/config.pro.js
@@ -0,0 +1,14 @@
+/**
+ * 生产环境配置
+ */
+const config = {
+ //是否开发模式
+ isDev: false,
+ domain: 'https://m.tuxiaoguai.com',
+ //接口服务配置
+ service: {
+ default: 'https://api.tuxiaoguai.com'
+ }
+};
+
+export default config;
main/config/config.test.js 10(+10 -0)
diff --git a/main/config/config.test.js b/main/config/config.test.js
new file mode 100644
index 0000000..b04a19e
--- /dev/null
+++ b/main/config/config.test.js
@@ -0,0 +1,10 @@
+/**
+ * 开发环境配置
+ */
+const config = {
+ //是否开发模式
+ isDev: false,
+ service: {}
+};
+
+export default config;
main/favicon.ico 0(+0 -0)
diff --git a/main/favicon.ico b/main/favicon.ico
new file mode 100644
index 0000000..0eed320
Binary files /dev/null and b/main/favicon.ico differ
main/index.html 22(+22 -0)
diff --git a/main/index.html b/main/index.html
new file mode 100644
index 0000000..f7ada08
--- /dev/null
+++ b/main/index.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta
+ name="viewport"
+ content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
+ />
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <!-- 禁止缓存 -->
+ <!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="0" /> -->
+ <title><%= htmlWebpackPlugin.options.title %></title>
+ </head>
+ <body class="tgj-body">
+ <div id="dai-app" class="dai-app d-box-v">
+ <router-view class="d-box-flex"></router-view>
+ </div>
+ <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
+ <script src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
+ </body>
+</html>
main/index.js 39(+39 -0)
diff --git a/main/index.js b/main/index.js
new file mode 100644
index 0000000..3a37159
--- /dev/null
+++ b/main/index.js
@@ -0,0 +1,39 @@
+import Vue from 'vue';
+import { DaiVue } from 'dai-vue';
+import modules from './modules.js';
+import config from './config/config.js';
+import interceptor from './interceptor.js';
+import store from './store.js';
+import { mapGetters } from 'vuex';
+
+import './style.less';
+
+window.baseVue = DaiVue(
+ {
+ el: '#dai-app',
+ store,
+ data() {
+ return {};
+ },
+ methods: {},
+ created: function () {},
+ watch: {},
+ components: {},
+ //计算属性
+ computed: {
+ ...mapGetters(['vx_userInfo'])
+ }
+ },
+ {
+ //全局配置
+ config,
+ //引用的所有模块
+ modules: modules,
+
+ use: {
+ // Vant: { plugin: Vant }
+ },
+ //http 拦截器
+ interceptor
+ }
+);
main/interceptor.js 62(+62 -0)
diff --git a/main/interceptor.js b/main/interceptor.js
new file mode 100644
index 0000000..a14f0aa
--- /dev/null
+++ b/main/interceptor.js
@@ -0,0 +1,62 @@
+const interceptor = {
+ //请求拦截
+ request(options) {
+ options.headers.token = localStorage.getItem('token');
+ },
+ //响应拦截
+ response(response, options) {
+ let obj = { isErr: false, data: '' };
+ if (response.status == '200') {
+ var json = response.data;
+ if (json.isErr) {
+ //如果显示错误信息,弹出错误,否则继续执行
+ if (options.showMsg) {
+ options.onError(this, '错误', json.errMsg);
+ this.$vue.$Notice.error({
+ title: '错误',
+ desc: json.errMsg
+ });
+ console.error(json.errMsg);
+ obj.isErr = true;
+ obj.data = json;
+ return obj;
+ } else {
+ //继续执行,内部处理错误
+ obj.isErr = false;
+ obj.data = json;
+ return obj;
+ }
+ } else {
+ //当现实返回消息时
+ if (options.showMsg) {
+ if (json.msg) {
+ // options.onMessage(this, '消息', json.msg);
+ this.$vue.$Notice.success({
+ title: json.msg,
+ // desc: nodesc ? '' : 'Here is the notification description. Here is the notification description. '
+ });
+ }
+ obj.isErr = false;
+ obj.data = json.data;
+ return obj;
+ }
+ //当不现实返回消息时
+ else {
+ obj.isErr = false;
+ obj.data = json;
+ return obj;
+ }
+ }
+ } else {
+ console.error(response);
+ if (options.showMsg) {
+ options.onError(this, '网络错误', '请联系管理员解决');
+ }
+ obj.isErr = true;
+ obj.data = '网络错误';
+ return obj;
+ }
+ return obj;
+ }
+};
+export default interceptor;
\ No newline at end of file
main/modules.js 2(+2 -0)
diff --git a/main/modules.js b/main/modules.js
new file mode 100644
index 0000000..d479e62
--- /dev/null
+++ b/main/modules.js
@@ -0,0 +1,2 @@
+
+export default { };
main/store.js 21(+21 -0)
diff --git a/main/store.js b/main/store.js
new file mode 100644
index 0000000..0d32ca2
--- /dev/null
+++ b/main/store.js
@@ -0,0 +1,21 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+Vue.use(Vuex);
+//创建VueX对象
+const store = new Vuex.Store({
+ state: {
+ //用户信息
+ vx_userInfo: {}
+ },
+ getters: {
+ vx_userInfo: (state) => state.vx_userInfo
+ },
+ mutations: {
+ vx_userInfo(state, userInfo) {
+ // 变更状态
+ state.userInfo = userInfo;
+ }
+ }
+});
+
+export default store;
main/style.less 2(+2 -0)
diff --git a/main/style.less b/main/style.less
new file mode 100644
index 0000000..332f5b2
--- /dev/null
+++ b/main/style.less
@@ -0,0 +1,2 @@
+//全局样式配置
+// @import '~dai-style/src/dai.less';
package.json 14(+14 -0)
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..4bbbe55
--- /dev/null
+++ b/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "dai-vue",
+ "version": "1.0.0",
+ "description": "dai-vue",
+ "main": "src/index.js",
+ "dependencies": {
+ },
+ "scripts": {
+ "dev": "node ./build/dev.js",
+ "build": "node ./build/build.js"
+ },
+ "author": "",
+ "license": "ISC"
+}
\ No newline at end of file
types/type.d.ts 154(+154 -0)
diff --git a/types/type.d.ts b/types/type.d.ts
new file mode 100644
index 0000000..4c078d4
--- /dev/null
+++ b/types/type.d.ts
@@ -0,0 +1,154 @@
+declare module uni {
+ // /**
+ // * 保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面。
+ // * @param object
+ // */
+ function navigateTo(object: object);
+ /**
+ * 关闭当前页面,跳转到应用内的某个页面。
+ * @param object
+ */
+ function redirectTo(object: object);
+ /**
+ * 关闭所有页面,打开到应用内的某个页面。
+ * @param object
+ */
+ function reLaunch(object: object);
+ /**
+ * 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
+ * @param object
+ */
+ function switchTab(object: object);
+ /**
+ * 关闭当前页面,返回上一页面或多级页面。
+ * @param object
+ */
+ function navigateBack(object: object): null;
+ /**
+ * 预加载页面,是一种性能优化技术。被预载的页面,在打开时速度更快。
+ * @param object {Object}
+ */
+ function preloadPage(object: object);
+ /**
+ * 将数据存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。
+ * @param object
+ */
+ function setStorage(object: object);
+ /**
+ * 将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。
+ * @param key
+ * @param value
+ */
+ function setStorageSync(key: string, value: string);
+ /**
+ * 从本地缓存中异步获取指定 key 对应的内容。
+ * @param object
+ */
+ function getStorage(object: object);
+ /**
+ * 从本地缓存中同步获取指定 key 对应的内容。
+ * @param key
+ */
+ function getStorageSync(key: string): string;
+ /**
+ * 异步获取当前 storage 的相关信息。
+ * @param object
+ */
+ function getStorageInfo(object: object);
+ /**
+ * 同步获取当前 storage 的相关信息。
+ * @param object
+ */
+ function getStorageInfoSync(object: string): object;
+ /**
+ * 从本地缓存中异步移除指定 key。
+ * @param object
+ */
+ function removeStorage(object: object);
+ /**
+ * 从本地缓存中同步移除指定 key。
+ * @param object
+ */
+ function removeStorageSync(object: object);
+ /**
+ * 同步清理本地数据缓存。
+ * @param object
+ */
+ function clearStorage(object: object);
+ /**
+ * 同步清理本地数据缓存。
+ * @param object
+ */
+ function clearStorageSync(object: object);
+ /**
+ * 获取当前的地理位置、速度。 在微信小程序中,当用户离开应用后,此接口无法调用,除非申请后台持续定位权限;当用户点击“显示在聊天顶部”时,此接口可继续调用。
+ * @param object
+ */
+ function getLocation(object: object);
+ /**
+ * 打开地图选择位置。
+ * @param object
+ */
+ function chooseLocation(object: object);
+ /**
+ * 使用应用内置地图查看位置。
+ * @param object
+ */
+ function openLocation(object: object);
+ /**
+ * 显示消息提示框。
+ * @param object
+ */
+ function showToast(object: object);
+ /**
+ * 隐藏消息框
+ * @param object
+ */
+ function hideToast(object: object);
+ /**
+ * 显示 loading 提示框, 需主动调用 uni.hideLoading 才能关闭提示框。
+ * @param object
+ */
+ function showLoading(object: object);
+ /**
+ * 隐藏 loading 提示框。
+ * @param object
+ */
+ function hideLoading(object: object);
+ /**
+ * 显示模态弹窗,可以只有一个确定按钮,也可以同时有确定和取消按钮。类似于一个API整合了 html 中:alert、confirm。
+ * @param object
+ */
+ function showModal(object: object);
+ /**
+ * 从底部向上弹出操作菜单
+ * @param object
+ */
+ function showActionSheet(object: object);
+ /**
+ * 动态设置当前页面的标题。
+ * @param object
+ */
+ function setNavigationBarTitle(object: object);
+ /**
+ * 设置页面导航条颜色。如果需要进入页面就设置颜色,请延迟执行,防止被框架内设置颜色逻辑覆盖
+ * @param object
+ */
+ function setNavigationBarColor(object: object);
+ /**
+ * 在当前页面显示导航条加载动画。
+ * @param object
+ */
+ function showNavigationBarLoading(object: object);
+ /**
+ * 在当前页面隐藏导航条加载动画。
+ * @param object
+ */
+ function hideNavigationBarLoading(object: object);
+ /**
+ * 隐藏返回首页按钮。
+ * @param object
+ */
+ function hideHomeButton(object: object);
+ function xxxxxxxxx(object: object);
+}