diff --git a/.gitignore b/.gitignore index c66359b..a268969 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .hbuilderx node_modules -/unpackage -uni_modules \ No newline at end of file +unpackage diff --git a/.vite/deps/package.json b/.vite/deps/package.json deleted file mode 100644 index 7c34deb..0000000 --- a/.vite/deps/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/App.vue b/App.vue index da04a07..34d965b 100644 --- a/App.vue +++ b/App.vue @@ -1,55 +1,64 @@ + - diff --git a/README.md b/README.md deleted file mode 100644 index 5344d44..0000000 --- a/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# 鹿和开发套件 - -## 使用清单 - -- ⚡️ [Vue 3](https://github.com/vuejs/vue-next), [Vite 2](https://github.com/vitejs/vite) - 又新又快! -- ✅ 使用了 [新的 ` - - diff --git a/components/Login/Login.vue b/components/Login/Login.vue deleted file mode 100644 index df17832..0000000 --- a/components/Login/Login.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - diff --git a/components/uni-section/uni-section.vue b/components/uni-section/uni-section.vue new file mode 100644 index 0000000..a68c7b7 --- /dev/null +++ b/components/uni-section/uni-section.vue @@ -0,0 +1,140 @@ + + + + diff --git a/index.html b/index.html index eb88455..9efb733 100644 --- a/index.html +++ b/index.html @@ -1,14 +1,14 @@ - - - - - - 鹿和开发套件 - - - -
- - + + + + + + + + + + +
+ + diff --git a/lu/axios.js b/lu/axios.js new file mode 100644 index 0000000..0baaa0c --- /dev/null +++ b/lu/axios.js @@ -0,0 +1,34 @@ +import { + getToken +} from './token.js' +import $api from '@/api/api.js' +let requests = {}; + +const noLogin = [ + 'YO', +] + +export const $post = async ({ + url, + data = {} +}) => { + let token = getToken() ? getToken() : ''; + if (noLogin.indexOf(url) === -1 && token === '') return false + if (requests[url]) return false; + requests[url] = true + let res = await uni.request({ + url: $api(url), + method: 'post', + data, + headers: { + Authorization: 'Bearer ' + getToken() + } + }); + requests[url] = false + if (!!res && res.data != '') { + return res.data + } else { + uni.$lu.toast("请求发生错误") + return false + } +} diff --git a/lu/post.js b/lu/post.js deleted file mode 100644 index 54cc920..0000000 --- a/lu/post.js +++ /dev/null @@ -1,56 +0,0 @@ -import { - getToken, - delToken -} from '../tool/member.js'; -import $api from "../api/api.js" - -const noLogin = [ - '用户信息', - '微信登录', - '基础参数', -] -const expirationJumpPath = '/pages/main/login/login' - -const post = (e) => { - if (typeof e.url === 'undefined') return console.error({ - 'data': { - 'message': 'URL没有定义' - }, - 'state': 201 - }); - let url = e.url; - let token = getToken() ? getToken() : ''; - if (noLogin.indexOf(url) === -1 && token === '') return false - let data = typeof e.data === 'undefined' ? {} : e.data; - let done = typeof e.done === 'undefined' ? response => console.log(response) : e.done; - let then = typeof e.then === 'undefined' ? response => console.log(response) : e.then; - let error = typeof e.error === 'undefined' ? err => console.log(err) : e.error; - data.SYSTEM_TYPE = 'WMP'; - let header = typeof e.header === 'undefined' ? { - 'content-type': 'application/json', - 'Authorization': `Bearer ${token}` - } : { - 'content-type': 'application/json', - ...e.header - }; - uni.request({ - url: $api(url), - method: 'POST', - data: data, - header: header, - success: (res) => { - done(res.data) - if (Number(res.data.code) === 20003) { - delToken() - uni.navigateTo({ - url: expirationJumpPath - }) - } else { - then(res.data) - } - }, - fail: (e) => error(e) - }); -} - -export default post; diff --git a/lu/response.js b/lu/response.js deleted file mode 100644 index 9f06113..0000000 --- a/lu/response.js +++ /dev/null @@ -1,10 +0,0 @@ -const response = (e) => { - const response = e.response - const then = typeof e.then === 'undefined' ? (response) => console.log(response) : e.then - const done = typeof e.done === 'undefined' ? (response) => console.log(response) : e.done - const error = typeof e.error === 'undefined' ? (response) => console.log(response) : e.error - done(response) - if (response.code === 200) then(response) - if (response.code !== 200) error(response) -} -export default response; diff --git a/tool/member.js b/lu/token.js similarity index 100% rename from tool/member.js rename to lu/token.js diff --git a/main.js b/main.js index 0157f60..da46995 100644 --- a/main.js +++ b/main.js @@ -1,22 +1,13 @@ -import App from './App' - -import uView from './uni_modules/vk-uview-ui'; -import Store from './store' +import { createSSRApp } from 'vue' +import store from './store' +import App from './App.vue' import $lu from './lu' -import $img from './api/img.js' - -import { - createSSRApp -} from 'vue' + uni.$lu = $lu -uni.$img = $img -export function createApp() { - const app = createSSRApp(App) - - app.use(uView) - app.use(Store) - - return { - app - } -} +export function createApp() { + const app = createSSRApp(App) + app.use(store) + return { + app + } +} diff --git a/manifest.json b/manifest.json index 886e1e7..05a653c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,27 +1,27 @@ { - "name" : "鹿和开发套件", - "appid" : "__UNI__4C3CB5F", + "name" : "uni-ui", + "appid" : "__UNI__ECA4C02", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", "transformPx" : false, - /* 5+App特有相关 */ "app-plus" : { + /* 5+App特有相关 */ "usingComponents" : true, + "nvueCompiler" : "uni-app", "nvueStyleCompiler" : "uni-app", - "compilerVersion" : 3, "splashscreen" : { "alwaysShowBeforeRender" : true, "waiting" : true, "autoclose" : true, "delay" : 0 }, - /* 模块配置 */ "modules" : {}, - /* 应用发布信息 */ + /* 模块配置 */ "distribute" : { - /* android打包配置 */ + /* 应用发布信息 */ "android" : { + /* android打包配置 */ "permissions" : [ "", "", @@ -40,33 +40,21 @@ "" ] }, - /* ios打包配置 */ "ios" : {}, - /* SDK配置 */ + /* ios打包配置 */ "sdkConfigs" : {} } }, - /* 快应用特有相关 */ + /* SDK配置 */ "quickapp" : {}, - /* 小程序特有相关 */ + /* 快应用特有相关 */ "mp-weixin" : { + /* 小程序特有相关 */ "appid" : "wxc90b858cee392865", "setting" : { "urlCheck" : false }, "usingComponents" : true }, - "mp-alipay" : { - "usingComponents" : true - }, - "mp-baidu" : { - "usingComponents" : true - }, - "mp-toutiao" : { - "usingComponents" : true - }, - "uniStatistics" : { - "enable" : false - }, "vueVersion" : "3" } diff --git a/pages.json b/pages.json index c10e876..17901e0 100644 --- a/pages.json +++ b/pages.json @@ -1,71 +1,29 @@ { + "pages": [{ + "path": "pages/main/home/home", + "style": { + "navigationBarTitleText": "鹿和开发套件", + "enablePullDownRefresh": false + } + }], + "subPackages": [{ + "root": "pages/dev", "pages": [{ - "path": "pages/main/home/home", - "style": { - "navigationBarTitleText": "鹿和开发套件", - "enablePullDownRefresh": false - } - }, { - "path": "pages/main/user/user", - "style": { - "navigationBarTitleText": "我的", - "enablePullDownRefresh": false - } - }, { - "path": "pages/main/login/login", - "style": { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - }], - "subPackages": [{ - "root": "pages/dev", - "pages": [{ - "path": "dev/dev", - "style": { - "navigationBarTitleText": "示例", - "enablePullDownRefresh": false, - "navigationStyle": "custom" - } - - }] - }, { - "root": "pages/user", - "pages": [{ - "path": "set_info/set_info", - "style": { - "navigationBarTitleText": "个人信息", - "enablePullDownRefresh": false - } - - }] - }], - "tabBar": { - "color": "#7A7E83", - "selectedColor": "#333333", - "borderStyle": "white", - "backgroundColor": "#ffffff", - "list": [{ - "pagePath": "pages/main/home/home", - "iconPath": "static/tabbar/hof.png", - "selectedIconPath": "static/tabbar/hon.png", - "text": "YO" - }, { - "pagePath": "pages/main/user/user", - "iconPath": "static/tabbar/hof.png", - "selectedIconPath": "static/tabbar/hon.png", - "text": "HA" - }] - }, - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "uni-app", - "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8" - }, - "easycom": { - "Login": "@/components/Login/Login.vue", - "Loading": "@/components/Loading/Loading.vue" + "path": "dev/dev", + "style": { + "navigationBarTitleText": "示例", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + }] + }], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "鹿和开发套件", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8", + "app-plus": { + "background": "#efeff4" } + } } diff --git a/pages/dev/dev/Api/Api.vue b/pages/dev/dev/Api/Api.vue index b473368..e4e6f6a 100644 --- a/pages/dev/dev/Api/Api.vue +++ b/pages/dev/dev/Api/Api.vue @@ -1,30 +1,30 @@ diff --git a/pages/dev/dev/Navbar/Navbar.vue b/pages/dev/dev/Navbar/Navbar.vue index ea3c64a..61eac85 100644 --- a/pages/dev/dev/Navbar/Navbar.vue +++ b/pages/dev/dev/Navbar/Navbar.vue @@ -1,10 +1,10 @@ - -