Commit a2b07068 authored by 李明环(东信)'s avatar 李明环(东信)

init

parent 061b364c
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
build
*.local
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.rexma
// .npmrc
public-hoist-pattern[]=@vue*
// or
// shamefully-hoist = true
/dist/*
.local
/node_modules/**
**/*.svg
**/*.sh
/public/*
stats.html
// @see: https://www.prettier.cn
module.exports = {
// 指定最大换行长度
printWidth: 130,
// 缩进制表符宽度 | 空格数
tabWidth: 4,
// 使用制表符而不是空格缩进行 (true:制表符,false:空格)
useTabs: false,
// 结尾不用分号 (true:有,false:没有)
semi: true,
// 使用单引号 (true:单引号,false:双引号)
singleQuote: false,
// 在对象字面量中决定是否将属性名用引号括起来 可选值 "<as-needed|consistent|preserve>"
quoteProps: "as-needed",
// 在JSX中使用单引号而不是双引号 (true:单引号,false:双引号)
jsxSingleQuote: false,
// 多行时尽可能打印尾随逗号 可选值"<none|es5|all>"
trailingComma: "none",
// 在对象,数组括号与文字之间加空格 "{ foo: bar }" (true:有,false:没有)
bracketSpacing: true,
// 将 > 多行元素放在最后一行的末尾,而不是单独放在下一行 (true:放末尾,false:单独一行)
bracketSameLine: false,
// (x) => {} 箭头函数参数只有一个时是否要有小括号 (avoid:省略括号,always:不省略括号)
arrowParens: "avoid",
// 指定要使用的解析器,不需要写文件开头的 @prettier
requirePragma: false,
// 可以在文件顶部插入一个特殊标记,指定该文件已使用 Prettier 格式化
insertPragma: false,
// 用于控制文本是否应该被换行以及如何进行换行
proseWrap: "preserve",
// 在html中空格是否是敏感的 "css" - 遵守 CSS 显示属性的默认值, "strict" - 空格被认为是敏感的 ,"ignore" - 空格被认为是不敏感的
htmlWhitespaceSensitivity: "css",
// 控制在 Vue 单文件组件中 <script> 和 <style> 标签内的代码缩进方式
vueIndentScriptAndStyle: false,
// 换行符使用 lf 结尾是 可选值 "<auto|lf|crlf|cr>"
endOfLine: "auto",
// 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码 (rangeStart:开始,rangeEnd:结束)
rangeStart: 0,
rangeEnd: Infinity
};
/dist/*
/public/*
public/*
stats.html
// @see: https://stylelint.io
module.exports = {
root: true,
// 继承某些已有的规则
extends: [
"stylelint-config-standard", // 配置 stylelint 拓展插件
"stylelint-config-html/vue", // 配置 vue 中 template 样式格式化
"stylelint-config-standard-scss", // 配置 stylelint scss 插件
"stylelint-config-recommended-vue/scss", // 配置 vue 中 scss 样式格式化
"stylelint-config-recess-order" // 配置 stylelint css 属性书写顺序插件,
],
overrides: [
// 扫描 .vue/html 文件中的 <style> 标签内的样式
{
files: ["**/*.{vue,html}"],
customSyntax: "postcss-html"
}
],
rules: {
"function-url-quotes": "always", // URL 的引号 "always(必须加上引号)"|"never(没有引号)"
"color-hex-length": "long", // 指定 16 进制颜色的简写或扩写 "short(16进制简写)"|"long(16进制扩写)"
"rule-empty-line-before": "never", // 要求或禁止在规则之前的空行 "always(规则之前必须始终有一个空行)"|"never(规则前绝不能有空行)"|"always-multi-line(多行规则之前必须始终有一个空行)"|"never-multi-line(多行规则之前绝不能有空行)"
"font-family-no-missing-generic-family-keyword": null, // 禁止在字体族名称列表中缺少通用字体族关键字
"scss/at-import-partial-extension": null, // 解决不能使用 @import 引入 scss 文件
"property-no-unknown": null, // 禁止未知的属性
"no-empty-source": null, // 禁止空源码
"selector-class-pattern": null, // 强制选择器类名的格式
"value-no-vendor-prefix": null, // 关闭 vendor-prefix (为了解决多行省略 -webkit-box)
"no-descending-specificity": null, // 不允许较低特异性的选择器出现在覆盖较高特异性的选择器
"value-keyword-case": null, // 解决在 scss 中使用 v-bind 大写单词报错
"selector-pseudo-class-no-unknown": [
true,
{
ignorePseudoClasses: ["global", "v-deep", "deep"]
}
]
},
ignoreFiles: ["**/*.js", "**/*.jsx", "**/*.tsx", "**/*.ts"]
};
{
"recommendations": ["Vue.volar", "stylelint.vscode-stylelint"]
}
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "explicit"
},
"stylelint.enable": true,
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass", "html"],
"files.eol": "\n",
"typescript.tsdk": "node_modules/typescript/lib",
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
### 3 分钟了解如何进入开发
# 小程序平台模板 vue3
欢迎使用云效代码管理 Codeup,通过阅读以下内容,你可以快速熟悉 Codeup ,并立即开始今天的工作。
## 安装依赖
```
yarn install
```
### 提交**文件**
### 本地服务
```
yarn start
```
Codeup 支持两种方式进行代码提交:网页端提交,以及本地 Git 客户端提交。
### 小程序平台打包
```
yarn build
```
* 如需体验本地命令行操作,请先安装 Git 工具,安装方法参见[安装Git](https://help.aliyun.com/document_detail/153800.html)
## 默认安装的 UI 库
* 如需体验 SSH 方式克隆和提交代码,请先在平台账号内配置 SSH 公钥,配置方法参见[配置 SSH 密钥](https://help.aliyun.com/document_detail/153709.html)
* 如需体验 HTTP 方式克隆和提交代码,请先在平台账号内配置克隆账密,配置方法参见[配置 HTTPS 克隆账号密码](https://help.aliyun.com/document_detail/153710.html)
现在,你可以在 Codeup 中提交代码文件了,跟着文档「[__提交第一行代码__](https://help.aliyun.com/document_detail/153707.html?spm=a2c4g.153710.0.0.3c213774PFSMIV#6a5dbb1063ai5)」一起操作试试看吧。
<img src="https://img.alicdn.com/imgextra/i3/O1CN013zHrNR1oXgGu8ccvY_!!6000000005235-0-tps-2866-1268.jpg" width="100%" />
### 进行代码检测
开发过程中,为了更好的维护你的代码质量,你可以开启 Codeup 内置开箱即用的「[代码检测服务](https://help.aliyun.com/document_detail/434321.html)」,开启后提交或合并请求的变更将自动触发检测,识别代码编写规范和安全漏洞问题,并及时提供结果报表和修复建议。
<img src="https://img.alicdn.com/imgextra/i2/O1CN01BRzI1I1IO0CR2i4Aw_!!6000000000882-0-tps-2862-1362.jpg" width="100%" />
### 开展代码评审
功能开发完毕后,通常你需要发起「[代码评审并执行合并](https://help.aliyun.com/document_detail/153872.html)」,Codeup 支持多人协作的代码评审服务,你可以通过「[保护分支设置合并规则](https://help.aliyun.com/document_detail/153873.html?spm=a2c4g.203108.0.0.430765d1l9tTRR#p-4on-aep-l5q)」策略及「[__合并请求设置__](https://help.aliyun.com/document_detail/153874.html?spm=a2c4g.153871.0.0.3d38686cJpcdJI)」对合并过程进行流程化管控,同时提供在线代码评审及冲突解决能力,让评审过程更加流畅。
<img src="https://img.alicdn.com/imgextra/i1/O1CN01MaBDFH1WWcGnQqMHy_!!6000000002796-0-tps-2592-1336.jpg" width="100%" />
### 成员协作
是时候邀请成员一起编写卓越的代码工程了,请点击左下角「成员」邀请你的小伙伴开始协作吧!
### 更多
Git 使用教学、高级功能指引等更多说明,参见[Codeup帮助文档](https://help.aliyun.com/document_detail/153402.html)
\ No newline at end of file
[wot-design-uni](https://wot-design-uni.netlify.app/component/button.html)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
{
"name": "rexma-temp-vue3",
"version": "0.0.0",
"scripts": {
"start": "rexma start-rexma",
"build": "rexma build-rexma",
"start:platform": "rexma start",
"build:platform": "rexma build"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-4000720240327002",
"@dcloudio/uni-app-plus": "3.0.0-4000720240327002",
"@dcloudio/uni-components": "3.0.0-4000720240327002",
"@dcloudio/uni-h5": "3.0.0-4000720240327002",
"@dcloudio/uni-mp-alipay": "3.0.0-4000720240327002",
"@dcloudio/uni-mp-baidu": "3.0.0-4000720240327002",
"@dcloudio/uni-mp-jd": "3.0.0-4000720240327002",
"@dcloudio/uni-mp-kuaishou": "3.0.0-4000720240327002",
"@dcloudio/uni-mp-lark": "3.0.0-4000720240327002",
"@dcloudio/uni-mp-qq": "3.0.0-4000720240327002",
"@dcloudio/uni-mp-toutiao": "3.0.0-4000720240327002",
"@dcloudio/uni-mp-weixin": "3.0.0-4000720240327002",
"@dcloudio/uni-mp-xhs": "3.0.0-4000720240327002",
"@dcloudio/uni-quickapp-webview": "3.0.0-4000720240327002",
"pinia": "2.0.36",
"vue": "^3.3.11",
"vue-i18n": "^9.1.9",
"wot-design-uni": "^1.3.2",
"xinhua-sdk": "^1.6.0"
},
"devDependencies": {
"@dcloudio/types": "^3.3.2",
"@dcloudio/uni-automator": "3.0.0-4000720240327002",
"@dcloudio/uni-cli-shared": "3.0.0-4000720240327002",
"@dcloudio/uni-stacktracey": "3.0.0-4000720240327002",
"@dcloudio/vite-plugin-uni": "3.0.0-4000720240327002",
"@types/node": "^20.14.5",
"@vitejs/plugin-legacy": "4.1.1",
"@vue/runtime-core": "^3.3.11",
"@vue/tsconfig": "^0.1.3",
"rexma-cli": "^1.9.3",
"sass": "^1.77.6",
"typescript": "^4.9.4",
"unplugin-auto-import": "^0.17.6",
"vite": "4.3.5",
"vue-tsc": "^1.0.24",
"stylelint": "^15.10.2",
"stylelint-config-html": "^1.1.0",
"stylelint-config-recess-order": "^4.3.0",
"stylelint-config-recommended-scss": "^12.0.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^10.0.0"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<template>
</template>
<script setup lang="ts">
</script>
<style></style>
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const effectScope: typeof import('vue')['effectScope']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onAddToFavorites: typeof import('@dcloudio/uni-app')['onAddToFavorites']
const onBackPress: typeof import('@dcloudio/uni-app')['onBackPress']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onError: typeof import('@dcloudio/uni-app')['onError']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onHide: typeof import('@dcloudio/uni-app')['onHide']
const onLaunch: typeof import('@dcloudio/uni-app')['onLaunch']
const onLoad: typeof import('@dcloudio/uni-app')['onLoad']
const onMounted: typeof import('vue')['onMounted']
const onNavigationBarButtonTap: typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap']
const onNavigationBarSearchInputChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged']
const onNavigationBarSearchInputClicked: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked']
const onNavigationBarSearchInputConfirmed: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed']
const onNavigationBarSearchInputFocusChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged']
const onPageNotFound: typeof import('@dcloudio/uni-app')['onPageNotFound']
const onPageScroll: typeof import('@dcloudio/uni-app')['onPageScroll']
const onPullDownRefresh: typeof import('@dcloudio/uni-app')['onPullDownRefresh']
const onReachBottom: typeof import('@dcloudio/uni-app')['onReachBottom']
const onReady: typeof import('@dcloudio/uni-app')['onReady']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onResize: typeof import('@dcloudio/uni-app')['onResize']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onShareAppMessage: typeof import('@dcloudio/uni-app')['onShareAppMessage']
const onShareTimeline: typeof import('@dcloudio/uni-app')['onShareTimeline']
const onShow: typeof import('@dcloudio/uni-app')['onShow']
const onTabItemTap: typeof import('@dcloudio/uni-app')['onTabItemTap']
const onThemeChange: typeof import('@dcloudio/uni-app')['onThemeChange']
const onUnhandledRejection: typeof import('@dcloudio/uni-app')['onUnhandledRejection']
const onUnload: typeof import('@dcloudio/uni-app')['onUnload']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useSlots: typeof import('vue')['useSlots']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
const xma: typeof import('rexma-cli')['xma']
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
import('vue')
}
/// <reference types='@dcloudio/types' />
import 'vue'
declare module '@vue/runtime-core' {
type Hooks = App.AppInstance & Page.PageInstance;
interface ComponentCustomOptions extends Hooks {
}
}
/// <reference types="vite/client" />
declare module '*.vue' {
import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}
import { createSSRApp } from 'vue';
import App from './App.vue';
import store from './store';
export function createApp() {
const app = createSSRApp(App);
app.use(store);
return {
app,
};
}
{
"name" : "",
"appid" : "",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios" : {},
/* SDK配置 */
"sdkConfigs" : {}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics": {
"enable": false
},
"vueVersion" : "3",
"h5" : {
"router" : {
"base" : "./",
"mode" : "hash"
},
"optimization" : {
"treeShaking" : {
"enable" : true
}
}
}
}
{
"easycom": {
"autoscan": true,
"custom": {
"^wd-(.*)": "wot-design-uni/components/wd-$1/wd-$1.vue"
}
},
"pages": [
{
"path": "pages/postionList/index",
"style": {
"navigationBarTitleText": "职位"
}
},
{
"path": "pages/messageList/index",
"style": {
"navigationBarTitleText": "消息"
}
},
{
"path": "pages/user/index",
"style": {
"navigationBarTitleText": "我的"
}
},
{
"path": "pages/dynamic/index",
"style": {
"navigationBarTitleText": "动态"
}
},
{
"path": "pages/policy/index",
"style": {
"navigationBarTitleText": "政策"
}
}
],
"tabBar": {
"color": "#646A73",
"selectedColor": "#007AFF",
"borderStyle": "black",
"backgroundColor": "#FFFFFF",
"position": "bottom",
"list": [
{
"pagePath": "pages/postionList/index",
"iconPath": "static/image/tabBar/home.png",
"selectedIconPath": "static/image/tabBar/homeActive.png",
"text": "首页"
},
{
"pagePath": "pages/policy/index",
"iconPath": "static/image/tabBar/policy.png",
"selectedIconPath": "static/image/tabBar/policyActive.png",
"text": "政策"
},
{
"pagePath": "pages/dynamic/index",
"iconPath": "static/image/tabBar/community.png",
"selectedIconPath": "static/image/tabBar/communityActive.png",
"text": "动态"
},
{
"pagePath": "pages/messageList/index",
"iconPath": "static/image/tabBar/msg.png",
"selectedIconPath": "static/image/tabBar/msgActive.png",
"text": "消息"
},
{
"pagePath": "pages/user/index",
"iconPath": "static/image/tabBar/user.png",
"selectedIconPath": "static/image/tabBar/userActive.png",
"text": "我的"
}
]
},
"globalStyle": {
"navigationBarTitleText": "equipment-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
}
\ No newline at end of file
<template>
<div>
123
</div>
</template>
<script setup>
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div>
123
</div>
</template>
<script setup>
uni.getSystemInfo({
success: function (res) {
console.log(res)
},
fail: function (err) {
console.log(err)
}
})
</script>
<style lang="scss" scoped>
div{
border: 1rpx solid red;
}
</style>
\ No newline at end of file
<template>
<div>
123
</div>
</template>
<script setup>
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div class="b">
123
<div class="t">222</div>
</div>
</template>
<script setup></script>
<style lang="scss" scoped>
.b {
color: red;
:deep(.t) {
padding: 20px;
color: blue;
border: 1px solid red;
}
}
</style>
<template>
<div>
123
</div>
</template>
<script setup>
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
import request from '@/services/request';
export function getList(params) {
return request.get('/api/queryList', params);
}
import * as foo from './foo';
const api = {
foo,
};
export default api;
type RequestConfig = UniApp.RequestOptions;
type IInterceptors = {
request?: {
onFulfilled?: (config: RequestConfig) => RequestConfig;
onRejected?: (error: any) => any;
};
response?: {
onFulfilled?: (result: UniApp.RequestSuccessCallbackResult) => any;
onRejected?: (error: any) => any;
};
};
class Request {
// 拦截器
private readonly interceptors?: IInterceptors;
constructor(config: { interceptors?: IInterceptors } = {}) {
this.interceptors = config.interceptors;
}
/**
* @description 统一结果处理
*/
private resultHandle(res: Promise<any>) {
return res.then((r) => [r, null]).catch((e) => [null, e]);
}
http(_config: RequestConfig): Promise<any> {
const requestOnFulfilled = this.interceptors?.request?.onFulfilled;
const requestOnRejected = this.interceptors?.request?.onRejected;
const responseOnFulfilled = this.interceptors?.response?.onFulfilled;
const responseOnRejected = this.interceptors?.response?.onRejected;
let config: RequestConfig = { ..._config, header: _config.header || {} };
if (requestOnFulfilled) {
try {
config = requestOnFulfilled(config);
} catch (e) {
requestOnRejected?.(e);
}
}
return new Promise((resolve, reject) => {
xma.request({
...config,
success: (result) => {
if (`${result.statusCode}`.startsWith('2')) {
resolve(responseOnFulfilled?.(result) || result);
} else {
reject(responseOnRejected?.(result) || result);
}
},
fail: (error) => {
reject(responseOnRejected?.(error) || error);
},
});
});
}
post(url: string, data: any = {}, config?: RequestConfig) {
return this.resultHandle(
this.http({
method: 'POST',
url,
data,
...config,
}),
);
}
get(url: string, data: any = {}, config?: RequestConfig) {
return this.resultHandle(
this.http({
method: 'GET',
url,
data,
...config,
}),
);
}
}
const request = new Request({
interceptors: {
request: {
onFulfilled(config) {
return config;
},
},
response: {
onFulfilled(result) {
return result.data;
},
onRejected(error) {
return error;
},
},
},
});
export default request;
export {}
declare module "vue" {
type Hooks = App.AppInstance & Page.PageInstance;
interface ComponentCustomOptions extends Hooks {}
}
\ No newline at end of file
import { defineStore } from 'pinia';
import { ref } from 'vue';
type ICountStore = {
count: number;
};
const initState: ICountStore = {
count: 0,
};
export const useCountStore = defineStore('user', () => {
const countInfo = ref<ICountStore>({ ...initState });
const addCount = (count: number = 1) => {
countInfo.value.count += count;
};
return {
countInfo,
addCount,
};
});
import { createPinia } from 'pinia';
const store = createPinia();
export default store;
// 模块统一导出
export * from './count';
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color: #333; // 基本色
$uni-text-color-inverse: #fff; // 反色
$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable: #c0c0c0;
/* 背景颜色 */
$uni-bg-color: #fff;
$uni-bg-color-grey: #f8f8f8;
$uni-bg-color-hover: #f1f1f1; // 点击状态颜色
$uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色
/* 边框颜色 */
$uni-border-color: #c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm: 12px;
$uni-font-size-base: 14px;
$uni-font-size-lg: 16;
/* 图片尺寸 */
$uni-img-size-sm: 20px;
$uni-img-size-base: 26px;
$uni-img-size-lg: 40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px;
/* 垂直间距 */
$uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2c405a; // 文章标题颜色
$uni-font-size-title: 20px;
$uni-color-subtitle: #555; // 二级标题颜色
$uni-font-size-subtitle: 18px;
$uni-color-paragraph: #3f536e; // 文章段落颜色
$uni-font-size-paragraph: 15px;
\ No newline at end of file
{
"extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"noImplicitThis": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"sourceMap": true,
"noImplicitAny": false,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
},
"outDir": "dist",
"lib": ["esnext", "dom"],
"types": ["@dcloudio/types", "wot-design-uni/global.d.ts"]
},
"vueCompilerOptions": {
"target": 3,
"nativeTags": ["block", "template", "component", "slot"]
},
"exclude": ["node_modules"],
"include": [
"src/**/*.ts",
"src/**/*.js",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.jsx",
"src/**/*.vue",
"src/**/*.json"
]
}
import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import AutoImport from 'unplugin-auto-import/vite';
import legacy from '@vitejs/plugin-legacy';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
uni(),
AutoImport({
imports: [
'vue',
'uni-app',
{
'rexma-cli': ['xma'],
},
],
dts: 'src/declaration/auto-imports.d.ts',
}),
process.env.UNI_PLATFORM === 'h5' &&
legacy({
targets: ['defaults', 'not IE 11'],
}),
].filter(Boolean),
server: {
open: true,
// 代理配置
// proxy: {
// '/api': {
// target: 'https://www.api.com',
// changeOrigin: true,
// },
// },
},
});
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment