提交 b0086031 作者: 陈楚尹

Merge branch 'main' of https://gitlab.yiring.com/hntq/hntq-v5 into dev_ccy

# API 接口地址
VITE_GLOB_API_URL=http://192.168.0.156:17181
VITE_GLOB_API_URL=http://192.168.0.156:8081
# API 接口地址前缀
VITE_GLOB_API_URL_PREFIX=/api
......@@ -10,7 +10,12 @@ module.exports = {
jsx: true,
},
},
extends: ['plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
extends: [
'@antfu',
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off',
......@@ -62,5 +67,6 @@ module.exports = {
},
],
'vue/multi-word-component-names': 'off',
'no-console': 'off',
},
}
node_modules
.DS_Store
dist
.npmrc
.cache
tests/server/static
......@@ -33,3 +32,5 @@ pnpm-debug.log*
.mocks/
.pnpm-debug.log
unpackage/release
strict-peer-dependencies=false
shell-emulator=true
/dist/*
.local
.output.js
.npmrc
.nvmrc
/node_modules/**
**/*.svg
......
{
"recommendations": [
"vue.volar",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"DavidAnson.vscode-markdownlint",
"esbenp.prettier-vscode",
"EditorConfig.EditorConfig",
"antfu.unocss",
"antfu.iconify",
"lokalise.i18n-ally",
"mrmlnc.vscode-less",
"aaron-bond.better-comments",
"shardulm94.trailing-spaces",
"formulahendry.auto-close-tag",
"formulahendry.auto-rename-tag",
"vincaslt.highlight-matching-tag",
"ChakrounAnas.turbo-console-log",
"mikestead.dotenv",
"redhat.vscode-yaml",
"eamodio.gitlens",
"christian-kohler.path-intellisense",
"IBM.output-colorizer",
"PKief.material-icon-theme"
]
}
{
"typescript.tsdk": "./node_modules/typescript/lib",
"npm.packageManager": "pnpm",
"editor.tabSize": 4,
"files.eol": "\n",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"i18n-ally.localesPaths": ["src/locales/lang"],
"i18n-ally.keystyle": "nested",
"i18n-ally.readonly": true,
......@@ -9,5 +15,97 @@
"i18n-ally.enabledParsers": ["ts", "json"],
"i18n-ally.sourceLanguage": "en",
"i18n-ally.displayLanguage": "zh-Hans",
"i18n-ally.enabledFrameworks": ["vue", "react"]
"i18n-ally.enabledFrameworks": ["vue", "react"],
"stylelint.enable": true,
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
"path-intellisense.mappings": {
"/@/": "${workspaceRoot}/src"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[vue]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
}
},
"search.exclude": {
"**/node_modules": true,
"**/*.log": true,
"**/*.log*": true,
"**/bower_components": true,
"**/dist": true,
"**/elehukouben": true,
"**/.git": true,
"**/.gitignore": true,
"**/.svn": true,
"**/.DS_Store": true,
"**/.idea": true,
"**/.vscode": false,
"**/yarn.lock": true,
"**/tmp": true,
"out": true,
"dist": true,
"node_modules": true,
"CHANGELOG.md": true,
"examples": true,
"res": true,
"screenshots": true,
"yarn-error.log": true,
"**/.yarn": true,
"**/.pnpm": true
},
"files.exclude": {
"**/.cache": true,
"**/.editorconfig": true,
"**/.eslintcache": true,
"**/bower_components": true,
"**/.idea": true,
"**/tmp": true,
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/.vscode/**": true,
"**/node_modules/**": true,
"**/tmp/**": true,
"**/bower_components/**": true,
"**/dist/**": true,
"**/yarn.lock": true,
"**/pnpm-lock.yaml": true
}
}
......@@ -28,7 +28,8 @@
- [x] 集成 [Stomp WebSocket](https://github.com/jmesnil/stomp-websocket)
- [x] 集成 [Pont](https://github.com/alibaba/pont)
- [x] 集成 [Pinia](https://pinia.vuejs.org/)
- [x] 集成 [vue-i18n](https://github.com/intlify/vue-i18n-next)
- [x] 集成 [Vue-i18n](https://github.com/intlify/vue-i18n-next)
- [x] 集成 [UnoCSS](https://github.com/antfu/unocss)
- [x] UI 组件集成 [FirstUI](https://gitlab.yiring.com/open/first-ui), [uni-ui](https://uniapp.dcloud.net.cn/component/uniui/quickstart.html)
- [x] 接入 [消息推送](https://uniapp.dcloud.net.cn/unipush.html)
- [x] 接入 [APP 升级中心](https://uniapp.dcloud.net.cn/uniCloud/upgrade-center.html)
......
......@@ -2,6 +2,6 @@
* Get the configuration file variable name
* @param env
*/
export const getConfigFileName = (env: Record<string, any>) => {
export function getConfigFileName(env: Record<string, any>) {
return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '')
}
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'
import dotenv from 'dotenv'
export function isDevFn(mode: string): boolean {
......@@ -40,7 +40,7 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
*/
function getConfFiles() {
const script = process.env.npm_lifecycle_script
const reg = new RegExp('--mode ([a-z_\\d]+)')
const reg = /--mode ([a-z_\d]+)/
const result = reg.exec(script as string) as any
if (result) {
const mode = result[1] as string
......
import type { Plugin } from 'vite'
import colors from 'picocolors'
import pkg from '../../package.json'
import { configUniPlugin } from './uni'
import { configImportPlugin } from './unplugin'
import pkg from '../../package.json'
import { configUnocssPlugin } from './unocss'
export function createVitePlugins(viteEnv: ViteEnv) {
const { VITE_GLOB_APP_NAME, VITE_GLOB_APP_DESCRIPTION, VITE_GLOB_API_URL, VITE_GLOB_API_URL_PREFIX } = viteEnv
......@@ -18,6 +19,9 @@ export function createVitePlugins(viteEnv: ViteEnv) {
// plugins
const vitePlugins: (Plugin | Plugin[])[] = []
// unocss
vitePlugins.push(configUnocssPlugin())
// unplugin-auto-import
// unplugin-vue-components
vitePlugins.push(configImportPlugin())
......
import fs from 'node:fs'
import type { Plugin } from 'vite'
import fs from 'fs'
import prettier from 'prettier'
// uni-app
import uni from '@dcloudio/vite-plugin-uni'
// @dcloudio/uni-helper-json
import tags from '@dcloudio/uni-helper-json/dist/tags.json'
......@@ -11,12 +12,19 @@ import tags from '@dcloudio/uni-helper-json/dist/tags.json'
* 根据 @dcloudio/uni-helper-json 生成组件 .d.ts 描述文件,对组件进行高亮展示
*/
function generateUniComponentsTypes() {
const components = Object.keys(tags).map((key) => `'${key}': typeof HTMLElement`)
const components = Object.keys(tags).map((key) => `'${key}': UniComponent`)
const content = `
// generated by @dcloudio/uni-helper-json/dist/tags.json
declare module 'vue' {
// uni-app 内置组件高亮
// shime-uni.d.ts
type Hooks = App.AppInstance & Page.PageInstance;
type ComponentCustomOptions = Hooks
// uni-app components
interface UniComponent {
[key in string]: any
}
export interface GlobalComponents {
${components.join(',\n\t')}
}
......@@ -26,9 +34,10 @@ function generateUniComponentsTypes() {
const formatted = prettier.format(content, {
parser: 'typescript',
// eslint-disable-next-line @typescript-eslint/no-require-imports
...require('../../prettier.config'),
})
fs.writeFileSync('./types/uni-components.d.ts', formatted, 'utf8')
fs.writeFileSync('./types/uni.d.ts', formatted, 'utf8')
}
/**
......
import type { Plugin } from 'vite'
// https://github.com/antfu/unocss
import Unocss from 'unocss/vite'
import { presetIcons } from 'unocss'
export function configUnocssPlugin(): Plugin[] {
return Unocss({
presets: [
presetIcons({
prefix: 'icon-',
extraProperties: {
display: 'inline-flex',
},
}),
],
})
}
import path from 'node:path'
import type { Plugin } from 'vite'
import path from 'path'
// https://github.com/antfu/unplugin-auto-import
import AutoImport from 'unplugin-auto-import/vite'
// https://github.com/antfu/unplugin-vue-components
import Components from 'unplugin-vue-components/vite'
......
const fs = require('fs')
const path = require('path')
const { execSync } = require('child_process')
const fs = require('node:fs')
const path = require('node:path')
const { execSync } = require('node:child_process')
const scopes = fs
.readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
......
......@@ -12,6 +12,7 @@
- ⭐TODO Highlight
- ⭐Volar (Vue3 + TS 开发首选)
-[Pont-engine](https://marketplace.visualstudio.com/items?itemName=jasonHzq.vscode-pont) 接口自动化工具,**必装**
- ⭐UnoCSS
- ESLint
- stylelint
......
......@@ -4,7 +4,7 @@
<!-- prettier-ignore -->
- [Vue v3.x](https://v3.vuejs.org/guide/introduction.html)
- [uni-app@vue3 v3.x](https://uniapp.dcloud.io/tutorial/migration-to-vue3.html), 依赖 `HBuilderX v3.4.x+` 版本编辑器
- [uni-app@vue3 v3.x](https://uniapp.dcloud.io/tutorial/migration-to-vue3.html), 依赖 `HBuilderX v3.6.x+` 版本编辑器
- [TypeScript](https://www.typescriptlang.org/zh/)
- [Less](https://lesscss.org/)
- [Sass](https://www.sass.hk/)
......@@ -21,13 +21,15 @@
- [Lodash](https://github.com/lodash/lodash) 函数库
- [Dayjs](https://github.com/iamkun/dayjs) 时间库
- [@vueuse/core](https://github.com/vueuse/vueuse) Vue2/3 实用工具集
- [mock.js](https://github.com/nuysoft/Mock) 数据模拟
- [faker-js](https://github.com/faker-js/faker) 数据模拟
- [UnoCSS](https://github.com/unocss/unocss) UnoCSS
### 网络
<!-- prettier-ignore -->
- [uni.request](https://uniapp.dcloud.net.cn/api/request/request.html)
- [axios](https://github.com/axios/axios)
- [vue-request@next](https://github.com/AttoJS/vue-request)
### 图表
......@@ -38,7 +40,7 @@
<!-- prettier-ignore -->
- [HBuilderX Latest](https://www.dcloud.io/hbuilderx.html)
- [Vite v3.x](https://vitejs.dev)
- [Vite](https://vitejs.dev)
### 其他插件
......
File added
......@@ -3,14 +3,14 @@
<head>
<meta charset="UTF-8" />
<script>
var coverSupport =
const 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' : '') +
'" />',
`<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>
......
logo.png

17.8 KB

......@@ -57,6 +57,7 @@
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s",
"u": "pnpx @dcloudio/uvm vue3",
"prepare": "husky install"
},
"config": {
......@@ -65,90 +66,98 @@
}
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-app-plus": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-components": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-h5": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-mp-lark": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-mp-qq": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-ui": "^1.4.23",
"@vue/runtime-core": "^3.2.45",
"@vueuse/core": "^9.10.0",
"axios": "^0.26.1",
"@dcloudio/uni-app": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-app-plus": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-components": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-h5": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-jd": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-lark": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-qq": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-ui": "^1.4.27",
"@faker-js/faker": "^8.0.2",
"@vue/runtime-core": "~3.2.47",
"@vueuse/core": "^10.1.2",
"axios": "^1.4.0",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.7",
"lodash-es": "^4.17.21",
"mockjs": "^1.1.0",
"nanoid": "^4.0.0",
"pinia": "^2.0.28",
"nanoid": "^4.0.2",
"pinia": "~2.0.36",
"qs": "~6.9.7",
"stompjs": "^2.3.3",
"urijs": "^1.19.11",
"vue": "^3.2.45",
"vue": "~3.2.47",
"vue-i18n": "^9.2.2",
"vue-types": "^5.0.2"
"vue-request": "2.0.0-rc.4",
"vue-types": "^5.0.3"
},
"devDependencies": {
"@commitlint/cli": "^17.4.0",
"@commitlint/config-conventional": "^17.4.0",
"@dcloudio/types": "^3.2.7",
"@dcloudio/uni-automator": "3.0.0-alpha-3061620230106001",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3061620230106001",
"@antfu/eslint-config": "^0.39.3",
"@commitlint/cli": "^17.6.3",
"@commitlint/config-conventional": "^17.6.3",
"@dcloudio/types": "^3.3.3",
"@dcloudio/uni-automator": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3080320230523001",
"@dcloudio/uni-helper-json": "^1.0.13",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3061620230106001",
"@types/lodash-es": "^4.17.6",
"@types/mockjs": "^1.0.7",
"@types/node": "^18.11.18",
"@dcloudio/uni-stacktracey": "3.0.0-alpha-3080320230523001",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3080320230523001",
"@iconify/json": "^2.2.71",
"@types/crypto-js": "^4.1.1",
"@types/lodash-es": "^4.17.7",
"@types/node": "^18.16.16",
"@types/prettier": "^2.7.2",
"@types/qs": "^6.9.7",
"@types/stompjs": "^2.3.5",
"@types/urijs": "^1.19.19",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"commitizen": "^4.2.6",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"commitizen": "^4.3.0",
"conventional-changelog-cli": "^2.2.2",
"cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^7.0.0",
"cz-git": "^1.4.1",
"czg": "^1.4.1",
"cz-git": "^1.6.1",
"czg": "^1.6.1",
"dotenv": "^16.0.3",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.6.0",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.8.0",
"eslint-plugin-vue": "^9.14.1",
"husky": "^8.0.3",
"jest": "27.0.4",
"jest-environment-node": "27.5.1",
"less": "^4.1.3",
"lint-staged": "^13.1.0",
"lint-staged": "^13.2.2",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"pont-engine": "^1.5.4",
"postcss": "^8.4.21",
"pont-engine": "^1.5.10",
"postcss": "^8.4.24",
"postcss-html": "^1.5.0",
"postcss-less": "^6.0.0",
"prettier": "^2.8.2",
"rimraf": "^3.0.2",
"sass": "^1.57.1",
"sort-package-json": "^2.1.0",
"stylelint": "^14.16.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.1",
"sass": "^1.62.1",
"sort-package-json": "^2.4.1",
"stylelint": "^15.6.2",
"stylelint-config-html": "^1.1.0",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-recommended": "^9.0.0",
"stylelint-config-standard": "^29.0.0",
"stylelint-order": "^5.0.0",
"stylus": "^0.59.0",
"terser": "^5.16.1",
"typescript": "^4.9.4",
"unplugin-auto-import": "^0.12.1",
"unplugin-vue-components": "^0.22.12",
"vite": "^4.0.4",
"vue-eslint-parser": "^9.1.0"
"stylelint-config-recommended": "^12.0.0",
"stylelint-config-standard": "^33.0.0",
"stylelint-order": "^6.0.3",
"typescript": "^5.0.4",
"unocss": "^0.52.4",
"unocss-preset-weapp": "^0.6.3",
"unplugin-auto-import": "^0.16.2",
"unplugin-vue-components": "^0.24.1",
"vite": "^4.3.9",
"vue-eslint-parser": "^9.3.0"
},
"engines": {
"node": ">=14"
"node": ">=16",
"pnpm": ">=8.1.0"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"originType": "SwaggerV2",
"originUrl": "http://127.0.0.1:8081/api/v2/api-docs",
"originType": "SwaggerV3",
"originUrl": "http://192.168.0.156:8081/api/v3/api-docs",
"templateType": "fetch",
"templatePath": "./pont-template",
"transformPath": "./pont-transform",
"outDir": "./src/api/services",
"surrounding": "typeScript",
"usingOperationId": true,
"mocks": {
"enable": true,
"basePath": "",
......
import * as Pont from 'pont-engine'
import { Interface, BaseClass, Property, CodeGenerator } from 'pont-engine'
// import * as Pont from 'pont-engine'
import type { BaseClass, Interface } from 'pont-engine'
import { CodeGenerator, Property } from 'pont-engine'
// 接口 API 前缀
// 通常与项目的 env 配置中的 VITE_GLOB_API_URL_PREFIX 相同
const API_URL_PREFIX = '/api'
export class FileStructures extends Pont.FileStructures {
getModsDeclaration(originCode: string): string {
return originCode
}
}
export default class BasicGenerator extends CodeGenerator {
checkJsonParam(inter: Interface, paramsCode: string): boolean {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const prettier = require('prettier')
const requestParams = inter.getRequestParams(this.surrounding)
const code = prettier.format(paramsCode, { parser: 'typescript' })
......@@ -21,6 +17,7 @@ export default class BasicGenerator extends CodeGenerator {
// 认为没有返回值的接口表示下载(通常是)
isDownload(inter: Interface): boolean {
console.log(inter.name, inter.responseType)
return inter.responseType === 'any'
}
......@@ -33,6 +30,7 @@ export default class BasicGenerator extends CodeGenerator {
let requestParams = inter.getRequestParams(this.surrounding)
let bodyTypeDef = ''
// eslint-disable-next-line @typescript-eslint/no-require-imports
const prettier = require('prettier')
if (prettier.format(paramsCode, { parser: 'typescript' }).includes('{}')) {
if (!requestParams.includes('form')) {
......@@ -40,15 +38,16 @@ export default class BasicGenerator extends CodeGenerator {
}
if (requestParams.includes('body')) {
requestParams = requestParams.replace('params?: Params, ', '')
bodyTypeDef = requestParams.replace(/^.*body: (.*),.*$/gi, '$1')
requestParams = requestParams.replace('params?: Params, ', '')
requestParams = requestParams.replace('body:', 'body?:')
}
}
return `${requestParams.replace(
'options?: any',
`config?: http.RequestConfig<${
bodyTypeDef ? bodyTypeDef : `Params${requestParams.includes('form') ? ' | FormData' : ''}`
bodyTypeDef || `Params${requestParams.includes('form') ? ' | FormData' : ''}`
}>`,
)}, options?: http.RequestOptions`
}
......@@ -56,11 +55,18 @@ export default class BasicGenerator extends CodeGenerator {
getInterfaceContentInDeclaration(inter: Interface) {
const paramsCode = inter.getParamsCode('Params')
const requestParams = this.getParams(inter, paramsCode)
const sourceResponseType = inter.responseType
const targetResponseType =
sourceResponseType === 'File'
? 'void'
: sourceResponseType === 'defs.ResultString'
? 'string'
: sourceResponseType.replace(/defs.Result(.*)/, 'defs.$1')
return `
export ${paramsCode}
export type Response = ${inter.responseType.replace(/defs.Result\<(.*)\>/, '$1')};
export type Response = ${targetResponseType};
export const init: Response;
......@@ -88,7 +94,8 @@ export default class BasicGenerator extends CodeGenerator {
const method = inter.method.toUpperCase()
const paramsCode = inter.getParamsCode('Params', this.surrounding)
const requestParams = this.getParams(inter, paramsCode)
const undef = inter.response.getInitialValue() === 'undefined'
const initValue = inter.response.getInitialValue(true)
const undef = initValue === 'undefined' || initValue === `''`
const isBody = this.checkJsonParam(inter, paramsCode)
// TODO
......@@ -105,7 +112,7 @@ export default class BasicGenerator extends CodeGenerator {
${isBody ? '' : `export ${paramsCode}`}
${undef ? '' : `export const init = ${inter.response.getInitialValue(true)};`}
${undef ? '' : `export const init = ${initValue};`}
export function request(${requestParams}) {
return defHttp.request({
......
import { StandardDataSource } from 'pont-engine'
import type { StandardDataSource } from 'pont-engine'
export default function (dataSource: StandardDataSource): StandardDataSource {
return dataSource
......
<script setup lang="ts">
import { checkUpgrade } from '@/utils/upgrade'
// import * as Push from '@/utils/push'
onLaunch(() => {
......@@ -9,10 +10,10 @@
checkUpgrade()
// 清除消息角标
// Push.setBadge()
// Push.setBadge(0)
// 监听在线消息
// Push.listenMessage()
// Push.listen()
})
onShow(() => {
......@@ -24,11 +25,11 @@
})
onError((err) => {
Message.toast('App Error: ' + err)
Message.toast(`App Error: ${err}`)
})
onUnhandledRejection((err) => {
Message.toast('App UnhandledRejection: ' + err)
Message.toast(`App UnhandledRejection: ${err}`)
})
</script>
......@@ -36,18 +37,20 @@
/* common css */
/* #ifndef APP-PLUS-NVUE */
/* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
@import './common/uni.css';
@import url('./common/uni.css');
/* #endif */
/*每个页面公共css */
@import './common/fui-app.css';
@import './components/firstui/fui-theme/fui-theme.css';
/* 每个页面公共css */
@import url('./common/fui-app.css');
@import url('./components/firstui/fui-theme/fui-theme.css');
// 全局样式
@import './common/public.less';
@import url('./common/public.less');
/** #ifdef H5 */
uni-page-body,
page {
height: 100%;
}
/** #endif */
</style>
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,6 +4,7 @@
import * as login from './login'
import * as logout from './logout'
import * as register from './register'
import * as safe from './safe'
import * as valid from './valid'
export { login, logout, register, valid }
export { login, logout, register, safe, valid }
......@@ -12,7 +12,7 @@ export class Params {
password: string
}
export const init = new defs.Result()
export const init = new defs.ResultLoginVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,25 +6,23 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 用户名 */
username: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 手机号 */
mobile: string
/** 头像 */
avatar?: string
/** 邮箱 */
email?: string
/** 是否启用 */
enable?: boolean
/** 简介 */
introduction?: string
/** 手机号 */
mobile: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 用户名 */
username: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
/**
* @desc 安全验证
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 密码 */
password: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/auth/safe',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 检查登录状态
* @desc 检查登录
*/
import * as defs from '../../baseClass'
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultBoolean()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典名称 */
name: string
/** 字典编号 */
code: string
/** 字典描述 */
description?: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
}
export const init = new defs.ResultDictVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description 字典管理
*/
import * as add from './add'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as selector from './selector'
export { add, find, modify, page, remove, selector }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典名称 */
name: string
/** 字典编号 */
code: string
/** 字典描述 */
description?: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: string
}
export const init = new defs.ResultPageVoDictVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/page',
method: 'GET',
params,
...config,
},
options,
)
}
......@@ -10,12 +10,12 @@ export class Params {
ids: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/role/deleted',
url: '/sys/dict/remove',
method: 'POST',
data: params,
......
/**
* @desc 选项查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.ResultArrayListKeyValueVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/selector',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典 ID */
dictId: string
/** 字典选项名称 */
name: string
/** 字典选项值 */
value: string
/** 字典选项描述 */
description?: string
/** 字典选项排序序号 */
serial?: number
/** 字典选项是否启用 */
enable: boolean
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
}
export const init = new defs.ResultDictItemVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description 字典选项管理
*/
import * as add from './add'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as selector from './selector'
export { add, find, modify, page, remove, selector }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 字典 ID */
dictId: string
/** 字典选项名称 */
name: string
/** 字典选项值 */
value: string
/** 字典选项描述 */
description?: string
/** 字典选项排序序号 */
serial?: number
/** 字典选项是否启用 */
enable: boolean
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: string
}
export const init = new defs.ResultPageVoDictItemVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/page',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/remove',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 选项查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 字典 ID */
dictId?: string
/** 字典 ID */
dictCode?: string
/** 字典选项是否启用 */
enable?: boolean
}
export const init = new defs.ResultArrayListKeyValueVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/dict/item/selector',
method: 'GET',
params,
...config,
},
options,
)
}
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultUserExtensionVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,5 +7,6 @@ import * as fail from './fail'
import * as findUserExtensionInfo from './findUserExtensionInfo'
import * as json from './json'
import * as page from './page'
import * as upload from './upload'
export { hello, download, fail, findUserExtensionInfo, json, page }
export { hello, download, fail, findUserExtensionInfo, json, page, upload }
......@@ -5,10 +5,10 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export const init = new defs.Result()
export const init = new defs.ResultPageVoString()
export function request(
body: defs.PageParam,
body?: defs.PageParam,
config?: http.RequestConfig<defs.PageParam>,
options?: http.RequestOptions,
) {
......
......@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export const init = new defs.Result()
export const init = new defs.ResultPageVoString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
/**
* @desc 文件上传
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export const init = new defs.ResultString()
export function request(body?: object, config?: http.RequestConfig<object>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/example/upload',
method: 'POST',
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
options,
)
}
......@@ -5,22 +5,15 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.ResultString()
export const init = new defs.Result()
export function request(
params: Params,
form: FormData,
config?: http.RequestConfig<Params | FormData>,
options?: http.RequestOptions,
) {
export function request(body?: object, config?: http.RequestConfig<object>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/upload',
method: 'POST',
data: form || params,
headers: { 'Content-Type': 'multipart/form-data;charset=UTF-8' },
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
......
......@@ -5,19 +5,15 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** Base64 图片信息 */
base64Image: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
export function request(body?: string, config?: http.RequestConfig<string>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/uploadBase64Image',
method: 'POST',
data: params,
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
......
import * as auth from './auth'
import * as dict from './dict'
import * as dictItem from './dictItem'
import * as example from './example'
import * as file from './file'
import * as permission from './permission'
......@@ -8,6 +10,8 @@ import * as userView from './userView'
export const API = {
auth,
dict,
dictItem,
example,
file,
permission,
......
......@@ -5,41 +5,19 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 元数据 */
meta?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: string
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
export function request(
body?: defs.PermissionParam,
config?: http.RequestConfig<defs.PermissionParam>,
options?: http.RequestOptions,
) {
return defHttp.request(
{
url: '/sys/permission/add',
method: 'POST',
data: params,
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
......
......@@ -10,7 +10,7 @@ export class Params {
id: string
}
export const init = new defs.Result()
export const init = new defs.ResultPermissionVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -2,10 +2,10 @@
* @description 权限管理
*/
import * as add from './add'
import * as deleted from './deleted'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as tree from './tree'
export { add, deleted, find, modify, page, tree }
export { add, find, modify, page, remove, tree }
......@@ -5,43 +5,19 @@
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** id */
id: string
/** 元数据 */
meta?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: string
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
export function request(
body?: defs.PermissionParam,
config?: http.RequestConfig<defs.PermissionParam>,
options?: http.RequestOptions,
) {
return defHttp.request(
{
url: '/sys/permission/modify',
method: 'POST',
data: params,
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
......
......@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export const init = new defs.Result()
export const init = new defs.ResultPageVoPermissionVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -10,12 +10,12 @@ export class Params {
id: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/permission/deleted',
url: '/sys/permission/remove',
method: 'POST',
data: params,
......
......@@ -7,10 +7,10 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {
/** pid */
pid?: string
pid: string
}
export const init = new defs.Result()
export const init = new defs.ResultArrayListPermissionVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,13 +6,15 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 名称 */
name: string
/** id */
id: string
/** 标识 */
uid: string
/** 名称 */
name: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -12,7 +12,7 @@ export class Params {
ids: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -10,7 +10,7 @@ export class Params {
id: string
}
export const init = new defs.Result()
export const init = new defs.ResultRoleVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -3,10 +3,10 @@
*/
import * as add from './add'
import * as assign from './assign'
import * as deleted from './deleted'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as remove from './remove'
import * as selector from './selector'
export { add, assign, deleted, find, modify, page, selector }
export { add, assign, find, modify, page, remove, selector }
......@@ -8,13 +8,13 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: string
/** 名称 */
name: string
/** 标识 */
uid: string
/** 名称 */
name: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export const init = new defs.Result()
export const init = new defs.ResultPageVoRoleVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/sys/role/remove',
method: 'POST',
data: params,
...config,
},
options,
)
}
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultArrayListRoleVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -12,7 +12,7 @@ export class Params {
ids: string
}
export const init = new defs.Result()
export const init = new defs.ResultString()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -6,17 +6,17 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 当前页数 */
pageNo: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
sortOrder?: string
}
export const init = new defs.Result()
export const init = new defs.ResultPageVoUserVo()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultArrayListMenuVo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultArrayListString()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
......@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export const init = new defs.ResultUserInfo()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
......
export const Message = {
/**
* 消息轻提示
* @param text 消息内容
* @param title 消息内容
*/
toast: (text: string, duration?: 'short' | 'long'): void => {
if (text) {
toast: (title: string, duration?: 'short' | 'long'): void => {
if (title) {
// #ifndef APP-PLUS
uni.showToast({
title: text,
title,
icon: 'none',
duration: duration === 'short' ? 2000 : 3500,
})
// #endif
// #ifdef APP-PLUS
plus.nativeUI.toast(text, {
plus.nativeUI.toast(title, {
duration: duration || 'short',
})
// #endif
......@@ -22,51 +22,51 @@ export const Message = {
},
/**
* 消息弹窗提示
* @param message 消息内容
* @param content 消息内容
* @param title 标题
* @returns Promise<void>
*/
alert: (message: string, title = '提示', confirmText = '确定'): Promise<void> => {
alert: (content: string, title = '提示', confirmText = '确定'): Promise<void> => {
return new Promise((resolve, reject) => {
// #ifndef APP-PLUS
uni.showModal({
title: title,
content: message,
title,
content,
showCancel: false,
confirmText: confirmText,
confirmText,
success: () => resolve(),
fail: (err) => reject(err),
})
// #endif
// #ifdef APP-PLUS
plus.nativeUI.alert(message, resolve, title, confirmText)
plus.nativeUI.alert(content, resolve, title, confirmText)
// #endif
})
},
/**
* 消息确认提示
* @param title 标题
* @param message 提示内容
* @param content 提示内容
* @param confirmText 确认按钮文字
* @param showCancel 是否显示取消按钮
* @returns Promise<boolean> 是否点击了确认按钮
*/
confirm: (message: string, title = '提示', confirmText = '确定', showCancel = true): Promise<boolean> => {
confirm: (content: string, title = '提示', confirmText = '确定', showCancel = true): Promise<boolean> => {
return new Promise((resolve, reject) => {
// #ifndef APP-PLUS
uni.showModal({
title: title,
content: message,
showCancel: showCancel,
confirmText: confirmText,
title,
content,
showCancel,
confirmText,
success: (res) => resolve(res.confirm),
fail: (err) => reject(err),
})
// #endif
// #ifdef APP-PLUS
plus.nativeUI.confirm(message, ({ index }) => resolve(index === 0), {
plus.nativeUI.confirm(content, ({ index }) => resolve(index === 0), {
title,
buttons: ['确认', '取消'],
verticalAlign: 'center',
......@@ -74,4 +74,20 @@ export const Message = {
// #endif
})
},
/**
* 加载中
* @param title 加载中文字
*/
loading: (title = '加载中...'): void => {
uni.showLoading({
title,
mask: true,
})
},
/**
* 隐藏加载中
*/
hideLoading: (): void => {
uni.hideLoading()
},
}
......@@ -4,116 +4,3 @@
align-items: center;
height: 100vh;
}
// ================ mapbox-gl ================
// 自定义 popup 内容样式
.mapboxgl-popup-content {
box-shadow: 0 1px 5px #6e6e6e !important;
}
.mapboxgl-popup-content .mapboxgl-custom-popup {
position: relative;
}
.mapboxgl-custom-popup .popup-title {
font-weight: bold;
}
.mapboxgl-ctrl-group:not(:empty) {
box-shadow: 0 0 6px #000 !important;
}
.mapboxgl-ctrl-group button {
display: flex !important;
overflow: visible !important;
}
.mapboxgl-ctrl-logo {
display: none !important;
}
.mapboxgl-ctrl-bottom-left {
display: flex;
bottom: 0;
left: 2px;
}
.mapboxgl-ctrl-lnglat {
background: rgb(0 0 0 / 40%);
color: white;
line-height: 2em;
padding: 0 10px;
}
// 覆盖全屏控件的图标
.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon {
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="currentColor" d="M3.75 3a.75.75 0 0 0-.75.75V5.5a.5.5 0 0 1-1 0V3.75C2 2.784 2.784 2 3.75 2H5.5a.5.5 0 0 1 0 1H3.75ZM10 2.5a.5.5 0 0 1 .5-.5h1.75c.966 0 1.75.784 1.75 1.75V5.5a.5.5 0 0 1-1 0V3.75a.75.75 0 0 0-.75-.75H10.5a.5.5 0 0 1-.5-.5ZM2.5 10a.5.5 0 0 1 .5.5v1.75c0 .414.336.75.75.75H5.5a.5.5 0 0 1 0 1H3.75A1.75 1.75 0 0 1 2 12.25V10.5a.5.5 0 0 1 .5-.5Zm11 0a.5.5 0 0 1 .5.5v1.75A1.75 1.75 0 0 1 12.25 14H10.5a.5.5 0 0 1 0-1h1.75a.75.75 0 0 0 .75-.75V10.5a.5.5 0 0 1 .5-.5Z"%2F%3E%3C%2Fsvg%3E') !important;
}
.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon {
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="currentColor" d="M11 4a1 1 0 0 0 1 1h1.5a.5.5 0 0 1 0 1H12a2 2 0 0 1-2-2V2.5a.5.5 0 0 1 1 0V4Zm0 8a1 1 0 0 1 1-1h1.5a.5.5 0 0 0 0-1H12a2 2 0 0 0-2 2v1.5a.5.5 0 0 0 1 0V12Zm-7-1a1 1 0 0 1 1 1v1.5a.5.5 0 0 0 1 0V12a2 2 0 0 0-2-2H2.5a.5.5 0 0 0 0 1H4Zm1-7a1 1 0 0 1-1 1H2.5a.5.5 0 0 0 0 1H4a2 2 0 0 0 2-2V2.5a.5.5 0 0 0-1 0V4Z"%2F%3E%3C%2Fsvg%3E') !important;
}
.mapboxgl-ctrl .mapboxgl-ctrl-reset-button .mapboxgl-ctrl-icon {
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3s-3 1.331-3 3s1.329 3 3 3z"%2F%3E%3Cpath fill="currentColor" d="M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219a9.053 9.053 0 0 0-2.43-2.43a8.95 8.95 0 0 0-3.219-1.355a9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053a7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725a7.11 7.11 0 0 1-.644 1.188a7.2 7.2 0 0 1-.858 1.039a7.028 7.028 0 0 1-3.536 1.907a7.13 7.13 0 0 1-2.822 0a6.961 6.961 0 0 1-2.503-1.054a7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034a9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183a9.014 9.014 0 0 0 3.218-1.355a8.886 8.886 0 0 0 1.331-1.099a9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"%2F%3E%3C%2Fsvg%3E') !important;
}
/* stylelint-disable-next-line selector-no-vendor-prefix */
.mapboxgl-map:-webkit-full-screen {
.mapboxgl-ctrl-bottom-left {
bottom: 0;
}
}
// 自定义图层控制器样式
.mapboxgl-ctrl button.-active svg {
color: #4264fb;
}
.mapboxgl-ctrl-layer-button {
position: relative;
.mapboxgl-ctrl-layer-wrap {
display: none;
justify-items: center;
align-items: center;
position: absolute;
right: 40px;
padding: 10px;
border-radius: 3px;
box-shadow: 0 0 3px #333;
background-color: #fff;
.mapboxgl-ctrl-layer {
width: 60px;
height: 60px;
display: flex;
justify-content: center;
border: 2px solid #fff;
position: relative;
&.active {
border-color: #3385ff;
}
img {
width: 100%;
height: 100%;
}
span {
display: inline-flex;
justify-content: center;
background-color: rgb(0 0 0 / 60%);
color: white;
position: absolute;
bottom: 0;
width: 100%;
}
}
}
&.-active .mapboxgl-ctrl-layer-wrap {
display: flex;
}
}
<script setup lang="ts">
import md5 from 'crypto-js/md5'
const props = defineProps({
width: {
type: [String, Number],
default: '320',
},
height: {
type: [String, Number],
default: '240',
},
radius: {
type: [String, Number],
default: 0,
},
mode: {
type: String,
default: 'scaleToFill',
},
background: {
type: String,
default: '#F7F7F7',
},
src: {
type: String,
required: true,
},
debug: {
type: Boolean,
default: false,
},
})
const srcImage = ref()
const hashCacheKey = ref()
onMounted(async () => {
await tryCache()
})
// 监听 src 变化
watch(
() => props.src,
async () => await tryCache(),
)
function log(...args: any[]) {
if (props.debug) {
console.log('[CacheImage]', ...args)
}
}
// 尝试缓存图片,如果失败则使用原始图片
async function tryCache() {
let url = props.src
if (!url) {
return
}
// 如果是网络图片,则缓存到本地
if (url.startsWith('http')) {
// #ifdef APP-PLUS
const hash = md5(url).toString()
hashCacheKey.value = `G_CACHE_IMAGE_${hash}`
if (uni.getStorageSync(hashCacheKey.value)) {
log('cache hit', url)
url = uni.getStorageSync(hashCacheKey.value)
} else {
log('cache miss', url)
try {
const res = await uni.downloadFile({ url })
if (res.statusCode === 200) {
const { savedFilePath } = await new Promise<UniApp.SaveFileSuccess>((resolve, reject) => {
uni.saveFile({
tempFilePath: res.tempFilePath,
success: (res) => resolve(res),
fail: (err) => reject(err),
})
})
url = `${savedFilePath}`
// 缓存图片本地地址
uni.setStorageSync(hashCacheKey.value, url)
} else {
log('cache error', url, res)
url = props.src
}
} catch (e) {
console.error(e)
}
}
log(props.src, '=>', url, hash, hashCacheKey.value)
// #endif
}
srcImage.value = url
}
const hasError = ref(false)
function onError() {
if (hasError.value) {
return
}
hasError.value = true
srcImage.value = props.src
// 清除缓存
hashCacheKey.value && uni.removeStorageSync(hashCacheKey.value)
console.warn('CacheImage cache error')
}
</script>
<template>
<fui-lazyload
v-bind="$attrs"
:mode="props.mode"
:width="props.width"
:height="props.height"
:radius="props.radius"
:background="props.background"
:src="srcImage"
@error="onError"
>
<slot></slot>
</fui-lazyload>
</template>
<template>
<view class="empty" :style="[{ background: bgColor }]">
<!-- 暂无数据/空数据 -->
<image src="../../static/images/empty.png" />
<!-- 提示内容 -->
<view class="empty-tips" :style="[{ color: tipsColor }]">{{ tips }}</view>
</view>
</template>
<script>
export default {
props: {
<script setup lang="ts">
defineProps({
/**
* 提示内容
*/
tips: {
type: String,
default: '',
},
/**
* 提示内容颜色
*/
tipsColor: {
type: String,
default: '#9C9C9C',
},
/**
* 背景颜色
*/
bgColor: {
type: String,
default: 'transparent',
},
},
}
})
</script>
<style>
<template>
<view class="empty" :style="{ background: bgColor }">
<!-- 暂无数据/空数据 -->
<image src="../../static/images/empty.png" />
<!-- 提示内容 -->
<view class="empty-tips" :style="{ color: tipsColor }">{{ tips }}</view>
</view>
</template>
<style scoped>
.empty {
width: 100%;
height: 100%;
......@@ -43,6 +52,6 @@
.empty .empty-tips {
display: flex;
font-size: 30rpx;
color: #999999;
color: #999;
}
</style>
<script setup lang="ts">
const props = defineProps({
icon: {
type: String,
required: true,
},
size: {
type: [Number, String],
default: 32,
},
color: {
type: String,
default: '#000',
},
})
const size = computed(() => `${props.size}rpx`)
const color = computed(() => props.color)
</script>
<template>
<view class="icon" />
</template>
<style lang="less" scoped>
.icon {
width: v-bind(size);
height: v-bind(size);
color: v-bind(color);
}
</style>
<script lang="ts" setup>
import md5 from 'crypto-js/md5'
import { nanoid } from 'nanoid'
import { getPoster, isImage, isVideo } from './utils'
import CacheImage from '@/components/CacheImage/index.vue'
type Asset = Recordable & { url: string }
const props = defineProps({
width: {
type: [String, Number],
default: '96',
},
height: {
type: [String, Number],
default: '96',
},
mode: {
type: String,
default: 'aspectFit',
},
background: {
type: String,
default: '#F7F7f7',
},
assets: {
type: Array as PropType<Asset[]>,
},
})
// 生成预览容器高度
const height = computed(() => `${props.height}rpx`)
// 分离图片和视频资源地址
const images = computed(() => props.assets.filter((item) => isImage(item.url)))
const videos = computed(() => props.assets.filter((item) => isVideo(item.url)))
// 预览图片
function preview(index: number) {
uni.previewImage({
urls: images.value.map((item) => {
// #ifdef APP-PLUS
const hash = md5(item.url).toString()
const key = `G_CACHE_IMAGE_${hash}`
if (uni.getStorageSync(key)) {
return uni.getStorageSync(key)
}
// #endif
return item.url
}),
current: index,
})
}
// 初始化视频组件配置
const videoId = nanoid()
const videoContext = ref()
const playVideoSrc = ref()
// 播放视频
function play(index: number) {
playVideoSrc.value = videos.value[index].url
videoContext.value?.requestFullScreen()
videoContext.value?.play()
}
function videoFullScreenChange(e: any) {
// 非全屏状态下停止播放
if (!e.detail.fullScreen) {
videoContext.value.seek(0)
videoContext.value.pause()
}
}
onMounted(() => {
// 初始化视频组件上下文对象
videoContext.value = uni.createVideoContext(videoId)
})
</script>
<template>
<view class="preview-wrap">
<!-- 视频预览 -->
<CacheImage
class="preview-video"
:background="props.background"
:mode="props.mode"
v-for="(item, index) in videos"
:key="item.url"
:src="getPoster(item.url)"
:width="props.width"
:height="props.height"
:radius="10"
@tap="play(index)"
>
<view class="icon-wrap" :style="{ width: props.width, height: props.height }">
<fui-icon class="video-play-icon" name="suspend" size="40" color="#fff" />
</view>
</CacheImage>
<!-- 图片预览 -->
<CacheImage
class="preview-image"
:background="props.background"
:mode="props.mode"
v-for="(item, index) in images"
:key="item.url"
:src="getPoster(item.url)"
:width="props.width"
:height="props.height"
:radius="10"
@tap="preview(index)"
/>
<!-- 视频 -->
<video
:id="videoId"
:src="playVideoSrc"
class="video"
autoplay
controls
@fullscreenchange="videoFullScreenChange"
></video>
</view>
</template>
<style lang="less" scoped>
.preview-wrap {
display: flex;
flex-wrap: wrap;
margin: -10rpx;
.preview-image,
.preview-video {
margin: 10rpx !important;
position: relative;
:deep(.fui-lazyload__img) {
height: v-bind(height) !important;
}
.icon-wrap {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgb(0 0 0 / 50%);
border-radius: 10rpx;
.video-play-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
.video {
position: absolute;
top: -999999px;
}
}
</style>
export type FileType = 'image' | 'video' | 'audio'
export function isImage(url: string) {
return /\.(png|jpe?g|webp|tif?f|avif|gif|svg)(\?.*)?$/i.test(url)
}
export function isVideo(url: string) {
return /\.(mp4|flv|mov|mkv|mpeg|mpg|wmv|m3u8)(\?.*)?$/i.test(url)
}
export function isAudio(url: string) {
return /\.(mp3|wav|ogg|aac|flac)(\?.*)?$/i.test(url)
}
export function getPoster(url: string) {
if (!isVideo(url)) {
return url
}
return `${url}.jpg`
}
# 组件更新说明
1. 从 https://firstui.cn/user/order 下载更新版本包
2. 在本地解压,找到 \FirstUI\components\firstui 目录,使用 vscode 打开当前目录
3. 清理掉组件文件头部的 license 信息,使用 vscode 全局替换
4. 全局替换换行符 \r\n\n [引用](https://segmentfault.com/q/1010000011799577)
5. 将文件拷贝到 src\components\FirstUI\ 目录下,检查 git diff,手动处理哪些文件需要更新
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 5 6 1 6 2 60195,身份证尾号: 503 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view @touchmove.stop.prevent="stop" v-if="isShow || !isNvue">
<view class="fui-actionsheet__mask" :class="{'fui-actionsheet__mask-show':show}" ref="fui_asm_ani"
......@@ -215,7 +214,8 @@
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax',
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini',
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini',
'iphone14pro', 'iphone14promax'
'iphone14pro', 'iphone14promax', 'iphone15', 'iphone15mini',
'iphone15pro', 'iphone15promax'
]
const model = res.model.replace(/\s/g, "").toLowerCase()
const newModel = model.split('<')[0]
......@@ -306,11 +306,12 @@
.fui-actionsheet__btn {
/* #ifndef APP-NVUE */
width: 100%;
box-sizing: content-box;
/* #endif */
flex: 1;
height: 100rpx;
/* #ifdef APP-NVUE */
line-height: 100rpx;
flex: 1;
/* #endif */
/* #ifndef APP-NVUE */
display: flex;
......
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 56 16 2 60 1 95,身份证尾号:5 0 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view class="fui-alert__wrap" :class="[background?'':('fui-alert__'+type)]"
:style="{background:background || getColor(type),borderRadius:radius,paddingTop:padding[0] || 0,paddingRight:padding[1]||0,paddingBottom:padding[2] || padding[0]||0,paddingLeft:padding[3] || padding[1]||0,marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx'}">
......
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 56 16 2 6 019 5,身份证尾号:5 0 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view class="fui-popup__animation" :class="[ani.in]" :style="'transform:' + transform + ';' + stylesObject"
@tap="change" v-if="isShow" ref="fui_ani">
......@@ -38,18 +37,7 @@
styles: {
type: Object,
default () {
return {
position: 'fixed',
bottom: 0,
top: 0,
left: 0,
right: 0,
// #ifndef APP-NVUE
display: 'flex',
// #endif
'justify-content': 'center',
'align-items': 'center'
};
return {}
}
}
},
......@@ -77,8 +65,22 @@
},
computed: {
stylesObject() {
let styles = {
...this.styles,
//默认值
const defStyles = {
position: 'fixed',
bottom: 0,
top: 0,
left: 0,
right: 0,
// #ifndef APP-NVUE
display: 'flex',
// #endif
'justify-content': 'center',
'align-items': 'center'
};
const mergeStyles = Object.assign({}, defStyles, this.styles);
const styles = {
...mergeStyles,
'transition-duration': this.duration / 1000 + 's'
};
let transfrom = '';
......
<!--本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:1 5616 2 6 019 5,身份证尾号: 5 0 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
<template>
<view class="fui-autograph__wrap" :style="{ width: w + 'px', height:h + 'px',background:background }"
ref="fui_gcanvas_ag">
......@@ -8,17 +7,23 @@
</gcanvas>
<!-- #endif -->
<!-- #ifndef APP-NVUE || MP-TOUTIAO-->
<!-- #ifndef APP-NVUE || MP-TOUTIAO || MP-QQ-->
<canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart"
@touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}" @mousedown="mousedown" @mousemove="mousemove" @mouseup="mouseup"
@mouseleave="mouseleave"></canvas>
<!-- #endif -->
<!-- #ifdef MP-QQ -->
<canvas :disable-scroll="!completed" canvas-id="canvas_autograph" @touchstart="onTouchstart"
@touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}"></canvas>
<!-- #endif -->
<!-- #ifdef MP-TOUTIAO -->
<canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart"
@touchmove.stop.prevent="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}"></canvas>
:style="{width:w+'px',height:h+'px'}" v-if="canvasId"></canvas>
<!-- #endif -->
</view>
</template>
......@@ -62,7 +67,11 @@
tips: {
type: String,
default: '请签名!'
}
},
suffix: {
type: String,
default: 'png'
},
},
watch: {
width(val) {
......@@ -77,16 +86,19 @@
}
},
data() {
// #ifndef MP-WEIXIN
// #ifndef MP-WEIXIN || MP-QQ
const canvasId = `fui_ag_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif
// #ifdef MP-QQ
const canvasId = 'canvas_autograph'
// #endif
return {
// #ifdef APP-NVUE
isAndroid: true,
nTop: 0,
nLeft: 0,
// #endif
canvasId:canvasId,
canvasId: canvasId,
w: 300,
h: 200,
completed: false,
......@@ -104,6 +116,7 @@
this.touchs = null;
},
mounted() {
this.$nextTick(() => {
setTimeout(() => {
// #ifdef APP-NVUE
let ganvas = this.$refs[this.canvasId];
......@@ -130,6 +143,7 @@
canvasId: this.canvasId
})
}, 50)
})
},
// #ifndef VUE3
beforeDestroy() {
......@@ -302,7 +316,7 @@
x: 0,
y: 0,
canvasId: this.canvasId,
fileType: 'png',
fileType: this.suffix,
quality: 1,
success: function(res) {
callback && callback(res.tempFilePath)
......@@ -321,7 +335,7 @@
this.h * 2,
this.w * 2,
this.h * 2,
"png",
this.suffix,
1,
function(res) {
callback && callback(res.tempFilePath)
......
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 15 6162 6019 5,身份证尾号: 5037 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
const isWeex = typeof WXEnvironment !== 'undefined';
const isWeexIOS = isWeex && /ios/i.test(WXEnvironment.platform);
const isWeexAndroid = isWeex && !isWeexIOS;
......
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 15 61 62 60 19 5,身份证尾号: 5 0 3 75T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStyleLinearGradient {
constructor(x0, y0, x1, y1) {
......
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号: 1 561 6 26 01 95,身份证尾号:5 03 7 5T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStylePattern {
constructor(img, pattern) {
this._style = pattern;
......
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:156 1 6 2 601 9 5,身份证尾号:5 0 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStyleRadialGradient {
constructor(x0, y0, r0, x1, y1, r1) {
this._start_pos = { _x: x0, _y: y0, _r: r0 };
......
// 本文件由FirstUI授权予长沙壹润信息科技发展有限公司(手机号:156 1 62 60 1 9 5,身份证尾号: 50 375T)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
import FillStylePattern from './FillStylePattern';
import FillStyleLinearGradient from './FillStyleLinearGradient';
import FillStyleRadialGradient from './FillStyleRadialGradient';
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论