Commit 503cdbc654305d8cce1143acaad2fe8f27774618
1 parent
abcd4f46
feat: init commit
Showing
19 changed files
with
489 additions
and
0 deletions
garbage-removal/.env.preview
0 → 100644
garbage-removal/.env.production
0 → 100644
garbage-removal/.gitignore
0 → 100644
| 1 | +# Logs | ||
| 2 | +logs | ||
| 3 | +*.log | ||
| 4 | +npm-debug.log* | ||
| 5 | +yarn-debug.log* | ||
| 6 | +yarn-error.log* | ||
| 7 | +pnpm-debug.log* | ||
| 8 | +lerna-debug.log* | ||
| 9 | + | ||
| 10 | +node_modules | ||
| 11 | +.DS_Store | ||
| 12 | +dist | ||
| 13 | +*.local | ||
| 14 | + | ||
| 15 | +# Editor directories and files | ||
| 16 | +.idea | ||
| 17 | +*.suo | ||
| 18 | +*.ntvs* | ||
| 19 | +*.njsproj | ||
| 20 | +*.sln | ||
| 21 | +*.sw? | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
garbage-removal/index.html
0 → 100644
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html lang="en"> | ||
| 3 | + <head> | ||
| 4 | + <meta charset="UTF-8" /> | ||
| 5 | + <script> | ||
| 6 | + var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || | ||
| 7 | + CSS.supports('top: constant(a)')) | ||
| 8 | + document.write( | ||
| 9 | + '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + | ||
| 10 | + (coverSupport ? ', viewport-fit=cover' : '') + '" />') | ||
| 11 | + </script> | ||
| 12 | + <title></title> | ||
| 13 | + <!--preload-links--> | ||
| 14 | + <!--app-context--> | ||
| 15 | + </head> | ||
| 16 | + <body> | ||
| 17 | + <div id="app"><!--app-html--></div> | ||
| 18 | + <script type="module" src="/src/main.js"></script> | ||
| 19 | + </body> | ||
| 20 | +</html> |
garbage-removal/package.json
0 → 100644
| 1 | +{ | ||
| 2 | + "name": "uni-preset-vue", | ||
| 3 | + "version": "0.0.0", | ||
| 4 | + "scripts": { | ||
| 5 | + "dev:app": "uni -p app", | ||
| 6 | + "dev:app-android": "uni -p app-android", | ||
| 7 | + "dev:app-ios": "uni -p app-ios", | ||
| 8 | + "dev:custom": "uni -p", | ||
| 9 | + "dev:h5": "uni", | ||
| 10 | + "dev:h5:ssr": "uni --ssr", | ||
| 11 | + "dev:mp-alipay": "uni -p mp-alipay", | ||
| 12 | + "dev:mp-baidu": "uni -p mp-baidu", | ||
| 13 | + "dev:mp-jd": "uni -p mp-jd", | ||
| 14 | + "dev:mp-kuaishou": "uni -p mp-kuaishou", | ||
| 15 | + "dev:mp-lark": "uni -p mp-lark", | ||
| 16 | + "dev:mp-qq": "uni -p mp-qq", | ||
| 17 | + "dev:mp-toutiao": "uni -p mp-toutiao", | ||
| 18 | + "dev:mp-weixin": "uni -p mp-weixin", | ||
| 19 | + "dev:mp-xhs": "uni -p mp-xhs", | ||
| 20 | + "dev:quickapp-webview": "uni -p quickapp-webview", | ||
| 21 | + "dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei", | ||
| 22 | + "dev:quickapp-webview-union": "uni -p quickapp-webview-union", | ||
| 23 | + "build:app": "uni build -p app", | ||
| 24 | + "build:app-android": "uni build -p app-android", | ||
| 25 | + "build:app-ios": "uni build -p app-ios", | ||
| 26 | + "build:custom": "uni build -p", | ||
| 27 | + "build:h5": "uni build", | ||
| 28 | + "build:h5:ssr": "uni build --ssr", | ||
| 29 | + "build:mp-alipay": "uni build -p mp-alipay", | ||
| 30 | + "build:mp-baidu": "uni build -p mp-baidu", | ||
| 31 | + "build:mp-jd": "uni build -p mp-jd", | ||
| 32 | + "build:mp-kuaishou": "uni build -p mp-kuaishou", | ||
| 33 | + "build:mp-lark": "uni build -p mp-lark", | ||
| 34 | + "build:mp-qq": "uni build -p mp-qq", | ||
| 35 | + "build:mp-toutiao": "uni build -p mp-toutiao", | ||
| 36 | + "build:mp-weixin": "uni build -p mp-weixin", | ||
| 37 | + "build:mp-xhs": "uni build -p mp-xhs", | ||
| 38 | + "build:quickapp-webview": "uni build -p quickapp-webview", | ||
| 39 | + "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei", | ||
| 40 | + "build:quickapp-webview-union": "uni build -p quickapp-webview-union" | ||
| 41 | + }, | ||
| 42 | + "dependencies": { | ||
| 43 | + "@dcloudio/uni-app": "3.0.0-3090620231104002", | ||
| 44 | + "@dcloudio/uni-app-plus": "3.0.0-3090620231104002", | ||
| 45 | + "@dcloudio/uni-components": "3.0.0-3090620231104002", | ||
| 46 | + "@dcloudio/uni-h5": "3.0.0-3090620231104002", | ||
| 47 | + "@dcloudio/uni-mp-alipay": "3.0.0-3090620231104002", | ||
| 48 | + "@dcloudio/uni-mp-baidu": "3.0.0-3090620231104002", | ||
| 49 | + "@dcloudio/uni-mp-jd": "3.0.0-3090620231104002", | ||
| 50 | + "@dcloudio/uni-mp-kuaishou": "3.0.0-3090620231104002", | ||
| 51 | + "@dcloudio/uni-mp-lark": "3.0.0-3090620231104002", | ||
| 52 | + "@dcloudio/uni-mp-qq": "3.0.0-3090620231104002", | ||
| 53 | + "@dcloudio/uni-mp-toutiao": "3.0.0-3090620231104002", | ||
| 54 | + "@dcloudio/uni-mp-weixin": "3.0.0-3090620231104002", | ||
| 55 | + "@dcloudio/uni-mp-xhs": "3.0.0-3090620231104002", | ||
| 56 | + "@dcloudio/uni-quickapp-webview": "3.0.0-3090620231104002", | ||
| 57 | + "vue": "^3.2.45", | ||
| 58 | + "vue-i18n": "^9.1.9" | ||
| 59 | + }, | ||
| 60 | + "devDependencies": { | ||
| 61 | + "@dcloudio/types": "^3.3.2", | ||
| 62 | + "@dcloudio/uni-automator": "3.0.0-3090620231104002", | ||
| 63 | + "@dcloudio/uni-cli-shared": "3.0.0-3090620231104002", | ||
| 64 | + "@dcloudio/uni-stacktracey": "3.0.0-3090620231104002", | ||
| 65 | + "@dcloudio/vite-plugin-uni": "3.0.0-3090620231104002", | ||
| 66 | + "@vue/runtime-core": "^3.2.45", | ||
| 67 | + "vite": "4.0.3" | ||
| 68 | + } | ||
| 69 | +} |
garbage-removal/shims-uni.d.ts
0 → 100644
garbage-removal/src/App.vue
0 → 100644
garbage-removal/src/apis/index.js
0 → 100644
| 1 | +export * from "./user"; |
garbage-removal/src/apis/user.js
0 → 100644
| 1 | +import { request } from "@/utils"; | ||
| 2 | + | ||
| 3 | +const prefix = "/user"; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @method 用户登录 | ||
| 8 | + */ | ||
| 9 | +export async function userLogin() { | ||
| 10 | + return await request.post<Response<string>>( | ||
| 11 | + `${prefix}/login`, | ||
| 12 | + params, | ||
| 13 | + config | ||
| 14 | + ); | ||
| 15 | +} | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * @method 获取用户信息 | ||
| 19 | + */ | ||
| 20 | +export async function getUserInfo(config) { | ||
| 21 | + return await request.get(`${prefix}/getUserInfo`, config); | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * @method 发送验证码 | ||
| 26 | + */ | ||
| 27 | +export function sendCode() { | ||
| 28 | + return request.get(`${prefix}/sendCode`); | ||
| 29 | +} |
garbage-removal/src/main.js
0 → 100644
garbage-removal/src/manifest.json
0 → 100644
| 1 | +{ | ||
| 2 | + "name" : "", | ||
| 3 | + "appid" : "", | ||
| 4 | + "description" : "", | ||
| 5 | + "versionName" : "1.0.0", | ||
| 6 | + "versionCode" : "100", | ||
| 7 | + "transformPx" : false, | ||
| 8 | + /* 5+App特有相关 */ | ||
| 9 | + "app-plus" : { | ||
| 10 | + "usingComponents" : true, | ||
| 11 | + "nvueStyleCompiler" : "uni-app", | ||
| 12 | + "compilerVersion" : 3, | ||
| 13 | + "splashscreen" : { | ||
| 14 | + "alwaysShowBeforeRender" : true, | ||
| 15 | + "waiting" : true, | ||
| 16 | + "autoclose" : true, | ||
| 17 | + "delay" : 0 | ||
| 18 | + }, | ||
| 19 | + /* 模块配置 */ | ||
| 20 | + "modules" : {}, | ||
| 21 | + /* 应用发布信息 */ | ||
| 22 | + "distribute" : { | ||
| 23 | + /* android打包配置 */ | ||
| 24 | + "android" : { | ||
| 25 | + "permissions" : [ | ||
| 26 | + "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", | ||
| 27 | + "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", | ||
| 28 | + "<uses-permission android:name=\"android.permission.VIBRATE\"/>", | ||
| 29 | + "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", | ||
| 30 | + "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", | ||
| 31 | + "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", | ||
| 32 | + "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", | ||
| 33 | + "<uses-permission android:name=\"android.permission.CAMERA\"/>", | ||
| 34 | + "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", | ||
| 35 | + "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", | ||
| 36 | + "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", | ||
| 37 | + "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", | ||
| 38 | + "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", | ||
| 39 | + "<uses-feature android:name=\"android.hardware.camera\"/>", | ||
| 40 | + "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" | ||
| 41 | + ] | ||
| 42 | + }, | ||
| 43 | + /* ios打包配置 */ | ||
| 44 | + "ios" : {}, | ||
| 45 | + /* SDK配置 */ | ||
| 46 | + "sdkConfigs" : {} | ||
| 47 | + } | ||
| 48 | + }, | ||
| 49 | + /* 快应用特有相关 */ | ||
| 50 | + "quickapp" : {}, | ||
| 51 | + /* 小程序特有相关 */ | ||
| 52 | + "mp-weixin" : { | ||
| 53 | + "appid" : "", | ||
| 54 | + "setting" : { | ||
| 55 | + "urlCheck" : false | ||
| 56 | + }, | ||
| 57 | + "usingComponents" : true | ||
| 58 | + }, | ||
| 59 | + "mp-alipay" : { | ||
| 60 | + "usingComponents" : true | ||
| 61 | + }, | ||
| 62 | + "mp-baidu" : { | ||
| 63 | + "usingComponents" : true | ||
| 64 | + }, | ||
| 65 | + "mp-toutiao" : { | ||
| 66 | + "usingComponents" : true | ||
| 67 | + }, | ||
| 68 | + "uniStatistics": { | ||
| 69 | + "enable": false | ||
| 70 | + }, | ||
| 71 | + "vueVersion" : "3" | ||
| 72 | +} |
garbage-removal/src/pages.json
0 → 100644
| 1 | +{ | ||
| 2 | + "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages | ||
| 3 | + { | ||
| 4 | + "path": "pages/index/index", | ||
| 5 | + "style": { | ||
| 6 | + "navigationBarTitleText": "uni-app" | ||
| 7 | + } | ||
| 8 | + } | ||
| 9 | + ], | ||
| 10 | + "globalStyle": { | ||
| 11 | + "navigationBarTextStyle": "black", | ||
| 12 | + "navigationBarTitleText": "uni-app", | ||
| 13 | + "navigationBarBackgroundColor": "#F8F8F8", | ||
| 14 | + "backgroundColor": "#F8F8F8" | ||
| 15 | + } | ||
| 16 | +} |
garbage-removal/src/pages/index/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view class="content"> | ||
| 3 | + <image class="logo" src="/static/logo.png"></image> | ||
| 4 | + <view class="text-area"> | ||
| 5 | + <text class="title">{{ title }}</text> | ||
| 6 | + </view> | ||
| 7 | + </view> | ||
| 8 | +</template> | ||
| 9 | + | ||
| 10 | +<script> | ||
| 11 | +export default { | ||
| 12 | + data() { | ||
| 13 | + return { | ||
| 14 | + title: 'Hello', | ||
| 15 | + } | ||
| 16 | + }, | ||
| 17 | + onLoad() {}, | ||
| 18 | + methods: {}, | ||
| 19 | +} | ||
| 20 | +</script> | ||
| 21 | + | ||
| 22 | +<style> | ||
| 23 | +.content { | ||
| 24 | + display: flex; | ||
| 25 | + flex-direction: column; | ||
| 26 | + align-items: center; | ||
| 27 | + justify-content: center; | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +.logo { | ||
| 31 | + height: 200rpx; | ||
| 32 | + width: 200rpx; | ||
| 33 | + margin-top: 200rpx; | ||
| 34 | + margin-left: auto; | ||
| 35 | + margin-right: auto; | ||
| 36 | + margin-bottom: 50rpx; | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +.text-area { | ||
| 40 | + display: flex; | ||
| 41 | + justify-content: center; | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +.title { | ||
| 45 | + font-size: 36rpx; | ||
| 46 | + color: #8f8f94; | ||
| 47 | +} | ||
| 48 | +</style> |
garbage-removal/src/shime-uni.d.ts
0 → 100644
garbage-removal/src/static/logo.png
0 → 100644
3.93 KB
garbage-removal/src/uni.scss
0 → 100644
| 1 | +/** | ||
| 2 | + * 这里是uni-app内置的常用样式变量 | ||
| 3 | + * | ||
| 4 | + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 | ||
| 5 | + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App | ||
| 6 | + * | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 | ||
| 11 | + * | ||
| 12 | + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 | ||
| 13 | + */ | ||
| 14 | + | ||
| 15 | +/* 颜色变量 */ | ||
| 16 | + | ||
| 17 | +/* 行为相关颜色 */ | ||
| 18 | +$uni-color-primary: #007aff; | ||
| 19 | +$uni-color-success: #4cd964; | ||
| 20 | +$uni-color-warning: #f0ad4e; | ||
| 21 | +$uni-color-error: #dd524d; | ||
| 22 | + | ||
| 23 | +/* 文字基本颜色 */ | ||
| 24 | +$uni-text-color: #333; // 基本色 | ||
| 25 | +$uni-text-color-inverse: #fff; // 反色 | ||
| 26 | +$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息 | ||
| 27 | +$uni-text-color-placeholder: #808080; | ||
| 28 | +$uni-text-color-disable: #c0c0c0; | ||
| 29 | + | ||
| 30 | +/* 背景颜色 */ | ||
| 31 | +$uni-bg-color: #fff; | ||
| 32 | +$uni-bg-color-grey: #f8f8f8; | ||
| 33 | +$uni-bg-color-hover: #f1f1f1; // 点击状态颜色 | ||
| 34 | +$uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色 | ||
| 35 | + | ||
| 36 | +/* 边框颜色 */ | ||
| 37 | +$uni-border-color: #c8c7cc; | ||
| 38 | + | ||
| 39 | +/* 尺寸变量 */ | ||
| 40 | + | ||
| 41 | +/* 文字尺寸 */ | ||
| 42 | +$uni-font-size-sm: 12px; | ||
| 43 | +$uni-font-size-base: 14px; | ||
| 44 | +$uni-font-size-lg: 16; | ||
| 45 | + | ||
| 46 | +/* 图片尺寸 */ | ||
| 47 | +$uni-img-size-sm: 20px; | ||
| 48 | +$uni-img-size-base: 26px; | ||
| 49 | +$uni-img-size-lg: 40px; | ||
| 50 | + | ||
| 51 | +/* Border Radius */ | ||
| 52 | +$uni-border-radius-sm: 2px; | ||
| 53 | +$uni-border-radius-base: 3px; | ||
| 54 | +$uni-border-radius-lg: 6px; | ||
| 55 | +$uni-border-radius-circle: 50%; | ||
| 56 | + | ||
| 57 | +/* 水平间距 */ | ||
| 58 | +$uni-spacing-row-sm: 5px; | ||
| 59 | +$uni-spacing-row-base: 10px; | ||
| 60 | +$uni-spacing-row-lg: 15px; | ||
| 61 | + | ||
| 62 | +/* 垂直间距 */ | ||
| 63 | +$uni-spacing-col-sm: 4px; | ||
| 64 | +$uni-spacing-col-base: 8px; | ||
| 65 | +$uni-spacing-col-lg: 12px; | ||
| 66 | + | ||
| 67 | +/* 透明度 */ | ||
| 68 | +$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 | ||
| 69 | + | ||
| 70 | +/* 文章场景相关 */ | ||
| 71 | +$uni-color-title: #2c405a; // 文章标题颜色 | ||
| 72 | +$uni-font-size-title: 20px; | ||
| 73 | +$uni-color-subtitle: #555; // 二级标题颜色 | ||
| 74 | +$uni-font-size-subtitle: 18px; | ||
| 75 | +$uni-color-paragraph: #3f536e; // 文章段落颜色 | ||
| 76 | +$uni-font-size-paragraph: 15px; | ||
| 0 | \ No newline at end of file | 77 | \ No newline at end of file |
garbage-removal/src/utils/index.js
0 → 100644
garbage-removal/src/utils/request.js
0 → 100644
| 1 | +import axios from "axios"; | ||
| 2 | +import settle from "axios/lib/core/settle"; | ||
| 3 | +import buildURL from "axios/lib/helpers/buildURL"; | ||
| 4 | +axios.defaults.adapter = function (config) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + const timer = setTimeout(() => { | ||
| 7 | + uni.showLoading({ | ||
| 8 | + title: "加载中...", | ||
| 9 | + }); | ||
| 10 | + }, 500); | ||
| 11 | + const request = uni.request({ | ||
| 12 | + method: config.method.toUpperCase(), | ||
| 13 | + url: | ||
| 14 | + config.baseURL + | ||
| 15 | + buildURL(config.url, config.params, config.paramsSerializer), | ||
| 16 | + header: config.headers, | ||
| 17 | + data: config.data, | ||
| 18 | + dataType: config.dataType, | ||
| 19 | + responseType: config.responseType, | ||
| 20 | + sslVerify: config.sslVerify, | ||
| 21 | + complete(response) { | ||
| 22 | + clearTimeout(timer); | ||
| 23 | + uni.hideLoading(); | ||
| 24 | + response = { | ||
| 25 | + data: response.data, | ||
| 26 | + status: response.statusCode, | ||
| 27 | + errMsg: response.errMsg, | ||
| 28 | + header: response.header, | ||
| 29 | + config: config, | ||
| 30 | + }; | ||
| 31 | + settle(resolve, reject, response); | ||
| 32 | + }, | ||
| 33 | + }); | ||
| 34 | + if (config.cancelToken) { | ||
| 35 | + config.cancelToken.promise.then((cancel) => { | ||
| 36 | + if (!request) { | ||
| 37 | + return; | ||
| 38 | + } | ||
| 39 | + request.abort(); | ||
| 40 | + reject(cancel); | ||
| 41 | + }); | ||
| 42 | + } | ||
| 43 | + }); | ||
| 44 | +}; | ||
| 45 | + | ||
| 46 | +const instance = axios.create({ | ||
| 47 | + baseURL: import.meta.env.VITE_BASE_URL, | ||
| 48 | + timeout: 10000, | ||
| 49 | +}); | ||
| 50 | +// 请求拦截器 | ||
| 51 | +instance.interceptors.request.use((config) => { | ||
| 52 | + console.log("请求拦截器", config); | ||
| 53 | + | ||
| 54 | + return config; | ||
| 55 | +}); | ||
| 56 | +// 响应拦截器 | ||
| 57 | +instance.interceptors.response.use((response) => { | ||
| 58 | + console.log("响应拦截器", response); | ||
| 59 | + if (response.data.code != 200) { | ||
| 60 | + uni.showToast({ | ||
| 61 | + title: response.data.message, | ||
| 62 | + icon: "none", | ||
| 63 | + }); | ||
| 64 | + if (response.data.code == 401) { | ||
| 65 | + uni.navigateTo({ | ||
| 66 | + url: "/pages/login/index", | ||
| 67 | + }); | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + return response; | ||
| 71 | +}); | ||
| 72 | +export default instance; | ||
| 73 | + | ||
| 74 | +export function setRequestToken(token) { | ||
| 75 | + instance.defaults.headers.common["Authorization"] = `${token}`; | ||
| 76 | +} |