提交 7ad7288e authored 作者: Administrator's avatar Administrator

更新

上级 2b90c182
# Logs # Logs
logs logs
*.log *.log
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
pnpm-debug.log* pnpm-debug.log*
lerna-debug.log* lerna-debug.log*
node_modules node_modules
.DS_Store .DS_Store
dist dist
*.local *.local
# Editor directories and files # Editor directories and files
.idea .idea
*.suo *.suo
*.ntvs* *.ntvs*
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
\ No newline at end of file
{ {
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version" : "0.0", "version" : "0.0",
"configurations" : [ "configurations" : [
{ {
"app-plus" : "app-plus" :
{ {
"launchtype" : "local" "launchtype" : "local"
}, },
"default" : "default" :
{ {
"launchtype" : "local" "launchtype" : "local"
}, },
"mp-weixin" : "mp-weixin" :
{ {
"launchtype" : "local" "launchtype" : "local"
}, },
"type" : "uniCloud" "type" : "uniCloud"
}, },
{ {
"openVueDevtools" : true, "openVueDevtools" : true,
"type" : "uni-app:h5" "type" : "uni-app:h5"
}, },
{ {
"playground" : "standard", "playground" : "standard",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
} }
] ]
} }
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<script> <script>
var coverSupport = var coverSupport =
'CSS' in window && 'CSS' in window &&
typeof CSS.supports === 'function' && typeof CSS.supports === 'function' &&
(CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write( document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + '<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' : '') + (coverSupport ? ', viewport-fit=cover' : '') +
'" />' '" />'
) )
</script> </script>
<title></title> <title></title>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--app-context-->
</head> </head>
<body> <body>
<div id="app"><!--app-html--></div> <div id="app"><!--app-html--></div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<!-- <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> --> <!-- <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> -->
</body> </body>
</html> </html>
{ {
"name": "uni-preset-vue", "name": "uni-preset-vue",
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"dev:app": "uni -p app", "dev:app": "uni -p app",
"dev:app-android": "uni -p app-android", "dev:app-android": "uni -p app-android",
"dev:app-ios": "uni -p app-ios", "dev:app-ios": "uni -p app-ios",
"dev:custom": "uni -p", "dev:custom": "uni -p",
"dev:h5": "uni", "dev:h5": "uni",
"dev:h5:ssr": "uni --ssr", "dev:h5:ssr": "uni --ssr",
"dev:mp-alipay": "uni -p mp-alipay", "dev:mp-alipay": "uni -p mp-alipay",
"dev:mp-baidu": "uni -p mp-baidu", "dev:mp-baidu": "uni -p mp-baidu",
"dev:mp-kuaishou": "uni -p mp-kuaishou", "dev:mp-kuaishou": "uni -p mp-kuaishou",
"dev:mp-lark": "uni -p mp-lark", "dev:mp-lark": "uni -p mp-lark",
"dev:mp-qq": "uni -p mp-qq", "dev:mp-qq": "uni -p mp-qq",
"dev:mp-toutiao": "uni -p mp-toutiao", "dev:mp-toutiao": "uni -p mp-toutiao",
"dev:mp-weixin": "uni -p mp-weixin", "dev:mp-weixin": "uni -p mp-weixin",
"dev:quickapp-webview": "uni -p quickapp-webview", "dev:quickapp-webview": "uni -p quickapp-webview",
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei", "dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
"dev:quickapp-webview-union": "uni -p quickapp-webview-union", "dev:quickapp-webview-union": "uni -p quickapp-webview-union",
"build:app": "uni build -p app", "build:app": "uni build -p app",
"build:app-android": "uni build -p app-android", "build:app-android": "uni build -p app-android",
"build:app-ios": "uni build -p app-ios", "build:app-ios": "uni build -p app-ios",
"build:custom": "uni build -p", "build:custom": "uni build -p",
"build:h5": "uni build", "build:h5": "uni build",
"build:h5:ssr": "uni build --ssr", "build:h5:ssr": "uni build --ssr",
"build:mp-alipay": "uni build -p mp-alipay", "build:mp-alipay": "uni build -p mp-alipay",
"build:mp-baidu": "uni build -p mp-baidu", "build:mp-baidu": "uni build -p mp-baidu",
"build:mp-kuaishou": "uni build -p mp-kuaishou", "build:mp-kuaishou": "uni build -p mp-kuaishou",
"build:mp-lark": "uni build -p mp-lark", "build:mp-lark": "uni build -p mp-lark",
"build:mp-qq": "uni build -p mp-qq", "build:mp-qq": "uni build -p mp-qq",
"build:mp-toutiao": "uni build -p mp-toutiao", "build:mp-toutiao": "uni build -p mp-toutiao",
"build:mp-weixin": "uni build -p mp-weixin", "build:mp-weixin": "uni build -p mp-weixin",
"build:quickapp-webview": "uni build -p quickapp-webview", "build:quickapp-webview": "uni build -p quickapp-webview",
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei", "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
"build:quickapp-webview-union": "uni build -p quickapp-webview-union", "build:quickapp-webview-union": "uni build -p quickapp-webview-union",
"type-check": "vue-tsc --noEmit" "type-check": "vue-tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"@dcloudio/uni-app": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-app": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-app-plus": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-app-plus": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-components": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-components": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-h5": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-h5": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-mp-alipay": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-mp-baidu": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-mp-jd": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-mp-jd": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-mp-lark": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-mp-lark": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-mp-qq": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-mp-qq": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-mp-weixin": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3070720230316001",
"vue": "^3.2.45", "vue": "^3.2.45",
"vue-i18n": "^9.1.9" "vue-i18n": "^9.1.9"
}, },
"devDependencies": { "devDependencies": {
"@dcloudio/types": "^3.2.7", "@dcloudio/types": "^3.2.7",
"@dcloudio/uni-automator": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-automator": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-cli-shared": "3.0.0-alpha-3070720230316001",
"@dcloudio/uni-stacktracey": "3.0.0-alpha-3070720230316001", "@dcloudio/uni-stacktracey": "3.0.0-alpha-3070720230316001",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3070720230316001", "@dcloudio/vite-plugin-uni": "3.0.0-alpha-3070720230316001",
"@vue/tsconfig": "^0.1.3", "@vue/tsconfig": "^0.1.3",
"sass": "^1.54.8", "sass": "^1.54.8",
"sass-loader": "^13.0.2", "sass-loader": "^13.0.2",
"typescript": "^4.9.4", "typescript": "^4.9.4",
"vite": "4.0.3", "vite": "4.0.3",
"vue-tsc": "^1.0.24" "vue-tsc": "^1.0.24"
} }
} }
<script setup lang="ts"> <script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"; import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
</script> </script>
<style></style> <style></style>
@font-face { @font-face {
font-family: "iconfont"; font-family: "iconfont";
src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAKUAAsAAAAABlAAAAJJAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcApcdgE2AiQDCAsGAAQgBYRtBy8bmwXIrjBu4UkbIjvjLimCmu1EP9KHAd4jgmi/3+zde18toRbpnkUTzRKRUkgQE6RA9xL+tMuG6RYp8bFsgmbcecAB9mDhH67tDS3pQsIsmSbPL7chM1RKsFr5mNDBoUDPJItlaZG8fvhi/tciWcbRfJ7L6U2gA1l9oBz3orEmTRpAvTigAPfCKLISSiNtGLvAJdwn0DCHgMfN/kgLK1jLAvE0p7YWzoUVCparCZWavYV4U6qllxTNa/j5+JeKMEmZWQ1njw1PK39hF+TnFG59QoSADpfI2AEUxFVt+oQpGIc10pYlYF+1wRfTfZfYq12wv86qboEZqLgnpau61VyC21L06V8d9cuJmT795hWPJp8ayHj0wrZNx+/+1Nzdf8MBtu9H2p+tgB5tn/W1PEZvgeD5Xf/if61ZgE9foa3Qz0ttd57gtyh79hS62nKmQlXWDiczp2tqaGAK+we+sZbxPeRDzXiEt2o2RVazQhbsDkpNu6io2UPDNn24aagxRVHHlgkQehaSjg9kPYcs2IvSxENFL0w03ASd2bQW82is0d6iB+YE2ZWCOO5tNKodIN0xe51Vh/wE15t5DGQsUcy1UOB6jg19T1NjSyCsJQcFHkPGJJS1XKC7jaXtVpV4nNS9KGYl16KOrCHbFvIA4wRkLkkg/uitaOn9A4jaYWzrlq6a/ARa25hPDiRG9CBbBtGr616e6faolGGLAMGaxAEFZiGGkUCpn7WAXFsxaURSKeH2oNDXEFvfxL/uGDRY1hT2lKy8Y3KDmgYA') format('woff2') src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAKUAAsAAAAABlAAAAJJAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcApcdgE2AiQDCAsGAAQgBYRtBy8bmwXIrjBu4UkbIjvjLimCmu1EP9KHAd4jgmi/3+zde18toRbpnkUTzRKRUkgQE6RA9xL+tMuG6RYp8bFsgmbcecAB9mDhH67tDS3pQsIsmSbPL7chM1RKsFr5mNDBoUDPJItlaZG8fvhi/tciWcbRfJ7L6U2gA1l9oBz3orEmTRpAvTigAPfCKLISSiNtGLvAJdwn0DCHgMfN/kgLK1jLAvE0p7YWzoUVCparCZWavYV4U6qllxTNa/j5+JeKMEmZWQ1njw1PK39hF+TnFG59QoSADpfI2AEUxFVt+oQpGIc10pYlYF+1wRfTfZfYq12wv86qboEZqLgnpau61VyC21L06V8d9cuJmT795hWPJp8ayHj0wrZNx+/+1Nzdf8MBtu9H2p+tgB5tn/W1PEZvgeD5Xf/if61ZgE9foa3Qz0ttd57gtyh79hS62nKmQlXWDiczp2tqaGAK+we+sZbxPeRDzXiEt2o2RVazQhbsDkpNu6io2UPDNn24aagxRVHHlgkQehaSjg9kPYcs2IvSxENFL0w03ASd2bQW82is0d6iB+YE2ZWCOO5tNKodIN0xe51Vh/wE15t5DGQsUcy1UOB6jg19T1NjSyCsJQcFHkPGJJS1XKC7jaXtVpV4nNS9KGYl16KOrCHbFvIA4wRkLkkg/uitaOn9A4jaYWzrlq6a/ARa25hPDiRG9CBbBtGr616e6faolGGLAMGaxAEFZiGGkUCpn7WAXFsxaURSKeH2oNDXEFvfxL/uGDRY1hT2lKy8Y3KDmgYA') format('woff2')
} }
.iconfont { .iconfont {
font-family: "iconfont" !important; font-family: "iconfont" !important;
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-close:before { .icon-close:before {
content: "\e622"; content: "\e622";
} }
\ No newline at end of file
// export const ApiUrl: string = '/ndr' // export const ApiUrl: string = '/ndr'
// export const ApiUrl: string = 'http://192.168.1.37/k3Cloud' // export const ApiUrl: string = 'http://192.168.1.37/k3Cloud'
// export const ApiUrl = 'http://192.168.0.242:89/k3Cloud' // export const ApiUrl = 'http://192.168.0.242:89/k3Cloud'
export const ApiUrl = 'http://k3.newdegreetech.com:89/k3cloud' export const ApiUrl = 'http://k3.newdegreetech.com:89/k3cloud'
/// <reference types="vite/client" /> /// <reference types="vite/client" />
declare module '*.vue' { declare module '*.vue' {
import { DefineComponent } from 'vue' import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any> const component: DefineComponent<{}, {}, any>
export default component export default component
} }
import { createSSRApp } from "vue"; import { createSSRApp } from "vue";
import App from "./App.vue"; import App from "./App.vue";
export function createApp() { export function createApp() {
const app = createSSRApp(App); const app = createSSRApp(App);
return { return {
app, app,
}; };
} }
{ {
"name" : "", "name" : "",
"appid" : "", "appid" : "",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
"usingComponents" : true, "usingComponents" : true,
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3, "compilerVersion" : 3,
"splashscreen" : { "splashscreen" : {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender" : true,
"waiting" : true, "waiting" : true,
"autoclose" : true, "autoclose" : true,
"delay" : 0 "delay" : 0
}, },
/* 模块配置 */ /* 模块配置 */
"modules" : {}, "modules" : {},
/* 应用发布信息 */ /* 应用发布信息 */
"distribute" : { "distribute" : {
/* android打包配置 */ /* android打包配置 */
"android" : { "android" : {
"permissions" : [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ]
}, },
/* ios打包配置 */ /* ios打包配置 */
"ios" : {}, "ios" : {},
/* SDK配置 */ /* SDK配置 */
"sdkConfigs" : {} "sdkConfigs" : {}
} }
}, },
/* 快应用特有相关 */ /* 快应用特有相关 */
"quickapp" : {}, "quickapp" : {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin" : {
"appid" : "", "appid" : "",
"setting" : { "setting" : {
"urlCheck" : false "urlCheck" : false
}, },
"usingComponents" : true "usingComponents" : true
}, },
"mp-alipay" : { "mp-alipay" : {
"usingComponents" : true "usingComponents" : true
}, },
"mp-baidu" : { "mp-baidu" : {
"usingComponents" : true "usingComponents" : true
}, },
"mp-toutiao" : { "mp-toutiao" : {
"usingComponents" : true "usingComponents" : true
}, },
"uniStatistics": { "uniStatistics": {
"enable": false "enable": false
}, },
"vueVersion" : "3" "vueVersion" : "3"
} }
{ {
"id": "mosowe-dropdown", "id": "mosowe-dropdown",
"name": "mosowe-dropdown", "name": "mosowe-dropdown",
"displayName": "mosowe-dropdown", "displayName": "mosowe-dropdown",
"version": "1.0.1", "version": "1.0.1",
"description": "PC端下拉菜单组件,用于Hbuilder创建的uniapp项目,当你无法使用element第三方组件库可以考虑", "description": "PC端下拉菜单组件,用于Hbuilder创建的uniapp项目,当你无法使用element第三方组件库可以考虑",
"keywords": [ "keywords": [
"下拉菜单" "下拉菜单"
], ],
"dcloudext": { "dcloudext": {
"category": [ "category": [
"前端组件", "前端组件",
"通用组件" "通用组件"
] ]
} }
} }
\ No newline at end of file
{ {
"pages": [ "pages": [
{ {
"path": "pages/login/index", "path": "pages/login/index",
"style": { "style": {
"navigationBarTitleText": "登录" "navigationBarTitleText": "登录"
} }
}, },
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "项目登记" "navigationBarTitleText": "项目登记"
} }
}, },
{ {
"path": "pages/query/index", "path": "pages/query/index",
"style": { "style": {
"navigationBarTitleText": "项目记录" "navigationBarTitleText": "项目记录"
} }
}, },
{ {
"path": "pages/index/components/edit", "path": "pages/index/components/edit",
"style": { "style": {
"navigationBarTitleText": "修改" "navigationBarTitleText": "修改"
} }
} }
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "NDT Bot", "navigationBarTitleText": "NDT Bot",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
} }
} }
<template> <template>
<div class='edit-container'> <div class='edit-container'>
<formList ref="formListRef" :select-list="selectList" @initSelect="initSelect"/> <formList ref="formListRef" :select-list="selectList" @initSelect="initSelect"/>
<view class="button"> <view class="button">
<button size="mini" @tap="onSave">保存</button> <button size="mini" @tap="onSave">保存</button>
</view> </view>
</div> </div>
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { nextTick, ref } from 'vue' import { nextTick, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
import { ApiUrl } from '@/config'; import { ApiUrl } from '@/config';
import formList from './formList.vue'; import formList from './formList.vue';
const selectList = ref([] as any[]) const selectList = ref([] as any[])
const formListRef = ref() const formListRef = ref()
const fid = ref() const fid = ref()
onLoad((options: any) => { onLoad((options: any) => {
let option = JSON.parse(options.row) let option = JSON.parse(options.row)
fid.value = option.FID fid.value = option.FID
initSelect() initSelect()
nextTick(() => { nextTick(() => {
formListRef.value.formData = { formListRef.value.formData = {
number: option.FNUMBER, number: option.FNUMBER,
Hours: option.F_LQKJ_WORKTIME, Hours: option.F_LQKJ_WORKTIME,
workContent: option.F_LQKJ_WORKCONATAINER workContent: option.F_LQKJ_WORKCONATAINER
} }
// formListRef.value.selectNumberData.fname = option.FNAME // formListRef.value.selectNumberData.fname = option.FNAME
formListRef.value.initRules() formListRef.value.initRules()
}); });
}) })
const initSelect = (FName?: string) => { const initSelect = (FName?: string) => {
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
}) })
uni.request({ uni.request({
url: ApiUrl + '/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.ExecuteCmdSelect,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc', url: ApiUrl + '/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.ExecuteCmdSelect,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc',
method: 'POST', method: 'POST',
data: { FName }, data: { FName },
success({ data: res }: any) { success({ data: res }: any) {
uni.hideLoading() uni.hideLoading()
if (res.code == 200) { if (res.code == 200) {
selectList.value = res.data selectList.value = res.data
} }
}, },
fail() { fail() {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '请求失败', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
}) })
} }
const onSave = () => { const onSave = () => {
formListRef.value.submit().then((res: any) => { formListRef.value.submit().then((res: any) => {
if (res.Hours > 8) return uni.showToast({ if (res.Hours > 8) return uni.showToast({
title: '工时数不大于8', title: '工时数不大于8',
icon: 'none' icon: 'none'
}) })
if (res.Hours <= 0) return uni.showToast({ if (res.Hours <= 0) return uni.showToast({
title: '填写工时数需大于0', title: '填写工时数需大于0',
icon: 'none' icon: 'none'
}) })
let data = { let data = {
parmeters: { parmeters: {
NeedUpDateFields: [ NeedUpDateFields: [
"F_LQKJ_FITEM", "F_LQKJ_DATE2", "F_LQKJ_WORKTIME", "F_LQKJ_FNAME", 'F_LQKJ_WORKCONATAINER' "F_LQKJ_FITEM", "F_LQKJ_DATE2", "F_LQKJ_WORKTIME", "F_LQKJ_FNAME", 'F_LQKJ_WORKCONATAINER'
], ],
Model: { Model: {
FID: fid.value, FID: fid.value,
F_LQKJ_FITEM: { F_LQKJ_FITEM: {
FNumber: res.number FNumber: res.number
}, },
F_LQKJ_WORKTIME: Number(res.Hours), F_LQKJ_WORKTIME: Number(res.Hours),
F_LQKJ_FNAME: { F_LQKJ_FNAME: {
FName: localStorage.getItem('Name') FName: localStorage.getItem('Name')
}, },
F_LQKJ_WORKCONATAINER: res.workContent F_LQKJ_WORKCONATAINER: res.workContent
} }
} }
} }
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
}) })
uni.request({ uni.request({
url: ApiUrl + '/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.ExecuteCmdEdit,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc', url: ApiUrl + '/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.ExecuteCmdEdit,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc',
method: 'POST', method: 'POST',
data, data,
success(res: any) { success(res: any) {
uni.hideLoading() uni.hideLoading()
const { data } = res const { data } = res
if (data.code == 200) { if (data.code == 200) {
uni.showToast({ uni.showToast({
title: '保存成功', title: '保存成功',
icon: 'none' icon: 'none'
}) })
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ delta: 1 }) uni.navigateBack({ delta: 1 })
}, 500); }, 500);
} else { } else {
uni.showToast({ uni.showToast({
title: data.msg, title: data.msg,
icon: 'none' icon: 'none'
}) })
} }
}, },
fail() { fail() {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '请求失败', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
}) })
}).catch((err: any) => { }).catch((err: any) => {
uni.showToast({ uni.showToast({
title: err[0].errorMessage, title: err[0].errorMessage,
icon: 'none' icon: 'none'
}) })
}) })
} }
</script> </script>
<style lang = "scss" scoped> <style lang = "scss" scoped>
.edit-container { .edit-container {
padding: 20rpx; padding: 20rpx;
margin: 100px auto; margin: 100px auto;
.button { .button {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
margin-top: 50rpx; margin-top: 50rpx;
& button { & button {
width: 240rpx; width: 240rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
font-weight: bold; font-weight: bold;
} }
& button:last-child { & button:last-child {
color: #fff; color: #fff;
background-color: rgb(7, 193, 69); background-color: rgb(7, 193, 69);
} }
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<view class="item-container"> <view class="item-container">
<view class="form-title">{{ placeholder }}</view> <view class="form-title">{{ placeholder }}</view>
<view class="line" /> <view class="line" />
<uni-forms <uni-forms
ref="formRef" ref="formRef"
:modelValue="formData" :modelValue="formData"
:rules="rules" :rules="rules"
label-width="10" label-width="10"
> >
<view <view
style=" style="
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
" "
> >
<uni-forms-item name="number"> <uni-forms-item name="number">
<div @tap="handleClick"> <div @tap="handleClick">
<uni-easyinput <uni-easyinput
type="text" type="text"
v-model="formData.number" v-model="formData.number"
placeholder="项目编号" placeholder="项目编号"
:inputBorder="false" :inputBorder="false"
:clearable="false" :clearable="false"
disabled disabled
placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx;" placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx;"
style="pointer-events: none" style="pointer-events: none"
/> />
</div> </div>
</uni-forms-item> </uni-forms-item>
<uni-icons <uni-icons
v-show="formData.number" v-show="formData.number"
type="clear" type="clear"
size="22" size="22"
color="#ccc" color="#ccc"
@tap="clear" @tap="clear"
/> />
</view> </view>
<view class="line" /> <view class="line" />
<uni-forms-item name="Hours"> <uni-forms-item name="Hours">
<uni-easyinput <uni-easyinput
type="number" type="number"
v-model="formData.Hours" v-model="formData.Hours"
placeholder="工时数" placeholder="工时数"
:inputBorder="false" :inputBorder="false"
:clearable="false" :clearable="false"
placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx" placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx"
/> />
<view class="line" /> <view class="line" />
</uni-forms-item> </uni-forms-item>
<view class="line" /> <view class="line" />
<uni-forms-item name="workContent"> <uni-forms-item name="workContent">
<uni-easyinput <uni-easyinput
type="textarea" type="textarea"
maxlength="-1" maxlength="-1"
v-model="formData.workContent" v-model="formData.workContent"
placeholder="工作内容" placeholder="工作内容"
:inputBorder="false" :inputBorder="false"
:clearable="false" :clearable="false"
placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx" placeholderStyle="color: rgba(0, 0, 0, 0.9); font-size: 28rpx"
/> />
<view class="line" /> <view class="line" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
</view> </view>
<popup <popup
ref="popupRef" ref="popupRef"
v-model="formData.number" v-model="formData.number"
:selectList="selectList" :selectList="selectList"
@input-value="inputValue" @input-value="inputValue"
/> />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { nextTick, ref } from 'vue' import { nextTick, ref } from 'vue'
import popup from './popup.vue' import popup from './popup.vue'
defineProps({ defineProps({
placeholder: { placeholder: {
type: String, type: String,
}, },
selectList: { selectList: {
type: Array, type: Array,
default: [], default: [],
}, },
}) })
const emits = defineEmits(['initSelect']) const emits = defineEmits(['initSelect'])
const formData = ref({ const formData = ref({
number: '', number: '',
Hours: '', Hours: '',
workContent: '', workContent: '',
}) })
const rules = ref({ const rules = ref({
number: { number: {
rules: [ rules: [
{ {
required: true, required: true,
errorMessage: '请选择项目编号', errorMessage: '请选择项目编号',
}, },
], ],
}, },
workContent: { workContent: {
rules: [ rules: [
{ {
required: true, required: true,
errorMessage: '请选择工作内容', errorMessage: '请选择工作内容',
}, },
], ],
}, },
Hours: { Hours: {
rules: [ rules: [
{ {
required: true, required: true,
errorMessage: '请输入工时数', errorMessage: '请输入工时数',
}, },
], ],
}, },
}) })
const formRef = ref() const formRef = ref()
const popupRef = ref() const popupRef = ref()
const initRules = () => { const initRules = () => {
formRef.value?.setRules(rules.value) formRef.value?.setRules(rules.value)
} }
const reset = () => { const reset = () => {
formData.value = { formData.value = {
number: '', number: '',
Hours: '', Hours: '',
workContent: '', workContent: '',
} }
} }
const submit = () => { const submit = () => {
let p = new Promise((resolve: any, reject: any) => { let p = new Promise((resolve: any, reject: any) => {
formRef.value formRef.value
?.validate() ?.validate()
.then((res: any) => { .then((res: any) => {
resolve(res) resolve(res)
}) })
.catch((err: any) => { .catch((err: any) => {
reject(err) reject(err)
}) })
}) })
return p return p
} }
const handleClick = (event: any) => { const handleClick = (event: any) => {
event.stopPropagation() event.stopPropagation()
console.log('sss') console.log('sss')
emits('initSelect') emits('initSelect')
popupRef.value.open() popupRef.value.open()
const height = localStorage.getItem('windowHeight') const height = localStorage.getItem('windowHeight')
nextTick(() => (popupRef.value.windowHeight = Number(height) * 0.8 * 0.9)) nextTick(() => (popupRef.value.windowHeight = Number(height) * 0.8 * 0.9))
} }
const clear = () => { const clear = () => {
formData.value.number = '' formData.value.number = ''
} }
const inputValue = (value: string) => emits('initSelect', value) const inputValue = (value: string) => emits('initSelect', value)
defineExpose({ defineExpose({
formData, formData,
initRules, initRules,
submit, submit,
reset, reset,
}) })
</script> </script>
<style scoped> <style scoped>
.form-title { .form-title {
padding: 14rpx 20rpx; padding: 14rpx 20rpx;
color: #ccc; color: #ccc;
font-size: 24rpx; font-size: 24rpx;
} }
.line { .line {
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
width: 100%; width: 100%;
transform: scaleY(0.5); transform: scaleY(0.5);
} }
.item-container { .item-container {
margin-bottom: 20rpx; margin-bottom: 20rpx;
/* border: #ddd 1px solid; /* border: #ddd 1px solid;
padding: 10rpx; padding: 10rpx;
border-radius: 10rpx; border-radius: 10rpx;
padding-bottom: 20rpx; */ padding-bottom: 20rpx; */
} }
.item-container >>> .uni-select { .item-container >>> .uni-select {
border: 0; border: 0;
} }
.item-container >>> .uni-select__input-placeholder { .item-container >>> .uni-select__input-placeholder {
color: rgba(0, 0, 0, 0.9); color: rgba(0, 0, 0, 0.9);
font-size: 28rpx; font-size: 28rpx;
} }
.item-container >>> .is-direction-left { .item-container >>> .is-direction-left {
width: 100%; width: 100%;
} }
.item-container >>> .uni-icons { .item-container >>> .uni-icons {
/* display: none; */ /* display: none; */
} }
/* .item-container>>>.uni-forms-item:last-child { /* .item-container>>>.uni-forms-item:last-child {
margin-bottom: 10px; margin-bottom: 10px;
} */ } */
.item-container >>> .uni-forms-item { .item-container >>> .uni-forms-item {
margin-bottom: 0; margin-bottom: 0;
} }
.item-container >>> .is-textarea { .item-container >>> .is-textarea {
padding: 0 20rpx; padding: 0 20rpx;
} }
.item-container >>> .uni-forms-item__error { .item-container >>> .uni-forms-item__error {
display: none; display: none;
} }
.item-container >>> .is-disabled { .item-container >>> .is-disabled {
background-color: #fff; background-color: #fff;
} }
</style> </style>
<template> <template>
<wyb-popup ref="popupRef" type="bottom" height="800" width="500" radius="4" :showCloseIcon="true"> <wyb-popup ref="popupRef" type="bottom" height="800" width="500" radius="4" :showCloseIcon="true">
<view class="popup-content"> <view class="popup-content">
<uni-easyinput suffixIcon="search" v-model="inputValue" placeholder="项目编号" @iconClick="inputChange" <uni-easyinput suffixIcon="search" v-model="inputValue" placeholder="项目编号" @iconClick="inputChange"
@input="inputChange" @change="inputChange" /> @input="inputChange" @change="inputChange" />
<view style="margin-bottom: 20px; box-sizing: border-box; overflow-y: scroll;" <view style="margin-bottom: 20px; box-sizing: border-box; overflow-y: scroll;"
:style="{ 'height': windowHeight + 'px' }"> :style="{ 'height': windowHeight + 'px' }">
<!-- <scroll-view scroll-top="0" scroll-y="true"> --> <!-- <scroll-view scroll-top="0" scroll-y="true"> -->
<uni-list v-if="selectList.length !== 0"> <uni-list v-if="selectList.length !== 0">
<uni-list-item class="project-list" v-for="(item, i) in selectList" :key="i" :title="item.fnumber" <uni-list-item class="project-list" v-for="(item, i) in selectList" :key="i" :title="item.fnumber"
@click="handleList(item.fnumber)" clickable /> @click="handleList(item.fnumber)" clickable />
</uni-list> </uni-list>
<view v-else class="loading">暂无数据</view> <view v-else class="loading">暂无数据</view>
<!-- </scroll-view> --> <!-- </scroll-view> -->
</view> </view>
</view> </view>
</wyb-popup> </wyb-popup>
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { ref } from 'vue' import { ref } from 'vue'
defineProps({ defineProps({
modelValue: { modelValue: {
type: String type: String
}, },
selectList: { selectList: {
type: Array type: Array
} as any } as any
}) })
const popupRef = ref() const popupRef = ref()
const windowHeight = ref() const windowHeight = ref()
const emits = defineEmits(['inputValue', 'update:modelValue']) const emits = defineEmits(['inputValue', 'update:modelValue'])
const inputValue = ref() const inputValue = ref()
const handleList = (value: String) => { const handleList = (value: String) => {
emits('update:modelValue', value) emits('update:modelValue', value)
popupRef.value?.hide() popupRef.value?.hide()
} }
const open = () => { const open = () => {
popupRef.value?.show() popupRef.value?.show()
} }
const inputChange = () => { const inputChange = () => {
setTimeout(() => { setTimeout(() => {
emits('inputValue', inputValue.value) emits('inputValue', inputValue.value)
}, 100) }, 100)
} }
defineExpose({ defineExpose({
open, open,
windowHeight windowHeight
}) })
</script> </script>
<style lang = "scss" scoped> <style lang = "scss" scoped>
.popup-content { .popup-content {
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx; padding: 20rpx;
height: 100%; height: 100%;
.uni-easyinput { .uni-easyinput {
width: 90%; width: 90%;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
:deep(.uni-scroll-view) { :deep(.uni-scroll-view) {
margin-top: 20rpx; margin-top: 20rpx;
height: 1200rpx; height: 1200rpx;
} }
.loading { .loading {
font-size: 28rpx; font-size: 28rpx;
width: 100%; width: 100%;
text-align: center; text-align: center;
color: #ccc; color: #ccc;
margin-top: 40rpx; margin-top: 40rpx;
} }
} }
</style> </style>
\ No newline at end of file
差异被折叠。
<template> <template>
<view class="login-container"> <view class="login-container">
<uni-easyinput placeholder="员工编号" v-model="ID" type="text" /> <uni-easyinput placeholder="员工编号" v-model="ID" type="text" />
<button @tap="tapLogin" class="getCaptcha">登录</button> <button @tap="tapLogin" class="getCaptcha">登录</button>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { ApiUrl } from '@/config'; import { ApiUrl } from '@/config';
const ID = ref() const ID = ref()
let tapLogin = () => { let tapLogin = () => {
if (!ID.value) return uni.showToast({ if (!ID.value) return uni.showToast({
title: '员工编号不能为空', title: '员工编号不能为空',
icon: 'none' icon: 'none'
}) })
login() login()
}; };
const login = () => { const login = () => {
uni.request({ uni.request({
url: ApiUrl + '/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.Login,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc', url: ApiUrl + '/LQKJ.K3.NDR.WebApiBusinessServicePlugIn.WebApi.Login,LQKJ.K3.NDR.WebApiBusinessServicePlugIn.common.kdsvc',
data: { ID: ID.value }, data: { ID: ID.value },
timeout: 5000, timeout: 5000,
method: 'POST', method: 'POST',
success: ({ data: res }: any) => { success: ({ data: res }: any) => {
if (res.code === 200) { if (res.code === 200) {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index', url: '/pages/index/index',
success() { success() {
localStorage.setItem("ID", ID.value) localStorage.setItem("ID", ID.value)
localStorage.setItem("Name", res.data[0].FNAME) localStorage.setItem("Name", res.data[0].FNAME)
} }
}) })
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}) })
} }
}, },
fail: (error) => { fail: (error) => {
uni.showToast({ uni.showToast({
title: '请求失败', title: '请求失败',
icon: 'none' icon: 'none'
}) })
} }
}) })
} }
onMounted(() => { onMounted(() => {
ID.value = localStorage.getItem('ID') ID.value = localStorage.getItem('ID')
if (ID.value) login() if (ID.value) login()
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.login-container { .login-container {
margin: 400rpx auto; margin: 400rpx auto;
padding: 40rpx; padding: 40rpx;
.getCaptcha { .getCaptcha {
width: 400rpx; width: 400rpx;
background-color: rgb(253, 243, 208); background-color: rgb(253, 243, 208);
color: #ccc; color: #ccc;
border: none; border: none;
font-size: 30rpx; font-size: 30rpx;
margin-top: 60rpx; margin-top: 60rpx;
&::after { &::after {
border: none; border: none;
} }
} }
} }
</style> </style>
差异被折叠。
export {} export {}
declare module "vue" { declare module "vue" {
type Hooks = App.AppInstance & Page.PageInstance; type Hooks = App.AppInstance & Page.PageInstance;
interface ComponentCustomOptions extends Hooks {} interface ComponentCustomOptions extends Hooks {}
} }
\ No newline at end of file
/** /**
* 这里是uni-app内置的常用样式变量 * 这里是uni-app内置的常用样式变量
* *
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
* *
*/ */
/** /**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
* *
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/ */
/* 颜色变量 */ /* 颜色变量 */
/* 行为相关颜色 */ /* 行为相关颜色 */
$uni-color-primary: #007aff; $uni-color-primary: #007aff;
$uni-color-success: #4cd964; $uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e; $uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d; $uni-color-error: #dd524d;
/* 文字基本颜色 */ /* 文字基本颜色 */
$uni-text-color: #333; // 基本色 $uni-text-color: #333; // 基本色
$uni-text-color-inverse: #fff; // 反色 $uni-text-color-inverse: #fff; // 反色
$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息 $uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080; $uni-text-color-placeholder: #808080;
$uni-text-color-disable: #c0c0c0; $uni-text-color-disable: #c0c0c0;
/* 背景颜色 */ /* 背景颜色 */
$uni-bg-color: #fff; $uni-bg-color: #fff;
$uni-bg-color-grey: #f8f8f8; $uni-bg-color-grey: #f8f8f8;
$uni-bg-color-hover: #f1f1f1; // 点击状态颜色 $uni-bg-color-hover: #f1f1f1; // 点击状态颜色
$uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色 $uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色
/* 边框颜色 */ /* 边框颜色 */
$uni-border-color: #c8c7cc; $uni-border-color: #c8c7cc;
/* 尺寸变量 */ /* 尺寸变量 */
/* 文字尺寸 */ /* 文字尺寸 */
$uni-font-size-sm: 12px; $uni-font-size-sm: 12px;
$uni-font-size-base: 14px; $uni-font-size-base: 14px;
$uni-font-size-lg: 16; $uni-font-size-lg: 16;
/* 图片尺寸 */ /* 图片尺寸 */
$uni-img-size-sm: 20px; $uni-img-size-sm: 20px;
$uni-img-size-base: 26px; $uni-img-size-base: 26px;
$uni-img-size-lg: 40px; $uni-img-size-lg: 40px;
/* Border Radius */ /* Border Radius */
$uni-border-radius-sm: 2px; $uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px; $uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px; $uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%; $uni-border-radius-circle: 50%;
/* 水平间距 */ /* 水平间距 */
$uni-spacing-row-sm: 5px; $uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px; $uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px; $uni-spacing-row-lg: 15px;
/* 垂直间距 */ /* 垂直间距 */
$uni-spacing-col-sm: 4px; $uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px; $uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px; $uni-spacing-col-lg: 12px;
/* 透明度 */ /* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 $uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */ /* 文章场景相关 */
$uni-color-title: #2c405a; // 文章标题颜色 $uni-color-title: #2c405a; // 文章标题颜色
$uni-font-size-title: 20px; $uni-font-size-title: 20px;
$uni-color-subtitle: #555; // 二级标题颜色 $uni-color-subtitle: #555; // 二级标题颜色
$uni-font-size-subtitle: 18px; $uni-font-size-subtitle: 18px;
$uni-color-paragraph: #3f536e; // 文章段落颜色 $uni-color-paragraph: #3f536e; // 文章段落颜色
$uni-font-size-paragraph: 15px; $uni-font-size-paragraph: 15px;
\ No newline at end of file
## 1.2.2(2023-01-28) ## 1.2.2(2023-01-28)
- 修复 运行/打包 控制台警告问题 - 修复 运行/打包 控制台警告问题
## 1.2.1(2022-09-05) ## 1.2.1(2022-09-05)
- 修复 当 text 超过 max-num 时,badge 的宽度计算是根据 text 的长度计算,更改为 css 计算实际展示宽度,详见:[https://ask.dcloud.net.cn/question/150473](https://ask.dcloud.net.cn/question/150473) - 修复 当 text 超过 max-num 时,badge 的宽度计算是根据 text 的长度计算,更改为 css 计算实际展示宽度,详见:[https://ask.dcloud.net.cn/question/150473](https://ask.dcloud.net.cn/question/150473)
## 1.2.0(2021-11-19) ## 1.2.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-badge](https://uniapp.dcloud.io/component/uniui/uni-badge) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-badge](https://uniapp.dcloud.io/component/uniui/uni-badge)
## 1.1.7(2021-11-08) ## 1.1.7(2021-11-08)
- 优化 升级ui - 优化 升级ui
- 修改 size 属性默认值调整为 small - 修改 size 属性默认值调整为 small
- 修改 type 属性,默认值调整为 error,info 替换 default - 修改 type 属性,默认值调整为 error,info 替换 default
## 1.1.6(2021-09-22) ## 1.1.6(2021-09-22)
- 修复 在字节小程序上样式不生效的 bug - 修复 在字节小程序上样式不生效的 bug
## 1.1.5(2021-07-30) ## 1.1.5(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.4(2021-07-29) ## 1.1.4(2021-07-29)
- 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性 - 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性
## 1.1.3(2021-06-24) ## 1.1.3(2021-06-24)
- 优化 示例项目 - 优化 示例项目
## 1.1.1(2021-05-12) ## 1.1.1(2021-05-12)
- 新增 组件示例地址 - 新增 组件示例地址
## 1.1.0(2021-05-12) ## 1.1.0(2021-05-12)
- 新增 uni-badge 的 absolute 属性,支持定位 - 新增 uni-badge 的 absolute 属性,支持定位
- 新增 uni-badge 的 offset 属性,支持定位偏移 - 新增 uni-badge 的 offset 属性,支持定位偏移
- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点 - 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点
- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+ - 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+
- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式 - 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式
## 1.0.7(2021-05-07) ## 1.0.7(2021-05-07)
- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug - 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug
- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug - 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug
- 新增 uni-badge 属性 custom-style, 支持自定义样式 - 新增 uni-badge 属性 custom-style, 支持自定义样式
## 1.0.6(2021-02-04) ## 1.0.6(2021-02-04)
- 调整为uni_modules目录规范 - 调整为uni_modules目录规范
{ {
"id": "uni-badge", "id": "uni-badge",
"displayName": "uni-badge 数字角标", "displayName": "uni-badge 数字角标",
"version": "1.2.2", "version": "1.2.2",
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
"keywords": [ "keywords": [
"", "",
"badge", "badge",
"uni-ui", "uni-ui",
"uniui", "uniui",
"数字角标", "数字角标",
"徽章" "徽章"
], ],
"repository": "https://github.com/dcloudio/uni-ui", "repository": "https://github.com/dcloudio/uni-ui",
"engines": { "engines": {
"HBuilderX": "" "HBuilderX": ""
}, },
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
"sourcecode": { "sourcecode": {
"price": "0.00" "price": "0.00"
} }
}, },
"contact": { "contact": {
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "无", "ads": "无",
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue" "type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": ["uni-scss"], "dependencies": ["uni-scss"],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y"
}, },
"client": { "client": {
"App": { "App": {
"app-vue": "y", "app-vue": "y",
"app-nvue": "y" "app-nvue": "y"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
"Android Browser": "y", "Android Browser": "y",
"微信浏览器(Android)": "y", "微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y" "QQ浏览器(Android)": "y"
}, },
"H5-pc": { "H5-pc": {
"Chrome": "y", "Chrome": "y",
"IE": "y", "IE": "y",
"Edge": "y", "Edge": "y",
"Firefox": "y", "Firefox": "y",
"Safari": "y" "Safari": "y"
}, },
"小程序": { "小程序": {
"微信": "y", "微信": "y",
"阿里": "y", "阿里": "y",
"百度": "y", "百度": "y",
"字节跳动": "y", "字节跳动": "y",
"QQ": "y" "QQ": "y"
}, },
"快应用": { "快应用": {
"华为": "y", "华为": "y",
"联盟": "y" "联盟": "y"
}, },
"Vue": { "Vue": {
"vue2": "y", "vue2": "y",
"vue3": "y" "vue3": "y"
} }
} }
} }
} }
} }
\ No newline at end of file
## Badge 数字角标 ## Badge 数字角标
> **组件名:uni-badge** > **组件名:uni-badge**
> 代码块: `uBadge` > 代码块: `uBadge`
数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景, 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景,
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-badge) ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-badge)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
## 1.4.9(2023-02-02) ## 1.4.9(2023-02-02)
- 修复 某些情况切换月份错误问题 - 修复 某些情况切换月份错误问题
## 1.4.8(2023-01-30) ## 1.4.8(2023-01-30)
- 修复 某些情况切换月份错误问题 - 修复 某些情况切换月份错误问题
## 1.4.7(2022-09-16) ## 1.4.7(2022-09-16)
- 可以使用 uni-scss 控制主题色 - 可以使用 uni-scss 控制主题色
## 1.4.6(2022-09-08) ## 1.4.6(2022-09-08)
- fix: 表头年月切换,导致改变当前日期为选择月1号,且未触发change事件 - fix: 表头年月切换,导致改变当前日期为选择月1号,且未触发change事件
## 1.4.5(2022-02-25) ## 1.4.5(2022-02-25)
- 修复 条件编译 nvue 不支持的 css 样式 - 修复 条件编译 nvue 不支持的 css 样式
## 1.4.4(2022-02-25) ## 1.4.4(2022-02-25)
- 修复 条件编译 nvue 不支持的 css 样式 - 修复 条件编译 nvue 不支持的 css 样式
## 1.4.3(2021-09-22) ## 1.4.3(2021-09-22)
- 修复 startDate、 endDate 属性失效的 bug - 修复 startDate、 endDate 属性失效的 bug
## 1.4.2(2021-08-24) ## 1.4.2(2021-08-24)
- 新增 支持国际化 - 新增 支持国际化
## 1.4.1(2021-08-05) ## 1.4.1(2021-08-05)
- 修复 弹出层被 tabbar 遮盖 bug - 修复 弹出层被 tabbar 遮盖 bug
## 1.4.0(2021-07-30) ## 1.4.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.3.16(2021-05-12) ## 1.3.16(2021-05-12)
- 新增 组件示例地址 - 新增 组件示例地址
## 1.3.15(2021-02-04) ## 1.3.15(2021-02-04)
- 调整为uni_modules目录规范 - 调整为uni_modules目录规范
{ {
"uni-calender.ok": "ok", "uni-calender.ok": "ok",
"uni-calender.cancel": "cancel", "uni-calender.cancel": "cancel",
"uni-calender.today": "today", "uni-calender.today": "today",
"uni-calender.MON": "MON", "uni-calender.MON": "MON",
"uni-calender.TUE": "TUE", "uni-calender.TUE": "TUE",
"uni-calender.WED": "WED", "uni-calender.WED": "WED",
"uni-calender.THU": "THU", "uni-calender.THU": "THU",
"uni-calender.FRI": "FRI", "uni-calender.FRI": "FRI",
"uni-calender.SAT": "SAT", "uni-calender.SAT": "SAT",
"uni-calender.SUN": "SUN" "uni-calender.SUN": "SUN"
} }
import en from './en.json' import en from './en.json'
import zhHans from './zh-Hans.json' import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json' import zhHant from './zh-Hant.json'
export default { export default {
en, en,
'zh-Hans': zhHans, 'zh-Hans': zhHans,
'zh-Hant': zhHant 'zh-Hant': zhHant
} }
{ {
"uni-calender.ok": "确定", "uni-calender.ok": "确定",
"uni-calender.cancel": "取消", "uni-calender.cancel": "取消",
"uni-calender.today": "今日", "uni-calender.today": "今日",
"uni-calender.SUN": "日", "uni-calender.SUN": "日",
"uni-calender.MON": "一", "uni-calender.MON": "一",
"uni-calender.TUE": "二", "uni-calender.TUE": "二",
"uni-calender.WED": "三", "uni-calender.WED": "三",
"uni-calender.THU": "四", "uni-calender.THU": "四",
"uni-calender.FRI": "五", "uni-calender.FRI": "五",
"uni-calender.SAT": "六" "uni-calender.SAT": "六"
} }
{ {
"uni-calender.ok": "確定", "uni-calender.ok": "確定",
"uni-calender.cancel": "取消", "uni-calender.cancel": "取消",
"uni-calender.today": "今日", "uni-calender.today": "今日",
"uni-calender.SUN": "日", "uni-calender.SUN": "日",
"uni-calender.MON": "一", "uni-calender.MON": "一",
"uni-calender.TUE": "二", "uni-calender.TUE": "二",
"uni-calender.WED": "三", "uni-calender.WED": "三",
"uni-calender.THU": "四", "uni-calender.THU": "四",
"uni-calender.FRI": "五", "uni-calender.FRI": "五",
"uni-calender.SAT": "六" "uni-calender.SAT": "六"
} }
{ {
"id": "uni-calendar", "id": "uni-calendar",
"displayName": "uni-calendar 日历", "displayName": "uni-calendar 日历",
"version": "1.4.9", "version": "1.4.9",
"description": "日历组件", "description": "日历组件",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
"uniui", "uniui",
"日历", "日历",
"", "",
"打卡", "打卡",
"日历选择" "日历选择"
], ],
"repository": "https://github.com/dcloudio/uni-ui", "repository": "https://github.com/dcloudio/uni-ui",
"engines": { "engines": {
"HBuilderX": "" "HBuilderX": ""
}, },
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
"sourcecode": { "sourcecode": {
"price": "0.00" "price": "0.00"
} }
}, },
"contact": { "contact": {
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "无", "ads": "无",
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue" "type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [], "dependencies": [],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y"
}, },
"client": { "client": {
"App": { "App": {
"app-vue": "y", "app-vue": "y",
"app-nvue": "y" "app-nvue": "y"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
"Android Browser": "y", "Android Browser": "y",
"微信浏览器(Android)": "y", "微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y" "QQ浏览器(Android)": "y"
}, },
"H5-pc": { "H5-pc": {
"Chrome": "y", "Chrome": "y",
"IE": "y", "IE": "y",
"Edge": "y", "Edge": "y",
"Firefox": "y", "Firefox": "y",
"Safari": "y" "Safari": "y"
}, },
"小程序": { "小程序": {
"微信": "y", "微信": "y",
"阿里": "y", "阿里": "y",
"百度": "y", "百度": "y",
"字节跳动": "y", "字节跳动": "y",
"QQ": "y" "QQ": "y"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
"联盟": "u" "联盟": "u"
}, },
"Vue": { "Vue": {
"vue2": "y", "vue2": "y",
"vue3": "y" "vue3": "y"
} }
} }
} }
} }
} }
\ No newline at end of file
## Calendar 日历 ## Calendar 日历
> **组件名:uni-calendar** > **组件名:uni-calendar**
> 代码块: `uCalendar` > 代码块: `uCalendar`
日历组件 日历组件
> **注意事项** > **注意事项**
> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 > 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
> - 本组件农历转换使用的js是 [@1900-2100区间内的公历、农历互转](https://github.com/jjonline/calendar.js) > - 本组件农历转换使用的js是 [@1900-2100区间内的公历、农历互转](https://github.com/jjonline/calendar.js)
> - 仅支持自定义组件模式 > - 仅支持自定义组件模式
> - `date`属性传入的应该是一个 String ,如: 2019-06-27 ,而不是 new Date() > - `date`属性传入的应该是一个 String ,如: 2019-06-27 ,而不是 new Date()
> - 通过 `insert` 属性来确定当前的事件是 @change 还是 @confirm 。理应合并为一个事件,但是为了区分模式,现使用两个事件,这里需要注意 > - 通过 `insert` 属性来确定当前的事件是 @change 还是 @confirm 。理应合并为一个事件,但是为了区分模式,现使用两个事件,这里需要注意
> - 弹窗模式下无法阻止后面的元素滚动,如有需要阻止,请在弹窗弹出后,手动设置滚动元素为不可滚动 > - 弹窗模式下无法阻止后面的元素滚动,如有需要阻止,请在弹窗弹出后,手动设置滚动元素为不可滚动
### 安装方式 ### 安装方式
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components` 本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`
如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) 如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
### 基本用法 ### 基本用法
``template`` 中使用组件 ``template`` 中使用组件
```html ```html
<view> <view>
<uni-calendar <uni-calendar
:insert="true" :insert="true"
:lunar="true" :lunar="true"
:start-date="'2019-3-2'" :start-date="'2019-3-2'"
:end-date="'2019-5-20'" :end-date="'2019-5-20'"
@change="change" @change="change"
/> />
</view> </view>
``` ```
### 通过方法打开日历 ### 通过方法打开日历
需要设置 `insert``false` 需要设置 `insert``false`
```html ```html
<view> <view>
<uni-calendar <uni-calendar
ref="calendar" ref="calendar"
:insert="false" :insert="false"
@confirm="confirm" @confirm="confirm"
/> />
<button @click="open">打开日历</button> <button @click="open">打开日历</button>
</view> </view>
``` ```
```javascript ```javascript
export default { export default {
data() { data() {
return {}; return {};
}, },
methods: { methods: {
open(){ open(){
this.$refs.calendar.open(); this.$refs.calendar.open();
}, },
confirm(e) { confirm(e) {
console.log(e); console.log(e);
} }
} }
}; };
``` ```
## API ## API
### Calendar Props ### Calendar Props
| 属性名 | 类型 | 默认值| 说明 | | 属性名 | 类型 | 默认值| 说明 |
| | | | | |
| date | String |- | 自定义当前时间,默认为今天 | | date | String |- | 自定义当前时间,默认为今天 |
| lunar | Boolean | false | 显示农历 | | lunar | Boolean | false | 显示农历 |
| startDate | String |- | 日期选择范围-开始日期 | | startDate | String |- | 日期选择范围-开始日期 |
| endDate | String |- | 日期选择范围-结束日期 | | endDate | String |- | 日期选择范围-结束日期 |
| range | Boolean | false | 范围选择 | | range | Boolean | false | 范围选择 |
| insert | Boolean | false | 插入模式,可选值,ture:插入模式;false:弹窗模式;默认为插入模式 | | insert | Boolean | false | 插入模式,可选值,ture:插入模式;false:弹窗模式;默认为插入模式 |
|clearDate |Boolean |true |弹窗模式是否清空上次选择内容 | |clearDate |Boolean |true |弹窗模式是否清空上次选择内容 |
| selected | Array |- | 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}] | | selected | Array |- | 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}] |
|showMonth | Boolean | true | 是否显示月份为背景 | |showMonth | Boolean | true | 是否显示月份为背景 |
### Calendar Events ### Calendar Events
| 事件名 | 说明 |返回值| | 事件名 | 说明 |返回值|
| | | | | | | |
| open | 弹出日历组件,`insert :false` 时生效|- | | open | 弹出日历组件,`insert :false` 时生效|- |
## 组件示例 ## 组件示例
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar](https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar) 点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar](https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar)
\ No newline at end of file
## 1.4.3(2022-01-25) ## 1.4.3(2022-01-25)
- 修复 初始化的时候 ,open 属性失效的bug - 修复 初始化的时候 ,open 属性失效的bug
## 1.4.2(2022-01-21) ## 1.4.2(2022-01-21)
- 修复 微信小程序resize后组件收起的bug - 修复 微信小程序resize后组件收起的bug
## 1.4.1(2021-11-22) ## 1.4.1(2021-11-22)
- 修复 vue3中个别scss变量无法找到的问题 - 修复 vue3中个别scss变量无法找到的问题
## 1.4.0(2021-11-19) ## 1.4.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-collapse](https://uniapp.dcloud.io/component/uniui/uni-collapse) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-collapse](https://uniapp.dcloud.io/component/uniui/uni-collapse)
## 1.3.3(2021-08-17) ## 1.3.3(2021-08-17)
- 优化 show-arrow 属性默认为true - 优化 show-arrow 属性默认为true
## 1.3.2(2021-08-17) ## 1.3.2(2021-08-17)
- 新增 show-arrow 属性,控制是否显示右侧箭头 - 新增 show-arrow 属性,控制是否显示右侧箭头
## 1.3.1(2021-07-30) ## 1.3.1(2021-07-30)
- 优化 vue3下小程序事件警告的问题 - 优化 vue3下小程序事件警告的问题
## 1.3.0(2021-07-30) ## 1.3.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.2.2(2021-07-21) ## 1.2.2(2021-07-21)
- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug - 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug
## 1.2.1(2021-07-21) ## 1.2.1(2021-07-21)
- 优化 组件示例 - 优化 组件示例
## 1.2.0(2021-07-21) ## 1.2.0(2021-07-21)
- 新增 组件折叠动画 - 新增 组件折叠动画
- 新增 value\v-model 属性 ,动态修改面板折叠状态 - 新增 value\v-model 属性 ,动态修改面板折叠状态
- 新增 title 插槽 ,可定义面板标题 - 新增 title 插槽 ,可定义面板标题
- 新增 border 属性 ,显示隐藏面板内容分隔线 - 新增 border 属性 ,显示隐藏面板内容分隔线
- 新增 title-border 属性 ,显示隐藏面板标题分隔线 - 新增 title-border 属性 ,显示隐藏面板标题分隔线
- 修复 resize 方法失效的Bug - 修复 resize 方法失效的Bug
- 修复 change 事件返回参数不正确的Bug - 修复 change 事件返回参数不正确的Bug
- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法 - 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法
## 1.1.7(2021-05-12) ## 1.1.7(2021-05-12)
- 新增 组件示例地址 - 新增 组件示例地址
## 1.1.6(2021-02-05) ## 1.1.6(2021-02-05)
- 优化 组件引用关系,通过uni_modules引用组件 - 优化 组件引用关系,通过uni_modules引用组件
## 1.1.5(2021-02-05) ## 1.1.5(2021-02-05)
- 调整为uni_modules目录规范 - 调整为uni_modules目录规范
\ No newline at end of file
<template> <template>
<view class="uni-collapse"> <view class="uni-collapse">
<slot /> <slot />
</view> </view>
</template> </template>
<script> <script>
/** /**
* Collapse 折叠面板 * Collapse 折叠面板
* @description 展示可以折叠 / 展开的内容区域 * @description 展示可以折叠 / 展开的内容区域
* @tutorial https://ext.dcloud.net.cn/plugin?id=23 * @tutorial https://ext.dcloud.net.cn/plugin?id=23
* @property {String|Array} value 当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array) * @property {String|Array} value 当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)
* @property {Boolean} accordion = [true|false] 是否开启手风琴效果是否开启手风琴效果 * @property {Boolean} accordion = [true|false] 是否开启手风琴效果是否开启手风琴效果
* @event {Function} change 切换面板时触发,如果是手风琴模式,返回类型为string,否则为array * @event {Function} change 切换面板时触发,如果是手风琴模式,返回类型为string,否则为array
*/ */
export default { export default {
name: 'uniCollapse', name: 'uniCollapse',
emits:['change','activeItem','input','update:modelValue'], emits:['change','activeItem','input','update:modelValue'],
props: { props: {
value: { value: {
type: [String, Array], type: [String, Array],
default: '' default: ''
}, },
modelValue: { modelValue: {
type: [String, Array], type: [String, Array],
default: '' default: ''
}, },
accordion: { accordion: {
// 是否开启手风琴效果 // 是否开启手风琴效果
type: [Boolean, String], type: [Boolean, String],
default: false default: false
}, },
}, },
data() { data() {
return {} return {}
}, },
computed: { computed: {
// TODO 兼容 vue2 和 vue3 // TODO 兼容 vue2 和 vue3
dataValue() { dataValue() {
let value = (typeof this.value === 'string' && this.value === '') || let value = (typeof this.value === 'string' && this.value === '') ||
(Array.isArray(this.value) && this.value.length === 0) (Array.isArray(this.value) && this.value.length === 0)
let modelValue = (typeof this.modelValue === 'string' && this.modelValue === '') || let modelValue = (typeof this.modelValue === 'string' && this.modelValue === '') ||
(Array.isArray(this.modelValue) && this.modelValue.length === 0) (Array.isArray(this.modelValue) && this.modelValue.length === 0)
if (value) { if (value) {
return this.modelValue return this.modelValue
} }
if (modelValue) { if (modelValue) {
return this.value return this.value
} }
return this.value return this.value
} }
}, },
watch: { watch: {
dataValue(val) { dataValue(val) {
this.setOpen(val) this.setOpen(val)
} }
}, },
created() { created() {
this.childrens = [] this.childrens = []
this.names = [] this.names = []
}, },
mounted() { mounted() {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.setOpen(this.dataValue) this.setOpen(this.dataValue)
}) })
}, },
methods: { methods: {
setOpen(val) { setOpen(val) {
let str = typeof val === 'string' let str = typeof val === 'string'
let arr = Array.isArray(val) let arr = Array.isArray(val)
this.childrens.forEach((vm, index) => { this.childrens.forEach((vm, index) => {
if (str) { if (str) {
if (val === vm.nameSync) { if (val === vm.nameSync) {
if (!this.accordion) { if (!this.accordion) {
console.warn('accordion 属性为 false ,v-model 类型应该为 array') console.warn('accordion 属性为 false ,v-model 类型应该为 array')
return return
} }
vm.isOpen = true vm.isOpen = true
} }
} }
if (arr) { if (arr) {
val.forEach(v => { val.forEach(v => {
if (v === vm.nameSync) { if (v === vm.nameSync) {
if (this.accordion) { if (this.accordion) {
console.warn('accordion 属性为 true ,v-model 类型应该为 string') console.warn('accordion 属性为 true ,v-model 类型应该为 string')
return return
} }
vm.isOpen = true vm.isOpen = true
} }
}) })
} }
}) })
this.emit(val) this.emit(val)
}, },
setAccordion(self) { setAccordion(self) {
if (!this.accordion) return if (!this.accordion) return
this.childrens.forEach((vm, index) => { this.childrens.forEach((vm, index) => {
if (self !== vm) { if (self !== vm) {
vm.isOpen = false vm.isOpen = false
} }
}) })
}, },
resize() { resize() {
this.childrens.forEach((vm, index) => { this.childrens.forEach((vm, index) => {
// #ifndef APP-NVUE // #ifndef APP-NVUE
vm.getCollapseHeight() vm.getCollapseHeight()
// #endif // #endif
// #ifdef APP-NVUE // #ifdef APP-NVUE
vm.getNvueHwight() vm.getNvueHwight()
// #endif // #endif
}) })
}, },
onChange(isOpen, self) { onChange(isOpen, self) {
let activeItem = [] let activeItem = []
if (this.accordion) { if (this.accordion) {
activeItem = isOpen ? self.nameSync : '' activeItem = isOpen ? self.nameSync : ''
} else { } else {
this.childrens.forEach((vm, index) => { this.childrens.forEach((vm, index) => {
if (vm.isOpen) { if (vm.isOpen) {
activeItem.push(vm.nameSync) activeItem.push(vm.nameSync)
} }
}) })
} }
this.$emit('change', activeItem) this.$emit('change', activeItem)
this.emit(activeItem) this.emit(activeItem)
}, },
emit(val){ emit(val){
this.$emit('input', val) this.$emit('input', val)
this.$emit('update:modelValue', val) this.$emit('update:modelValue', val)
} }
} }
} }
</script> </script>
<style lang="scss" > <style lang="scss" >
.uni-collapse { .uni-collapse {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
width: 100%; width: 100%;
display: flex; display: flex;
/* #endif */ /* #endif */
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
flex: 1; flex: 1;
/* #endif */ /* #endif */
flex-direction: column; flex-direction: column;
background-color: #fff; background-color: #fff;
} }
</style> </style>
{ {
"id": "uni-collapse", "id": "uni-collapse",
"displayName": "uni-collapse 折叠面板", "displayName": "uni-collapse 折叠面板",
"version": "1.4.3", "version": "1.4.3",
"description": "Collapse 组件,可以折叠 / 展开的内容区域。", "description": "Collapse 组件,可以折叠 / 展开的内容区域。",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
"折叠", "折叠",
"折叠面板", "折叠面板",
"手风琴" "手风琴"
], ],
"repository": "https://github.com/dcloudio/uni-ui", "repository": "https://github.com/dcloudio/uni-ui",
"engines": { "engines": {
"HBuilderX": "" "HBuilderX": ""
}, },
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"category": [ "category": [
"前端组件", "前端组件",
"通用组件" "通用组件"
], ],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
"sourcecode": { "sourcecode": {
"price": "0.00" "price": "0.00"
} }
}, },
"contact": { "contact": {
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "无", "ads": "无",
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [ "dependencies": [
"uni-scss", "uni-scss",
"uni-icons" "uni-icons"
], ],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y"
}, },
"client": { "client": {
"App": { "App": {
"app-vue": "y", "app-vue": "y",
"app-nvue": "y" "app-nvue": "y"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
"Android Browser": "y", "Android Browser": "y",
"微信浏览器(Android)": "y", "微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y" "QQ浏览器(Android)": "y"
}, },
"H5-pc": { "H5-pc": {
"Chrome": "y", "Chrome": "y",
"IE": "y", "IE": "y",
"Edge": "y", "Edge": "y",
"Firefox": "y", "Firefox": "y",
"Safari": "y" "Safari": "y"
}, },
"小程序": { "小程序": {
"微信": "y", "微信": "y",
"阿里": "y", "阿里": "y",
"百度": "y", "百度": "y",
"字节跳动": "y", "字节跳动": "y",
"QQ": "y" "QQ": "y"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
"联盟": "u" "联盟": "u"
}, },
"Vue": { "Vue": {
"vue2": "y", "vue2": "y",
"vue3": "y" "vue3": "y"
} }
} }
} }
} }
} }
## Collapse 折叠面板 ## Collapse 折叠面板
> **组件名:uni-collapse** > **组件名:uni-collapse**
> 代码块: `uCollapse` > 代码块: `uCollapse`
> 关联组件:`uni-collapse-item`、`uni-icons`。 > 关联组件:`uni-collapse-item`、`uni-icons`。
折叠面板用来折叠/显示过长的内容或者是列表。通常是在多内容分类项使用,折叠不重要的内容,显示重要内容。点击可以展开折叠部分。 折叠面板用来折叠/显示过长的内容或者是列表。通常是在多内容分类项使用,折叠不重要的内容,显示重要内容。点击可以展开折叠部分。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-collapse) ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-collapse)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
## 1.0.5(2023-02-03) ## 1.0.5(2023-02-03)
- 修复 禁用时会显示清空按钮 - 修复 禁用时会显示清空按钮
## 1.0.4(2023-02-02) ## 1.0.4(2023-02-02)
- 优化 查询条件短期内多次变更只查询最后一次变更后的结果 - 优化 查询条件短期内多次变更只查询最后一次变更后的结果
- 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue - 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue
## 1.0.3(2023-01-16) ## 1.0.3(2023-01-16)
- 修复 不关联服务空间报错的问题 - 修复 不关联服务空间报错的问题
## 1.0.2(2023-01-14) ## 1.0.2(2023-01-14)
- 新增 属性 `format` 可用于格式化显示选项内容 - 新增 属性 `format` 可用于格式化显示选项内容
## 1.0.1(2022-12-06) ## 1.0.1(2022-12-06)
- 修复 当where变化时,数据不会自动更新的问题 - 修复 当where变化时,数据不会自动更新的问题
## 0.1.9(2022-09-05) ## 0.1.9(2022-09-05)
- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框 - 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框
## 0.1.8(2022-08-29) ## 0.1.8(2022-08-29)
- 修复 点击的位置不准确 - 修复 点击的位置不准确
## 0.1.7(2022-08-12) ## 0.1.7(2022-08-12)
- 新增 支持 disabled 属性 - 新增 支持 disabled 属性
## 0.1.6(2022-07-06) ## 0.1.6(2022-07-06)
- 修复 pc端宽度异常的bug - 修复 pc端宽度异常的bug
## 0.1.5 ## 0.1.5
- 修复 pc端宽度异常的bug - 修复 pc端宽度异常的bug
## 0.1.4(2022-07-05) ## 0.1.4(2022-07-05)
- 优化 显示样式 - 优化 显示样式
## 0.1.3(2022-06-02) ## 0.1.3(2022-06-02)
- 修复 localdata 赋值不生效的 bug - 修复 localdata 赋值不生效的 bug
- 新增 支持 uni.scss 修改颜色 - 新增 支持 uni.scss 修改颜色
- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用) - 新增 支持选项禁用(数据选项设置 disabled: true 即禁用)
## 0.1.2(2022-05-08) ## 0.1.2(2022-05-08)
- 修复 当 value 为 0 时选择不生效的 bug - 修复 当 value 为 0 时选择不生效的 bug
## 0.1.1(2022-05-07) ## 0.1.1(2022-05-07)
- 新增 记住上次的选项(仅 collection 存在时有效) - 新增 记住上次的选项(仅 collection 存在时有效)
## 0.1.0(2022-04-22) ## 0.1.0(2022-04-22)
- 初始化 - 初始化
{ {
"id": "uni-data-select", "id": "uni-data-select",
"displayName": "uni-data-select 下拉框选择器", "displayName": "uni-data-select 下拉框选择器",
"version": "1.0.5", "version": "1.0.5",
"description": "通过数据驱动的下拉框选择器", "description": "通过数据驱动的下拉框选择器",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
"select", "select",
"uni-data-select", "uni-data-select",
"下拉框", "下拉框",
"下拉选" "下拉选"
], ],
"repository": "https://github.com/dcloudio/uni-ui", "repository": "https://github.com/dcloudio/uni-ui",
"engines": { "engines": {
"HBuilderX": "^3.1.1" "HBuilderX": "^3.1.1"
}, },
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
"sourcecode": { "sourcecode": {
"price": "0.00" "price": "0.00"
} }
}, },
"contact": { "contact": {
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "无", "ads": "无",
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue" "type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": ["uni-load-more"], "dependencies": ["uni-load-more"],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y"
}, },
"client": { "client": {
"App": { "App": {
"app-vue": "u", "app-vue": "u",
"app-nvue": "n" "app-nvue": "n"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
"Android Browser": "y", "Android Browser": "y",
"微信浏览器(Android)": "y", "微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y" "QQ浏览器(Android)": "y"
}, },
"H5-pc": { "H5-pc": {
"Chrome": "y", "Chrome": "y",
"IE": "y", "IE": "y",
"Edge": "y", "Edge": "y",
"Firefox": "y", "Firefox": "y",
"Safari": "y" "Safari": "y"
}, },
"小程序": { "小程序": {
"微信": "y", "微信": "y",
"阿里": "u", "阿里": "u",
"百度": "u", "百度": "u",
"字节跳动": "u", "字节跳动": "u",
"QQ": "u", "QQ": "u",
"京东": "u" "京东": "u"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
"联盟": "u" "联盟": "u"
}, },
"Vue": { "Vue": {
"vue2": "y", "vue2": "y",
"vue3": "y" "vue3": "y"
} }
} }
} }
} }
} }
## DataSelect 下拉框选择器 ## DataSelect 下拉框选择器
> **组件名:uni-data-select** > **组件名:uni-data-select**
> 代码块: `uDataSelect` > 代码块: `uDataSelect`
当选项过多时,使用下拉菜单展示并选择内容 当选项过多时,使用下拉菜单展示并选择内容
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select) ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
## 1.0.0(2021-11-19) ## 1.0.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-dateformat](https://uniapp.dcloud.io/component/uniui/uni-dateformat) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-dateformat](https://uniapp.dcloud.io/component/uniui/uni-dateformat)
## 0.0.5(2021-07-08) ## 0.0.5(2021-07-08)
- 调整 默认时间不再是当前时间,而是显示'-'字符 - 调整 默认时间不再是当前时间,而是显示'-'字符
## 0.0.4(2021-05-12) ## 0.0.4(2021-05-12)
- 新增 组件示例地址 - 新增 组件示例地址
## 0.0.3(2021-02-04) ## 0.0.3(2021-02-04)
- 调整为uni_modules目录规范 - 调整为uni_modules目录规范
- 修复 iOS 平台日期格式化出错的问题 - 修复 iOS 平台日期格式化出错的问题
// yyyy-MM-dd hh:mm:ss.SSS 所有支持的类型 // yyyy-MM-dd hh:mm:ss.SSS 所有支持的类型
function pad(str, length = 2) { function pad(str, length = 2) {
str += '' str += ''
while (str.length < length) { while (str.length < length) {
str = '0' + str str = '0' + str
} }
return str.slice(-length) return str.slice(-length)
} }
const parser = { const parser = {
yyyy: (dateObj) => { yyyy: (dateObj) => {
return pad(dateObj.year, 4) return pad(dateObj.year, 4)
}, },
yy: (dateObj) => { yy: (dateObj) => {
return pad(dateObj.year) return pad(dateObj.year)
}, },
MM: (dateObj) => { MM: (dateObj) => {
return pad(dateObj.month) return pad(dateObj.month)
}, },
M: (dateObj) => { M: (dateObj) => {
return dateObj.month return dateObj.month
}, },
dd: (dateObj) => { dd: (dateObj) => {
return pad(dateObj.day) return pad(dateObj.day)
}, },
d: (dateObj) => { d: (dateObj) => {
return dateObj.day return dateObj.day
}, },
hh: (dateObj) => { hh: (dateObj) => {
return pad(dateObj.hour) return pad(dateObj.hour)
}, },
h: (dateObj) => { h: (dateObj) => {
return dateObj.hour return dateObj.hour
}, },
mm: (dateObj) => { mm: (dateObj) => {
return pad(dateObj.minute) return pad(dateObj.minute)
}, },
m: (dateObj) => { m: (dateObj) => {
return dateObj.minute return dateObj.minute
}, },
ss: (dateObj) => { ss: (dateObj) => {
return pad(dateObj.second) return pad(dateObj.second)
}, },
s: (dateObj) => { s: (dateObj) => {
return dateObj.second return dateObj.second
}, },
SSS: (dateObj) => { SSS: (dateObj) => {
return pad(dateObj.millisecond, 3) return pad(dateObj.millisecond, 3)
}, },
S: (dateObj) => { S: (dateObj) => {
return dateObj.millisecond return dateObj.millisecond
}, },
} }
// 这都n年了iOS依然不认识2020-12-12,需要转换为2020/12/12 // 这都n年了iOS依然不认识2020-12-12,需要转换为2020/12/12
function getDate(time) { function getDate(time) {
if (time instanceof Date) { if (time instanceof Date) {
return time return time
} }
switch (typeof time) { switch (typeof time) {
case 'string': case 'string':
{ {
// 2020-12-12T12:12:12.000Z、2020-12-12T12:12:12.000 // 2020-12-12T12:12:12.000Z、2020-12-12T12:12:12.000
if (time.indexOf('T') > -1) { if (time.indexOf('T') > -1) {
return new Date(time) return new Date(time)
} }
return new Date(time.replace(/-/g, '/')) return new Date(time.replace(/-/g, '/'))
} }
default: default:
return new Date(time) return new Date(time)
} }
} }
export function formatDate(date, format = 'yyyy/MM/dd hh:mm:ss') { export function formatDate(date, format = 'yyyy/MM/dd hh:mm:ss') {
if (!date && date !== 0) { if (!date && date !== 0) {
return '' return ''
} }
date = getDate(date) date = getDate(date)
const dateObj = { const dateObj = {
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth() + 1, month: date.getMonth() + 1,
day: date.getDate(), day: date.getDate(),
hour: date.getHours(), hour: date.getHours(),
minute: date.getMinutes(), minute: date.getMinutes(),
second: date.getSeconds(), second: date.getSeconds(),
millisecond: date.getMilliseconds() millisecond: date.getMilliseconds()
} }
const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/ const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/
let flag = true let flag = true
let result = format let result = format
while (flag) { while (flag) {
flag = false flag = false
result = result.replace(tokenRegExp, function(matched) { result = result.replace(tokenRegExp, function(matched) {
flag = true flag = true
return parser[matched](dateObj) return parser[matched](dateObj)
}) })
} }
return result return result
} }
export function friendlyDate(time, { export function friendlyDate(time, {
locale = 'zh', locale = 'zh',
threshold = [60000, 3600000], threshold = [60000, 3600000],
format = 'yyyy/MM/dd hh:mm:ss' format = 'yyyy/MM/dd hh:mm:ss'
}) { }) {
if (time === '-') { if (time === '-') {
return time return time
} }
if (!time && time !== 0) { if (!time && time !== 0) {
return '' return ''
} }
const localeText = { const localeText = {
zh: { zh: {
year: '年', year: '年',
month: '月', month: '月',
day: '天', day: '天',
hour: '小时', hour: '小时',
minute: '分钟', minute: '分钟',
second: '秒', second: '秒',
ago: '前', ago: '前',
later: '后', later: '后',
justNow: '刚刚', justNow: '刚刚',
soon: '马上', soon: '马上',
template: '{num}{unit}{suffix}' template: '{num}{unit}{suffix}'
}, },
en: { en: {
year: 'year', year: 'year',
month: 'month', month: 'month',
day: 'day', day: 'day',
hour: 'hour', hour: 'hour',
minute: 'minute', minute: 'minute',
second: 'second', second: 'second',
ago: 'ago', ago: 'ago',
later: 'later', later: 'later',
justNow: 'just now', justNow: 'just now',
soon: 'soon', soon: 'soon',
template: '{num} {unit} {suffix}' template: '{num} {unit} {suffix}'
} }
} }
const text = localeText[locale] || localeText.zh const text = localeText[locale] || localeText.zh
let date = getDate(time) let date = getDate(time)
let ms = date.getTime() - Date.now() let ms = date.getTime() - Date.now()
let absMs = Math.abs(ms) let absMs = Math.abs(ms)
if (absMs < threshold[0]) { if (absMs < threshold[0]) {
return ms < 0 ? text.justNow : text.soon return ms < 0 ? text.justNow : text.soon
} }
if (absMs >= threshold[1]) { if (absMs >= threshold[1]) {
return formatDate(date, format) return formatDate(date, format)
} }
let num let num
let unit let unit
let suffix = text.later let suffix = text.later
if (ms < 0) { if (ms < 0) {
suffix = text.ago suffix = text.ago
ms = -ms ms = -ms
} }
const seconds = Math.floor((ms) / 1000) const seconds = Math.floor((ms) / 1000)
const minutes = Math.floor(seconds / 60) const minutes = Math.floor(seconds / 60)
const hours = Math.floor(minutes / 60) const hours = Math.floor(minutes / 60)
const days = Math.floor(hours / 24) const days = Math.floor(hours / 24)
const months = Math.floor(days / 30) const months = Math.floor(days / 30)
const years = Math.floor(months / 12) const years = Math.floor(months / 12)
switch (true) { switch (true) {
case years > 0: case years > 0:
num = years num = years
unit = text.year unit = text.year
break break
case months > 0: case months > 0:
num = months num = months
unit = text.month unit = text.month
break break
case days > 0: case days > 0:
num = days num = days
unit = text.day unit = text.day
break break
case hours > 0: case hours > 0:
num = hours num = hours
unit = text.hour unit = text.hour
break break
case minutes > 0: case minutes > 0:
num = minutes num = minutes
unit = text.minute unit = text.minute
break break
default: default:
num = seconds num = seconds
unit = text.second unit = text.second
break break
} }
if (locale === 'en') { if (locale === 'en') {
if (num === 1) { if (num === 1) {
num = 'a' num = 'a'
} else { } else {
unit += 's' unit += 's'
} }
} }
return text.template.replace(/{\s*num\s*}/g, num + '').replace(/{\s*unit\s*}/g, unit).replace(/{\s*suffix\s*}/g, return text.template.replace(/{\s*num\s*}/g, num + '').replace(/{\s*unit\s*}/g, unit).replace(/{\s*suffix\s*}/g,
suffix) suffix)
} }
<template> <template>
<text>{{dateShow}}</text> <text>{{dateShow}}</text>
</template> </template>
<script> <script>
import {friendlyDate} from './date-format.js' import {friendlyDate} from './date-format.js'
/** /**
* Dateformat 日期格式化 * Dateformat 日期格式化
* @description 日期格式化组件 * @description 日期格式化组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=3279 * @tutorial https://ext.dcloud.net.cn/plugin?id=3279
* @property {Object|String|Number} date 日期对象/日期字符串/时间戳 * @property {Object|String|Number} date 日期对象/日期字符串/时间戳
* @property {String} locale 格式化使用的语言 * @property {String} locale 格式化使用的语言
* @value zh 中文 * @value zh 中文
* @value en 英文 * @value en 英文
* @property {Array} threshold 应用不同类型格式化的阈值 * @property {Array} threshold 应用不同类型格式化的阈值
* @property {String} format 输出日期字符串时的格式 * @property {String} format 输出日期字符串时的格式
*/ */
export default { export default {
name: 'uniDateformat', name: 'uniDateformat',
props: { props: {
date: { date: {
type: [Object, String, Number], type: [Object, String, Number],
default () { default () {
return '-' return '-'
} }
}, },
locale: { locale: {
type: String, type: String,
default: 'zh', default: 'zh',
}, },
threshold: { threshold: {
type: Array, type: Array,
default () { default () {
return [0, 0] return [0, 0]
} }
}, },
format: { format: {
type: String, type: String,
default: 'yyyy/MM/dd hh:mm:ss' default: 'yyyy/MM/dd hh:mm:ss'
}, },
// refreshRate使用不当可能导致性能问题,谨慎使用 // refreshRate使用不当可能导致性能问题,谨慎使用
refreshRate: { refreshRate: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
} }
}, },
data() { data() {
return { return {
refreshMark: 0 refreshMark: 0
} }
}, },
computed: { computed: {
dateShow() { dateShow() {
this.refreshMark this.refreshMark
return friendlyDate(this.date, { return friendlyDate(this.date, {
locale: this.locale, locale: this.locale,
threshold: this.threshold, threshold: this.threshold,
format: this.format format: this.format
}) })
} }
}, },
watch: { watch: {
refreshRate: { refreshRate: {
handler() { handler() {
this.setAutoRefresh() this.setAutoRefresh()
}, },
immediate: true immediate: true
} }
}, },
methods: { methods: {
refresh() { refresh() {
this.refreshMark++ this.refreshMark++
}, },
setAutoRefresh() { setAutoRefresh() {
clearInterval(this.refreshInterval) clearInterval(this.refreshInterval)
if (this.refreshRate) { if (this.refreshRate) {
this.refreshInterval = setInterval(() => { this.refreshInterval = setInterval(() => {
this.refresh() this.refresh()
}, parseInt(this.refreshRate)) }, parseInt(this.refreshRate))
} }
} }
} }
} }
</script> </script>
<style> <style>
</style> </style>
{ {
"id": "uni-dateformat", "id": "uni-dateformat",
"displayName": "uni-dateformat 日期格式化", "displayName": "uni-dateformat 日期格式化",
"version": "1.0.0", "version": "1.0.0",
"description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式", "description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
"uniui", "uniui",
"日期格式化", "日期格式化",
"时间格式化", "时间格式化",
"格式化时间", "格式化时间",
"" ""
], ],
"repository": "https://github.com/dcloudio/uni-ui", "repository": "https://github.com/dcloudio/uni-ui",
"engines": { "engines": {
"HBuilderX": "" "HBuilderX": ""
}, },
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"category": [ "category": [
"前端组件", "前端组件",
"通用组件" "通用组件"
], ],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
"sourcecode": { "sourcecode": {
"price": "0.00" "price": "0.00"
} }
}, },
"contact": { "contact": {
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "无", "ads": "无",
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
}, },
"uni_modules": { "uni_modules": {
"dependencies": ["uni-scss"], "dependencies": ["uni-scss"],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y"
}, },
"client": { "client": {
"App": { "App": {
"app-vue": "y", "app-vue": "y",
"app-nvue": "y" "app-nvue": "y"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
"Android Browser": "y", "Android Browser": "y",
"微信浏览器(Android)": "y", "微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y" "QQ浏览器(Android)": "y"
}, },
"H5-pc": { "H5-pc": {
"Chrome": "y", "Chrome": "y",
"IE": "y", "IE": "y",
"Edge": "y", "Edge": "y",
"Firefox": "y", "Firefox": "y",
"Safari": "y" "Safari": "y"
}, },
"小程序": { "小程序": {
"微信": "y", "微信": "y",
"阿里": "y", "阿里": "y",
"百度": "y", "百度": "y",
"字节跳动": "y", "字节跳动": "y",
"QQ": "y" "QQ": "y"
}, },
"快应用": { "快应用": {
"华为": "y", "华为": "y",
"联盟": "y" "联盟": "y"
}, },
"Vue": { "Vue": {
"vue2": "y", "vue2": "y",
"vue3": "y" "vue3": "y"
} }
} }
} }
} }
} }
\ No newline at end of file
### DateFormat 日期格式化 ### DateFormat 日期格式化
> **组件名:uni-dateformat** > **组件名:uni-dateformat**
> 代码块: `uDateformat` > 代码块: `uDateformat`
日期格式化组件。 日期格式化组件。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-dateformat) ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-dateformat)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
## 1.1.6(2023-01-28) ## 1.1.6(2023-01-28)
- 新增 keyboardheightchange 事件,可监听键盘高度变化 - 新增 keyboardheightchange 事件,可监听键盘高度变化
## 1.1.5(2022-11-29) ## 1.1.5(2022-11-29)
- 优化 主题样式 - 优化 主题样式
## 1.1.4(2022-10-27) ## 1.1.4(2022-10-27)
- 修复 props 中背景颜色无默认值的bug - 修复 props 中背景颜色无默认值的bug
## 1.1.0(2022-06-30) ## 1.1.0(2022-06-30)
- 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容 - 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容
- 新增 clear 事件,点击右侧叉号图标触发 - 新增 clear 事件,点击右侧叉号图标触发
- 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发 - 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发
- 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等 - 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等
## 1.0.5(2022-06-07) ## 1.0.5(2022-06-07)
- 优化 clearable 显示策略 - 优化 clearable 显示策略
## 1.0.4(2022-06-07) ## 1.0.4(2022-06-07)
- 优化 clearable 显示策略 - 优化 clearable 显示策略
## 1.0.3(2022-05-20) ## 1.0.3(2022-05-20)
- 修复 关闭图标某些情况下无法取消的 bug - 修复 关闭图标某些情况下无法取消的 bug
## 1.0.2(2022-04-12) ## 1.0.2(2022-04-12)
- 修复 默认值不生效的 bug - 修复 默认值不生效的 bug
## 1.0.1(2022-04-02) ## 1.0.1(2022-04-02)
- 修复 value 不能为 0 的 bug - 修复 value 不能为 0 的 bug
## 1.0.0(2021-11-19) ## 1.0.0(2021-11-19)
- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-easyinput](https://uniapp.dcloud.io/component/uniui/uni-easyinput) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-easyinput](https://uniapp.dcloud.io/component/uniui/uni-easyinput)
## 0.1.4(2021-08-20) ## 0.1.4(2021-08-20)
- 修复 在 uni-forms 的动态表单中默认值校验不通过的 bug - 修复 在 uni-forms 的动态表单中默认值校验不通过的 bug
## 0.1.3(2021-08-11) ## 0.1.3(2021-08-11)
- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题 - 修复 在 uni-forms 中重置表单,错误信息无法清除的问题
## 0.1.2(2021-07-30) ## 0.1.2(2021-07-30)
- 优化 vue3 下事件警告的问题 - 优化 vue3 下事件警告的问题
## 0.1.1 ## 0.1.1
- 优化 errorMessage 属性支持 Boolean 类型 - 优化 errorMessage 属性支持 Boolean 类型
## 0.1.0(2021-07-13) ## 0.1.0(2021-07-13)
- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) - 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 0.0.16(2021-06-29) ## 0.0.16(2021-06-29)
- 修复 confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug - 修复 confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug
## 0.0.15(2021-06-21) ## 0.0.15(2021-06-21)
- 修复 passwordIcon 属性拼写错误的 bug - 修复 passwordIcon 属性拼写错误的 bug
## 0.0.14(2021-06-18) ## 0.0.14(2021-06-18)
- 新增 passwordIcon 属性,当 type=password 时是否显示小眼睛图标 - 新增 passwordIcon 属性,当 type=password 时是否显示小眼睛图标
- 修复 confirmType 属性不生效的问题 - 修复 confirmType 属性不生效的问题
## 0.0.13(2021-06-04) ## 0.0.13(2021-06-04)
- 修复 disabled 状态可清出内容的 bug - 修复 disabled 状态可清出内容的 bug
## 0.0.12(2021-05-12) ## 0.0.12(2021-05-12)
- 新增 组件示例地址 - 新增 组件示例地址
## 0.0.11(2021-05-07) ## 0.0.11(2021-05-07)
- 修复 input-border 属性不生效的问题 - 修复 input-border 属性不生效的问题
## 0.0.10(2021-04-30) ## 0.0.10(2021-04-30)
- 修复 ios 遮挡文字、显示一半的问题 - 修复 ios 遮挡文字、显示一半的问题
## 0.0.9(2021-02-05) ## 0.0.9(2021-02-05)
- 调整为 uni_modules 目录规范 - 调整为 uni_modules 目录规范
- 优化 兼容 nvue 页面 - 优化 兼容 nvue 页面
/** /**
* @desc 函数防抖 * @desc 函数防抖
* @param func 目标函数 * @param func 目标函数
* @param wait 延迟执行毫秒数 * @param wait 延迟执行毫秒数
* @param immediate true - 立即执行, false - 延迟执行 * @param immediate true - 立即执行, false - 延迟执行
*/ */
export const debounce = function(func, wait = 1000, immediate = true) { export const debounce = function(func, wait = 1000, immediate = true) {
let timer; let timer;
console.log(1); console.log(1);
return function() { return function() {
console.log(123); console.log(123);
let context = this, let context = this,
args = arguments; args = arguments;
if (timer) clearTimeout(timer); if (timer) clearTimeout(timer);
if (immediate) { if (immediate) {
let callNow = !timer; let callNow = !timer;
timer = setTimeout(() => { timer = setTimeout(() => {
timer = null; timer = null;
}, wait); }, wait);
if (callNow) func.apply(context, args); if (callNow) func.apply(context, args);
} else { } else {
timer = setTimeout(() => { timer = setTimeout(() => {
func.apply(context, args); func.apply(context, args);
}, wait) }, wait)
} }
} }
} }
/** /**
* @desc 函数节流 * @desc 函数节流
* @param func 函数 * @param func 函数
* @param wait 延迟执行毫秒数 * @param wait 延迟执行毫秒数
* @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发 * @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发
*/ */
export const throttle = (func, wait = 1000, type = 1) => { export const throttle = (func, wait = 1000, type = 1) => {
let previous = 0; let previous = 0;
let timeout; let timeout;
return function() { return function() {
let context = this; let context = this;
let args = arguments; let args = arguments;
if (type === 1) { if (type === 1) {
let now = Date.now(); let now = Date.now();
if (now - previous > wait) { if (now - previous > wait) {
func.apply(context, args); func.apply(context, args);
previous = now; previous = now;
} }
} else if (type === 2) { } else if (type === 2) {
if (!timeout) { if (!timeout) {
timeout = setTimeout(() => { timeout = setTimeout(() => {
timeout = null; timeout = null;
func.apply(context, args) func.apply(context, args)
}, wait) }, wait)
} }
} }
} }
} }
{ {
"id": "uni-easyinput", "id": "uni-easyinput",
"displayName": "uni-easyinput 增强输入框", "displayName": "uni-easyinput 增强输入框",
"version": "1.1.6", "version": "1.1.6",
"description": "Easyinput 组件是对原生input组件的增强", "description": "Easyinput 组件是对原生input组件的增强",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
"uniui", "uniui",
"input", "input",
"uni-easyinput", "uni-easyinput",
"输入框" "输入框"
], ],
"repository": "https://github.com/dcloudio/uni-ui", "repository": "https://github.com/dcloudio/uni-ui",
"engines": { "engines": {
"HBuilderX": "" "HBuilderX": ""
}, },
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
"sourcecode": { "sourcecode": {
"price": "0.00" "price": "0.00"
} }
}, },
"contact": { "contact": {
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "无", "ads": "无",
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue" "type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [ "dependencies": [
"uni-scss", "uni-scss",
"uni-icons" "uni-icons"
], ],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y"
}, },
"client": { "client": {
"App": { "App": {
"app-vue": "y", "app-vue": "y",
"app-nvue": "y" "app-nvue": "y"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
"Android Browser": "y", "Android Browser": "y",
"微信浏览器(Android)": "y", "微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y" "QQ浏览器(Android)": "y"
}, },
"H5-pc": { "H5-pc": {
"Chrome": "y", "Chrome": "y",
"IE": "y", "IE": "y",
"Edge": "y", "Edge": "y",
"Firefox": "y", "Firefox": "y",
"Safari": "y" "Safari": "y"
}, },
"小程序": { "小程序": {
"微信": "y", "微信": "y",
"阿里": "y", "阿里": "y",
"百度": "y", "百度": "y",
"字节跳动": "y", "字节跳动": "y",
"QQ": "y" "QQ": "y"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
"联盟": "u" "联盟": "u"
}, },
"Vue": { "Vue": {
"vue2": "y", "vue2": "y",
"vue3": "y" "vue3": "y"
} }
} }
} }
} }
} }
\ No newline at end of file
### Easyinput 增强输入框 ### Easyinput 增强输入框
> **组件名:uni-easyinput** > **组件名:uni-easyinput**
> 代码块: `uEasyinput` > 代码块: `uEasyinput`
easyinput 组件是对原生input组件的增强 ,是专门为配合表单组件[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)而设计的,easyinput 内置了边框,图标等,同时包含 input 所有功能 easyinput 组件是对原生input组件的增强 ,是专门为配合表单组件[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)而设计的,easyinput 内置了边框,图标等,同时包含 input 所有功能
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-easyinput) ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-easyinput)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
## 1.0.4(2023-03-29) ## 1.0.4(2023-03-29)
- 修复 手动上传删除一个文件后不能再上传的bug - 修复 手动上传删除一个文件后不能再上传的bug
## 1.0.3(2022-12-19) ## 1.0.3(2022-12-19)
- 新增 sourceType 属性, 可以自定义图片和视频选择的来源 - 新增 sourceType 属性, 可以自定义图片和视频选择的来源
## 1.0.2(2022-07-04) ## 1.0.2(2022-07-04)
- 修复 在uni-forms下样式不生效的bug - 修复 在uni-forms下样式不生效的bug
## 1.0.1(2021-11-23) ## 1.0.1(2021-11-23)
- 修复 参数为对象的情况下,url在某些情况显示错误的bug - 修复 参数为对象的情况下,url在某些情况显示错误的bug
## 1.0.0(2021-11-19) ## 1.0.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-file-picker](https://uniapp.dcloud.io/component/uniui/uni-file-picker) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-file-picker](https://uniapp.dcloud.io/component/uniui/uni-file-picker)
## 0.2.16(2021-11-08) ## 0.2.16(2021-11-08)
- 修复 传入空对象 ,显示错误的Bug - 修复 传入空对象 ,显示错误的Bug
## 0.2.15(2021-08-30) ## 0.2.15(2021-08-30)
- 修复 return-type="object" 时且存在v-model时,无法删除文件的Bug - 修复 return-type="object" 时且存在v-model时,无法删除文件的Bug
## 0.2.14(2021-08-23) ## 0.2.14(2021-08-23)
- 新增 参数中返回 fileID 字段 - 新增 参数中返回 fileID 字段
## 0.2.13(2021-08-23) ## 0.2.13(2021-08-23)
- 修复 腾讯云传入fileID 不能回显的bug - 修复 腾讯云传入fileID 不能回显的bug
- 修复 选择图片后,不能放大的问题 - 修复 选择图片后,不能放大的问题
## 0.2.12(2021-08-17) ## 0.2.12(2021-08-17)
- 修复 由于 0.2.11 版本引起的不能回显图片的Bug - 修复 由于 0.2.11 版本引起的不能回显图片的Bug
## 0.2.11(2021-08-16) ## 0.2.11(2021-08-16)
- 新增 clearFiles(index) 方法,可以手动删除指定文件 - 新增 clearFiles(index) 方法,可以手动删除指定文件
- 修复 v-model 值设为 null 报错的Bug - 修复 v-model 值设为 null 报错的Bug
## 0.2.10(2021-08-13) ## 0.2.10(2021-08-13)
- 修复 return-type="object" 时,无法删除文件的Bug - 修复 return-type="object" 时,无法删除文件的Bug
## 0.2.9(2021-08-03) ## 0.2.9(2021-08-03)
- 修复 auto-upload 属性失效的Bug - 修复 auto-upload 属性失效的Bug
## 0.2.8(2021-07-31) ## 0.2.8(2021-07-31)
- 修复 fileExtname属性不指定值报错的Bug - 修复 fileExtname属性不指定值报错的Bug
## 0.2.7(2021-07-31) ## 0.2.7(2021-07-31)
- 修复 在某种场景下图片不回显的Bug - 修复 在某种场景下图片不回显的Bug
## 0.2.6(2021-07-30) ## 0.2.6(2021-07-30)
- 修复 return-type为object下,返回值不正确的Bug - 修复 return-type为object下,返回值不正确的Bug
## 0.2.5(2021-07-30) ## 0.2.5(2021-07-30)
- 修复(重要) H5 平台下如果和uni-forms组件一同使用导致页面卡死的问题 - 修复(重要) H5 平台下如果和uni-forms组件一同使用导致页面卡死的问题
## 0.2.3(2021-07-28) ## 0.2.3(2021-07-28)
- 优化 调整示例代码 - 优化 调整示例代码
## 0.2.2(2021-07-27) ## 0.2.2(2021-07-27)
- 修复 vue3 下赋值错误的Bug - 修复 vue3 下赋值错误的Bug
- 优化 h5平台下上传文件导致页面卡死的问题 - 优化 h5平台下上传文件导致页面卡死的问题
## 0.2.0(2021-07-13) ## 0.2.0(2021-07-13)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) - 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 0.1.1(2021-07-02) ## 0.1.1(2021-07-02)
- 修复 sourceType 缺少默认值导致 ios 无法选择文件 - 修复 sourceType 缺少默认值导致 ios 无法选择文件
## 0.1.0(2021-06-30) ## 0.1.0(2021-06-30)
- 优化 解耦与uniCloud的强绑定关系 ,如不绑定服务空间,默认autoUpload为false且不可更改 - 优化 解耦与uniCloud的强绑定关系 ,如不绑定服务空间,默认autoUpload为false且不可更改
## 0.0.11(2021-06-30) ## 0.0.11(2021-06-30)
- 修复 由 0.0.10 版本引发的 returnType 属性失效的问题 - 修复 由 0.0.10 版本引发的 returnType 属性失效的问题
## 0.0.10(2021-06-29) ## 0.0.10(2021-06-29)
- 优化 文件上传后进度条消失时机 - 优化 文件上传后进度条消失时机
## 0.0.9(2021-06-29) ## 0.0.9(2021-06-29)
- 修复 在uni-forms 中,删除文件 ,获取的值不对的Bug - 修复 在uni-forms 中,删除文件 ,获取的值不对的Bug
## 0.0.8(2021-06-15) ## 0.0.8(2021-06-15)
- 修复 删除文件时无法触发 v-model 的Bug - 修复 删除文件时无法触发 v-model 的Bug
## 0.0.7(2021-05-12) ## 0.0.7(2021-05-12)
- 新增 组件示例地址 - 新增 组件示例地址
## 0.0.6(2021-04-09) ## 0.0.6(2021-04-09)
- 修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug - 修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug
## 0.0.5(2021-04-09) ## 0.0.5(2021-04-09)
- 优化 更新组件示例 - 优化 更新组件示例
## 0.0.4(2021-04-09) ## 0.0.4(2021-04-09)
- 优化 file-extname 字段支持字符串写法,多个扩展名需要用逗号分隔 - 优化 file-extname 字段支持字符串写法,多个扩展名需要用逗号分隔
## 0.0.3(2021-02-05) ## 0.0.3(2021-02-05)
- 调整为uni_modules目录规范 - 调整为uni_modules目录规范
- 修复 微信小程序不指定 fileExtname 属性选择失败的Bug - 修复 微信小程序不指定 fileExtname 属性选择失败的Bug
差异被折叠。
差异被折叠。
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论