Kaynağa Gözat

第一次提交

master
dong 1 yıl önce
işleme
6fd80c1bda
100 değiştirilmiş dosya ile 14816 ekleme ve 0 silme
  1. 20
    0
      .hbuilderx/launch.json
  2. 48
    0
      App.vue
  3. 117
    0
      api/api.js
  4. 100
    0
      api/http.js
  5. BIN
      components/.DS_Store
  6. 22
    0
      index.html
  7. 68
    0
      main.js
  8. 172
    0
      manifest.json
  9. 16
    0
      package.json
  10. 54
    0
      pages.json
  11. 496
    0
      pages/details/index.vue
  12. 1247
    0
      pages/electricity/index.vue
  13. 1266
    0
      pages/home/index.vue
  14. 455
    0
      pages/index/index.vue
  15. 1255
    0
      pages/supply/supply.vue
  16. 1473
    0
      pages/supplyss/supplyss.vue
  17. BIN
      static.lnk
  18. BIN
      static/!.png
  19. BIN
      static/503.png
  20. BIN
      static/Battery.png
  21. BIN
      static/DCpower.png
  22. BIN
      static/DCpower1.png
  23. BIN
      static/SOC.png
  24. BIN
      static/__UNI__8782431_0801094442.apk
  25. BIN
      static/appicons.png
  26. BIN
      static/che.png
  27. BIN
      static/che1.png
  28. BIN
      static/choice1.png
  29. BIN
      static/choice2.png
  30. BIN
      static/choice3.png
  31. BIN
      static/choice4.png
  32. BIN
      static/dian1.png
  33. BIN
      static/dian2.png
  34. BIN
      static/direct.png
  35. BIN
      static/direct1.png
  36. BIN
      static/electricity.png
  37. BIN
      static/electricity1.png
  38. BIN
      static/fang.png
  39. BIN
      static/heng.png
  40. BIN
      static/home.png
  41. BIN
      static/home1.png
  42. BIN
      static/log.png
  43. BIN
      static/logo.png
  44. BIN
      static/power.png
  45. BIN
      static/power1.png
  46. BIN
      static/setup.png
  47. BIN
      static/shan.png
  48. BIN
      static/system.png
  49. BIN
      static/tite.png
  50. BIN
      static/y1.png
  51. BIN
      static/y4.png
  52. BIN
      static/y6.png
  53. BIN
      static/y8.png
  54. BIN
      static/z16.png
  55. 10
    0
      uni.promisify.adaptor.js
  56. 76
    0
      uni.scss
  57. 193
    0
      uni_modules/jerry-gauge/index.js
  58. 54
    0
      uni_modules/jerry-gauge/index.vue
  59. 160
    0
      uni_modules/uni-datetime-picker/changelog.md
  60. 177
    0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue
  61. 947
    0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue
  62. 22
    0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json
  63. 8
    0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js
  64. 22
    0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json
  65. 22
    0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json
  66. 940
    0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue
  67. 1057
    0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
  68. 421
    0
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js
  69. 88
    0
      uni_modules/uni-datetime-picker/package.json
  70. 21
    0
      uni_modules/uni-datetime-picker/readme.md
  71. 42
    0
      uni_modules/uni-icons/changelog.md
  72. 91
    0
      uni_modules/uni-icons/components/uni-icons/uni-icons.uvue
  73. 110
    0
      uni_modules/uni-icons/components/uni-icons/uni-icons.vue
  74. 664
    0
      uni_modules/uni-icons/components/uni-icons/uniicons.css
  75. BIN
      uni_modules/uni-icons/components/uni-icons/uniicons.ttf
  76. 664
    0
      uni_modules/uni-icons/components/uni-icons/uniicons_file.ts
  77. 649
    0
      uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js
  78. 89
    0
      uni_modules/uni-icons/package.json
  79. 8
    0
      uni_modules/uni-icons/readme.md
  80. 27
    0
      uni_modules/uni-pagination/changelog.md
  81. 5
    0
      uni_modules/uni-pagination/components/uni-pagination/i18n/en.json
  82. 5
    0
      uni_modules/uni-pagination/components/uni-pagination/i18n/es.json
  83. 5
    0
      uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json
  84. 12
    0
      uni_modules/uni-pagination/components/uni-pagination/i18n/index.js
  85. 5
    0
      uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json
  86. 5
    0
      uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json
  87. 465
    0
      uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue
  88. 83
    0
      uni_modules/uni-pagination/package.json
  89. 11
    0
      uni_modules/uni-pagination/readme.md
  90. 84
    0
      uni_modules/uni-popup/changelog.md
  91. 45
    0
      uni_modules/uni-popup/components/uni-popup-dialog/keypress.js
  92. 316
    0
      uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue
  93. 143
    0
      uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue
  94. 187
    0
      uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue
  95. 7
    0
      uni_modules/uni-popup/components/uni-popup/i18n/en.json
  96. 8
    0
      uni_modules/uni-popup/components/uni-popup/i18n/index.js
  97. 7
    0
      uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json
  98. 7
    0
      uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json
  99. 45
    0
      uni_modules/uni-popup/components/uni-popup/keypress.js
  100. 0
    0
      uni_modules/uni-popup/components/uni-popup/popup.js

+ 20
- 0
.hbuilderx/launch.json Dosyayı Görüntüle

@@ -0,0 +1,20 @@
1
+{
2
+    // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
3
+    // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
4
+    "version" : "0.0",
5
+    "configurations" : [
6
+        {
7
+            "app-plus" : {
8
+                "launchtype" : "local"
9
+            },
10
+            "default" : {
11
+                "launchtype" : "local"
12
+            },
13
+            "type" : "uniCloud"
14
+        },
15
+        {
16
+            "playground" : "standard",
17
+            "type" : "uni-app:app-android"
18
+        }
19
+    ]
20
+}

+ 48
- 0
App.vue Dosyayı Görüntüle

@@ -0,0 +1,48 @@
1
+<script>
2
+	// import {
3
+	// 	login
4
+	// } from "./api/api.js"
5
+	export default {
6
+		data() {
7
+			return {
8
+				// uidatas:''
9
+			}
10
+		},
11
+		onLaunch: function() {
12
+			// 隐藏导航栏
13
+			  // var main = plus.android.runtimeMainActivity();
14
+			  // var window = main.getWindow();
15
+			  // var decorView = window.getDecorView();
16
+			  // var uiOptions = plus.android.getField(plus.android.View.class, "SYSTEM_UI_FLAG_HIDE_NAVIGATION");
17
+			  // decorView.setSystemUiVisibility(uiOptions);
18
+			  // this.onlogin()
19
+			  // plus.screen.lockOrientation( 'landscape-primary');
20
+			  // plus.navigator.hideSystemBar();
21
+			 plus.navigator.setFullscreen(true) //隐藏状态栏
22
+			 	plus.navigator.hideSystemNavigation() //隐藏虚拟按键
23
+		},
24
+		beforeUnmount() {
25
+			// clearInterval(this.uidatas);
26
+		},
27
+		methods: {
28
+			 
29
+		
30
+		},
31
+		onShow: function() {
32
+			console.log('App Show')
33
+		},
34
+		onHide: function() {
35
+			console.log('App Hide')
36
+		}
37
+	}
38
+</script>
39
+
40
+<style>
41
+	/*每个页面公共css */
42
+	/* .uni-page-head {
43
+	    display: none !important;
44
+	} */
45
+	page {
46
+	  padding-bottom: 0 !important; /* 移除底部的padding,使内容可以填满屏幕 */
47
+	}
48
+</style>

+ 117
- 0
api/api.js Dosyayı Görüntüle

@@ -0,0 +1,117 @@
1
+ // 启停接口
2
+ export const control = async (data) => {
3
+   try {
4
+     const response = await uni.$http.post(`/api/v1/items/rt/${data.id}`,data,{'Content-Type': "application/json;charset=utf-8","Authorization":`JWT ${uni.getStorageSync('token')}` });
5
+ 	console.log(response);
6
+     if (response.statusCode != 200||response.data.error=='token过期且未提供刷新令牌') {
7
+       // uni.showToast({
8
+       //   title: '数据请求失败! ',
9
+       //   duration: 1500,
10
+       //   icon: 'none',
11
+       // });
12
+	    uni.removeStorageSync('token');
13
+	 login();
14
+       return response.data;
15
+     }
16
+     return response.data;
17
+   } catch (error) {
18
+	   console.log(error);
19
+     // uni.showToast({
20
+     //   title: '网络请求失败! ',
21
+     //   duration: 1500,
22
+     //   icon: 'none',
23
+     // });
24
+	 login();
25
+     return response.data;
26
+   }
27
+ };
28
+// 二级页面信息
29
+export const getuidatas = async (data) => {
30
+  try {
31
+    const response = await uni.$http.get('/api/v1/uidatas/rt/uis/3224a3eb-2375-4dfc-99ce-b182edd30996',data,{'Content-Type': "application/json;charset=utf-8","Authorization":`JWT ${uni.getStorageSync('token')}` });
32
+	console.log(response);
33
+
34
+    if (response.statusCode != 200||response.data.error=='token过期且未提供刷新令牌') {
35
+      // uni.showToast({
36
+      //   title: '数据请求失败! ',
37
+      //   duration: 1500,
38
+      //   icon: 'none',
39
+      // });
40
+	  uni.removeStorageSync('token');
41
+	  login();
42
+	  
43
+      return response.data;
44
+    }
45
+    return response.data;
46
+  } catch (error) {
47
+    // console.error('Network request failed:', error);
48
+	console.log(error);
49
+    // uni.showToast({
50
+    //   title: '网络请求失败! ',
51
+    //   duration: 1500,
52
+    //   icon: 'none',
53
+    // });
54
+	login();
55
+    return response.data;
56
+  }
57
+};
58
+// 系统故障列表
59
+ export const getfaultsList = async (data) => {
60
+   try {
61
+ 	// console.log(uni.getStorageSync('token'));
62
+     const response = await uni.$http.get('/api/v1/faults',data,{'Content-Type': "application/json;charset=utf-8","Authorization":`JWT ${uni.getStorageSync('token')}` });
63
+ 	console.log(response.data);
64
+     if (response.statusCode != 200||response.data.error=='token过期且未提供刷新令牌') {
65
+       // uni.showToast({
66
+       //   title: '数据请求失败! ',
67
+       //   duration: 1500,
68
+       //   icon: 'none',
69
+       // });
70
+	    uni.removeStorageSync('token');
71
+		login();
72
+       return response.data;
73
+     }
74
+     return response.data;
75
+   } catch (error) {
76
+     console.error('Network request failed:', error);
77
+	 console.log(error);
78
+     // uni.showToast({
79
+     //   title: '网络请求失败! ',
80
+     //   duration: 1500,
81
+     //   icon: 'none',
82
+     // });
83
+	 uni.removeStorageSync('token');
84
+	 login();
85
+     return response.data;
86
+   }
87
+ };
88
+ // 登录接口
89
+export const login = async (start,count) => {
90
+  try {
91
+	console.log('login request');
92
+    const response = await uni.$http.post('/api/v1/login',
93
+	{name: "dexnui", pwd: "dexn1001"},{'Content-Type': 'application/json;charset=utf-8'});
94
+	console.log(response);
95
+    if (response.statusCode != 200||response.data.error=='token过期且未提供刷新令牌') {
96
+      // uni.showToast({
97
+      //   title: '数据请求失败! ',
98
+      //   duration: 1500,
99
+      //   icon: 'none',
100
+      // });
101
+      return response.data;
102
+    }
103
+	console.log(response.data);
104
+	uni.setStorageSync('token', response.data.data.token);
105
+    return response.data;
106
+  } catch (error) {
107
+    // console.error('Network request failed:', error);
108
+    // uni.showToast({
109
+    //   title: '网络请求失败! ',
110
+    //   duration: 1500,
111
+    //   icon: 'none',
112
+    // });
113
+    return response.data;
114
+  }
115
+};
116
+ 
117
+ 

+ 100
- 0
api/http.js Dosyayı Görüntüle

@@ -0,0 +1,100 @@
1
+//utils/http.js
2
+class Request {
3
+  constructor(options = {}) {
4
+    // 请求的根路径
5
+    this.baseUrl = options.baseUrl || 'http://10.168.1.100'
6
+    // this.baseUrl = options.baseUrl || 'http://10.168.3.100'
7
+    // this.baseUrl =options.baseUrl || 'http://192.168.137.100'
8
+    // 请求的 url 地址
9
+    this.url = options.url || ''
10
+    // 请求方式
11
+    this.method = 'GET'
12
+    // 请求的参数对象
13
+    this.data = null
14
+    // header 请求头
15
+    this.header = options.header || {}
16
+    this.beforeRequest = null
17
+    this.afterRequest = null
18
+  }
19
+  
20
+   // 添加对header的支持
21
+    _mergeHeaders(customHeader = {}) {
22
+      return Object.assign({}, this.header, customHeader); // 合并默认header和自定义header
23
+    }
24
+ 
25
+  get(url, data = {},header = {}) {
26
+	  // console.log(header);
27
+    this.method = 'GET'
28
+    this.url = this.baseUrl + url
29
+    this.data = data
30
+	this.header = this._mergeHeaders(header) // 合并header
31
+    return this._()
32
+  }
33
+ 
34
+  post(url, data = {},header = {}) {
35
+    this.method = 'POST'
36
+    this.url = this.baseUrl + url
37
+    this.data = data
38
+	this.header = this._mergeHeaders(header) // 合并header
39
+    return this._()
40
+  }
41
+ 
42
+  put(url, data = {}) {
43
+    this.method = 'PUT'
44
+    this.url = this.baseUrl + url
45
+    this.data = data
46
+    return this._()
47
+  }
48
+ 
49
+  delete(url, data = {}) {
50
+    this.method = 'DELETE'
51
+    this.url = this.baseUrl + url
52
+    this.data = data
53
+    return this._()
54
+  }
55
+ 
56
+  _() {
57
+			  if(this.baseUrl==''){
58
+			
59
+			  		  this.url ="http://10.168.1.100"+this.url
60
+			  }
61
+			 
62
+    // 清空 header 对象
63
+    // this.header = {}
64
+    // 请求之前做一些事
65
+    this.beforeRequest && typeof this.beforeRequest === 'function' && this.beforeRequest(this)
66
+    // 发起请求
67
+    return new Promise((resolve, reject) => {
68
+      let weixin = wx
69
+      // 适配 uniapp
70
+      if ('undefined' !== typeof uni) {
71
+        weixin = uni
72
+      }
73
+      weixin.request({
74
+        url:this.url,
75
+        method: this.method,
76
+        data: this.data,
77
+        header: this.header,
78
+        success: (res) => {
79
+		
80
+			resolve(res)
81
+			 },
82
+        fail: (err) => { 
83
+		
84
+			reject(err)
85
+			 },
86
+        complete: (res) => {
87
+			
88
+          // 请求完成以后做一些事情
89
+          this.afterRequest && typeof this.afterRequest === 'function' && this.afterRequest(res)
90
+        }
91
+      })
92
+    })
93
+  }
94
+}
95
+ 
96
+export const $http = new Request()
97
+
98
+
99
+
100
+ 

BIN
components/.DS_Store Dosyayı Görüntüle


+ 22
- 0
index.html Dosyayı Görüntüle

@@ -0,0 +1,22 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="UTF-8" />
5
+    <script>
6
+      var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
7
+        CSS.supports('top: constant(a)'))
8
+      document.write(
9
+        '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
10
+        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
11
+    </script>
12
+    <title></title>
13
+    <!--preload-links-->
14
+    <!--app-context-->
15
+  </head>
16
+  <body>
17
+    <div id="app"><!--app-html--></div>
18
+    <script type="module" src="/main.js">
19
+		
20
+	</script>
21
+  </body>
22
+</html>

+ 68
- 0
main.js Dosyayı Görüntüle

@@ -0,0 +1,68 @@
1
+import App from './App'
2
+
3
+// #ifndef VUE3
4
+import Vue from 'vue'
5
+import './uni.promisify.adaptor'
6
+Vue.config.productionTip = false
7
+App.mpType = 'app'
8
+const app = new Vue({
9
+  ...App
10
+})
11
+app.$mount()
12
+// #endif
13
+
14
+// #ifdef VUE3
15
+import { createSSRApp } from 'vue'
16
+export function createApp() {
17
+  const app = createSSRApp(App)
18
+  return {
19
+    app
20
+  }
21
+}
22
+// #endif
23
+
24
+import { $http } from './api/http.js'
25
+// import { login } from './api/api'
26
+uni.$http = $http
27
+
28
+$http.baseUrl = ''
29
+// uni.$apiKey = 'xxxxxxxxx'
30
+// 请求开始之前
31
+$http.beforeRequest = function (options) {
32
+	// uni.showLoading({
33
+	//   title: '数据加载中...',
34
+	// })
35
+	// if(options.url!="http://10.168.4.100:80/api/v1/login"){
36
+	// console.log(options);
37
+	// 	if (!uni.getStorageSync('token')) {
38
+	// 		login().then(data => {
39
+	// 			// console.log(data);
40
+	// 			if (data.status == 'ok') {
41
+	// 				uni.setStorage({
42
+	// 					key: 'token',
43
+	// 					data: data.data.token,
44
+	// 					success: function(res) {
45
+	// 						console.log(res);
46
+	// 					}
47
+	// 				});
48
+					
49
+	// 			}else{
50
+	// 				uni.showToast({
51
+	// 				  title:data.msg,
52
+	// 				  icon: 'none',
53
+	// 				  duration: 2000, // 显示时长,单位为毫秒
54
+	// 				});
55
+	// 			}
56
+	// 		});
57
+	// 	}
58
+	// }
59
+	
60
+ 
61
+}
62
+ 
63
+// 请求完成之后
64
+$http.afterRequest = function () {
65
+  // uni.hideLoading()
66
+}
67
+
68
+ 

+ 172
- 0
manifest.json Dosyayı Görüntüle

@@ -0,0 +1,172 @@
1
+{
2
+    "name" : "移动储能",
3
+    "appid" : "__UNI__8782431",
4
+    "description" : "",
5
+    "versionName" : "1.0.0",
6
+    "versionCode" : "100",
7
+    "transformPx" : false,
8
+    /* 5+App特有相关 */
9
+    "app-plus" : {
10
+        "usingComponents" : true,
11
+        "universalApk" : true,
12
+        "nvueStyleCompiler" : "uni-app",
13
+        "compilerVersion" : 3,
14
+        "titleNView" : false,
15
+        "compatible" : {
16
+            "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持  
17
+        },
18
+        "splashscreen" : {
19
+            "alwaysShowBeforeRender" : true,
20
+            "waiting" : true,
21
+            "autoclose" : true,
22
+            "delay" : 0
23
+        },
24
+        "screenOrientation" : [ "landscape-primary" ],
25
+        /* 模块配置 */
26
+        "modules" : {},
27
+        /* 应用发布信息 */
28
+        "distribute" : {
29
+            /* android打包配置 */
30
+            "android" : {
31
+                "permissions" : [
32
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
33
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
34
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
35
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
36
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
37
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
38
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
39
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
40
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
41
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
42
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
43
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
44
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
45
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
46
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
47
+                ],
48
+                "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
49
+                "orientation" : "landscape"
50
+            },
51
+            "screenOrientation" : [ "landscape-primary" ],
52
+            /* ios打包配置 */
53
+            "ios" : {
54
+                "dSYMs" : false,
55
+                "idfa" : false
56
+            },
57
+            /* SDK配置 */
58
+            "sdkConfigs" : {
59
+                "ad" : {}
60
+            },
61
+            "splashscreen" : {
62
+                "androidStyle" : "default",
63
+                "android" : {
64
+                    "hdpi" : "D:/project/esswisdom_ipad/static/log.png",
65
+                    "xhdpi" : "D:/project/esswisdom_ipad/static/log.png",
66
+                    "xxhdpi" : "D:\\project\\esswisdom_ipad\\static\\log.png"
67
+                }
68
+            },
69
+            "icons" : {
70
+                "android" : {
71
+                    "hdpi" : "D:\\project\\esswisdom_ipad\\static\\appicons.png",
72
+                    "xhdpi" : "D:\\project\\esswisdom_ipad\\static\\appicons.png",
73
+                    "xxhdpi" : "D:\\project\\esswisdom_ipad\\static\\appicons.png",
74
+                    "xxxhdpi" : "D:\\project\\esswisdom_ipad\\static\\appicons.png"
75
+                },
76
+                "ios" : {
77
+                    "appstore" : ""
78
+                }
79
+            }
80
+        },
81
+        "fullScreen" : true, // 全屏显示
82
+        "statusbar" : {
83
+            "immersive" : true, // 沉浸式状态栏
84
+            "immersiveStatus" : true, // 隐藏状态栏
85
+            "immersiveNavBar" : true // 隐藏导航栏
86
+        },
87
+        "nativePlugins" : {
88
+            "Fvv-AutoStart" : {
89
+                "__plugin_info__" : {
90
+                    "name" : "安卓开机自启动 Fvv-AutoStart",
91
+                    "description" : "uni-app 安卓开机自启动插件,不保证所有机型和系统都有效",
92
+                    "platforms" : "Android",
93
+                    "url" : "https://ext.dcloud.net.cn/plugin?id=1820",
94
+                    "android_package_name" : "uni.UNI8782431",
95
+                    "ios_bundle_id" : "",
96
+                    "isCloud" : true,
97
+                    "bought" : 1,
98
+                    "pid" : "1820",
99
+                    "parameters" : {}
100
+                }
101
+            }
102
+        }
103
+    },
104
+    /* 快应用特有相关 */
105
+    "quickapp" : {},
106
+    /* 小程序特有相关 */
107
+    "mp-weixin" : {
108
+        "appid" : "",
109
+        "setting" : {
110
+            "urlCheck" : false
111
+        },
112
+        "usingComponents" : true
113
+    },
114
+    "mp-alipay" : {
115
+        "usingComponents" : true
116
+    },
117
+    "mp-baidu" : {
118
+        "usingComponents" : true
119
+    },
120
+    "mp-toutiao" : {
121
+        "usingComponents" : true
122
+    },
123
+    "uniStatistics" : {
124
+        "enable" : false
125
+    },
126
+    "vueVersion" : "3",
127
+    "app" : {
128
+        "distribute" : {
129
+            "syncDebug" : true,
130
+            "android" : {
131
+                "packagename" : "uni.UNI8782431",
132
+                "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
133
+                "minSdkVersion" : "21",
134
+                "targetSdkVersion" : "32",
135
+                "orientation" : "landscape"
136
+            },
137
+            "ios" : {
138
+                "appid" : "iOS Bundle ID"
139
+            }
140
+        }
141
+    },
142
+    "h5" : {
143
+        "devServer" : {
144
+            "port" : 80,
145
+            "proxy" : {
146
+                "/api" : {
147
+                    "target" : "http://10.168.1.100",
148
+                    "changeOrigin" : true,
149
+                    "pathRewrite" : {
150
+                        "^/api" : ""
151
+                    }
152
+                }
153
+            }
154
+        },
155
+        "template" : "index.html",
156
+        "router" : {
157
+            "mode" : "hash",
158
+            "base" : "/index/"
159
+        }
160
+    }
161
+}
162
+// "port" : 5173,
163
+// "proxy" : {
164
+//     "/api" : {
165
+//         "target" : "http://192.168.137.100",
166
+//         "changeOrigin" : true,
167
+//         "pathRewrite" : {
168
+//             "^/api" : ""
169
+//         }
170
+//     }
171
+// }
172
+

+ 16
- 0
package.json Dosyayı Görüntüle

@@ -0,0 +1,16 @@
1
+{
2
+    "id": "jerry-gauge",
3
+    "name": "仪表盘或者环形进度条",
4
+    "version": "1.0.3",
5
+    "description": "基于canvas自定义仪表盘",
6
+    "keywords": [
7
+        "canvas",
8
+        "gauge"
9
+    ],
10
+    "dcloudext": {
11
+        "category": [
12
+            "前端组件",
13
+            "通用组件"
14
+        ]
15
+    }
16
+}

+ 54
- 0
pages.json Dosyayı Görüntüle

@@ -0,0 +1,54 @@
1
+{
2
+	
3
+	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
4
+		{
5
+			"path": "pages/index/index",
6
+			"style": {
7
+				"navigationBarTitleText": ""
8
+				
9
+			}
10
+		},
11
+		{
12
+			"path": "pages/home/index",
13
+			"style": {
14
+				"navigationBarTitleText": ""
15
+			}
16
+		},
17
+		{
18
+			"path": "pages/details/index",
19
+			"style": {
20
+				"navigationBarTitleText": ""
21
+			}
22
+		},
23
+		{
24
+			"path" : "pages/electricity/index",
25
+			"style" : 
26
+			{
27
+				"navigationBarTitleText" : ""
28
+			}
29
+		},
30
+		{
31
+			"path" : "pages/supply/supply",
32
+			"style" : 
33
+			{
34
+				"navigationBarTitleText" : ""
35
+			}
36
+		},
37
+		{
38
+			"path" : "pages/supplyss/supplyss",
39
+			"style" : 
40
+			{
41
+				"navigationBarTitleText" : ""
42
+			}
43
+		} 
44
+	],
45
+	
46
+	"globalStyle": {
47
+		"navigationBarTextStyle": "black",
48
+		"navigationBarTitleText": "",
49
+		"navigationStyle": "custom",
50
+		"navigationBarBackgroundColor": "#F8F8F8",
51
+		"backgroundColor": "#F8F8F8"
52
+	},
53
+	"uniIdRouter": {}
54
+}

+ 496
- 0
pages/details/index.vue Dosyayı Görüntüle

@@ -0,0 +1,496 @@
1
+<template>
2
+	<view class="content">
3
+		<view class="top">
4
+			<image class="top_logo" src="../../static/logo.png" mode=""></image>
5
+			<image class="tite" src="../../static/tite.png" mode=""></image>
6
+			<view class="time">
7
+				<view class="time_top">
8
+				{{formattedTime}}
9
+				</view>
10
+				<view class="time_bottom">
11
+					<view>
12
+
13
+					</view>
14
+					<view class="time_bottom1">
15
+						连接状态:
16
+						<view class="time_state" v-if="this.total">
17
+							在线
18
+						</view>
19
+						<view class="time_state1" v-else>
20
+							离线
21
+						</view>
22
+						
23
+					</view>
24
+
25
+				</view>
26
+
27
+			</view>
28
+		</view>
29
+		<view class="parameter">
30
+			<view class="parameter_xian">
31
+				<view class="parameter_xian1">
32
+					序号
33
+				</view>
34
+				<view class="parameter_xian2">
35
+					类型
36
+				</view>
37
+				<view class="parameter_xian3">
38
+					设备
39
+				</view>
40
+				<view class="parameter_xian4">
41
+					内容
42
+				</view>
43
+				<view class="parameter_xian5">
44
+					发生时间
45
+				</view>
46
+				<view class="parameter_xian6">
47
+					恢复时间
48
+				</view>
49
+			</view>
50
+			<view class="parameter_box">
51
+				<view v-for="(item,index) in faultsList" :class="item.RESETTIME==''?'parameter_divred':'parameter_div'" :key="index">
52
+					<view class="parameter_xian1">
53
+						{{item.ID}}
54
+					</view>
55
+					<view class="parameter_xian2">
56
+						{{item.TYPE}}
57
+					</view>
58
+					<zb-tooltip @click.top="closedevice" :content="item.DEVICE" placement="top" :ref="'device'+index">
59
+					<view class="parameter_xian3">
60
+						{{item.DEVICE}}
61
+					</view>				
62
+						</zb-tooltip>
63
+					<zb-tooltip @click.top="close" :content="item.CONTENT" placement="top" :ref="'tooltip'+index">
64
+					<view class="parameter_xian4">
65
+						{{item.CONTENT}}
66
+					</view>
67
+					</zb-tooltip>
68
+					<view class="parameter_xian5">
69
+						{{item.FAULTTIME.substring(0, 19)}}
70
+					</view>
71
+					<view class="parameter_xian6">
72
+						{{item.RESETTIME.substring(0, 19)}}
73
+					</view>
74
+				</view>
75
+				 
76
+			</view>
77
+
78
+			<view class="parameter_bottom">
79
+				<view class="parameter_bottom1" @click="onclick">  
80
+					<image src="../../static/home.png" mode=""></image><text class="parameter_bottom2">返回模式选择</text>
81
+				</view>
82
+				<view class="parameter_bottom3">
83
+					<view :class="faulttaps=='实时'?'parameter_bottom31':'parameter_bottom32'" @click="taps('实时')">
84
+						实时
85
+					</view>
86
+					<!-- <view :class="faulttaps=='全部'?'parameter_bottom31':'parameter_bottom32'" @click="taps('全部')">
87
+						全部
88
+					</view> -->
89
+					<view :class="faulttaps=='故障'?'parameter_bottom31':'parameter_bottom32'" @click="taps('故障')">
90
+						故障
91
+					</view>
92
+					<view :class="faulttaps=='告警'?'parameter_bottom31':'parameter_bottom32'" @click="taps('告警')">
93
+						告警
94
+					</view>
95
+					<view :class="faulttaps=='事件'?'parameter_bottom31':'parameter_bottom32'" @click="taps('事件')">
96
+						事件
97
+					</view>
98
+				</view>
99
+				<view class="parameter_bottom4">
100
+					<view class="eliminate">
101
+						故障清除
102
+					</view>
103
+					<uni-pagination :total="total" title="标题文字" :show-icon="true" @change="change" />
104
+				</view>
105
+			</view>
106
+
107
+		</view>
108
+	</view>
109
+</template>
110
+<!--table -->
111
+<script>
112
+	import {getTime} from "../../utils/index.js"
113
+	import {getfaultsList} from "../../api/api.js"
114
+	export default {
115
+		data() {
116
+			return {
117
+				current: 1,
118
+				total: 0,
119
+				pageSize: 10,
120
+				faulttaps:'实时',
121
+				faultsList:[],
122
+				formattedTime:getTime('yyyy年MM月dd日 hh:mm:ss'),
123
+				formatTimeid:''
124
+			}
125
+		},
126
+		onLoad() {
127
+			
128
+			this.formatTimeid = setInterval(() => {
129
+			   const customFormat = 'yyyy年MM月dd日 hh:mm:ss';
130
+			    this.formattedTime = getTime(customFormat);
131
+			  }, 1000);
132
+			this.onfaultsList();
133
+		},
134
+		beforeUnmount() {
135
+			clearInterval(this.formatTimeid);
136
+		},
137
+		methods: {
138
+			onfaultsList(){
139
+				let data ={
140
+					page:this.current,
141
+					rows: this.pageSize,
142
+					device: '',
143
+					starttime: '',
144
+					endtime: '',
145
+					rt: this.faulttaps=='实时' ? 1:0,
146
+					type: this.faulttaps=='实时'?'':this.faulttaps
147
+				}
148
+						getfaultsList(data).then(res => {
149
+							console.log(res);
150
+						 if(res.status=='ok'){
151
+						 	 this.faultsList= res.data.list
152
+							 this.total = res.data.pagination.total
153
+						 }else{
154
+							 
155
+						 }
156
+				});
157
+			
158
+							 
159
+						},
160
+			onclick() {
161
+				uni.redirectTo({
162
+					url: '/pages/index/index'
163
+				});
164
+			},
165
+
166
+			change(e) {
167
+				console.log(e);
168
+				this.current = e.current
169
+				this.onfaultsList()
170
+			},
171
+			taps(e){
172
+				this.faulttaps=e
173
+				console.log(e);
174
+				this.onfaultsList()
175
+			},
176
+			// 文字提示
177
+		 closedevice(){
178
+		 	for(let i=1;i<this.total;i++){
179
+		 		this.$refs[('device'+i)].close()
180
+		 	}
181
+		 },
182
+			close(){
183
+				for(let i=1;i<this.total;i++){
184
+					this.$refs[('tooltip'+i)].close()
185
+				}
186
+			}
187
+		}
188
+	}
189
+</script>
190
+
191
+<style scoped>
192
+	.content {
193
+		width: 100%;
194
+		height: 100vh;
195
+		opacity: 1;
196
+		background: linear-gradient(180deg, rgba(215, 230, 245, 0) 0%, rgba(196, 229, 255, 1) 100%);
197
+		box-sizing: border-box;
198
+	}
199
+
200
+	.top {
201
+		width: 100%;
202
+		height: 100px;
203
+		display: flex;
204
+		align-items: center;
205
+		justify-content: space-between;
206
+		background-size: 100% 100%;
207
+		background-repeat: no-repeat;
208
+		background-color: #fff;
209
+		padding: 0px 46px;
210
+		box-sizing: border-box;
211
+	}
212
+
213
+	.top_logo {
214
+		width: 426px;
215
+		height: 68px;
216
+	}
217
+
218
+	.tite {
219
+		width: 277px;
220
+		height: 48px;
221
+	}
222
+
223
+	.time {
224
+		text-align: right;
225
+	}
226
+
227
+	.time_top {
228
+		font-size: 17px;
229
+	}
230
+
231
+	.time_bottom {
232
+		display: flex;
233
+		font-size: 17px;
234
+		justify-content: space-between;
235
+	}
236
+
237
+	.time_bottom1 {
238
+		display: flex;
239
+	}
240
+
241
+	.time_state {
242
+		font-size: 17px;
243
+		font-weight: 600;
244
+		color: rgba(22, 68, 144, 1);
245
+	}
246
+
247
+	.parameter {
248
+		width: 100%;
249
+		/* padding-bottom: 20px; */
250
+		display: flex;
251
+		padding:0px 20px 20px 20px;
252
+		display: flex;
253
+		flex-direction: column;
254
+		box-sizing: border-box;
255
+	}
256
+
257
+	.parameter_xian {
258
+		width: 100%;
259
+		height: 55px;
260
+		background: linear-gradient(180deg, rgba(30, 131, 189, 1) 0%, rgba(69, 168, 230, 0.92) 100%);
261
+		box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
262
+		display: flex;
263
+		align-items: center;
264
+		/* justify-content: space-around; */
265
+		font-size: 28px;
266
+		font-weight: 600;
267
+		padding: 0px 20px;
268
+		box-sizing: border-box;
269
+		.parameter_xian1 {
270
+			width: 100px;
271
+		}
272
+		
273
+		.parameter_xian2 {
274
+			width: 100px;
275
+		}
276
+		
277
+		.parameter_xian3 {
278
+			width: 120px;
279
+		}
280
+		
281
+		.parameter_xian4 {
282
+			width: 400px;
283
+			margin-right: 10px;
284
+			  white-space: nowrap; /* 禁止换行 */
285
+  overflow: hidden; /* 超出部分隐藏 */
286
+  text-overflow: ellipsis; /* 显示省略号 */
287
+		}
288
+		
289
+		.parameter_xian5 {
290
+			width: 220px;
291
+			margin-right: 10px;
292
+		}
293
+		
294
+		.parameter_xian6 {
295
+		width: 220px; 
296
+		}
297
+	}
298
+
299
+	.parameter_box {
300
+		width: 100%;
301
+		overflow: auto;
302
+	}
303
+
304
+	.parameter_div {
305
+		width: 100%;
306
+		height: 44.05px;
307
+		background: rgba(255, 255, 255, 1);
308
+		box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
309
+		margin-top: 10px;
310
+		display: flex;
311
+		align-items: center;
312
+		/* justify-content: space-around; */
313
+		font-weight: 500;
314
+		padding: 0px 20px;
315
+		box-sizing: border-box;
316
+		.parameter_xian1 {
317
+			font-size: 18px;
318
+			width: 100px;
319
+		}
320
+		
321
+		.parameter_xian2 {
322
+			font-size: 18px;
323
+			width: 100px;
324
+		}
325
+		
326
+		.parameter_xian3 {
327
+			font-size: 18px;
328
+			width: 120px;
329
+			white-space: nowrap; /* 禁止换行 */
330
+			overflow: hidden; /* 超出部分隐藏 */
331
+			text-overflow: ellipsis; /* 显示省略号 */
332
+			margin-right: 10px;
333
+		}
334
+		
335
+		.parameter_xian4 {
336
+			font-size: 18px;
337
+			width: 400px;
338
+			margin-right: 10px;
339
+			white-space: nowrap; /* 禁止换行 */
340
+			overflow: hidden; /* 超出部分隐藏 */
341
+			text-overflow: ellipsis; /* 显示省略号 */
342
+		}
343
+		
344
+		.parameter_xian5 {
345
+			font-size: 18px;
346
+			width: 220px;
347
+			margin-right: 10px;
348
+			
349
+		}
350
+		
351
+		.parameter_xian6 {
352
+			font-size: 18px;
353
+			width: 220px;
354
+		}
355
+	}
356
+
357
+	.parameter_divred {
358
+		width: 100%;
359
+		height: 44.05px;
360
+		background: rgba(245, 99, 83, 1);
361
+		box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
362
+		margin-bottom: 10px;
363
+		display: flex;
364
+		align-items: center;
365
+		color: #fff;
366
+		font-weight: 500;
367
+		/* justify-content: space-around; */
368
+		padding: 0px 16px;
369
+		box-sizing: border-box;
370
+		.parameter_xian1 {
371
+			font-size: 18px;
372
+			width: 100px;
373
+		}
374
+		
375
+		.parameter_xian2 {
376
+			font-size: 18px;
377
+			width: 100px;
378
+		}
379
+		
380
+		.parameter_xian3 {
381
+			font-size: 18px;
382
+			width: 120px;
383
+			white-space: nowrap; /* 禁止换行 */
384
+			overflow: hidden; /* 超出部分隐藏 */
385
+			text-overflow: ellipsis; /* 显示省略号 */
386
+			margin-right: 10px;
387
+		}
388
+		
389
+		.parameter_xian4 {
390
+			font-size: 18px;
391
+			width: 400px;
392
+			margin-right: 10px;
393
+			white-space: nowrap; /* 禁止换行 */
394
+			overflow: hidden; /* 超出部分隐藏 */
395
+			text-overflow: ellipsis; /* 显示省略号 */
396
+		}
397
+		
398
+		.parameter_xian5 {
399
+			font-size: 18px;
400
+			width: 220px;
401
+			margin-right: 10px;
402
+			
403
+		}
404
+		
405
+		.parameter_xian6 {
406
+			font-size: 18px;
407
+			width: 220px;
408
+		}
409
+	}
410
+
411
+	.parameter_bottom {
412
+		display: flex;
413
+		justify-content: space-between;
414
+		margin-bottom: 10px;
415
+		padding: 0px 16px;
416
+		position: fixed;
417
+		left: 0px;
418
+		bottom: 10px;
419
+		width: 100%;
420
+		box-sizing: border-box;
421
+	}
422
+
423
+	.parameter_bottom1 {
424
+		display: flex;
425
+		align-items: center;
426
+
427
+		image {
428
+			width: 32px;
429
+			height: 32px;
430
+			display: flex;
431
+		}
432
+	}
433
+
434
+	.parameter_bottom2 {
435
+		font-size: 19.58px;
436
+		font-weight: 400;
437
+		color: rgba(0, 0, 0, 1);
438
+		margin-left: 10px;
439
+	}
440
+
441
+	.parameter_bottom3 {
442
+		display: flex;
443
+	}
444
+
445
+	.parameter_bottom31 {
446
+		width: 48px;
447
+		height: 48px;
448
+		background: linear-gradient(180deg, rgba(74, 167, 224, 1) 0%, rgba(36, 134, 192, 1) 100%);
449
+		border-radius: 100%;
450
+		display: flex;
451
+		align-items: center;
452
+		justify-content: center;
453
+		font-size: 19px;
454
+		font-weight: 700;
455
+		margin-right: 20px;
456
+		color: rgba(255, 255, 255, 1);
457
+	}
458
+	.parameter_bottom32 {
459
+		width: 48px;
460
+		height: 48px;
461
+		background: linear-gradient(180deg, rgba(224, 218, 218, 1) 0%, rgba(130, 121, 121, 1) 100%);
462
+		border-radius: 100%;
463
+		display: flex;
464
+		align-items: center;
465
+		justify-content: center;
466
+		font-size: 19px;
467
+		font-weight: 700;
468
+		color:#222222;
469
+		margin-right: 20px;
470
+	}
471
+	.parameter_bottom4 {
472
+		display: flex;
473
+		align-items: center;
474
+	}
475
+
476
+	.eliminate {
477
+		width: 107.69px;
478
+		height: 44.05px;
479
+		opacity: 1;
480
+		border-radius: 2.45px;
481
+		background: linear-gradient(180deg, rgba(119, 163, 230, 1) 0%, rgba(25, 85, 176, 1) 10.42%, rgba(6, 53, 94, 1) 88.89%, rgba(119, 163, 230, 1) 100%);
482
+		margin-right: 20px;
483
+		display: flex;
484
+		align-items: center;
485
+		justify-content: center;
486
+		font-size: 23.5px;
487
+		font-weight: 400;
488
+		color: rgba(255, 255, 255, 1);
489
+		box-sizing: border-box;
490
+	}
491
+	.time_state1 {
492
+			font-size: 17px;
493
+			font-weight: 600;
494
+			color: rgba(217, 22, 22, 1);
495
+		}
496
+</style>

+ 1247
- 0
pages/electricity/index.vue
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 1266
- 0
pages/home/index.vue
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 455
- 0
pages/index/index.vue Dosyayı Görüntüle

@@ -0,0 +1,455 @@
1
+<template>
2
+	<view class="content">
3
+		<view class="top">
4
+			<image class="top_logo" src="../../static/logo.png" mode=""></image>
5
+			<image class="tite" src="../../static/tite.png" mode=""></image>
6
+			<view class="time">
7
+				<view class="time_top">
8
+				{{ formattedTime}}
9
+				</view>
10
+				<view class="time_bottom">
11
+					<view>
12
+						
13
+					</view>
14
+					<view class="time_bottom1">
15
+						连接状态:
16
+						<view class="time_state" v-if="uidatasdata.bms_ChgLinkSt">
17
+							在线
18
+						</view>
19
+						<view class="time_state1" v-else>
20
+							离线
21
+						</view>
22
+					</view>
23
+					
24
+				</view>
25
+			</view>
26
+		</view>
27
+		<view class="tap">
28
+			<view class="tap_1">
29
+				AC
30
+			</view>
31
+			<view class="tap_2">
32
+				DC
33
+			</view>
34
+			<view class="tap_3">
35
+				System
36
+			</view>
37
+		</view>
38
+     <view class="power">
39
+     	<view class="power_1" @click="onclick(3)">
40
+			<image v-if="selectorid==3" src="../../static/electricity.png" mode=""></image>
41
+			<image v-else src="../../static/choice1.png" mode=""></image>
42
+     	</view>
43
+		<view class="power_1" @click="onclick(2)">
44
+			<image v-if="selectorid==2" src="../../static/power1.png" mode=""></image>
45
+			<image v-else src="../../static/choice2.png" mode=""></image>
46
+		</view>
47
+		<view class="power_1" @click="onclick(4)">
48
+			<image v-if="selectorid==4" src="../../static/direct1.png" mode=""></image>
49
+			<image v-else src="../../static/choice3.png" mode=""></image>
50
+		</view>
51
+		<view class="power_1" @click="onclick(1)">
52
+			<image v-if="selectorid==1" src="../../static/DCpower1.png" mode=""></image>
53
+			<image v-else src="../../static/choice4.png" mode=""></image>
54
+		</view>
55
+		<view class="power_5" @click="system">
56
+			<image src="../../static/system.png" mode=""></image>
57
+		</view>
58
+     </view>
59
+	 <view class="power_6" v-if="this.uidatasdata.SysControl_RunCmd==1">
60
+	 	<image src="../../static/!.png" mode=""></image>若想重新选择模式,请返回之前模式停止以后再重新选择!
61
+	 </view>
62
+	 <uni-popup ref="message" type="message">
63
+	 				<uni-popup-message type="error" :message="messageText" :duration="2500"></uni-popup-message>
64
+	 			</uni-popup>
65
+	</view>
66
+</template>
67
+<script>
68
+	import {getuidatas,control} from "../../api/api.js"
69
+	import {getTime} from "../../utils/index.js"
70
+	export default {
71
+		data() {
72
+			return {
73
+				title: '',
74
+				uidatasdata:{},
75
+				uidatas:'',
76
+				formattedTime:getTime('yyyy年MM月dd日 hh:mm:ss'),
77
+				formatTimeid:'',
78
+				selectorid:0,
79
+				messageText:''
80
+			}
81
+		},
82
+		created() {
83
+		  this.formatTimeid = setInterval(() => {
84
+		     const customFormat = 'yyyy年MM月dd日 hh:mm:ss';
85
+		      this.formattedTime = getTime(customFormat);
86
+		    }, 1000);
87
+		  },
88
+		mounted(){
89
+	       
90
+		},
91
+		
92
+		onLoad() {
93
+           // this.onlogin();
94
+		   
95
+		   this.onfaultsList();
96
+		},
97
+		beforeUnmount() {
98
+			clearInterval(this.uidatas);
99
+			clearInterval(this.formatTimeid);
100
+		},
101
+		methods: {
102
+		
103
+			onfaultsList() {
104
+				let data = {
105
+					id: "3224a3eb-2375-4dfc-99ce-b182edd30996",
106
+					page: 1,
107
+					rows: 10000,
108
+				}
109
+				getuidatas(data).then(data => {
110
+					
111
+					if (data.status == 'ok') {
112
+						this.uidatasdata = data.data.reduce((obj, item) => {
113
+							let a = item.module;
114
+							let b = item[a];
115
+							let numericValue = parseFloat(b); // 转换为数字
116
+							// 如果是有效的数字,保留小数点后两位
117
+							let roundedValue = isNaN(numericValue) ? b : numericValue.toFixed(2);
118
+							return {
119
+								...obj,
120
+								[item.id]: roundedValue
121
+							};
122
+						}, {});
123
+						this.selectorid =this.uidatasdata.SysInstall_EssRunModeManual
124
+					// console.log(this.uidatasdata);
125
+					this.uidatas =setTimeout(() => {
126
+												     this.onfaultsList();
127
+												      }, 2000); // 10秒后隐藏消息
128
+					}else{
129
+											this.uidatas =setTimeout(() => {
130
+											     this.onfaultsList();
131
+	                           }, 2000); // 10秒后隐藏消息 
132
+					}
133
+				}).catch(error => {
134
+					console.log(error);
135
+					this.uidatasdata={}
136
+					this.uidatas =setTimeout(() => {
137
+					     this.onfaultsList();
138
+					      }, 2000); // 10秒后隐藏消息 
139
+  });
140
+			},
141
+
142
+         onclick(e){
143
+			 console.log(e);
144
+			 if(this.uidatasdata.SysInstall_EssRunModeManual==e){
145
+				if (this.uidatasdata.SysInstall_EssRunModeManual==3) {
146
+					uni.redirectTo({
147
+					  url: '/pages/home/index'
148
+					});
149
+				} else if(this.uidatasdata.SysInstall_EssRunModeManual==2){
150
+					uni.redirectTo({
151
+					  url: '/pages/electricity/index'
152
+					});
153
+				}else if(this.uidatasdata.SysInstall_EssRunModeManual==4){
154
+					uni.redirectTo({
155
+					  url: '/pages/supply/supply'
156
+					});
157
+				}else if(this.uidatasdata.SysInstall_EssRunModeManual==1){
158
+					uni.redirectTo({
159
+					  url: '/pages/supplyss/supplyss'
160
+					});
161
+				} 
162
+			 }else{
163
+				 if(this.uidatasdata.SysControl_RunCmd==1||this.uidatasdata.SysControl_Gun1RunCmd==1||this.uidatasdata.SysControl_Gun2RunCmd==1){
164
+					 // uni.showToast({
165
+					 //   title:'请停止之前模式选择',
166
+					 //   icon: 'warning',
167
+					 //   duration: 2500, // 显示时长,单位为毫秒
168
+					 // });
169
+					 this.messageText = '请停止之前模式,在选择'
170
+					 this.$refs.message.open()
171
+					 return
172
+					 
173
+				 }else if(e==3){
174
+					
175
+				 if(this.uidatasdata.AC_Out_380V_125A_Status==1){
176
+					 // uni.showToast({
177
+					 //   title:'请先手动断开125A',
178
+					 //   icon: 'warning',
179
+					 //   duration: 2500, // 显示时长,单位为毫秒
180
+					 // });
181
+					 this.messageText = '需将AC输出端125A的开关手动断开'
182
+					 this.$refs.message.open()
183
+					 return
184
+				 }else if(this.uidatasdata.AC_Out_380V_63A_Status==1){
185
+					// uni.showToast({
186
+					//   title:'请先手动断开63A',
187
+					//   icon: 'warning',
188
+					//   duration: 2500, // 显示时长,单位为毫秒
189
+					// });
190
+					this.messageText = '需将AC输出端63A的开关手动断开'
191
+					this.$refs.message.open()
192
+					return 
193
+				 }else if(this.uidatasdata.AC_Out_220V_16A_Status==1){
194
+					// uni.showToast({
195
+					//   title:'请先手动断开16A',
196
+					//   icon: 'warning',
197
+					//   duration: 2500, // 显示时长,单位为毫秒
198
+					// });
199
+					this.messageText = '需将AC输出端16A的开关手动断开'
200
+					this.$refs.message.open()
201
+					return 
202
+				 }else{
203
+					 uni.setStorageSync('selector',e);
204
+					 this.pattern(e)
205
+				 }
206
+					 
207
+				 }else if(e==2){
208
+					if(this.uidatasdata.AC_In_380V_63A1_Status==1){
209
+										 // uni.showToast({
210
+										 //   title:'请先手动断开63A1',
211
+										 //   icon: 'warning',
212
+										 //   duration: 2500, // 显示时长,单位为毫秒
213
+										 // });
214
+										 this.messageText = '需将AC输出端63A1的开关手动断开'
215
+										 this.$refs.message.open()
216
+										 return
217
+					} else if(this.uidatasdata.AC_In_380V_63A2_Status==1){
218
+					// uni.showToast({
219
+					//   title:'请先手动断开63A2',
220
+					//   icon: 'warning',
221
+					//   duration: 2500, // 显示时长,单位为毫秒
222
+					// });
223
+					this.messageText = '需将AC输出端63A2的开关手动断开'
224
+					this.$refs.message.open()
225
+					return 
226
+					 
227
+				 }else{
228
+					 uni.setStorageSync('selector',e);
229
+					 this.pattern(e)
230
+				 }
231
+				 }else{
232
+			 uni.setStorageSync('selector',e);
233
+			 this.pattern(e)
234
+				 }
235
+			 }
236
+		 },
237
+		 pattern(unm){
238
+			 let data = {
239
+			 		id: "c32e6a80-9159-4f6e-9acc-8525cf177808",
240
+			 		issaveinitvalue:false,
241
+			 		value:unm+''  // 直流供电=1,直流补电=4,交流供电=2,交流补电=3
242
+			 	}
243
+			 	control(data).then(data => {
244
+			 		console.log(data);
245
+			 		if (data.status == 'ok') {
246
+			 		if (unm==3) {
247
+			 			uni.redirectTo({
248
+			 			  url: '/pages/home/index'
249
+			 			});
250
+			 		} else if(unm==2){
251
+			 			uni.redirectTo({
252
+			 			  url: '/pages/electricity/index'
253
+			 			});
254
+			 		}else if(unm==4){
255
+			 			uni.redirectTo({
256
+			 			  url: '/pages/supply/supply'
257
+			 			});
258
+			 		}else if(unm==1){
259
+			 			uni.redirectTo({
260
+			 			  url: '/pages/supplyss/supplyss'
261
+			 			});
262
+			 		}
263
+			 		} else {
264
+						 // uni.hideLoading()
265
+						 // uni.showToast({
266
+						 //   title:'选择模式失败请重新选择',
267
+						 //   icon: 'warning',
268
+						 //   duration: 2500, // 显示时长,单位为毫秒
269
+						 // });
270
+						 this.messageText = '选择模式失败请重新选择'
271
+						 this.$refs.message.open()
272
+						 return
273
+			 		}
274
+			 	});
275
+		 },
276
+		 system(){
277
+			uni.redirectTo({
278
+			  url: '/pages/details/index'
279
+			}); 
280
+		 }
281
+		}
282
+	}
283
+</script>
284
+
285
+<style scoped>
286
+	.content{
287
+		width: 100%;
288
+		height: 100vh;
289
+		opacity: 1;
290
+		background: linear-gradient(180deg, rgba(215, 230, 245, 0) 0%, rgba(196, 229, 255, 1) 100%);
291
+box-sizing: border-box;
292
+	}
293
+	.top {
294
+		 width: 100%;
295
+		 height: 100px;
296
+		 display: flex;
297
+       align-items: center;
298
+	  justify-content: space-between;
299
+background-size: 100% 100%;
300
+background-repeat: no-repeat;
301
+box-sizing: border-box;
302
+background-color: #fff;
303
+		padding: 0px 46px;
304
+	}
305
+	.top_logo{
306
+		width:426px;
307
+		height: 68px;
308
+	}
309
+	.tite{
310
+		 width:277px;
311
+		 height: 48px;
312
+	}
313
+	.time{
314
+	text-align: right;
315
+	}
316
+	.time_top{
317
+		font-size: 17px;
318
+	}
319
+.time_bottom{
320
+	display: flex;
321
+	font-size: 17px;
322
+	justify-content: space-between;
323
+}
324
+.time_bottom1{
325
+	display: flex;
326
+}
327
+.time_state{
328
+	font-size: 17px;
329
+	font-weight: 600;
330
+	color: rgba(22, 68, 144, 1);
331
+}
332
+.time_state1 {
333
+		font-size: 17px;
334
+		font-weight: 600;
335
+		color: rgba(217, 22, 22, 1);
336
+	}
337
+	 .tap{
338
+		width: 100%;
339
+		height: 46.01px;
340
+		 display: flex;
341
+		 justify-content: space-between;
342
+		 margin-top: 118px;
343
+		 margin-bottom: 50px;
344
+		 padding: 0px 20px;
345
+		 box-sizing: border-box;
346
+	 }
347
+	 .tap_1{
348
+	   width: 485.57px;
349
+      height: 46.5px;
350
+	  border-radius: 50px;
351
+	  background: linear-gradient(180deg, rgba(43, 158, 218, 1) 0%, rgba(39, 114, 186, 1) 100%);
352
+	  display: flex;
353
+	  align-items: center;
354
+      justify-content: center;
355
+  font-size: 35.24px;
356
+  font-weight: 700;
357
+  color: #fff;
358
+	 }
359
+	 .tap_2{
360
+		width: 485px;
361
+		    height: 46.5px;
362
+			  border-radius: 50px;
363
+			  background: linear-gradient(180deg, rgba(43, 158, 218, 1) 0%, rgba(39, 114, 186, 1) 100%);
364
+			  display: flex;
365
+			  align-items: center;
366
+		    justify-content: center;
367
+		font-size: 35.24px;
368
+		font-weight: 700;
369
+		color: #fff; 
370
+	 }
371
+	 .tap_3{
372
+		 width: 155.17px;
373
+		 height: 46.01px;
374
+		 opacity: 1;
375
+		 border-radius: 24.47px;
376
+		 background: linear-gradient(180deg, rgba(43, 158, 218, 1) 0%, rgba(39, 114, 186, 1) 100%);
377
+         display: flex;
378
+		 align-items: center;
379
+		    justify-content: center;
380
+			font-size: 30px;
381
+			font-weight: 700;
382
+			color: #fff; 
383
+	 }
384
+	 .power{
385
+		 width: 100%;
386
+		display: flex; 
387
+		justify-content: space-between;
388
+		padding: 0px 20px;
389
+		box-sizing: border-box;
390
+	 }
391
+	 .power_1{
392
+		width: 237.55px;
393
+		height: 298.98px;
394
+		opacity: 1;
395
+		box-sizing: border-box;
396
+ image{
397
+ 	 width: 100%;
398
+ 	 height: 100%;
399
+ }
400
+	 }
401
+	 .power_11{
402
+		width: 237.55px;
403
+				height: 298.98px;
404
+				opacity: 1;
405
+				box-sizing: border-box;
406
+				font-size: 23px;
407
+				font-family: 400;
408
+	              display: flex;
409
+				  flex-direction: column;
410
+          align-items: center;
411
+     .power_image{
412
+		 width: 100%;
413
+		 height: 248px;
414
+		 margin-bottom: 20px;
415
+		 background-image: url("../../static/electricity1.png");
416
+		 background-size: 100% 100%;
417
+		 display: flex;
418
+          align-items: center;
419
+		  justify-content: center;
420
+		  padding: 0px 16px;
421
+		  box-sizing: border-box;
422
+		image{
423
+			width: 100%;
424
+			height: 160.06px;
425
+		} 
426
+	 }
427
+	 }
428
+	 .power_5{
429
+		 width: 154.19px;
430
+		 height: 297.61px;
431
+		 opacity: 1;
432
+ image{
433
+ 	 width: 100%;
434
+ 	 height: 100%;
435
+ }
436
+	 }
437
+	 .power_6{
438
+		 width: 100%;
439
+		 height: 50px;
440
+		 font-size: 17.62px;
441
+		 margin-top: 80px;
442
+		 display: flex;
443
+		 align-items: center;
444
+		 padding: 0px 20px;
445
+		 box-sizing: border-box;
446
+		 position: fixed;
447
+		 left: 0px;
448
+		 bottom: 64px;
449
+		 image{
450
+		 margin-right: 10px;
451
+			 width: 27.41px;
452
+			 height: 27.41px;
453
+		 };
454
+	 }
455
+</style>

+ 1255
- 0
pages/supply/supply.vue
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 1473
- 0
pages/supplyss/supplyss.vue
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


BIN
static.lnk Dosyayı Görüntüle


BIN
static/!.png Dosyayı Görüntüle


BIN
static/503.png Dosyayı Görüntüle


BIN
static/Battery.png Dosyayı Görüntüle


BIN
static/DCpower.png Dosyayı Görüntüle


BIN
static/DCpower1.png Dosyayı Görüntüle


BIN
static/SOC.png Dosyayı Görüntüle


BIN
static/__UNI__8782431_0801094442.apk Dosyayı Görüntüle


BIN
static/appicons.png Dosyayı Görüntüle


BIN
static/che.png Dosyayı Görüntüle


BIN
static/che1.png Dosyayı Görüntüle


BIN
static/choice1.png Dosyayı Görüntüle


BIN
static/choice2.png Dosyayı Görüntüle


BIN
static/choice3.png Dosyayı Görüntüle


BIN
static/choice4.png Dosyayı Görüntüle


BIN
static/dian1.png Dosyayı Görüntüle


BIN
static/dian2.png Dosyayı Görüntüle


BIN
static/direct.png Dosyayı Görüntüle


BIN
static/direct1.png Dosyayı Görüntüle


BIN
static/electricity.png Dosyayı Görüntüle


BIN
static/electricity1.png Dosyayı Görüntüle


BIN
static/fang.png Dosyayı Görüntüle


BIN
static/heng.png Dosyayı Görüntüle


BIN
static/home.png Dosyayı Görüntüle


BIN
static/home1.png Dosyayı Görüntüle


BIN
static/log.png Dosyayı Görüntüle


BIN
static/logo.png Dosyayı Görüntüle


BIN
static/power.png Dosyayı Görüntüle


BIN
static/power1.png Dosyayı Görüntüle


BIN
static/setup.png Dosyayı Görüntüle


BIN
static/shan.png Dosyayı Görüntüle


BIN
static/system.png Dosyayı Görüntüle


BIN
static/tite.png Dosyayı Görüntüle


BIN
static/y1.png Dosyayı Görüntüle


BIN
static/y4.png Dosyayı Görüntüle


BIN
static/y6.png Dosyayı Görüntüle


BIN
static/y8.png Dosyayı Görüntüle


BIN
static/z16.png Dosyayı Görüntüle


+ 10
- 0
uni.promisify.adaptor.js Dosyayı Görüntüle

@@ -0,0 +1,10 @@
1
+uni.addInterceptor({
2
+  returnValue (res) {
3
+    if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
4
+      return res;
5
+    }
6
+    return new Promise((resolve, reject) => {
7
+      res.then((res) => res[0] ? reject(res[0]) : resolve(res[1]));
8
+    });
9
+  },
10
+});

+ 76
- 0
uni.scss Dosyayı Görüntüle

@@ -0,0 +1,76 @@
1
+/**
2
+ * 这里是uni-app内置的常用样式变量
3
+ *
4
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
5
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
6
+ *
7
+ */
8
+
9
+/**
10
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
11
+ *
12
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
13
+ */
14
+
15
+/* 颜色变量 */
16
+
17
+/* 行为相关颜色 */
18
+$uni-color-primary: #007aff;
19
+$uni-color-success: #4cd964;
20
+$uni-color-warning: #f0ad4e;
21
+$uni-color-error: #dd524d;
22
+
23
+/* 文字基本颜色 */
24
+$uni-text-color:#333;//基本色
25
+$uni-text-color-inverse:#fff;//反色
26
+$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
27
+$uni-text-color-placeholder: #808080;
28
+$uni-text-color-disable:#c0c0c0;
29
+
30
+/* 背景颜色 */
31
+$uni-bg-color:#ffffff;
32
+$uni-bg-color-grey:#f8f8f8;
33
+$uni-bg-color-hover:#f1f1f1;//点击状态颜色
34
+$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
35
+
36
+/* 边框颜色 */
37
+$uni-border-color:#c8c7cc;
38
+
39
+/* 尺寸变量 */
40
+
41
+/* 文字尺寸 */
42
+$uni-font-size-sm:12px;
43
+$uni-font-size-base:14px;
44
+$uni-font-size-lg:16px;
45
+
46
+/* 图片尺寸 */
47
+$uni-img-size-sm:20px;
48
+$uni-img-size-base:26px;
49
+$uni-img-size-lg:40px;
50
+
51
+/* Border Radius */
52
+$uni-border-radius-sm: 2px;
53
+$uni-border-radius-base: 3px;
54
+$uni-border-radius-lg: 6px;
55
+$uni-border-radius-circle: 50%;
56
+
57
+/* 水平间距 */
58
+$uni-spacing-row-sm: 5px;
59
+$uni-spacing-row-base: 10px;
60
+$uni-spacing-row-lg: 15px;
61
+
62
+/* 垂直间距 */
63
+$uni-spacing-col-sm: 4px;
64
+$uni-spacing-col-base: 8px;
65
+$uni-spacing-col-lg: 12px;
66
+
67
+/* 透明度 */
68
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
69
+
70
+/* 文章场景相关 */
71
+$uni-color-title: #2C405A; // 文章标题颜色
72
+$uni-font-size-title:20px;
73
+$uni-color-subtitle: #555555; // 二级标题颜色
74
+$uni-font-size-subtitle:26px;
75
+$uni-color-paragraph: #3F536E; // 文章段落颜色
76
+$uni-font-size-paragraph:15px;

+ 193
- 0
uni_modules/jerry-gauge/index.js Dosyayı Görüntüle

@@ -0,0 +1,193 @@
1
+class Gauge {
2
+	constructor({
3
+		canvasId,
4
+		startAngle = 3.5 / 4 * Math.PI, // 135
5
+		endAngle = 0.5 / 4 * Math.PI, // 45
6
+		width = 180,
7
+		min = 0,
8
+		max = 100,
9
+		value = 0,
10
+		unit = '%',
11
+		showTick = false,
12
+		valueColor = '#555',
13
+		progressColor = '#f58220',
14
+		trackColor = '#F1F1F1',
15
+		lineWidth = 10
16
+	}) {
17
+		this.ctx = uni.createCanvasContext(canvasId)
18
+		this.startAngle = startAngle
19
+		this.endAngle = endAngle
20
+		this.width = width
21
+		this.min = min
22
+		this.max = max
23
+		this.value = value
24
+		this.unit = unit
25
+		this.showTick = showTick
26
+		this.valueColor = valueColor
27
+		this.progressColor = progressColor
28
+		this.trackColor = trackColor
29
+		// track width
30
+		this.lineWidth = lineWidth
31
+
32
+		this.radius = this.width / 2
33
+		this.process = min || -1
34
+		this.tickLength = this.max - this.min
35
+		// track radius
36
+		this.trackRadius = this.radius - this.lineWidth / 2
37
+		// one tick rad
38
+		this.tickRad = (2 * Math.PI - this.startAngle + this.endAngle) / this.tickLength
39
+		this.start()
40
+	}
41
+	draw() {
42
+		// 将坐标中心点移动到圆心位置
43
+		this.ctx.translate(this.radius, this.radius)
44
+
45
+		this.drawTrack()
46
+		this.drawValueText()
47
+		this.drawProgress()
48
+		if (this.showTick) {
49
+			this.drawTick()
50
+			this.drawTickText()
51
+		}
52
+		this.ctx.draw()
53
+	}
54
+	// 轨迹圆环
55
+	drawTrack() {
56
+		this.ctx.save()
57
+		this.ctx.lineWidth = this.lineWidth
58
+		// this.ctx.lineCap = 'round'
59
+		this.ctx.strokeStyle = this.trackColor
60
+		this.ctx.arc(0, 0, this.trackRadius, this.startAngle, this.endAngle)
61
+		this.ctx.stroke()
62
+		this.ctx.restore()
63
+	}
64
+	// 当前值显示
65
+	drawValueText() {
66
+		this.ctx.save()
67
+		this.ctx.fillStyle = this.valueColor
68
+		this.ctx.font = "34px serif"
69
+		this.ctx.textAlign = 'center'
70
+		this.ctx.textBaseline = 'middle'
71
+		this.ctx.fillText(`${this.value}${this.unit}`, 0, 0)
72
+		this.ctx.restore()
73
+	}
74
+	// 进度圆环
75
+	drawProgress() {
76
+		this.ctx.save()
77
+		const valueRad = this.getValueRad()
78
+		this.ctx.beginPath()
79
+		this.ctx.lineWidth = this.lineWidth
80
+		this.ctx.strokeStyle = typeof this.progressColor === 'string' ? this.progressColor : this.getGradient(this.progressColor)
81
+		// this.ctx.lineCap = 'round' // 会导致进度条加长
82
+		this.ctx.lineJoin = 'round'
83
+		// 终点角度是动态的
84
+		this.ctx.arc(0, 0, this.trackRadius, this.startAngle, valueRad)
85
+		this.ctx.stroke()
86
+		this.ctx.restore()
87
+	}
88
+	// 刻度线
89
+	drawTick() {
90
+		// 不可是使用旋转,否则文字也会旋转
91
+		let deg = this.startAngle
92
+		for (let i = this.min; i <= this.max; i++) {
93
+			this.ctx.save()
94
+			this.ctx.lineWidth = 1
95
+			this.ctx.strokeStyle = '#999'
96
+			this.ctx.beginPath()
97
+			// 刻度起点
98
+			let x0 = (this.radius - this.lineWidth - 2) * Math.cos(deg)
99
+			let y0 = (this.radius - this.lineWidth - 2) * Math.sin(deg)
100
+			// 刻度终点
101
+			var x1 = (this.radius - this.lineWidth - 8) * Math.cos(deg)
102
+			var y1 = (this.radius - this.lineWidth - 8) * Math.sin(deg)
103
+			this.ctx.moveTo(x0, y0)
104
+			this.ctx.lineTo(x1, y1)
105
+			deg += this.tickRad
106
+			this.ctx.stroke()
107
+			this.ctx.restore()
108
+		}
109
+
110
+	}
111
+	// 刻度值
112
+	drawTickText() {
113
+		let deg = this.startAngle
114
+		for (let i = this.min; i <= this.max; i++) {
115
+			let x = (this.radius - this.lineWidth - 20) * Math.cos(deg)
116
+			let y = (this.radius - this.lineWidth - 20) * Math.sin(deg)
117
+			deg += this.tickRad
118
+			this.ctx.save()
119
+			this.ctx.font = '12px serif'
120
+			this.ctx.fillStyle = '#999'
121
+			this.ctx.textAlign = 'center'
122
+			// 不设置会与tick错位
123
+			this.ctx.textBaseline = 'middle'
124
+			this.ctx.fillText(i, x, y)
125
+			this.ctx.restore()
126
+		}
127
+
128
+	}
129
+	// 当前值的弧度
130
+	getValueRad() {
131
+		// 超出
132
+		if (this.value > this.max) {
133
+			return (this.max - this.min) * this.tickRad + this.startAngle
134
+		}
135
+		return (this.process - this.min) * this.tickRad + this.startAngle
136
+	}
137
+	start() {
138
+	let update = () => {
139
+	this.process = this.process + (this.max - this.min) / 100
140
+	if (this.process > this.value) {
141
+	cancelAnimationFrame(update)
142
+	} else {
143
+	this.draw()
144
+	uni.requestAnimationFrame(update)
145
+	}
146
+	}
147
+	uni.requestAnimationFrame(update);
148
+	}
149
+	// 渐变
150
+	getGradient(colorList) {
151
+		let grd = this.ctx.createLinearGradient(0, 0, this.trackRadius, 0)
152
+		colorList.forEach((color, index) => {
153
+			grd.addColorStop(index / (colorList.length - 1), color)
154
+		})
155
+		return grd
156
+	}
157
+}
158
+
159
+
160
+// https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
161
+uni.requestAnimationFrame = function (callback) {  
162
+    var  lastTime=0;  
163
+  var currTime = new Date().getTime();  
164
+  var timeToCall = Math.max(0, 16 - (currTime - lastTime));  
165
+  var id = setTimeout(function () { callback(currTime + timeToCall); }, timeToCall);  
166
+  lastTime = currTime + timeToCall;  
167
+  return id;  
168
+};  
169
+
170
+uni.cancelAnimationFrame = function (id) {  
171
+  clearTimeout(id);  
172
+};  
173
+
174
+(function () {  
175
+  var lastTime = 0;  
176
+  var vendors = ['webkit', 'moz', 'ms', 'o'];  
177
+  for (var x = 0; x < vendors.length && !uni.requestAnimationFrame; ++x) {  
178
+    uni.requestAnimationFrame = uni[vendors[x] + 'RequestAnimationFrame'];  
179
+    uni.cancelAnimationFrame =  
180
+      uni[vendors[x] + 'CancelAnimationFrame'] || uni[vendors[x] + 'CancelRequestAnimationFrame'];  
181
+  }  
182
+  if (!uni.requestAnimationFrame)  
183
+    uni.requestAnimationFrame = function (callback) {  
184
+      return setTimeout(callback, 16);  
185
+    };  
186
+  if (!uni.cancelAnimationFrame)  
187
+    uni.cancelAnimationFrame = function (id) {  
188
+      clearTimeout(id);  
189
+    };  
190
+})();
191
+
192
+
193
+export default Gauge

+ 54
- 0
uni_modules/jerry-gauge/index.vue Dosyayı Görüntüle

@@ -0,0 +1,54 @@
1
+<template>
2
+  <view class="gauge-container">
3
+    <view class="title">温度类</view>
4
+    <canvas class="canvas" canvas-id="canvas"></canvas>
5
+    <view class="title">进度类</view>
6
+    <canvas class="canvas" canvas-id="canvas2"></canvas>
7
+  </view>
8
+</template>
9
+
10
+<script>
11
+import Gauge from "./index.js";
12
+export default {
13
+  name: "gauge",
14
+  data() {
15
+    return {};
16
+  },
17
+  mounted() {
18
+    new Gauge({
19
+      canvasId: "canvas",
20
+      width: 200,
21
+      min: 16,
22
+      max: 30,
23
+      value: 20.5,
24
+      unit: "℃",
25
+      showTick: true,
26
+    });
27
+    new Gauge({
28
+      canvasId: "canvas2",
29
+      value: 80,
30
+      lineWidth: 20,
31
+      progressColor: ["#2196F3", "#9C27B0", "#F44336"],
32
+      valueColor: "blue",
33
+    });
34
+  },
35
+};
36
+</script>
37
+
38
+<style>
39
+.gauge-container {
40
+  padding: 20rpx 40rpx;
41
+  text-align: left;
42
+}
43
+.title {
44
+  margin-bottom: 20rpx;
45
+  color: #000;
46
+  font-size: 32rpx;
47
+  font-weight: 500;
48
+}
49
+.canvas {
50
+  width: 200px;
51
+  height: 200px;
52
+  margin: 40rpx auto;
53
+}
54
+</style>

+ 160
- 0
uni_modules/uni-datetime-picker/changelog.md Dosyayı Görüntüle

@@ -0,0 +1,160 @@
1
+## 2.2.34(2024-04-24)
2
+- 新增 日期点击事件,在点击日期时会触发该事件。
3
+## 2.2.33(2024-04-15)
4
+- 修复 抖音小程序事件传递失效bug
5
+## 2.2.32(2024-02-20)
6
+- 修复 日历的close事件触发异常的bug [详情](https://github.com/dcloudio/uni-ui/issues/844)
7
+## 2.2.31(2024-02-20)
8
+- 修复 h5平台 右边日历的月份默认+1的bug [详情](https://github.com/dcloudio/uni-ui/issues/841)
9
+## 2.2.30(2024-01-31)
10
+- 修复 隐藏“秒”时,在IOS15及以下版本时出现 结束时间在开始时间之前 的bug [详情](https://github.com/dcloudio/uni-ui/issues/788)
11
+## 2.2.29(2024-01-20)
12
+- 新增 show事件,弹窗弹出时触发该事件 [详情](https://github.com/dcloudio/uni-app/issues/4694)
13
+## 2.2.28(2024-01-18)
14
+- 去除 noChange事件,当进行日期范围选择时,若只选了一天,则开始结束日期都为同一天 [详情](https://github.com/dcloudio/uni-ui/issues/815)
15
+## 2.2.27(2024-01-10)
16
+- 优化 增加noChange事件,当进行日期范围选择时,若有空值,则触发该事件 [详情](https://github.com/dcloudio/uni-ui/issues/815)
17
+## 2.2.26(2024-01-08)
18
+- 修复 字节小程序时间选择范围器失效问题 [详情](https://github.com/dcloudio/uni-ui/issues/834)
19
+## 2.2.25(2023-10-18)
20
+- 修复 PC端初次修改时间,开始时间未更新的Bug [详情](https://github.com/dcloudio/uni-ui/issues/737)
21
+## 2.2.24(2023-06-02)
22
+- 修复 部分情况修改时间,开始、结束时间显示异常的Bug [详情](https://ask.dcloud.net.cn/question/171146)
23
+- 优化 当前月可以选择上月、下月的日期的Bug
24
+## 2.2.23(2023-05-02)
25
+- 修复 部分情况修改时间,开始时间未更新的Bug [详情](https://github.com/dcloudio/uni-ui/issues/737)
26
+- 修复 部分平台及设备第一次点击无法显示弹框的Bug
27
+- 修复 ios 日期格式未补零显示及使用异常的Bug [详情](https://ask.dcloud.net.cn/question/162979)
28
+## 2.2.22(2023-03-30)
29
+- 修复 日历 picker 修改年月后,自动选中当月1日的Bug [详情](https://ask.dcloud.net.cn/question/165937)
30
+- 修复 小程序端 低版本 ios NaN的Bug [详情](https://ask.dcloud.net.cn/question/162979)
31
+## 2.2.21(2023-02-20)
32
+- 修复 firefox 浏览器显示区域点击无法拉起日历弹框的Bug [详情](https://ask.dcloud.net.cn/question/163362)
33
+## 2.2.20(2023-02-17)
34
+- 优化 值为空依然选中当天问题
35
+- 优化 提供 default-value 属性支持配置选择器打开时默认显示的时间
36
+- 优化 非范围选择未选择日期时间,点击确认按钮选中当前日期时间
37
+- 优化 字节小程序日期时间范围选择,底部日期换行的Bug
38
+## 2.2.19(2023-02-09)
39
+- 修复 2.2.18 引起范围选择配置 end 选择无效的Bug [详情](https://github.com/dcloudio/uni-ui/issues/686)
40
+## 2.2.18(2023-02-08)
41
+- 修复 移动端范围选择change事件触发异常的Bug [详情](https://github.com/dcloudio/uni-ui/issues/684)
42
+- 优化 PC端输入日期格式错误时返回当前日期时间
43
+- 优化 PC端输入日期时间超出 start、end 限制的Bug
44
+- 优化 移动端日期时间范围用法时间展示不完整问题
45
+## 2.2.17(2023-02-04)
46
+- 修复 小程序端绑定 Date 类型报错的Bug [详情](https://github.com/dcloudio/uni-ui/issues/679)
47
+- 修复 vue3 time-picker 无法显示绑定时分秒的Bug
48
+## 2.2.16(2023-02-02)
49
+- 修复 字节小程序报错的Bug
50
+## 2.2.15(2023-02-02)
51
+- 修复 某些情况切换月份错误的Bug
52
+## 2.2.14(2023-01-30)
53
+- 修复 某些情况切换月份错误的Bug [详情](https://ask.dcloud.net.cn/question/162033)
54
+## 2.2.13(2023-01-10)
55
+- 修复 多次加载组件造成内存占用的Bug
56
+## 2.2.12(2022-12-01)
57
+- 修复 vue3 下 i18n 国际化初始值不正确的Bug
58
+## 2.2.11(2022-09-19)
59
+- 修复 支付宝小程序样式错乱的Bug [详情](https://github.com/dcloudio/uni-app/issues/3861)
60
+## 2.2.10(2022-09-19)
61
+- 修复 反向选择日期范围,日期显示异常的Bug [详情](https://ask.dcloud.net.cn/question/153401?item_id=212892&rf=false)
62
+## 2.2.9(2022-09-16)
63
+- 可以使用 uni-scss 控制主题色
64
+## 2.2.8(2022-09-08)
65
+- 修复 close事件无效的Bug
66
+## 2.2.7(2022-09-05)
67
+- 修复 移动端 maskClick 无效的Bug [详情](https://ask.dcloud.net.cn/question/140824)
68
+## 2.2.6(2022-06-30)
69
+- 优化 组件样式,调整了组件图标大小、高度、颜色等,与uni-ui风格保持一致
70
+## 2.2.5(2022-06-24)
71
+- 修复 日历顶部年月及底部确认未国际化的Bug
72
+## 2.2.4(2022-03-31)
73
+- 修复 Vue3 下动态赋值,单选类型未响应的Bug
74
+## 2.2.3(2022-03-28)
75
+- 修复 Vue3 下动态赋值未响应的Bug
76
+## 2.2.2(2021-12-10)
77
+- 修复 clear-icon 属性在小程序平台不生效的Bug
78
+## 2.2.1(2021-12-10)
79
+- 修复 日期范围选在小程序平台,必须多点击一次才能取消选中状态的Bug
80
+## 2.2.0(2021-11-19)
81
+- 优化 组件UI,并提供设计资源 [详情](https://uniapp.dcloud.io/component/uniui/resource)
82
+- 文档迁移 [https://uniapp.dcloud.io/component/uniui/uni-datetime-picker](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker)
83
+## 2.1.5(2021-11-09)
84
+- 新增 提供组件设计资源,组件样式调整
85
+## 2.1.4(2021-09-10)
86
+- 修复 hide-second 在移动端的Bug
87
+- 修复 单选赋默认值时,赋值日期未高亮的Bug
88
+- 修复 赋默认值时,移动端未正确显示时间的Bug
89
+## 2.1.3(2021-09-09)
90
+- 新增 hide-second 属性,支持只使用时分,隐藏秒
91
+## 2.1.2(2021-09-03)
92
+- 优化 取消选中时(范围选)直接开始下一次选择, 避免多点一次
93
+- 优化 移动端支持清除按钮,同时支持通过 ref 调用组件的 clear 方法
94
+- 优化 调整字号大小,美化日历界面
95
+- 修复 因国际化导致的 placeholder 失效的Bug
96
+## 2.1.1(2021-08-24)
97
+- 新增 支持国际化
98
+- 优化 范围选择器在 pc 端过宽的问题
99
+## 2.1.0(2021-08-09)
100
+- 新增 适配 vue3
101
+## 2.0.19(2021-08-09)
102
+- 新增 支持作为 uni-forms 子组件相关功能
103
+- 修复 在 uni-forms 中使用时,选择时间报 NAN 错误的Bug
104
+## 2.0.18(2021-08-05)
105
+- 修复 type 属性动态赋值无效的Bug
106
+- 修复 ‘确认’按钮被 tabbar 遮盖 bug
107
+- 修复 组件未赋值时范围选左、右日历相同的Bug
108
+## 2.0.17(2021-08-04)
109
+- 修复 范围选未正确显示当前值的Bug
110
+- 修复 h5 平台(移动端)报错 'cale' of undefined 的Bug
111
+## 2.0.16(2021-07-21)
112
+- 新增 return-type 属性支持返回 date 日期对象
113
+## 2.0.15(2021-07-14)
114
+- 修复 单选日期类型,初始赋值后不在当前日历的Bug
115
+- 新增 clearIcon 属性,显示框的清空按钮可配置显示隐藏(仅 pc 有效)
116
+- 优化 移动端移除显示框的清空按钮,无实际用途
117
+## 2.0.14(2021-07-14)
118
+- 修复 组件赋值为空,界面未更新的Bug
119
+- 修复 start 和 end 不能动态赋值的Bug
120
+- 修复 范围选类型,用户选择后再次选择右侧日历(结束日期)显示不正确的Bug
121
+## 2.0.13(2021-07-08)
122
+- 修复 范围选择不能动态赋值的Bug
123
+## 2.0.12(2021-07-08)
124
+- 修复 范围选择的初始时间在一个月内时,造成无法选择的bug
125
+## 2.0.11(2021-07-08)
126
+- 优化 弹出层在超出视窗边缘定位不准确的问题
127
+## 2.0.10(2021-07-08)
128
+- 修复 范围起始点样式的背景色与今日样式的字体前景色融合,导致日期字体看不清的Bug
129
+- 优化 弹出层在超出视窗边缘被遮盖的问题
130
+## 2.0.9(2021-07-07)
131
+- 新增 maskClick 事件
132
+- 修复 特殊情况日历 rpx 布局错误的Bug,rpx -> px
133
+- 修复 范围选择时清空返回值不合理的bug,['', ''] -> []
134
+## 2.0.8(2021-07-07)
135
+- 新增 日期时间显示框支持插槽
136
+## 2.0.7(2021-07-01)
137
+- 优化 添加 uni-icons 依赖
138
+## 2.0.6(2021-05-22)
139
+- 修复 图标在小程序上不显示的Bug
140
+- 优化 重命名引用组件,避免潜在组件命名冲突
141
+## 2.0.5(2021-05-20)
142
+- 优化 代码目录扁平化
143
+## 2.0.4(2021-05-12)
144
+- 新增 组件示例地址
145
+## 2.0.3(2021-05-10)
146
+- 修复 ios 下不识别 '-' 日期格式的Bug
147
+- 优化 pc 下弹出层添加边框和阴影
148
+## 2.0.2(2021-05-08)
149
+- 修复 在 admin 中获取弹出层定位错误的bug
150
+## 2.0.1(2021-05-08)
151
+- 修复 type 属性向下兼容,默认值从 date 变更为 datetime
152
+## 2.0.0(2021-04-30)
153
+- 支持日历形式的日期+时间的范围选择
154
+ > 注意:此版本不向后兼容,不再支持单独时间选择(type=time)及相关的 hide-second 属性(时间选可使用内置组件 picker)
155
+## 1.0.6(2021-03-18)
156
+- 新增 hide-second 属性,时间支持仅选择时、分
157
+- 修复 选择跟显示的日期不一样的Bug
158
+- 修复 chang事件触发2次的Bug
159
+- 修复 分、秒 end 范围错误的Bug
160
+- 优化 更好的 nvue 适配

+ 177
- 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue Dosyayı Görüntüle

@@ -0,0 +1,177 @@
1
+<template>
2
+	<view class="uni-calendar-item__weeks-box" :class="{
3
+		'uni-calendar-item--disable':weeks.disable,
4
+		'uni-calendar-item--before-checked-x':weeks.beforeMultiple,
5
+		'uni-calendar-item--multiple': weeks.multiple,
6
+		'uni-calendar-item--after-checked-x':weeks.afterMultiple,
7
+		}" @click="choiceDate(weeks)" @mouseenter="handleMousemove(weeks)">
8
+		<view class="uni-calendar-item__weeks-box-item" :class="{
9
+				'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && (calendar.userChecked || !checkHover),
10
+				'uni-calendar-item--checked-range-text': checkHover,
11
+				'uni-calendar-item--before-checked':weeks.beforeMultiple,
12
+				'uni-calendar-item--multiple': weeks.multiple,
13
+				'uni-calendar-item--after-checked':weeks.afterMultiple,
14
+				'uni-calendar-item--disable':weeks.disable,
15
+				}">
16
+			<text v-if="selected && weeks.extraInfo" class="uni-calendar-item__weeks-box-circle"></text>
17
+			<text class="uni-calendar-item__weeks-box-text uni-calendar-item__weeks-box-text-disable uni-calendar-item--checked-text">{{weeks.date}}</text>
18
+		</view>
19
+		<view :class="{'uni-calendar-item--today': weeks.isToday}"></view>
20
+	</view>
21
+</template>
22
+
23
+<script>
24
+	export default {
25
+		props: {
26
+			weeks: {
27
+				type: Object,
28
+				default () {
29
+					return {}
30
+				}
31
+			},
32
+			calendar: {
33
+				type: Object,
34
+				default: () => {
35
+					return {}
36
+				}
37
+			},
38
+			selected: {
39
+				type: Array,
40
+				default: () => {
41
+					return []
42
+				}
43
+			},
44
+			checkHover: {
45
+				type: Boolean,
46
+				default: false
47
+			}
48
+		},
49
+		methods: {
50
+			choiceDate(weeks) {
51
+				this.$emit('change', weeks)
52
+			},
53
+			handleMousemove(weeks) {
54
+				this.$emit('handleMouse', weeks)
55
+			}
56
+		}
57
+	}
58
+</script>
59
+
60
+<style lang="scss" >
61
+	$uni-primary: #007aff !default;
62
+
63
+	.uni-calendar-item__weeks-box {
64
+		flex: 1;
65
+		/* #ifndef APP-NVUE */
66
+		display: flex;
67
+		/* #endif */
68
+		flex-direction: column;
69
+		justify-content: center;
70
+		align-items: center;
71
+		margin: 1px 0;
72
+		position: relative;
73
+	}
74
+
75
+	.uni-calendar-item__weeks-box-text {
76
+		font-size: 14px;
77
+		// font-family: Lato-Bold, Lato;
78
+		font-weight: bold;
79
+		color: darken($color: $uni-primary, $amount: 40%);
80
+	}
81
+
82
+	.uni-calendar-item__weeks-box-item {
83
+		position: relative;
84
+		/* #ifndef APP-NVUE */
85
+		display: flex;
86
+		/* #endif */
87
+		flex-direction: column;
88
+		justify-content: center;
89
+		align-items: center;
90
+		width: 40px;
91
+		height: 40px;
92
+		/* #ifdef H5 */
93
+		cursor: pointer;
94
+		/* #endif */
95
+	}
96
+
97
+
98
+	.uni-calendar-item__weeks-box-circle {
99
+		position: absolute;
100
+		top: 5px;
101
+		right: 5px;
102
+		width: 8px;
103
+		height: 8px;
104
+		border-radius: 8px;
105
+		background-color: #dd524d;
106
+
107
+	}
108
+
109
+	.uni-calendar-item__weeks-box .uni-calendar-item--disable {
110
+		cursor: default;
111
+	}
112
+
113
+	.uni-calendar-item--disable .uni-calendar-item__weeks-box-text-disable {
114
+		color: #D1D1D1;
115
+	}
116
+
117
+	.uni-calendar-item--today {
118
+		position: absolute;
119
+		top: 10px;
120
+		right: 17%;
121
+		background-color: #dd524d;
122
+		width:6px;
123
+		height: 6px;
124
+		border-radius: 50%;
125
+	}
126
+
127
+	.uni-calendar-item--extra {
128
+		color: #dd524d;
129
+		opacity: 0.8;
130
+	}
131
+
132
+	.uni-calendar-item__weeks-box .uni-calendar-item--checked {
133
+		background-color: $uni-primary;
134
+		border-radius: 50%;
135
+		box-sizing: border-box;
136
+		border: 3px solid #fff;
137
+	}
138
+
139
+	.uni-calendar-item--checked .uni-calendar-item--checked-text {
140
+		color: #fff;
141
+	}
142
+
143
+	.uni-calendar-item--multiple .uni-calendar-item--checked-range-text {
144
+		color: #333;
145
+	}
146
+
147
+	.uni-calendar-item--multiple {
148
+		background-color:  #F6F7FC;
149
+		// color: #fff;
150
+	}
151
+
152
+	.uni-calendar-item--multiple .uni-calendar-item--before-checked,
153
+	.uni-calendar-item--multiple .uni-calendar-item--after-checked {
154
+		background-color: $uni-primary;
155
+		border-radius: 50%;
156
+		box-sizing: border-box;
157
+		border: 3px solid #F6F7FC;
158
+	}
159
+
160
+	.uni-calendar-item--before-checked .uni-calendar-item--checked-text,
161
+	.uni-calendar-item--after-checked .uni-calendar-item--checked-text {
162
+		color: #fff;
163
+	}
164
+
165
+	.uni-calendar-item--before-checked-x {
166
+		border-top-left-radius: 50px;
167
+		border-bottom-left-radius: 50px;
168
+		box-sizing: border-box;
169
+		background-color: #F6F7FC;
170
+	}
171
+
172
+	.uni-calendar-item--after-checked-x {
173
+		border-top-right-radius: 50px;
174
+		border-bottom-right-radius: 50px;
175
+		background-color: #F6F7FC;
176
+	}
177
+</style>

+ 947
- 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue Dosyayı Görüntüle

@@ -0,0 +1,947 @@
1
+<template>
2
+	<view class="uni-calendar" @mouseleave="leaveCale">
3
+
4
+		<view v-if="!insert && show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}"
5
+			@click="maskClick"></view>
6
+
7
+		<view v-if="insert || show" class="uni-calendar__content"
8
+			:class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow, 'uni-calendar__content-mobile': aniMaskShow}">
9
+			<view class="uni-calendar__header" :class="{'uni-calendar__header-mobile' :!insert}">
10
+
11
+				<view class="uni-calendar__header-btn-box" @click.stop="changeMonth('pre')">
12
+					<view class="uni-calendar__header-btn uni-calendar--left"></view>
13
+				</view>
14
+
15
+				<picker mode="date" :value="date" fields="month" @change="bindDateChange">
16
+					<text
17
+						class="uni-calendar__header-text">{{ (nowDate.year||'') + yearText + ( nowDate.month||'') + monthText}}</text>
18
+				</picker>
19
+
20
+				<view class="uni-calendar__header-btn-box" @click.stop="changeMonth('next')">
21
+					<view class="uni-calendar__header-btn uni-calendar--right"></view>
22
+				</view>
23
+
24
+				<view v-if="!insert" class="dialog-close" @click="maskClick">
25
+					<view class="dialog-close-plus" data-id="close"></view>
26
+					<view class="dialog-close-plus dialog-close-rotate" data-id="close"></view>
27
+				</view>
28
+			</view>
29
+			<view class="uni-calendar__box">
30
+
31
+				<view v-if="showMonth" class="uni-calendar__box-bg">
32
+					<text class="uni-calendar__box-bg-text">{{nowDate.month}}</text>
33
+				</view>
34
+
35
+				<view class="uni-calendar__weeks" style="padding-bottom: 7px;">
36
+					<view class="uni-calendar__weeks-day">
37
+						<text class="uni-calendar__weeks-day-text">{{SUNText}}</text>
38
+					</view>
39
+					<view class="uni-calendar__weeks-day">
40
+						<text class="uni-calendar__weeks-day-text">{{MONText}}</text>
41
+					</view>
42
+					<view class="uni-calendar__weeks-day">
43
+						<text class="uni-calendar__weeks-day-text">{{TUEText}}</text>
44
+					</view>
45
+					<view class="uni-calendar__weeks-day">
46
+						<text class="uni-calendar__weeks-day-text">{{WEDText}}</text>
47
+					</view>
48
+					<view class="uni-calendar__weeks-day">
49
+						<text class="uni-calendar__weeks-day-text">{{THUText}}</text>
50
+					</view>
51
+					<view class="uni-calendar__weeks-day">
52
+						<text class="uni-calendar__weeks-day-text">{{FRIText}}</text>
53
+					</view>
54
+					<view class="uni-calendar__weeks-day">
55
+						<text class="uni-calendar__weeks-day-text">{{SATText}}</text>
56
+					</view>
57
+				</view>
58
+
59
+				<view class="uni-calendar__weeks" v-for="(item,weekIndex) in weeks" :key="weekIndex">
60
+					<view class="uni-calendar__weeks-item" v-for="(weeks,weeksIndex) in item" :key="weeksIndex">
61
+						<calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar" :selected="selected"
62
+							:checkHover="range" @change="choiceDate" @handleMouse="handleMouse">
63
+						</calendar-item>
64
+					</view>
65
+				</view>
66
+			</view>
67
+
68
+			<view v-if="!insert && !range && hasTime" class="uni-date-changed uni-calendar--fixed-top"
69
+				style="padding: 0 80px;">
70
+				<view class="uni-date-changed--time-date">{{tempSingleDate ? tempSingleDate : selectDateText}}</view>
71
+				<time-picker type="time" :start="timepickerStartTime" :end="timepickerEndTime" v-model="time"
72
+					:disabled="!tempSingleDate" :border="false" :hide-second="hideSecond" class="time-picker-style">
73
+				</time-picker>
74
+			</view>
75
+
76
+			<view v-if="!insert && range && hasTime" class="uni-date-changed uni-calendar--fixed-top">
77
+				<view class="uni-date-changed--time-start">
78
+					<view class="uni-date-changed--time-date">{{tempRange.before ? tempRange.before : startDateText}}
79
+					</view>
80
+					<time-picker type="time" :start="timepickerStartTime" v-model="timeRange.startTime" :border="false"
81
+						:hide-second="hideSecond" :disabled="!tempRange.before" class="time-picker-style">
82
+					</time-picker>
83
+				</view>
84
+				<view style="line-height: 50px;">
85
+					<uni-icons type="arrowthinright" color="#999"></uni-icons>
86
+				</view>
87
+				<view class="uni-date-changed--time-end">
88
+					<view class="uni-date-changed--time-date">{{tempRange.after ? tempRange.after : endDateText}}</view>
89
+					<time-picker type="time" :end="timepickerEndTime" v-model="timeRange.endTime" :border="false"
90
+						:hide-second="hideSecond" :disabled="!tempRange.after" class="time-picker-style">
91
+					</time-picker>
92
+				</view>
93
+			</view>
94
+
95
+			<view v-if="!insert" class="uni-date-changed uni-date-btn--ok">
96
+				<view class="uni-datetime-picker--btn" @click="confirm">{{confirmText}}</view>
97
+			</view>
98
+		</view>
99
+	</view>
100
+</template>
101
+
102
+<script>
103
+	import {
104
+		Calendar,
105
+		getDate,
106
+		getTime
107
+	} from './util.js';
108
+	import calendarItem from './calendar-item.vue'
109
+	import timePicker from './time-picker.vue'
110
+
111
+	import {
112
+		initVueI18n
113
+	} from '@dcloudio/uni-i18n'
114
+	import i18nMessages from './i18n/index.js'
115
+	const {
116
+		t
117
+	} = initVueI18n(i18nMessages)
118
+
119
+	/**
120
+	 * Calendar 日历
121
+	 * @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等
122
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=56
123
+	 * @property {String} date 自定义当前时间,默认为今天
124
+	 * @property {String} startDate 日期选择范围-开始日期
125
+	 * @property {String} endDate 日期选择范围-结束日期
126
+	 * @property {Boolean} range 范围选择
127
+	 * @property {Boolean} insert = [true|false] 插入模式,默认为false
128
+	 * 	@value true 弹窗模式
129
+	 * 	@value false 插入模式
130
+	 * @property {Boolean} clearDate = [true|false] 弹窗模式是否清空上次选择内容
131
+	 * @property {Array} selected 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]
132
+	 * @property {Boolean} showMonth 是否选择月份为背景
133
+	 * @property {[String} defaultValue 选择器打开时默认显示的时间
134
+	 * @event {Function} change 日期改变,`insert :ture` 时生效
135
+	 * @event {Function} confirm 确认选择`insert :false` 时生效
136
+	 * @event {Function} monthSwitch 切换月份时触发
137
+	 * @example <uni-calendar :insert="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" />
138
+	 */
139
+	export default {
140
+		components: {
141
+			calendarItem,
142
+			timePicker
143
+		},
144
+
145
+		options: {
146
+			// #ifdef MP-TOUTIAO
147
+			virtualHost: false,
148
+			// #endif
149
+			// #ifndef MP-TOUTIAO
150
+			virtualHost: true
151
+			// #endif
152
+		},
153
+		props: {
154
+			date: {
155
+				type: String,
156
+				default: ''
157
+			},
158
+			defTime: {
159
+				type: [String, Object],
160
+				default: ''
161
+			},
162
+			selectableTimes: {
163
+				type: [Object],
164
+				default () {
165
+					return {}
166
+				}
167
+			},
168
+			selected: {
169
+				type: Array,
170
+				default () {
171
+					return []
172
+				}
173
+			},
174
+			startDate: {
175
+				type: String,
176
+				default: ''
177
+			},
178
+			endDate: {
179
+				type: String,
180
+				default: ''
181
+			},
182
+			startPlaceholder: {
183
+				type: String,
184
+				default: ''
185
+			},
186
+			endPlaceholder: {
187
+				type: String,
188
+				default: ''
189
+			},
190
+			range: {
191
+				type: Boolean,
192
+				default: false
193
+			},
194
+			hasTime: {
195
+				type: Boolean,
196
+				default: false
197
+			},
198
+			insert: {
199
+				type: Boolean,
200
+				default: true
201
+			},
202
+			showMonth: {
203
+				type: Boolean,
204
+				default: true
205
+			},
206
+			clearDate: {
207
+				type: Boolean,
208
+				default: true
209
+			},
210
+			checkHover: {
211
+				type: Boolean,
212
+				default: true
213
+			},
214
+			hideSecond: {
215
+				type: [Boolean],
216
+				default: false
217
+			},
218
+			pleStatus: {
219
+				type: Object,
220
+				default () {
221
+					return {
222
+						before: '',
223
+						after: '',
224
+						data: [],
225
+						fulldate: ''
226
+					}
227
+				}
228
+			},
229
+			defaultValue: {
230
+				type: [String, Object, Array],
231
+				default: ''
232
+			}
233
+		},
234
+		data() {
235
+			return {
236
+				show: false,
237
+				weeks: [],
238
+				calendar: {},
239
+				nowDate: {},
240
+				aniMaskShow: false,
241
+				firstEnter: true,
242
+				time: '',
243
+				timeRange: {
244
+					startTime: '',
245
+					endTime: ''
246
+				},
247
+				tempSingleDate: '',
248
+				tempRange: {
249
+					before: '',
250
+					after: ''
251
+				}
252
+			}
253
+		},
254
+		watch: {
255
+			date: {
256
+				immediate: true,
257
+				handler(newVal) {
258
+					if (!this.range) {
259
+						this.tempSingleDate = newVal
260
+						setTimeout(() => {
261
+							this.init(newVal)
262
+						}, 100)
263
+					}
264
+				}
265
+			},
266
+			defTime: {
267
+				immediate: true,
268
+				handler(newVal) {
269
+					if (!this.range) {
270
+						this.time = newVal
271
+					} else {
272
+						this.timeRange.startTime = newVal.start
273
+						this.timeRange.endTime = newVal.end
274
+					}
275
+				}
276
+			},
277
+			startDate(val) {
278
+				// 字节小程序 watch 早于 created
279
+				if (!this.cale) {
280
+					return
281
+				}
282
+				this.cale.setStartDate(val)
283
+				this.cale.setDate(this.nowDate.fullDate)
284
+				this.weeks = this.cale.weeks
285
+			},
286
+			endDate(val) {
287
+				// 字节小程序 watch 早于 created
288
+				if (!this.cale) {
289
+					return
290
+				}
291
+				this.cale.setEndDate(val)
292
+				this.cale.setDate(this.nowDate.fullDate)
293
+				this.weeks = this.cale.weeks
294
+			},
295
+			selected(newVal) {
296
+				// 字节小程序 watch 早于 created
297
+				if (!this.cale) {
298
+					return
299
+				}
300
+				this.cale.setSelectInfo(this.nowDate.fullDate, newVal)
301
+				this.weeks = this.cale.weeks
302
+			},
303
+			pleStatus: {
304
+				immediate: true,
305
+				handler(newVal) {
306
+					const {
307
+						before,
308
+						after,
309
+						fulldate,
310
+						which
311
+					} = newVal
312
+					this.tempRange.before = before
313
+					this.tempRange.after = after
314
+					setTimeout(() => {
315
+						if (fulldate) {
316
+							this.cale.setHoverMultiple(fulldate)
317
+							if (before && after) {
318
+								this.cale.lastHover = true
319
+								if (this.rangeWithinMonth(after, before)) return
320
+								this.setDate(before)
321
+							} else {
322
+								this.cale.setMultiple(fulldate)
323
+								this.setDate(this.nowDate.fullDate)
324
+								this.calendar.fullDate = ''
325
+								this.cale.lastHover = false
326
+							}
327
+						} else {
328
+							// 字节小程序 watch 早于 created
329
+							if (!this.cale) {
330
+								return
331
+							}
332
+
333
+							this.cale.setDefaultMultiple(before, after)
334
+							if (which === 'left' && before) {
335
+								this.setDate(before)
336
+								this.weeks = this.cale.weeks
337
+							} else if (after) {
338
+								this.setDate(after)
339
+								this.weeks = this.cale.weeks
340
+							}
341
+							this.cale.lastHover = true
342
+						}
343
+					}, 16)
344
+				}
345
+			}
346
+		},
347
+		computed: {
348
+			timepickerStartTime() {
349
+				const activeDate = this.range ? this.tempRange.before : this.calendar.fullDate
350
+				return activeDate === this.startDate ? this.selectableTimes.start : ''
351
+			},
352
+			timepickerEndTime() {
353
+				const activeDate = this.range ? this.tempRange.after : this.calendar.fullDate
354
+				return activeDate === this.endDate ? this.selectableTimes.end : ''
355
+			},
356
+			/**
357
+			 * for i18n
358
+			 */
359
+			selectDateText() {
360
+				return t("uni-datetime-picker.selectDate")
361
+			},
362
+			startDateText() {
363
+				return this.startPlaceholder || t("uni-datetime-picker.startDate")
364
+			},
365
+			endDateText() {
366
+				return this.endPlaceholder || t("uni-datetime-picker.endDate")
367
+			},
368
+			okText() {
369
+				return t("uni-datetime-picker.ok")
370
+			},
371
+			yearText() {
372
+				return t("uni-datetime-picker.year")
373
+			},
374
+			monthText() {
375
+				return t("uni-datetime-picker.month")
376
+			},
377
+			MONText() {
378
+				return t("uni-calender.MON")
379
+			},
380
+			TUEText() {
381
+				return t("uni-calender.TUE")
382
+			},
383
+			WEDText() {
384
+				return t("uni-calender.WED")
385
+			},
386
+			THUText() {
387
+				return t("uni-calender.THU")
388
+			},
389
+			FRIText() {
390
+				return t("uni-calender.FRI")
391
+			},
392
+			SATText() {
393
+				return t("uni-calender.SAT")
394
+			},
395
+			SUNText() {
396
+				return t("uni-calender.SUN")
397
+			},
398
+			confirmText() {
399
+				return t("uni-calender.confirm")
400
+			},
401
+		},
402
+		created() {
403
+			// 获取日历方法实例
404
+			this.cale = new Calendar({
405
+				selected: this.selected,
406
+				startDate: this.startDate,
407
+				endDate: this.endDate,
408
+				range: this.range,
409
+			})
410
+			// 选中某一天
411
+			this.init(this.date)
412
+		},
413
+		methods: {
414
+			leaveCale() {
415
+				this.firstEnter = true
416
+			},
417
+			handleMouse(weeks) {
418
+				if (weeks.disable) return
419
+				if (this.cale.lastHover) return
420
+				let {
421
+					before,
422
+					after
423
+				} = this.cale.multipleStatus
424
+				if (!before) return
425
+				this.calendar = weeks
426
+				// 设置范围选
427
+				this.cale.setHoverMultiple(this.calendar.fullDate)
428
+				this.weeks = this.cale.weeks
429
+				// hover时,进入一个日历,更新另一个
430
+				if (this.firstEnter) {
431
+					this.$emit('firstEnterCale', this.cale.multipleStatus)
432
+					this.firstEnter = false
433
+				}
434
+			},
435
+			rangeWithinMonth(A, B) {
436
+				const [yearA, monthA] = A.split('-')
437
+				const [yearB, monthB] = B.split('-')
438
+				return yearA === yearB && monthA === monthB
439
+			},
440
+			// 蒙版点击事件
441
+			maskClick() {
442
+				this.close()
443
+				this.$emit('maskClose')
444
+			},
445
+
446
+			clearCalender() {
447
+				if (this.range) {
448
+					this.timeRange.startTime = ''
449
+					this.timeRange.endTime = ''
450
+					this.tempRange.before = ''
451
+					this.tempRange.after = ''
452
+					this.cale.multipleStatus.before = ''
453
+					this.cale.multipleStatus.after = ''
454
+					this.cale.multipleStatus.data = []
455
+					this.cale.lastHover = false
456
+				} else {
457
+					this.time = ''
458
+					this.tempSingleDate = ''
459
+				}
460
+				this.calendar.fullDate = ''
461
+				this.setDate(new Date())
462
+			},
463
+
464
+			bindDateChange(e) {
465
+				const value = e.detail.value + '-1'
466
+				this.setDate(value)
467
+			},
468
+			/**
469
+			 * 初始化日期显示
470
+			 * @param {Object} date
471
+			 */
472
+			init(date) {
473
+				// 字节小程序 watch 早于 created
474
+				if (!this.cale) {
475
+					return
476
+				}
477
+				this.cale.setDate(date || new Date())
478
+				this.weeks = this.cale.weeks
479
+				this.nowDate = this.cale.getInfo(date)
480
+				this.calendar = {
481
+					...this.nowDate
482
+				}
483
+				if (!date) {
484
+					// 优化date为空默认不选中今天
485
+					this.calendar.fullDate = ''
486
+					if (this.defaultValue && !this.range) {
487
+						// 暂时只支持移动端非范围选择
488
+						const defaultDate = new Date(this.defaultValue)
489
+						const fullDate = getDate(defaultDate)
490
+						const year = defaultDate.getFullYear()
491
+						const month = defaultDate.getMonth() + 1
492
+						const date = defaultDate.getDate()
493
+						const day = defaultDate.getDay()
494
+						this.calendar = {
495
+								fullDate,
496
+								year,
497
+								month,
498
+								date,
499
+								day
500
+							},
501
+							this.tempSingleDate = fullDate
502
+						this.time = getTime(defaultDate, this.hideSecond)
503
+					}
504
+				}
505
+			},
506
+			/**
507
+			 * 打开日历弹窗
508
+			 */
509
+			open() {
510
+				// 弹窗模式并且清理数据
511
+				if (this.clearDate && !this.insert) {
512
+					this.cale.cleanMultipleStatus()
513
+					this.init(this.date)
514
+				}
515
+				this.show = true
516
+				this.$nextTick(() => {
517
+					setTimeout(() => {
518
+						this.aniMaskShow = true
519
+					}, 50)
520
+				})
521
+			},
522
+			/**
523
+			 * 关闭日历弹窗
524
+			 */
525
+			close() {
526
+				this.aniMaskShow = false
527
+				this.$nextTick(() => {
528
+					setTimeout(() => {
529
+						this.show = false
530
+						this.$emit('close')
531
+					}, 300)
532
+				})
533
+			},
534
+			/**
535
+			 * 确认按钮
536
+			 */
537
+			confirm() {
538
+				this.setEmit('confirm')
539
+				this.close()
540
+			},
541
+			/**
542
+			 * 变化触发
543
+			 */
544
+			change(isSingleChange) {
545
+				if (!this.insert && !isSingleChange) return
546
+				this.setEmit('change')
547
+			},
548
+			/**
549
+			 * 选择月份触发
550
+			 */
551
+			monthSwitch() {
552
+				let {
553
+					year,
554
+					month
555
+				} = this.nowDate
556
+				this.$emit('monthSwitch', {
557
+					year,
558
+					month: Number(month)
559
+				})
560
+			},
561
+			/**
562
+			 * 派发事件
563
+			 * @param {Object} name
564
+			 */
565
+			setEmit(name) {
566
+				if (!this.range) {
567
+					if (!this.calendar.fullDate) {
568
+						this.calendar = this.cale.getInfo(new Date())
569
+						this.tempSingleDate = this.calendar.fullDate
570
+					}
571
+					if (this.hasTime && !this.time) {
572
+						this.time = getTime(new Date(), this.hideSecond)
573
+					}
574
+				}
575
+				let {
576
+					year,
577
+					month,
578
+					date,
579
+					fullDate,
580
+					extraInfo
581
+				} = this.calendar
582
+				this.$emit(name, {
583
+					range: this.cale.multipleStatus,
584
+					year,
585
+					month,
586
+					date,
587
+					time: this.time,
588
+					timeRange: this.timeRange,
589
+					fulldate: fullDate,
590
+					extraInfo: extraInfo || {}
591
+				})
592
+			},
593
+			/**
594
+			 * 选择天触发
595
+			 * @param {Object} weeks
596
+			 */
597
+			choiceDate(weeks) {
598
+				if (weeks.disable) return
599
+				this.calendar = weeks
600
+				this.calendar.userChecked = true
601
+				// 设置多选
602
+				this.cale.setMultiple(this.calendar.fullDate, true)
603
+				this.weeks = this.cale.weeks
604
+				this.tempSingleDate = this.calendar.fullDate
605
+				const beforeDate = new Date(this.cale.multipleStatus.before).getTime()
606
+				const afterDate = new Date(this.cale.multipleStatus.after).getTime()
607
+				if (beforeDate > afterDate && afterDate) {
608
+					this.tempRange.before = this.cale.multipleStatus.after
609
+					this.tempRange.after = this.cale.multipleStatus.before
610
+				} else {
611
+					this.tempRange.before = this.cale.multipleStatus.before
612
+					this.tempRange.after = this.cale.multipleStatus.after
613
+				}
614
+				this.change(true)
615
+			},
616
+			changeMonth(type) {
617
+				let newDate
618
+				if (type === 'pre') {
619
+					newDate = this.cale.getPreMonthObj(this.nowDate.fullDate).fullDate
620
+				} else if (type === 'next') {
621
+					newDate = this.cale.getNextMonthObj(this.nowDate.fullDate).fullDate
622
+				}
623
+
624
+				this.setDate(newDate)
625
+				this.monthSwitch()
626
+			},
627
+			/**
628
+			 * 设置日期
629
+			 * @param {Object} date
630
+			 */
631
+			setDate(date) {
632
+				this.cale.setDate(date)
633
+				this.weeks = this.cale.weeks
634
+				this.nowDate = this.cale.getInfo(date)
635
+			}
636
+		}
637
+	}
638
+</script>
639
+
640
+<style lang="scss">
641
+	$uni-primary: #007aff !default;
642
+
643
+	.uni-calendar {
644
+		/* #ifndef APP-NVUE */
645
+		display: flex;
646
+		/* #endif */
647
+		flex-direction: column;
648
+	}
649
+
650
+	.uni-calendar__mask {
651
+		position: fixed;
652
+		bottom: 0;
653
+		top: 0;
654
+		left: 0;
655
+		right: 0;
656
+		background-color: rgba(0, 0, 0, 0.4);
657
+		transition-property: opacity;
658
+		transition-duration: 0.3s;
659
+		opacity: 0;
660
+		/* #ifndef APP-NVUE */
661
+		z-index: 99;
662
+		/* #endif */
663
+	}
664
+
665
+	.uni-calendar--mask-show {
666
+		opacity: 1
667
+	}
668
+
669
+	.uni-calendar--fixed {
670
+		position: fixed;
671
+		bottom: calc(var(--window-bottom));
672
+		left: 0;
673
+		right: 0;
674
+		transition-property: transform;
675
+		transition-duration: 0.3s;
676
+		transform: translateY(460px);
677
+		/* #ifndef APP-NVUE */
678
+		z-index: 99;
679
+		/* #endif */
680
+	}
681
+
682
+	.uni-calendar--ani-show {
683
+		transform: translateY(0);
684
+	}
685
+
686
+	.uni-calendar__content {
687
+		background-color: #fff;
688
+	}
689
+
690
+	.uni-calendar__content-mobile {
691
+		border-top-left-radius: 10px;
692
+		border-top-right-radius: 10px;
693
+		box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.1);
694
+	}
695
+
696
+	.uni-calendar__header {
697
+		position: relative;
698
+		/* #ifndef APP-NVUE */
699
+		display: flex;
700
+		/* #endif */
701
+		flex-direction: row;
702
+		justify-content: center;
703
+		align-items: center;
704
+		height: 50px;
705
+	}
706
+
707
+	.uni-calendar__header-mobile {
708
+		padding: 10px;
709
+		padding-bottom: 0;
710
+	}
711
+
712
+	.uni-calendar--fixed-top {
713
+		/* #ifndef APP-NVUE */
714
+		display: flex;
715
+		/* #endif */
716
+		flex-direction: row;
717
+		justify-content: space-between;
718
+		border-top-color: rgba(0, 0, 0, 0.4);
719
+		border-top-style: solid;
720
+		border-top-width: 1px;
721
+	}
722
+
723
+	.uni-calendar--fixed-width {
724
+		width: 50px;
725
+	}
726
+
727
+	.uni-calendar__backtoday {
728
+		position: absolute;
729
+		right: 0;
730
+		top: 25rpx;
731
+		padding: 0 5px;
732
+		padding-left: 10px;
733
+		height: 25px;
734
+		line-height: 25px;
735
+		font-size: 12px;
736
+		border-top-left-radius: 25px;
737
+		border-bottom-left-radius: 25px;
738
+		color: #fff;
739
+		background-color: #f1f1f1;
740
+	}
741
+
742
+	.uni-calendar__header-text {
743
+		text-align: center;
744
+		width: 100px;
745
+		font-size: 15px;
746
+		color: #666;
747
+	}
748
+
749
+	.uni-calendar__button-text {
750
+		text-align: center;
751
+		width: 100px;
752
+		font-size: 14px;
753
+		color: $uni-primary;
754
+		/* #ifndef APP-NVUE */
755
+		letter-spacing: 3px;
756
+		/* #endif */
757
+	}
758
+
759
+	.uni-calendar__header-btn-box {
760
+		/* #ifndef APP-NVUE */
761
+		display: flex;
762
+		/* #endif */
763
+		flex-direction: row;
764
+		align-items: center;
765
+		justify-content: center;
766
+		width: 50px;
767
+		height: 50px;
768
+	}
769
+
770
+	.uni-calendar__header-btn {
771
+		width: 9px;
772
+		height: 9px;
773
+		border-left-color: #808080;
774
+		border-left-style: solid;
775
+		border-left-width: 1px;
776
+		border-top-color: #555555;
777
+		border-top-style: solid;
778
+		border-top-width: 1px;
779
+	}
780
+
781
+	.uni-calendar--left {
782
+		transform: rotate(-45deg);
783
+	}
784
+
785
+	.uni-calendar--right {
786
+		transform: rotate(135deg);
787
+	}
788
+
789
+
790
+	.uni-calendar__weeks {
791
+		position: relative;
792
+		/* #ifndef APP-NVUE */
793
+		display: flex;
794
+		/* #endif */
795
+		flex-direction: row;
796
+	}
797
+
798
+	.uni-calendar__weeks-item {
799
+		flex: 1;
800
+	}
801
+
802
+	.uni-calendar__weeks-day {
803
+		flex: 1;
804
+		/* #ifndef APP-NVUE */
805
+		display: flex;
806
+		/* #endif */
807
+		flex-direction: column;
808
+		justify-content: center;
809
+		align-items: center;
810
+		height: 40px;
811
+		border-bottom-color: #F5F5F5;
812
+		border-bottom-style: solid;
813
+		border-bottom-width: 1px;
814
+	}
815
+
816
+	.uni-calendar__weeks-day-text {
817
+		font-size: 12px;
818
+		color: #B2B2B2;
819
+	}
820
+
821
+	.uni-calendar__box {
822
+		position: relative;
823
+		// padding: 0 10px;
824
+		padding-bottom: 7px;
825
+	}
826
+
827
+	.uni-calendar__box-bg {
828
+		/* #ifndef APP-NVUE */
829
+		display: flex;
830
+		/* #endif */
831
+		justify-content: center;
832
+		align-items: center;
833
+		position: absolute;
834
+		top: 0;
835
+		left: 0;
836
+		right: 0;
837
+		bottom: 0;
838
+	}
839
+
840
+	.uni-calendar__box-bg-text {
841
+		font-size: 200px;
842
+		font-weight: bold;
843
+		color: #999;
844
+		opacity: 0.1;
845
+		text-align: center;
846
+		/* #ifndef APP-NVUE */
847
+		line-height: 1;
848
+		/* #endif */
849
+	}
850
+
851
+	.uni-date-changed {
852
+		padding: 0 10px;
853
+		// line-height: 50px;
854
+		text-align: center;
855
+		color: #333;
856
+		border-top-color: #DCDCDC;
857
+		;
858
+		border-top-style: solid;
859
+		border-top-width: 1px;
860
+		flex: 1;
861
+	}
862
+
863
+	.uni-date-btn--ok {
864
+		padding: 20px 15px;
865
+	}
866
+
867
+	.uni-date-changed--time-start {
868
+		/* #ifndef APP-NVUE */
869
+		display: flex;
870
+		/* #endif */
871
+		align-items: center;
872
+	}
873
+
874
+	.uni-date-changed--time-end {
875
+		/* #ifndef APP-NVUE */
876
+		display: flex;
877
+		/* #endif */
878
+		align-items: center;
879
+	}
880
+
881
+	.uni-date-changed--time-date {
882
+		color: #999;
883
+		line-height: 50px;
884
+		/* #ifdef MP-TOUTIAO */
885
+		font-size: 16px;
886
+		/* #endif */
887
+		margin-right: 5px;
888
+		// opacity: 0.6;
889
+	}
890
+
891
+	.time-picker-style {
892
+		// width: 62px;
893
+		/* #ifndef APP-NVUE */
894
+		display: flex;
895
+		/* #endif */
896
+		justify-content: center;
897
+		align-items: center
898
+	}
899
+
900
+	.mr-10 {
901
+		margin-right: 10px;
902
+	}
903
+
904
+	.dialog-close {
905
+		position: absolute;
906
+		top: 0;
907
+		right: 0;
908
+		bottom: 0;
909
+		/* #ifndef APP-NVUE */
910
+		display: flex;
911
+		/* #endif */
912
+		flex-direction: row;
913
+		align-items: center;
914
+		padding: 0 25px;
915
+		margin-top: 10px;
916
+	}
917
+
918
+	.dialog-close-plus {
919
+		width: 16px;
920
+		height: 2px;
921
+		background-color: #737987;
922
+		border-radius: 2px;
923
+		transform: rotate(45deg);
924
+	}
925
+
926
+	.dialog-close-rotate {
927
+		position: absolute;
928
+		transform: rotate(-45deg);
929
+	}
930
+
931
+	.uni-datetime-picker--btn {
932
+		border-radius: 100px;
933
+		height: 40px;
934
+		line-height: 40px;
935
+		background-color: $uni-primary;
936
+		color: #fff;
937
+		font-size: 16px;
938
+		letter-spacing: 2px;
939
+	}
940
+
941
+	/* #ifndef APP-NVUE */
942
+	.uni-datetime-picker--btn:active {
943
+		opacity: 0.7;
944
+	}
945
+
946
+	/* #endif */
947
+</style>

+ 22
- 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json Dosyayı Görüntüle

@@ -0,0 +1,22 @@
1
+{
2
+	"uni-datetime-picker.selectDate": "select date",
3
+	"uni-datetime-picker.selectTime": "select time",
4
+	"uni-datetime-picker.selectDateTime": "select date and time",
5
+	"uni-datetime-picker.startDate": "start date",
6
+	"uni-datetime-picker.endDate": "end date",
7
+	"uni-datetime-picker.startTime": "start time",
8
+	"uni-datetime-picker.endTime": "end time",
9
+	"uni-datetime-picker.ok": "ok",
10
+	"uni-datetime-picker.clear": "clear",
11
+	"uni-datetime-picker.cancel": "cancel",
12
+	"uni-datetime-picker.year": "-",
13
+	"uni-datetime-picker.month": "",
14
+	"uni-calender.MON": "MON",
15
+	"uni-calender.TUE": "TUE",
16
+	"uni-calender.WED": "WED",
17
+	"uni-calender.THU": "THU",
18
+	"uni-calender.FRI": "FRI",
19
+	"uni-calender.SAT": "SAT",
20
+	"uni-calender.SUN": "SUN",
21
+	"uni-calender.confirm": "confirm"
22
+}

+ 8
- 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js Dosyayı Görüntüle

@@ -0,0 +1,8 @@
1
+import en from './en.json'
2
+import zhHans from './zh-Hans.json'
3
+import zhHant from './zh-Hant.json'
4
+export default {
5
+	en,
6
+	'zh-Hans': zhHans,
7
+	'zh-Hant': zhHant
8
+}

+ 22
- 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json Dosyayı Görüntüle

@@ -0,0 +1,22 @@
1
+{
2
+	"uni-datetime-picker.selectDate": "选择日期",
3
+	"uni-datetime-picker.selectTime": "选择时间",
4
+	"uni-datetime-picker.selectDateTime": "选择日期时间",
5
+	"uni-datetime-picker.startDate": "开始日期",
6
+	"uni-datetime-picker.endDate": "结束日期",
7
+	"uni-datetime-picker.startTime": "开始时间",
8
+	"uni-datetime-picker.endTime": "结束时间",
9
+	"uni-datetime-picker.ok": "确定",
10
+	"uni-datetime-picker.clear": "清除",
11
+	"uni-datetime-picker.cancel": "取消",
12
+	"uni-datetime-picker.year": "年",
13
+	"uni-datetime-picker.month": "月",
14
+	"uni-calender.SUN": "日",
15
+	"uni-calender.MON": "一",
16
+	"uni-calender.TUE": "二",
17
+	"uni-calender.WED": "三",
18
+	"uni-calender.THU": "四",
19
+	"uni-calender.FRI": "五",
20
+	"uni-calender.SAT": "六",
21
+	"uni-calender.confirm": "确认"
22
+}

+ 22
- 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json Dosyayı Görüntüle

@@ -0,0 +1,22 @@
1
+{
2
+  "uni-datetime-picker.selectDate": "選擇日期",
3
+  "uni-datetime-picker.selectTime": "選擇時間",
4
+  "uni-datetime-picker.selectDateTime": "選擇日期時間",
5
+  "uni-datetime-picker.startDate": "開始日期",
6
+  "uni-datetime-picker.endDate": "結束日期",
7
+  "uni-datetime-picker.startTime": "開始时间",
8
+  "uni-datetime-picker.endTime": "結束时间",
9
+  "uni-datetime-picker.ok": "確定",
10
+  "uni-datetime-picker.clear": "清除",
11
+  "uni-datetime-picker.cancel": "取消",
12
+  "uni-datetime-picker.year": "年",
13
+  "uni-datetime-picker.month": "月",
14
+  "uni-calender.SUN": "日",
15
+  "uni-calender.MON": "一",
16
+  "uni-calender.TUE": "二",
17
+  "uni-calender.WED": "三",
18
+  "uni-calender.THU": "四",
19
+  "uni-calender.FRI": "五",
20
+  "uni-calender.SAT": "六",
21
+  "uni-calender.confirm": "確認"
22
+}

+ 940
- 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue Dosyayı Görüntüle

@@ -0,0 +1,940 @@
1
+<template>
2
+	<view class="uni-datetime-picker">
3
+		<view @click="initTimePicker">
4
+			<slot>
5
+				<view class="uni-datetime-picker-timebox-pointer"
6
+					:class="{'uni-datetime-picker-disabled': disabled, 'uni-datetime-picker-timebox': border}">
7
+					<text class="uni-datetime-picker-text">{{time}}</text>
8
+					<view v-if="!time" class="uni-datetime-picker-time">
9
+						<text class="uni-datetime-picker-text">{{selectTimeText}}</text>
10
+					</view>
11
+				</view>
12
+			</slot>
13
+		</view>
14
+		<view v-if="visible" id="mask" class="uni-datetime-picker-mask" @click="tiggerTimePicker"></view>
15
+		<view v-if="visible" class="uni-datetime-picker-popup" :class="[dateShow && timeShow ? '' : 'fix-nvue-height']"
16
+			:style="fixNvueBug">
17
+			<view class="uni-title">
18
+				<text class="uni-datetime-picker-text">{{selectTimeText}}</text>
19
+			</view>
20
+			<view v-if="dateShow" class="uni-datetime-picker__container-box">
21
+				<picker-view class="uni-datetime-picker-view" :indicator-style="indicatorStyle" :value="ymd"
22
+					@change="bindDateChange">
23
+					<picker-view-column>
24
+						<view class="uni-datetime-picker-item" v-for="(item,index) in years" :key="index">
25
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
26
+						</view>
27
+					</picker-view-column>
28
+					<picker-view-column>
29
+						<view class="uni-datetime-picker-item" v-for="(item,index) in months" :key="index">
30
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
31
+						</view>
32
+					</picker-view-column>
33
+					<picker-view-column>
34
+						<view class="uni-datetime-picker-item" v-for="(item,index) in days" :key="index">
35
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
36
+						</view>
37
+					</picker-view-column>
38
+				</picker-view>
39
+				<!-- 兼容 nvue 不支持伪类 -->
40
+				<text class="uni-datetime-picker-sign sign-left">-</text>
41
+				<text class="uni-datetime-picker-sign sign-right">-</text>
42
+			</view>
43
+			<view v-if="timeShow" class="uni-datetime-picker__container-box">
44
+				<picker-view class="uni-datetime-picker-view" :class="[hideSecond ? 'time-hide-second' : '']"
45
+					:indicator-style="indicatorStyle" :value="hms" @change="bindTimeChange">
46
+					<picker-view-column>
47
+						<view class="uni-datetime-picker-item" v-for="(item,index) in hours" :key="index">
48
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
49
+						</view>
50
+					</picker-view-column>
51
+					<picker-view-column>
52
+						<view class="uni-datetime-picker-item" v-for="(item,index) in minutes" :key="index">
53
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
54
+						</view>
55
+					</picker-view-column>
56
+					<picker-view-column v-if="!hideSecond">
57
+						<view class="uni-datetime-picker-item" v-for="(item,index) in seconds" :key="index">
58
+							<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
59
+						</view>
60
+					</picker-view-column>
61
+				</picker-view>
62
+				<!-- 兼容 nvue 不支持伪类 -->
63
+				<text class="uni-datetime-picker-sign" :class="[hideSecond ? 'sign-center' : 'sign-left']">:</text>
64
+				<text v-if="!hideSecond" class="uni-datetime-picker-sign sign-right">:</text>
65
+			</view>
66
+			<view class="uni-datetime-picker-btn">
67
+				<view @click="clearTime">
68
+					<text class="uni-datetime-picker-btn-text">{{clearText}}</text>
69
+				</view>
70
+				<view class="uni-datetime-picker-btn-group">
71
+					<view class="uni-datetime-picker-cancel" @click="tiggerTimePicker">
72
+						<text class="uni-datetime-picker-btn-text">{{cancelText}}</text>
73
+					</view>
74
+					<view @click="setTime">
75
+						<text class="uni-datetime-picker-btn-text">{{okText}}</text>
76
+					</view>
77
+				</view>
78
+			</view>
79
+		</view>
80
+	</view>
81
+</template>
82
+
83
+<script>
84
+	import {
85
+		initVueI18n
86
+	} from '@dcloudio/uni-i18n'
87
+	import i18nMessages from './i18n/index.js'
88
+	const {
89
+		t
90
+	} = initVueI18n(i18nMessages)
91
+	import {
92
+		fixIosDateFormat
93
+	} from './util'
94
+
95
+	/**
96
+	 * DatetimePicker 时间选择器
97
+	 * @description 可以同时选择日期和时间的选择器
98
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=xxx
99
+	 * @property {String} type = [datetime | date | time] 显示模式
100
+	 * @property {Boolean} multiple = [true|false] 是否多选
101
+	 * @property {String|Number} value 默认值
102
+	 * @property {String|Number} start 起始日期或时间
103
+	 * @property {String|Number} end 起始日期或时间
104
+	 * @property {String} return-type = [timestamp | string]
105
+	 * @event {Function} change  选中发生变化触发
106
+	 */
107
+
108
+	export default {
109
+		name: 'UniDatetimePicker',
110
+		data() {
111
+			return {
112
+				indicatorStyle: `height: 50px;`,
113
+				visible: false,
114
+				fixNvueBug: {},
115
+				dateShow: true,
116
+				timeShow: true,
117
+				title: '日期和时间',
118
+				// 输入框当前时间
119
+				time: '',
120
+				// 当前的年月日时分秒
121
+				year: 1920,
122
+				month: 0,
123
+				day: 0,
124
+				hour: 0,
125
+				minute: 0,
126
+				second: 0,
127
+				// 起始时间
128
+				startYear: 1920,
129
+				startMonth: 1,
130
+				startDay: 1,
131
+				startHour: 0,
132
+				startMinute: 0,
133
+				startSecond: 0,
134
+				// 结束时间
135
+				endYear: 2120,
136
+				endMonth: 12,
137
+				endDay: 31,
138
+				endHour: 23,
139
+				endMinute: 59,
140
+				endSecond: 59,
141
+			}
142
+		},
143
+		options: {
144
+			// #ifdef MP-TOUTIAO
145
+			virtualHost: false,
146
+			// #endif
147
+			// #ifndef MP-TOUTIAO
148
+			virtualHost: true
149
+			// #endif
150
+		},
151
+		props: {
152
+			type: {
153
+				type: String,
154
+				default: 'datetime'
155
+			},
156
+			value: {
157
+				type: [String, Number],
158
+				default: ''
159
+			},
160
+			modelValue: {
161
+				type: [String, Number],
162
+				default: ''
163
+			},
164
+			start: {
165
+				type: [Number, String],
166
+				default: ''
167
+			},
168
+			end: {
169
+				type: [Number, String],
170
+				default: ''
171
+			},
172
+			returnType: {
173
+				type: String,
174
+				default: 'string'
175
+			},
176
+			disabled: {
177
+				type: [Boolean, String],
178
+				default: false
179
+			},
180
+			border: {
181
+				type: [Boolean, String],
182
+				default: true
183
+			},
184
+			hideSecond: {
185
+				type: [Boolean, String],
186
+				default: false
187
+			}
188
+		},
189
+		watch: {
190
+			// #ifndef VUE3
191
+			value: {
192
+				handler(newVal) {
193
+					if (newVal) {
194
+						this.parseValue(fixIosDateFormat(newVal))
195
+						this.initTime(false)
196
+					} else {
197
+						this.time = ''
198
+						this.parseValue(Date.now())
199
+					}
200
+				},
201
+				immediate: true
202
+			},
203
+			// #endif
204
+			// #ifdef VUE3
205
+			modelValue: {
206
+				handler(newVal) {
207
+					if (newVal) {
208
+						this.parseValue(fixIosDateFormat(newVal))
209
+						this.initTime(false)
210
+					} else {
211
+						this.time = ''
212
+						this.parseValue(Date.now())
213
+					}
214
+				},
215
+				immediate: true
216
+			},
217
+			// #endif
218
+			type: {
219
+				handler(newValue) {
220
+					if (newValue === 'date') {
221
+						this.dateShow = true
222
+						this.timeShow = false
223
+						this.title = '日期'
224
+					} else if (newValue === 'time') {
225
+						this.dateShow = false
226
+						this.timeShow = true
227
+						this.title = '时间'
228
+					} else {
229
+						this.dateShow = true
230
+						this.timeShow = true
231
+						this.title = '日期和时间'
232
+					}
233
+				},
234
+				immediate: true
235
+			},
236
+			start: {
237
+				handler(newVal) {
238
+					this.parseDatetimeRange(fixIosDateFormat(newVal), 'start')
239
+				},
240
+				immediate: true
241
+			},
242
+			end: {
243
+				handler(newVal) {
244
+					this.parseDatetimeRange(fixIosDateFormat(newVal), 'end')
245
+				},
246
+				immediate: true
247
+			},
248
+
249
+			// 月、日、时、分、秒可选范围变化后,检查当前值是否在范围内,不在则当前值重置为可选范围第一项
250
+			months(newVal) {
251
+				this.checkValue('month', this.month, newVal)
252
+			},
253
+			days(newVal) {
254
+				this.checkValue('day', this.day, newVal)
255
+			},
256
+			hours(newVal) {
257
+				this.checkValue('hour', this.hour, newVal)
258
+			},
259
+			minutes(newVal) {
260
+				this.checkValue('minute', this.minute, newVal)
261
+			},
262
+			seconds(newVal) {
263
+				this.checkValue('second', this.second, newVal)
264
+			}
265
+		},
266
+		computed: {
267
+			// 当前年、月、日、时、分、秒选择范围
268
+			years() {
269
+				return this.getCurrentRange('year')
270
+			},
271
+
272
+			months() {
273
+				return this.getCurrentRange('month')
274
+			},
275
+
276
+			days() {
277
+				return this.getCurrentRange('day')
278
+			},
279
+
280
+			hours() {
281
+				return this.getCurrentRange('hour')
282
+			},
283
+
284
+			minutes() {
285
+				return this.getCurrentRange('minute')
286
+			},
287
+
288
+			seconds() {
289
+				return this.getCurrentRange('second')
290
+			},
291
+
292
+			// picker 当前值数组
293
+			ymd() {
294
+				return [this.year - this.minYear, this.month - this.minMonth, this.day - this.minDay]
295
+			},
296
+			hms() {
297
+				return [this.hour - this.minHour, this.minute - this.minMinute, this.second - this.minSecond]
298
+			},
299
+
300
+			// 当前 date 是 start
301
+			currentDateIsStart() {
302
+				return this.year === this.startYear && this.month === this.startMonth && this.day === this.startDay
303
+			},
304
+
305
+			// 当前 date 是 end
306
+			currentDateIsEnd() {
307
+				return this.year === this.endYear && this.month === this.endMonth && this.day === this.endDay
308
+			},
309
+
310
+			// 当前年、月、日、时、分、秒的最小值和最大值
311
+			minYear() {
312
+				return this.startYear
313
+			},
314
+			maxYear() {
315
+				return this.endYear
316
+			},
317
+			minMonth() {
318
+				if (this.year === this.startYear) {
319
+					return this.startMonth
320
+				} else {
321
+					return 1
322
+				}
323
+			},
324
+			maxMonth() {
325
+				if (this.year === this.endYear) {
326
+					return this.endMonth
327
+				} else {
328
+					return 12
329
+				}
330
+			},
331
+			minDay() {
332
+				if (this.year === this.startYear && this.month === this.startMonth) {
333
+					return this.startDay
334
+				} else {
335
+					return 1
336
+				}
337
+			},
338
+			maxDay() {
339
+				if (this.year === this.endYear && this.month === this.endMonth) {
340
+					return this.endDay
341
+				} else {
342
+					return this.daysInMonth(this.year, this.month)
343
+				}
344
+			},
345
+			minHour() {
346
+				if (this.type === 'datetime') {
347
+					if (this.currentDateIsStart) {
348
+						return this.startHour
349
+					} else {
350
+						return 0
351
+					}
352
+				}
353
+				if (this.type === 'time') {
354
+					return this.startHour
355
+				}
356
+			},
357
+			maxHour() {
358
+				if (this.type === 'datetime') {
359
+					if (this.currentDateIsEnd) {
360
+						return this.endHour
361
+					} else {
362
+						return 23
363
+					}
364
+				}
365
+				if (this.type === 'time') {
366
+					return this.endHour
367
+				}
368
+			},
369
+			minMinute() {
370
+				if (this.type === 'datetime') {
371
+					if (this.currentDateIsStart && this.hour === this.startHour) {
372
+						return this.startMinute
373
+					} else {
374
+						return 0
375
+					}
376
+				}
377
+				if (this.type === 'time') {
378
+					if (this.hour === this.startHour) {
379
+						return this.startMinute
380
+					} else {
381
+						return 0
382
+					}
383
+				}
384
+			},
385
+			maxMinute() {
386
+				if (this.type === 'datetime') {
387
+					if (this.currentDateIsEnd && this.hour === this.endHour) {
388
+						return this.endMinute
389
+					} else {
390
+						return 59
391
+					}
392
+				}
393
+				if (this.type === 'time') {
394
+					if (this.hour === this.endHour) {
395
+						return this.endMinute
396
+					} else {
397
+						return 59
398
+					}
399
+				}
400
+			},
401
+			minSecond() {
402
+				if (this.type === 'datetime') {
403
+					if (this.currentDateIsStart && this.hour === this.startHour && this.minute === this.startMinute) {
404
+						return this.startSecond
405
+					} else {
406
+						return 0
407
+					}
408
+				}
409
+				if (this.type === 'time') {
410
+					if (this.hour === this.startHour && this.minute === this.startMinute) {
411
+						return this.startSecond
412
+					} else {
413
+						return 0
414
+					}
415
+				}
416
+			},
417
+			maxSecond() {
418
+				if (this.type === 'datetime') {
419
+					if (this.currentDateIsEnd && this.hour === this.endHour && this.minute === this.endMinute) {
420
+						return this.endSecond
421
+					} else {
422
+						return 59
423
+					}
424
+				}
425
+				if (this.type === 'time') {
426
+					if (this.hour === this.endHour && this.minute === this.endMinute) {
427
+						return this.endSecond
428
+					} else {
429
+						return 59
430
+					}
431
+				}
432
+			},
433
+
434
+			/**
435
+			 * for i18n
436
+			 */
437
+			selectTimeText() {
438
+				return t("uni-datetime-picker.selectTime")
439
+			},
440
+			okText() {
441
+				return t("uni-datetime-picker.ok")
442
+			},
443
+			clearText() {
444
+				return t("uni-datetime-picker.clear")
445
+			},
446
+			cancelText() {
447
+				return t("uni-datetime-picker.cancel")
448
+			}
449
+		},
450
+
451
+		mounted() {
452
+			// #ifdef APP-NVUE
453
+			const res = uni.getSystemInfoSync();
454
+			this.fixNvueBug = {
455
+				top: res.windowHeight / 2,
456
+				left: res.windowWidth / 2
457
+			}
458
+			// #endif
459
+		},
460
+
461
+		methods: {
462
+			/**
463
+			 * @param {Object} item
464
+			 * 小于 10 在前面加个 0
465
+			 */
466
+
467
+			lessThanTen(item) {
468
+				return item < 10 ? '0' + item : item
469
+			},
470
+
471
+			/**
472
+			 * 解析时分秒字符串,例如:00:00:00
473
+			 * @param {String} timeString
474
+			 */
475
+			parseTimeType(timeString) {
476
+				if (timeString) {
477
+					let timeArr = timeString.split(':')
478
+					this.hour = Number(timeArr[0])
479
+					this.minute = Number(timeArr[1])
480
+					this.second = Number(timeArr[2])
481
+				}
482
+			},
483
+
484
+			/**
485
+			 * 解析选择器初始值,类型可以是字符串、时间戳,例如:2000-10-02、'08:30:00'、 1610695109000
486
+			 * @param {String | Number} datetime
487
+			 */
488
+			initPickerValue(datetime) {
489
+				let defaultValue = null
490
+				if (datetime) {
491
+					defaultValue = this.compareValueWithStartAndEnd(datetime, this.start, this.end)
492
+				} else {
493
+					defaultValue = Date.now()
494
+					defaultValue = this.compareValueWithStartAndEnd(defaultValue, this.start, this.end)
495
+				}
496
+				this.parseValue(defaultValue)
497
+			},
498
+
499
+			/**
500
+			 * 初始值规则:
501
+			 * - 用户设置初始值 value
502
+			 * 	- 设置了起始时间 start、终止时间 end,并 start < value < end,初始值为 value, 否则初始值为 start
503
+			 * 	- 只设置了起始时间 start,并 start < value,初始值为 value,否则初始值为 start
504
+			 * 	- 只设置了终止时间 end,并 value < end,初始值为 value,否则初始值为 end
505
+			 * 	- 无起始终止时间,则初始值为 value
506
+			 * - 无初始值 value,则初始值为当前本地时间 Date.now()
507
+			 * @param {Object} value
508
+			 * @param {Object} dateBase
509
+			 */
510
+			compareValueWithStartAndEnd(value, start, end) {
511
+				let winner = null
512
+				value = this.superTimeStamp(value)
513
+				start = this.superTimeStamp(start)
514
+				end = this.superTimeStamp(end)
515
+
516
+				if (start && end) {
517
+					if (value < start) {
518
+						winner = new Date(start)
519
+					} else if (value > end) {
520
+						winner = new Date(end)
521
+					} else {
522
+						winner = new Date(value)
523
+					}
524
+				} else if (start && !end) {
525
+					winner = start <= value ? new Date(value) : new Date(start)
526
+				} else if (!start && end) {
527
+					winner = value <= end ? new Date(value) : new Date(end)
528
+				} else {
529
+					winner = new Date(value)
530
+				}
531
+
532
+				return winner
533
+			},
534
+
535
+			/**
536
+			 * 转换为可比较的时间戳,接受日期、时分秒、时间戳
537
+			 * @param {Object} value
538
+			 */
539
+			superTimeStamp(value) {
540
+				let dateBase = ''
541
+				if (this.type === 'time' && value && typeof value === 'string') {
542
+					const now = new Date()
543
+					const year = now.getFullYear()
544
+					const month = now.getMonth() + 1
545
+					const day = now.getDate()
546
+					dateBase = year + '/' + month + '/' + day + ' '
547
+				}
548
+				if (Number(value)) {
549
+					value = parseInt(value)
550
+					dateBase = 0
551
+				}
552
+				return this.createTimeStamp(dateBase + value)
553
+			},
554
+
555
+			/**
556
+			 * 解析默认值 value,字符串、时间戳
557
+			 * @param {Object} defaultTime
558
+			 */
559
+			parseValue(value) {
560
+				if (!value) {
561
+					return
562
+				}
563
+				if (this.type === 'time' && typeof value === "string") {
564
+					this.parseTimeType(value)
565
+				} else {
566
+					let defaultDate = null
567
+					defaultDate = new Date(value)
568
+					if (this.type !== 'time') {
569
+						this.year = defaultDate.getFullYear()
570
+						this.month = defaultDate.getMonth() + 1
571
+						this.day = defaultDate.getDate()
572
+					}
573
+					if (this.type !== 'date') {
574
+						this.hour = defaultDate.getHours()
575
+						this.minute = defaultDate.getMinutes()
576
+						this.second = defaultDate.getSeconds()
577
+					}
578
+				}
579
+				if (this.hideSecond) {
580
+					this.second = 0
581
+				}
582
+			},
583
+
584
+			/**
585
+			 * 解析可选择时间范围 start、end,年月日字符串、时间戳
586
+			 * @param {Object} defaultTime
587
+			 */
588
+			parseDatetimeRange(point, pointType) {
589
+				// 时间为空,则重置为初始值
590
+				if (!point) {
591
+					if (pointType === 'start') {
592
+						this.startYear = 1920
593
+						this.startMonth = 1
594
+						this.startDay = 1
595
+						this.startHour = 0
596
+						this.startMinute = 0
597
+						this.startSecond = 0
598
+					}
599
+					if (pointType === 'end') {
600
+						this.endYear = 2120
601
+						this.endMonth = 12
602
+						this.endDay = 31
603
+						this.endHour = 23
604
+						this.endMinute = 59
605
+						this.endSecond = 59
606
+					}
607
+					return
608
+				}
609
+				if (this.type === 'time') {
610
+					const pointArr = point.split(':')
611
+					this[pointType + 'Hour'] = Number(pointArr[0])
612
+					this[pointType + 'Minute'] = Number(pointArr[1])
613
+					this[pointType + 'Second'] = Number(pointArr[2])
614
+				} else {
615
+					if (!point) {
616
+						pointType === 'start' ? this.startYear = this.year - 60 : this.endYear = this.year + 60
617
+						return
618
+					}
619
+					if (Number(point)) {
620
+						point = parseInt(point)
621
+					}
622
+					// datetime 的 end 没有时分秒, 则不限制
623
+					const hasTime = /[0-9]:[0-9]/
624
+					if (this.type === 'datetime' && pointType === 'end' && typeof point === 'string' && !hasTime.test(
625
+							point)) {
626
+						point = point + ' 23:59:59'
627
+					}
628
+					const pointDate = new Date(point)
629
+					this[pointType + 'Year'] = pointDate.getFullYear()
630
+					this[pointType + 'Month'] = pointDate.getMonth() + 1
631
+					this[pointType + 'Day'] = pointDate.getDate()
632
+					if (this.type === 'datetime') {
633
+						this[pointType + 'Hour'] = pointDate.getHours()
634
+						this[pointType + 'Minute'] = pointDate.getMinutes()
635
+						this[pointType + 'Second'] = pointDate.getSeconds()
636
+					}
637
+				}
638
+			},
639
+
640
+			// 获取 年、月、日、时、分、秒 当前可选范围
641
+			getCurrentRange(value) {
642
+				const range = []
643
+				for (let i = this['min' + this.capitalize(value)]; i <= this['max' + this.capitalize(value)]; i++) {
644
+					range.push(i)
645
+				}
646
+				return range
647
+			},
648
+
649
+			// 字符串首字母大写
650
+			capitalize(str) {
651
+				return str.charAt(0).toUpperCase() + str.slice(1)
652
+			},
653
+
654
+			// 检查当前值是否在范围内,不在则当前值重置为可选范围第一项
655
+			checkValue(name, value, values) {
656
+				if (values.indexOf(value) === -1) {
657
+					this[name] = values[0]
658
+				}
659
+			},
660
+
661
+			// 每个月的实际天数
662
+			daysInMonth(year, month) { // Use 1 for January, 2 for February, etc.
663
+				return new Date(year, month, 0).getDate();
664
+			},
665
+
666
+			/**
667
+			 * 生成时间戳
668
+			 * @param {Object} time
669
+			 */
670
+			createTimeStamp(time) {
671
+				if (!time) return
672
+				if (typeof time === "number") {
673
+					return time
674
+				} else {
675
+					time = time.replace(/-/g, '/')
676
+					if (this.type === 'date') {
677
+						time = time + ' ' + '00:00:00'
678
+					}
679
+					return Date.parse(time)
680
+				}
681
+			},
682
+
683
+			/**
684
+			 * 生成日期或时间的字符串
685
+			 */
686
+			createDomSting() {
687
+				const yymmdd = this.year +
688
+					'-' +
689
+					this.lessThanTen(this.month) +
690
+					'-' +
691
+					this.lessThanTen(this.day)
692
+
693
+				let hhmmss = this.lessThanTen(this.hour) +
694
+					':' +
695
+					this.lessThanTen(this.minute)
696
+
697
+				if (!this.hideSecond) {
698
+					hhmmss = hhmmss + ':' + this.lessThanTen(this.second)
699
+				}
700
+
701
+				if (this.type === 'date') {
702
+					return yymmdd
703
+				} else if (this.type === 'time') {
704
+					return hhmmss
705
+				} else {
706
+					return yymmdd + ' ' + hhmmss
707
+				}
708
+			},
709
+
710
+			/**
711
+			 * 初始化返回值,并抛出 change 事件
712
+			 */
713
+			initTime(emit = true) {
714
+				this.time = this.createDomSting()
715
+				if (!emit) return
716
+				if (this.returnType === 'timestamp' && this.type !== 'time') {
717
+					this.$emit('change', this.createTimeStamp(this.time))
718
+					this.$emit('input', this.createTimeStamp(this.time))
719
+					this.$emit('update:modelValue', this.createTimeStamp(this.time))
720
+				} else {
721
+					this.$emit('change', this.time)
722
+					this.$emit('input', this.time)
723
+					this.$emit('update:modelValue', this.time)
724
+				}
725
+			},
726
+
727
+			/**
728
+			 * 用户选择日期或时间更新 data
729
+			 * @param {Object} e
730
+			 */
731
+			bindDateChange(e) {
732
+				const val = e.detail.value
733
+				this.year = this.years[val[0]]
734
+				this.month = this.months[val[1]]
735
+				this.day = this.days[val[2]]
736
+			},
737
+			bindTimeChange(e) {
738
+				const val = e.detail.value
739
+				this.hour = this.hours[val[0]]
740
+				this.minute = this.minutes[val[1]]
741
+				this.second = this.seconds[val[2]]
742
+			},
743
+
744
+			/**
745
+			 * 初始化弹出层
746
+			 */
747
+			initTimePicker() {
748
+				if (this.disabled) return
749
+				const value = fixIosDateFormat(this.time)
750
+				this.initPickerValue(value)
751
+				this.visible = !this.visible
752
+			},
753
+
754
+			/**
755
+			 * 触发或关闭弹框
756
+			 */
757
+			tiggerTimePicker(e) {
758
+				this.visible = !this.visible
759
+			},
760
+
761
+			/**
762
+			 * 用户点击“清空”按钮,清空当前值
763
+			 */
764
+			clearTime() {
765
+				this.time = ''
766
+				this.$emit('change', this.time)
767
+				this.$emit('input', this.time)
768
+				this.$emit('update:modelValue', this.time)
769
+				this.tiggerTimePicker()
770
+			},
771
+
772
+			/**
773
+			 * 用户点击“确定”按钮
774
+			 */
775
+			setTime() {
776
+				this.initTime()
777
+				this.tiggerTimePicker()
778
+			}
779
+		}
780
+	}
781
+</script>
782
+
783
+<style lang="scss">
784
+	$uni-primary: #007aff !default;
785
+
786
+	.uni-datetime-picker {
787
+		/* #ifndef APP-NVUE */
788
+		/* width: 100%; */
789
+		/* #endif */
790
+	}
791
+
792
+	.uni-datetime-picker-view {
793
+		height: 130px;
794
+		width: 270px;
795
+		/* #ifndef APP-NVUE */
796
+		cursor: pointer;
797
+		/* #endif */
798
+	}
799
+
800
+	.uni-datetime-picker-item {
801
+		height: 50px;
802
+		line-height: 50px;
803
+		text-align: center;
804
+		font-size: 14px;
805
+	}
806
+
807
+	.uni-datetime-picker-btn {
808
+		margin-top: 60px;
809
+		/* #ifndef APP-NVUE */
810
+		display: flex;
811
+		cursor: pointer;
812
+		/* #endif */
813
+		flex-direction: row;
814
+		justify-content: space-between;
815
+	}
816
+
817
+	.uni-datetime-picker-btn-text {
818
+		font-size: 14px;
819
+		color: $uni-primary;
820
+	}
821
+
822
+	.uni-datetime-picker-btn-group {
823
+		/* #ifndef APP-NVUE */
824
+		display: flex;
825
+		/* #endif */
826
+		flex-direction: row;
827
+	}
828
+
829
+	.uni-datetime-picker-cancel {
830
+		margin-right: 30px;
831
+	}
832
+
833
+	.uni-datetime-picker-mask {
834
+		position: fixed;
835
+		bottom: 0px;
836
+		top: 0px;
837
+		left: 0px;
838
+		right: 0px;
839
+		background-color: rgba(0, 0, 0, 0.4);
840
+		transition-duration: 0.3s;
841
+		z-index: 998;
842
+	}
843
+
844
+	.uni-datetime-picker-popup {
845
+		border-radius: 8px;
846
+		padding: 30px;
847
+		width: 270px;
848
+		/* #ifdef APP-NVUE */
849
+		height: 500px;
850
+		/* #endif */
851
+		/* #ifdef APP-NVUE */
852
+		width: 330px;
853
+		/* #endif */
854
+		background-color: #fff;
855
+		position: fixed;
856
+		top: 50%;
857
+		left: 50%;
858
+		transform: translate(-50%, -50%);
859
+		transition-duration: 0.3s;
860
+		z-index: 999;
861
+	}
862
+
863
+	.fix-nvue-height {
864
+		/* #ifdef APP-NVUE */
865
+		height: 330px;
866
+		/* #endif */
867
+	}
868
+
869
+	.uni-datetime-picker-time {
870
+		color: grey;
871
+	}
872
+
873
+	.uni-datetime-picker-column {
874
+		height: 50px;
875
+	}
876
+
877
+	.uni-datetime-picker-timebox {
878
+
879
+		border: 1px solid #E5E5E5;
880
+		border-radius: 5px;
881
+		padding: 7px 10px;
882
+		/* #ifndef APP-NVUE */
883
+		box-sizing: border-box;
884
+		cursor: pointer;
885
+		/* #endif */
886
+	}
887
+
888
+	.uni-datetime-picker-timebox-pointer {
889
+		/* #ifndef APP-NVUE */
890
+		cursor: pointer;
891
+		/* #endif */
892
+	}
893
+
894
+
895
+	.uni-datetime-picker-disabled {
896
+		opacity: 0.4;
897
+		/* #ifdef H5 */
898
+		cursor: not-allowed !important;
899
+		/* #endif */
900
+	}
901
+
902
+	.uni-datetime-picker-text {
903
+		font-size: 14px;
904
+		line-height: 50px
905
+	}
906
+
907
+	.uni-datetime-picker-sign {
908
+		position: absolute;
909
+		top: 53px;
910
+		/* 减掉 10px 的元素高度,兼容nvue */
911
+		color: #999;
912
+		/* #ifdef APP-NVUE */
913
+		font-size: 16px;
914
+		/* #endif */
915
+	}
916
+
917
+	.sign-left {
918
+		left: 86px;
919
+	}
920
+
921
+	.sign-right {
922
+		right: 86px;
923
+	}
924
+
925
+	.sign-center {
926
+		left: 135px;
927
+	}
928
+
929
+	.uni-datetime-picker__container-box {
930
+		position: relative;
931
+		display: flex;
932
+		align-items: center;
933
+		justify-content: center;
934
+		margin-top: 40px;
935
+	}
936
+
937
+	.time-hide-second {
938
+		width: 180px;
939
+	}
940
+</style>

+ 1057
- 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 421
- 0
uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js Dosyayı Görüntüle

@@ -0,0 +1,421 @@
1
+class Calendar {
2
+	constructor({
3
+		selected,
4
+		startDate,
5
+		endDate,
6
+		range,
7
+	} = {}) {
8
+		// 当前日期
9
+		this.date = this.getDateObj(new Date()) // 当前初入日期
10
+		// 打点信息
11
+		this.selected = selected || [];
12
+		// 起始时间
13
+		this.startDate = startDate
14
+		// 终止时间
15
+		this.endDate = endDate
16
+		// 是否范围选择
17
+		this.range = range
18
+		// 多选状态
19
+		this.cleanMultipleStatus()
20
+		// 每周日期
21
+		this.weeks = {}
22
+		this.lastHover = false
23
+	}
24
+	/**
25
+	 * 设置日期
26
+	 * @param {Object} date
27
+	 */
28
+	setDate(date) {
29
+		const selectDate = this.getDateObj(date)
30
+		this.getWeeks(selectDate.fullDate)
31
+	}
32
+
33
+	/**
34
+	 * 清理多选状态
35
+	 */
36
+	cleanMultipleStatus() {
37
+		this.multipleStatus = {
38
+			before: '',
39
+			after: '',
40
+			data: []
41
+		}
42
+	}
43
+
44
+	setStartDate(startDate) {
45
+		this.startDate = startDate
46
+	}
47
+
48
+	setEndDate(endDate) {
49
+		this.endDate = endDate
50
+	}
51
+
52
+	getPreMonthObj(date) {
53
+		date = fixIosDateFormat(date)
54
+		date = new Date(date)
55
+
56
+		const oldMonth = date.getMonth()
57
+		date.setMonth(oldMonth - 1)
58
+		const newMonth = date.getMonth()
59
+		if (oldMonth !== 0 && newMonth - oldMonth === 0) {
60
+			date.setMonth(newMonth - 1)
61
+		}
62
+		return this.getDateObj(date)
63
+	}
64
+	getNextMonthObj(date) {
65
+		date = fixIosDateFormat(date)
66
+		date = new Date(date)
67
+
68
+		const oldMonth = date.getMonth()
69
+		date.setMonth(oldMonth + 1)
70
+		const newMonth = date.getMonth()
71
+		if (newMonth - oldMonth > 1) {
72
+			date.setMonth(newMonth - 1)
73
+		}
74
+		return this.getDateObj(date)
75
+	}
76
+
77
+	/**
78
+	 * 获取指定格式Date对象
79
+	 */
80
+	getDateObj(date) {
81
+		date = fixIosDateFormat(date)
82
+		date = new Date(date)
83
+
84
+		return {
85
+			fullDate: getDate(date),
86
+			year: date.getFullYear(),
87
+			month: addZero(date.getMonth() + 1),
88
+			date: addZero(date.getDate()),
89
+			day: date.getDay()
90
+		}
91
+	}
92
+
93
+	/**
94
+	 * 获取上一个月日期集合
95
+	 */
96
+	getPreMonthDays(amount, dateObj) {
97
+		const result = []
98
+		for (let i = amount - 1; i >= 0; i--) {
99
+			const month = dateObj.month - 1
100
+			result.push({
101
+				date: new Date(dateObj.year, month, -i).getDate(),
102
+				month,
103
+				disable: true
104
+			})
105
+		}
106
+		return result
107
+	}
108
+	/**
109
+	 * 获取本月日期集合
110
+	 */
111
+	getCurrentMonthDays(amount, dateObj) {
112
+		const result = []
113
+		const fullDate = this.date.fullDate
114
+		for (let i = 1; i <= amount; i++) {
115
+			const currentDate = `${dateObj.year}-${dateObj.month}-${addZero(i)}`
116
+			const isToday = fullDate === currentDate
117
+			// 获取打点信息
118
+			const info = this.selected && this.selected.find((item) => {
119
+				if (this.dateEqual(currentDate, item.date)) {
120
+					return item
121
+				}
122
+			})
123
+
124
+			// 日期禁用
125
+			let disableBefore = true
126
+			let disableAfter = true
127
+			if (this.startDate) {
128
+				disableBefore = dateCompare(this.startDate, currentDate)
129
+			}
130
+
131
+			if (this.endDate) {
132
+				disableAfter = dateCompare(currentDate, this.endDate)
133
+			}
134
+
135
+			let multiples = this.multipleStatus.data
136
+			let multiplesStatus = -1
137
+			if (this.range && multiples) {
138
+				multiplesStatus = multiples.findIndex((item) => {
139
+					return this.dateEqual(item, currentDate)
140
+				})
141
+			}
142
+			const checked = multiplesStatus !== -1
143
+
144
+			result.push({
145
+				fullDate: currentDate,
146
+				year: dateObj.year,
147
+				date: i,
148
+				multiple: this.range ? checked : false,
149
+				beforeMultiple: this.isLogicBefore(currentDate, this.multipleStatus.before, this.multipleStatus.after),
150
+				afterMultiple: this.isLogicAfter(currentDate, this.multipleStatus.before, this.multipleStatus.after),
151
+				month: dateObj.month,
152
+				disable: (this.startDate && !dateCompare(this.startDate, currentDate)) || (this.endDate && !dateCompare(
153
+					currentDate, this.endDate)),
154
+				isToday,
155
+				userChecked: false,
156
+				extraInfo: info
157
+			})
158
+		}
159
+		return result
160
+	}
161
+	/**
162
+	 * 获取下一个月日期集合
163
+	 */
164
+	_getNextMonthDays(amount, dateObj) {
165
+		const result = []
166
+		const month = dateObj.month + 1
167
+		for (let i = 1; i <= amount; i++) {
168
+			result.push({
169
+				date: i,
170
+				month,
171
+				disable: true
172
+			})
173
+		}
174
+		return result
175
+	}
176
+
177
+	/**
178
+	 * 获取当前日期详情
179
+	 * @param {Object} date
180
+	 */
181
+	getInfo(date) {
182
+		if (!date) {
183
+			date = new Date()
184
+		}
185
+
186
+		return this.calendar.find(item => item.fullDate === this.getDateObj(date).fullDate)
187
+	}
188
+
189
+	/**
190
+	 * 比较时间是否相等
191
+	 */
192
+	dateEqual(before, after) {
193
+		before = new Date(fixIosDateFormat(before))
194
+		after = new Date(fixIosDateFormat(after))
195
+		return before.valueOf() === after.valueOf()
196
+	}
197
+
198
+	/**
199
+	 *  比较真实起始日期
200
+	 */
201
+
202
+	isLogicBefore(currentDate, before, after) {
203
+		let logicBefore = before
204
+		if (before && after) {
205
+			logicBefore = dateCompare(before, after) ? before : after
206
+		}
207
+		return this.dateEqual(logicBefore, currentDate)
208
+	}
209
+
210
+	isLogicAfter(currentDate, before, after) {
211
+		let logicAfter = after
212
+		if (before && after) {
213
+			logicAfter = dateCompare(before, after) ? after : before
214
+		}
215
+		return this.dateEqual(logicAfter, currentDate)
216
+	}
217
+
218
+	/**
219
+	 * 获取日期范围内所有日期
220
+	 * @param {Object} begin
221
+	 * @param {Object} end
222
+	 */
223
+	geDateAll(begin, end) {
224
+		var arr = []
225
+		var ab = begin.split('-')
226
+		var ae = end.split('-')
227
+		var db = new Date()
228
+		db.setFullYear(ab[0], ab[1] - 1, ab[2])
229
+		var de = new Date()
230
+		de.setFullYear(ae[0], ae[1] - 1, ae[2])
231
+		var unixDb = db.getTime() - 24 * 60 * 60 * 1000
232
+		var unixDe = de.getTime() - 24 * 60 * 60 * 1000
233
+		for (var k = unixDb; k <= unixDe;) {
234
+			k = k + 24 * 60 * 60 * 1000
235
+			arr.push(this.getDateObj(new Date(parseInt(k))).fullDate)
236
+		}
237
+		return arr
238
+	}
239
+
240
+	/**
241
+	 *  获取多选状态
242
+	 */
243
+	setMultiple(fullDate) {
244
+		if (!this.range) return
245
+
246
+		let {
247
+			before,
248
+			after
249
+		} = this.multipleStatus
250
+		if (before && after) {
251
+			if (!this.lastHover) {
252
+				this.lastHover = true
253
+				return
254
+			}
255
+			this.multipleStatus.before = fullDate
256
+			this.multipleStatus.after = ''
257
+			this.multipleStatus.data = []
258
+			this.multipleStatus.fulldate = ''
259
+			this.lastHover = false
260
+		} else {
261
+			if (!before) {
262
+				this.multipleStatus.before = fullDate
263
+				this.multipleStatus.after = undefined;
264
+				this.lastHover = false
265
+			} else {
266
+				this.multipleStatus.after = fullDate
267
+				if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
268
+					this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus
269
+						.after);
270
+				} else {
271
+					this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus
272
+						.before);
273
+				}
274
+				this.lastHover = true
275
+			}
276
+		}
277
+		this.getWeeks(fullDate)
278
+	}
279
+
280
+	/**
281
+	 *  鼠标 hover 更新多选状态
282
+	 */
283
+	setHoverMultiple(fullDate) {
284
+		//抖音小程序点击会触发hover事件,需要避免一下
285
+		// #ifndef MP-TOUTIAO
286
+		if (!this.range || this.lastHover) return
287
+		const {
288
+			before
289
+		} = this.multipleStatus
290
+
291
+		if (!before) {
292
+			this.multipleStatus.before = fullDate
293
+		} else {
294
+			this.multipleStatus.after = fullDate
295
+			if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
296
+				this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
297
+			} else {
298
+				this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
299
+			}
300
+		}
301
+		this.getWeeks(fullDate)
302
+		// #endif
303
+
304
+	}
305
+
306
+	/**
307
+	 * 更新默认值多选状态
308
+	 */
309
+	setDefaultMultiple(before, after) {
310
+		this.multipleStatus.before = before
311
+		this.multipleStatus.after = after
312
+		if (before && after) {
313
+			if (dateCompare(before, after)) {
314
+				this.multipleStatus.data = this.geDateAll(before, after);
315
+				this.getWeeks(after)
316
+			} else {
317
+				this.multipleStatus.data = this.geDateAll(after, before);
318
+				this.getWeeks(before)
319
+			}
320
+		}
321
+	}
322
+
323
+	/**
324
+	 * 获取每周数据
325
+	 * @param {Object} dateData
326
+	 */
327
+	getWeeks(dateData) {
328
+		const {
329
+			year,
330
+			month,
331
+		} = this.getDateObj(dateData)
332
+
333
+		const preMonthDayAmount = new Date(year, month - 1, 1).getDay()
334
+		const preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData))
335
+
336
+		const currentMonthDayAmount = new Date(year, month, 0).getDate()
337
+		const currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData))
338
+
339
+		const nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount
340
+		const nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData))
341
+
342
+		const calendarDays = [...preMonthDays, ...currentMonthDays, ...nextMonthDays]
343
+
344
+		const weeks = new Array(6)
345
+		for (let i = 0; i < calendarDays.length; i++) {
346
+			const index = Math.floor(i / 7)
347
+			if (!weeks[index]) {
348
+				weeks[index] = new Array(7)
349
+			}
350
+			weeks[index][i % 7] = calendarDays[i]
351
+		}
352
+
353
+		this.calendar = calendarDays
354
+		this.weeks = weeks
355
+	}
356
+}
357
+
358
+function getDateTime(date, hideSecond) {
359
+	return `${getDate(date)} ${getTime(date, hideSecond)}`
360
+}
361
+
362
+function getDate(date) {
363
+	date = fixIosDateFormat(date)
364
+	date = new Date(date)
365
+	const year = date.getFullYear()
366
+	const month = date.getMonth() + 1
367
+	const day = date.getDate()
368
+	return `${year}-${addZero(month)}-${addZero(day)}`
369
+}
370
+
371
+function getTime(date, hideSecond) {
372
+	date = fixIosDateFormat(date)
373
+	date = new Date(date)
374
+	const hour = date.getHours()
375
+	const minute = date.getMinutes()
376
+	const second = date.getSeconds()
377
+	return hideSecond ? `${addZero(hour)}:${addZero(minute)}` : `${addZero(hour)}:${addZero(minute)}:${addZero(second)}`
378
+}
379
+
380
+function addZero(num) {
381
+	if (num < 10) {
382
+		num = `0${num}`
383
+	}
384
+	return num
385
+}
386
+
387
+function getDefaultSecond(hideSecond) {
388
+	return hideSecond ? '00:00' : '00:00:00'
389
+}
390
+
391
+function dateCompare(startDate, endDate) {
392
+	startDate = new Date(fixIosDateFormat(startDate))
393
+	endDate = new Date(fixIosDateFormat(endDate))
394
+	return startDate <= endDate
395
+}
396
+
397
+function checkDate(date) {
398
+	const dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g
399
+	return date.match(dateReg)
400
+}
401
+//ios低版本15及以下,无法匹配 没有 ’秒‘ 时的情况,所以需要在末尾 秒 加上 问号
402
+const dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9](:[0-5]?[0-9])?)?$/;
403
+
404
+function fixIosDateFormat(value) {
405
+	if (typeof value === 'string' && dateTimeReg.test(value)) {
406
+		value = value.replace(/-/g, '/')
407
+	}
408
+	return value
409
+}
410
+
411
+export {
412
+	Calendar,
413
+	getDateTime,
414
+	getDate,
415
+	getTime,
416
+	addZero,
417
+	getDefaultSecond,
418
+	dateCompare,
419
+	checkDate,
420
+	fixIosDateFormat
421
+}

+ 88
- 0
uni_modules/uni-datetime-picker/package.json Dosyayı Görüntüle

@@ -0,0 +1,88 @@
1
+{
2
+  "id": "uni-datetime-picker",
3
+  "displayName": "uni-datetime-picker 日期选择器",
4
+  "version": "2.2.34",
5
+  "description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
6
+  "keywords": [
7
+    "uni-datetime-picker",
8
+    "uni-ui",
9
+    "uniui",
10
+    "日期时间选择器",
11
+    "日期时间"
12
+],
13
+  "repository": "https://github.com/dcloudio/uni-ui",
14
+  "engines": {
15
+    "HBuilderX": ""
16
+  },
17
+  "directories": {
18
+    "example": "../../temps/example_temps"
19
+  },
20
+"dcloudext": {
21
+    "sale": {
22
+      "regular": {
23
+        "price": "0.00"
24
+      },
25
+      "sourcecode": {
26
+        "price": "0.00"
27
+      }
28
+    },
29
+    "contact": {
30
+      "qq": ""
31
+    },
32
+    "declaration": {
33
+      "ads": "无",
34
+      "data": "无",
35
+      "permissions": "无"
36
+    },
37
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
38
+    "type": "component-vue"
39
+  },
40
+  "uni_modules": {
41
+    "dependencies": [
42
+			"uni-scss",
43
+			"uni-icons"
44
+		],
45
+    "encrypt": [],
46
+    "platforms": {
47
+      "cloud": {
48
+        "tcb": "y",
49
+        "aliyun": "y",
50
+        "alipay": "n"
51
+      },
52
+      "client": {
53
+        "App": {
54
+          "app-vue": "y",
55
+          "app-nvue": "n"
56
+        },
57
+        "H5-mobile": {
58
+          "Safari": "y",
59
+          "Android Browser": "y",
60
+          "微信浏览器(Android)": "y",
61
+          "QQ浏览器(Android)": "y"
62
+        },
63
+        "H5-pc": {
64
+          "Chrome": "y",
65
+          "IE": "y",
66
+          "Edge": "y",
67
+          "Firefox": "y",
68
+          "Safari": "y"
69
+        },
70
+        "小程序": {
71
+          "微信": "y",
72
+          "阿里": "y",
73
+          "百度": "y",
74
+          "字节跳动": "y",
75
+          "QQ": "y"
76
+        },
77
+        "快应用": {
78
+          "华为": "u",
79
+          "联盟": "u"
80
+        },
81
+        "Vue": {
82
+            "vue2": "y",
83
+            "vue3": "y"
84
+        }
85
+      }
86
+    }
87
+  }
88
+}

+ 21
- 0
uni_modules/uni-datetime-picker/readme.md Dosyayı Görüntüle

@@ -0,0 +1,21 @@
1
+
2
+
3
+> `重要通知:组件升级更新 2.0.0 后,支持日期+时间范围选择,组件 ui 将使用日历选择日期,ui 变化较大,同时支持 PC 和 移动端。此版本不向后兼容,不再支持单独的时间选择(type=time)及相关的 hide-second 属性(时间选可使用内置组件 picker)。若仍需使用旧版本,可在插件市场下载*非uni_modules版本*,旧版本将不再维护`
4
+
5
+## DatetimePicker 时间选择器
6
+
7
+> **组件名:uni-datetime-picker**
8
+> 代码块: `uDatetimePicker`
9
+
10
+
11
+该组件的优势是,支持**时间戳**输入和输出(起始时间、终止时间也支持时间戳),可**同时选择**日期和时间。
12
+
13
+若只是需要单独选择日期和时间,不需要时间戳输入和输出,可使用原生的 picker 组件。
14
+
15
+**_点击 picker 默认值规则:_**
16
+
17
+- 若设置初始值 value, 会显示在 picker 显示框中
18
+- 若无初始值 value,则初始值 value 为当前本地时间 Date.now(), 但不会显示在 picker 显示框中
19
+
20
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker)
21
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 

+ 42
- 0
uni_modules/uni-icons/changelog.md Dosyayı Görüntüle

@@ -0,0 +1,42 @@
1
+## 2.0.10(2024-06-07)
2
+- 优化 uni-app x 中,size 属性的类型
3
+## 2.0.9(2024-01-12)
4
+fix: 修复图标大小默认值错误的问题
5
+## 2.0.8(2023-12-14)
6
+- 修复 项目未使用 ts 情况下,打包报错的bug
7
+## 2.0.7(2023-12-14)
8
+- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
9
+## 2.0.6(2023-12-11)
10
+- 优化 兼容老版本icon类型,如 top ,bottom 等
11
+## 2.0.5(2023-12-11)
12
+- 优化 兼容老版本icon类型,如 top ,bottom 等
13
+## 2.0.4(2023-12-06)
14
+- 优化 uni-app x 下示例项目图标排序
15
+## 2.0.3(2023-12-06)
16
+- 修复 nvue下引入组件报错的bug
17
+## 2.0.2(2023-12-05)
18
+-优化 size 属性支持单位
19
+## 2.0.1(2023-12-05)
20
+- 新增 uni-app x 支持定义图标
21
+## 1.3.5(2022-01-24)
22
+- 优化 size 属性可以传入不带单位的字符串数值
23
+## 1.3.4(2022-01-24)
24
+- 优化 size 支持其他单位
25
+## 1.3.3(2022-01-17)
26
+- 修复 nvue 有些图标不显示的bug,兼容老版本图标
27
+## 1.3.2(2021-12-01)
28
+- 优化 示例可复制图标名称
29
+## 1.3.1(2021-11-23)
30
+- 优化 兼容旧组件 type 值
31
+## 1.3.0(2021-11-19)
32
+- 新增 更多图标
33
+- 优化 自定义图标使用方式
34
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
35
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-icons](https://uniapp.dcloud.io/component/uniui/uni-icons)
36
+## 1.1.7(2021-11-08)
37
+## 1.2.0(2021-07-30)
38
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
39
+## 1.1.5(2021-05-12)
40
+- 新增 组件示例地址
41
+## 1.1.4(2021-02-05)
42
+- 调整为uni_modules目录规范

+ 91
- 0
uni_modules/uni-icons/components/uni-icons/uni-icons.uvue Dosyayı Görüntüle

@@ -0,0 +1,91 @@
1
+<template>
2
+  <text class="uni-icons" :style="styleObj">
3
+    <slot>{{unicode}}</slot>
4
+  </text>
5
+</template>
6
+
7
+<script>
8
+  import { fontData, IconsDataItem } from './uniicons_file'
9
+
10
+  /**
11
+   * Icons 图标
12
+   * @description 用于展示 icon 图标
13
+   * @tutorial https://ext.dcloud.net.cn/plugin?id=28
14
+   * @property {Number,String} size 图标大小
15
+   * @property {String} type 图标图案,参考示例
16
+   * @property {String} color 图标颜色
17
+   * @property {String} customPrefix 自定义图标
18
+   * @event {Function} click 点击 Icon 触发事件
19
+   */
20
+  export default {
21
+    name: "uni-icons",
22
+    props: {
23
+      type: {
24
+        type: String,
25
+        default: ''
26
+      },
27
+      color: {
28
+        type: String,
29
+        default: '#333333'
30
+      },
31
+      size: {
32
+        type: [Number, String],
33
+        default: 16
34
+      },
35
+      fontFamily: {
36
+        type: String,
37
+        default: ''
38
+      }
39
+    },
40
+    data() {
41
+      return {};
42
+    },
43
+    computed: {
44
+      unicode() : string {
45
+        let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
46
+        if (codes !== null) {
47
+          return codes.unicode
48
+        }
49
+        return ''
50
+      },
51
+      iconSize() : string {
52
+        const size = this.size
53
+        if (typeof size == 'string') {
54
+          const reg = /^[0-9]*$/g
55
+          return reg.test(size as string) ? '' + size + 'px' : '' + size;
56
+          // return '' + this.size
57
+        }
58
+        return this.getFontSize(size as number)
59
+      },
60
+      styleObj() : UTSJSONObject {
61
+        if (this.fontFamily !== '') {
62
+          return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
63
+        }
64
+        return { color: this.color, fontSize: this.iconSize }
65
+      }
66
+    },
67
+    created() { },
68
+    methods: {
69
+      /**
70
+       * 字体大小
71
+       */
72
+      getFontSize(size : number) : string {
73
+        return size + 'px';
74
+      },
75
+    },
76
+  }
77
+</script>
78
+
79
+<style scoped>
80
+  @font-face {
81
+    font-family: UniIconsFontFamily;
82
+    src: url('./uniicons.ttf');
83
+  }
84
+
85
+  .uni-icons {
86
+    font-family: UniIconsFontFamily;
87
+    font-size: 18px;
88
+    font-style: normal;
89
+    color: #333;
90
+  }
91
+</style>

+ 110
- 0
uni_modules/uni-icons/components/uni-icons/uni-icons.vue Dosyayı Görüntüle

@@ -0,0 +1,110 @@
1
+<template>
2
+	<!-- #ifdef APP-NVUE -->
3
+	<text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
4
+	<!-- #endif -->
5
+	<!-- #ifndef APP-NVUE -->
6
+	<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
7
+		<slot></slot>
8
+	</text>
9
+	<!-- #endif -->
10
+</template>
11
+
12
+<script>
13
+	import { fontData } from './uniicons_file_vue.js';
14
+
15
+	const getVal = (val) => {
16
+		const reg = /^[0-9]*$/g
17
+		return (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;
18
+	}
19
+
20
+	// #ifdef APP-NVUE
21
+	var domModule = weex.requireModule('dom');
22
+	import iconUrl from './uniicons.ttf'
23
+	domModule.addRule('fontFace', {
24
+		'fontFamily': "uniicons",
25
+		'src': "url('" + iconUrl + "')"
26
+	});
27
+	// #endif
28
+
29
+	/**
30
+	 * Icons 图标
31
+	 * @description 用于展示 icons 图标
32
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=28
33
+	 * @property {Number} size 图标大小
34
+	 * @property {String} type 图标图案,参考示例
35
+	 * @property {String} color 图标颜色
36
+	 * @property {String} customPrefix 自定义图标
37
+	 * @event {Function} click 点击 Icon 触发事件
38
+	 */
39
+	export default {
40
+		name: 'UniIcons',
41
+		emits: ['click'],
42
+		props: {
43
+			type: {
44
+				type: String,
45
+				default: ''
46
+			},
47
+			color: {
48
+				type: String,
49
+				default: '#333333'
50
+			},
51
+			size: {
52
+				type: [Number, String],
53
+				default: 16
54
+			},
55
+			customPrefix: {
56
+				type: String,
57
+				default: ''
58
+			},
59
+			fontFamily: {
60
+				type: String,
61
+				default: ''
62
+			}
63
+		},
64
+		data() {
65
+			return {
66
+				icons: fontData
67
+			}
68
+		},
69
+		computed: {
70
+			unicode() {
71
+				let code = this.icons.find(v => v.font_class === this.type)
72
+				if (code) {
73
+					return code.unicode
74
+				}
75
+				return ''
76
+			},
77
+			iconSize() {
78
+				return getVal(this.size)
79
+			},
80
+			styleObj() {
81
+				if (this.fontFamily !== '') {
82
+					return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`
83
+				}
84
+				return `color: ${this.color}; font-size: ${this.iconSize};`
85
+			}
86
+		},
87
+		methods: {
88
+			_onClick() {
89
+				this.$emit('click')
90
+			}
91
+		}
92
+	}
93
+</script>
94
+
95
+<style lang="scss">
96
+	/* #ifndef APP-NVUE */
97
+	@import './uniicons.css';
98
+
99
+	@font-face {
100
+		font-family: uniicons;
101
+		src: url('./uniicons.ttf');
102
+	}
103
+
104
+	/* #endif */
105
+	.uni-icons {
106
+		font-family: uniicons;
107
+		text-decoration: none;
108
+		text-align: center;
109
+	}
110
+</style>

+ 664
- 0
uni_modules/uni-icons/components/uni-icons/uniicons.css Dosyayı Görüntüle

@@ -0,0 +1,664 @@
1
+
2
+.uniui-cart-filled:before {
3
+  content: "\e6d0";
4
+}
5
+
6
+.uniui-gift-filled:before {
7
+  content: "\e6c4";
8
+}
9
+
10
+.uniui-color:before {
11
+  content: "\e6cf";
12
+}
13
+
14
+.uniui-wallet:before {
15
+  content: "\e6b1";
16
+}
17
+
18
+.uniui-settings-filled:before {
19
+  content: "\e6ce";
20
+}
21
+
22
+.uniui-auth-filled:before {
23
+  content: "\e6cc";
24
+}
25
+
26
+.uniui-shop-filled:before {
27
+  content: "\e6cd";
28
+}
29
+
30
+.uniui-staff-filled:before {
31
+  content: "\e6cb";
32
+}
33
+
34
+.uniui-vip-filled:before {
35
+  content: "\e6c6";
36
+}
37
+
38
+.uniui-plus-filled:before {
39
+  content: "\e6c7";
40
+}
41
+
42
+.uniui-folder-add-filled:before {
43
+  content: "\e6c8";
44
+}
45
+
46
+.uniui-color-filled:before {
47
+  content: "\e6c9";
48
+}
49
+
50
+.uniui-tune-filled:before {
51
+  content: "\e6ca";
52
+}
53
+
54
+.uniui-calendar-filled:before {
55
+  content: "\e6c0";
56
+}
57
+
58
+.uniui-notification-filled:before {
59
+  content: "\e6c1";
60
+}
61
+
62
+.uniui-wallet-filled:before {
63
+  content: "\e6c2";
64
+}
65
+
66
+.uniui-medal-filled:before {
67
+  content: "\e6c3";
68
+}
69
+
70
+.uniui-fire-filled:before {
71
+  content: "\e6c5";
72
+}
73
+
74
+.uniui-refreshempty:before {
75
+  content: "\e6bf";
76
+}
77
+
78
+.uniui-location-filled:before {
79
+  content: "\e6af";
80
+}
81
+
82
+.uniui-person-filled:before {
83
+  content: "\e69d";
84
+}
85
+
86
+.uniui-personadd-filled:before {
87
+  content: "\e698";
88
+}
89
+
90
+.uniui-arrowthinleft:before {
91
+  content: "\e6d2";
92
+}
93
+
94
+.uniui-arrowthinup:before {
95
+  content: "\e6d3";
96
+}
97
+
98
+.uniui-arrowthindown:before {
99
+  content: "\e6d4";
100
+}
101
+
102
+.uniui-back:before {
103
+  content: "\e6b9";
104
+}
105
+
106
+.uniui-forward:before {
107
+  content: "\e6ba";
108
+}
109
+
110
+.uniui-arrow-right:before {
111
+  content: "\e6bb";
112
+}
113
+
114
+.uniui-arrow-left:before {
115
+  content: "\e6bc";
116
+}
117
+
118
+.uniui-arrow-up:before {
119
+  content: "\e6bd";
120
+}
121
+
122
+.uniui-arrow-down:before {
123
+  content: "\e6be";
124
+}
125
+
126
+.uniui-arrowthinright:before {
127
+  content: "\e6d1";
128
+}
129
+
130
+.uniui-down:before {
131
+  content: "\e6b8";
132
+}
133
+
134
+.uniui-bottom:before {
135
+  content: "\e6b8";
136
+}
137
+
138
+.uniui-arrowright:before {
139
+  content: "\e6d5";
140
+}
141
+
142
+.uniui-right:before {
143
+  content: "\e6b5";
144
+}
145
+
146
+.uniui-up:before {
147
+  content: "\e6b6";
148
+}
149
+
150
+.uniui-top:before {
151
+  content: "\e6b6";
152
+}
153
+
154
+.uniui-left:before {
155
+  content: "\e6b7";
156
+}
157
+
158
+.uniui-arrowup:before {
159
+  content: "\e6d6";
160
+}
161
+
162
+.uniui-eye:before {
163
+  content: "\e651";
164
+}
165
+
166
+.uniui-eye-filled:before {
167
+  content: "\e66a";
168
+}
169
+
170
+.uniui-eye-slash:before {
171
+  content: "\e6b3";
172
+}
173
+
174
+.uniui-eye-slash-filled:before {
175
+  content: "\e6b4";
176
+}
177
+
178
+.uniui-info-filled:before {
179
+  content: "\e649";
180
+}
181
+
182
+.uniui-reload:before {
183
+  content: "\e6b2";
184
+}
185
+
186
+.uniui-micoff-filled:before {
187
+  content: "\e6b0";
188
+}
189
+
190
+.uniui-map-pin-ellipse:before {
191
+  content: "\e6ac";
192
+}
193
+
194
+.uniui-map-pin:before {
195
+  content: "\e6ad";
196
+}
197
+
198
+.uniui-location:before {
199
+  content: "\e6ae";
200
+}
201
+
202
+.uniui-starhalf:before {
203
+  content: "\e683";
204
+}
205
+
206
+.uniui-star:before {
207
+  content: "\e688";
208
+}
209
+
210
+.uniui-star-filled:before {
211
+  content: "\e68f";
212
+}
213
+
214
+.uniui-calendar:before {
215
+  content: "\e6a0";
216
+}
217
+
218
+.uniui-fire:before {
219
+  content: "\e6a1";
220
+}
221
+
222
+.uniui-medal:before {
223
+  content: "\e6a2";
224
+}
225
+
226
+.uniui-font:before {
227
+  content: "\e6a3";
228
+}
229
+
230
+.uniui-gift:before {
231
+  content: "\e6a4";
232
+}
233
+
234
+.uniui-link:before {
235
+  content: "\e6a5";
236
+}
237
+
238
+.uniui-notification:before {
239
+  content: "\e6a6";
240
+}
241
+
242
+.uniui-staff:before {
243
+  content: "\e6a7";
244
+}
245
+
246
+.uniui-vip:before {
247
+  content: "\e6a8";
248
+}
249
+
250
+.uniui-folder-add:before {
251
+  content: "\e6a9";
252
+}
253
+
254
+.uniui-tune:before {
255
+  content: "\e6aa";
256
+}
257
+
258
+.uniui-auth:before {
259
+  content: "\e6ab";
260
+}
261
+
262
+.uniui-person:before {
263
+  content: "\e699";
264
+}
265
+
266
+.uniui-email-filled:before {
267
+  content: "\e69a";
268
+}
269
+
270
+.uniui-phone-filled:before {
271
+  content: "\e69b";
272
+}
273
+
274
+.uniui-phone:before {
275
+  content: "\e69c";
276
+}
277
+
278
+.uniui-email:before {
279
+  content: "\e69e";
280
+}
281
+
282
+.uniui-personadd:before {
283
+  content: "\e69f";
284
+}
285
+
286
+.uniui-chatboxes-filled:before {
287
+  content: "\e692";
288
+}
289
+
290
+.uniui-contact:before {
291
+  content: "\e693";
292
+}
293
+
294
+.uniui-chatbubble-filled:before {
295
+  content: "\e694";
296
+}
297
+
298
+.uniui-contact-filled:before {
299
+  content: "\e695";
300
+}
301
+
302
+.uniui-chatboxes:before {
303
+  content: "\e696";
304
+}
305
+
306
+.uniui-chatbubble:before {
307
+  content: "\e697";
308
+}
309
+
310
+.uniui-upload-filled:before {
311
+  content: "\e68e";
312
+}
313
+
314
+.uniui-upload:before {
315
+  content: "\e690";
316
+}
317
+
318
+.uniui-weixin:before {
319
+  content: "\e691";
320
+}
321
+
322
+.uniui-compose:before {
323
+  content: "\e67f";
324
+}
325
+
326
+.uniui-qq:before {
327
+  content: "\e680";
328
+}
329
+
330
+.uniui-download-filled:before {
331
+  content: "\e681";
332
+}
333
+
334
+.uniui-pyq:before {
335
+  content: "\e682";
336
+}
337
+
338
+.uniui-sound:before {
339
+  content: "\e684";
340
+}
341
+
342
+.uniui-trash-filled:before {
343
+  content: "\e685";
344
+}
345
+
346
+.uniui-sound-filled:before {
347
+  content: "\e686";
348
+}
349
+
350
+.uniui-trash:before {
351
+  content: "\e687";
352
+}
353
+
354
+.uniui-videocam-filled:before {
355
+  content: "\e689";
356
+}
357
+
358
+.uniui-spinner-cycle:before {
359
+  content: "\e68a";
360
+}
361
+
362
+.uniui-weibo:before {
363
+  content: "\e68b";
364
+}
365
+
366
+.uniui-videocam:before {
367
+  content: "\e68c";
368
+}
369
+
370
+.uniui-download:before {
371
+  content: "\e68d";
372
+}
373
+
374
+.uniui-help:before {
375
+  content: "\e679";
376
+}
377
+
378
+.uniui-navigate-filled:before {
379
+  content: "\e67a";
380
+}
381
+
382
+.uniui-plusempty:before {
383
+  content: "\e67b";
384
+}
385
+
386
+.uniui-smallcircle:before {
387
+  content: "\e67c";
388
+}
389
+
390
+.uniui-minus-filled:before {
391
+  content: "\e67d";
392
+}
393
+
394
+.uniui-micoff:before {
395
+  content: "\e67e";
396
+}
397
+
398
+.uniui-closeempty:before {
399
+  content: "\e66c";
400
+}
401
+
402
+.uniui-clear:before {
403
+  content: "\e66d";
404
+}
405
+
406
+.uniui-navigate:before {
407
+  content: "\e66e";
408
+}
409
+
410
+.uniui-minus:before {
411
+  content: "\e66f";
412
+}
413
+
414
+.uniui-image:before {
415
+  content: "\e670";
416
+}
417
+
418
+.uniui-mic:before {
419
+  content: "\e671";
420
+}
421
+
422
+.uniui-paperplane:before {
423
+  content: "\e672";
424
+}
425
+
426
+.uniui-close:before {
427
+  content: "\e673";
428
+}
429
+
430
+.uniui-help-filled:before {
431
+  content: "\e674";
432
+}
433
+
434
+.uniui-paperplane-filled:before {
435
+  content: "\e675";
436
+}
437
+
438
+.uniui-plus:before {
439
+  content: "\e676";
440
+}
441
+
442
+.uniui-mic-filled:before {
443
+  content: "\e677";
444
+}
445
+
446
+.uniui-image-filled:before {
447
+  content: "\e678";
448
+}
449
+
450
+.uniui-locked-filled:before {
451
+  content: "\e668";
452
+}
453
+
454
+.uniui-info:before {
455
+  content: "\e669";
456
+}
457
+
458
+.uniui-locked:before {
459
+  content: "\e66b";
460
+}
461
+
462
+.uniui-camera-filled:before {
463
+  content: "\e658";
464
+}
465
+
466
+.uniui-chat-filled:before {
467
+  content: "\e659";
468
+}
469
+
470
+.uniui-camera:before {
471
+  content: "\e65a";
472
+}
473
+
474
+.uniui-circle:before {
475
+  content: "\e65b";
476
+}
477
+
478
+.uniui-checkmarkempty:before {
479
+  content: "\e65c";
480
+}
481
+
482
+.uniui-chat:before {
483
+  content: "\e65d";
484
+}
485
+
486
+.uniui-circle-filled:before {
487
+  content: "\e65e";
488
+}
489
+
490
+.uniui-flag:before {
491
+  content: "\e65f";
492
+}
493
+
494
+.uniui-flag-filled:before {
495
+  content: "\e660";
496
+}
497
+
498
+.uniui-gear-filled:before {
499
+  content: "\e661";
500
+}
501
+
502
+.uniui-home:before {
503
+  content: "\e662";
504
+}
505
+
506
+.uniui-home-filled:before {
507
+  content: "\e663";
508
+}
509
+
510
+.uniui-gear:before {
511
+  content: "\e664";
512
+}
513
+
514
+.uniui-smallcircle-filled:before {
515
+  content: "\e665";
516
+}
517
+
518
+.uniui-map-filled:before {
519
+  content: "\e666";
520
+}
521
+
522
+.uniui-map:before {
523
+  content: "\e667";
524
+}
525
+
526
+.uniui-refresh-filled:before {
527
+  content: "\e656";
528
+}
529
+
530
+.uniui-refresh:before {
531
+  content: "\e657";
532
+}
533
+
534
+.uniui-cloud-upload:before {
535
+  content: "\e645";
536
+}
537
+
538
+.uniui-cloud-download-filled:before {
539
+  content: "\e646";
540
+}
541
+
542
+.uniui-cloud-download:before {
543
+  content: "\e647";
544
+}
545
+
546
+.uniui-cloud-upload-filled:before {
547
+  content: "\e648";
548
+}
549
+
550
+.uniui-redo:before {
551
+  content: "\e64a";
552
+}
553
+
554
+.uniui-images-filled:before {
555
+  content: "\e64b";
556
+}
557
+
558
+.uniui-undo-filled:before {
559
+  content: "\e64c";
560
+}
561
+
562
+.uniui-more:before {
563
+  content: "\e64d";
564
+}
565
+
566
+.uniui-more-filled:before {
567
+  content: "\e64e";
568
+}
569
+
570
+.uniui-undo:before {
571
+  content: "\e64f";
572
+}
573
+
574
+.uniui-images:before {
575
+  content: "\e650";
576
+}
577
+
578
+.uniui-paperclip:before {
579
+  content: "\e652";
580
+}
581
+
582
+.uniui-settings:before {
583
+  content: "\e653";
584
+}
585
+
586
+.uniui-search:before {
587
+  content: "\e654";
588
+}
589
+
590
+.uniui-redo-filled:before {
591
+  content: "\e655";
592
+}
593
+
594
+.uniui-list:before {
595
+  content: "\e644";
596
+}
597
+
598
+.uniui-mail-open-filled:before {
599
+  content: "\e63a";
600
+}
601
+
602
+.uniui-hand-down-filled:before {
603
+  content: "\e63c";
604
+}
605
+
606
+.uniui-hand-down:before {
607
+  content: "\e63d";
608
+}
609
+
610
+.uniui-hand-up-filled:before {
611
+  content: "\e63e";
612
+}
613
+
614
+.uniui-hand-up:before {
615
+  content: "\e63f";
616
+}
617
+
618
+.uniui-heart-filled:before {
619
+  content: "\e641";
620
+}
621
+
622
+.uniui-mail-open:before {
623
+  content: "\e643";
624
+}
625
+
626
+.uniui-heart:before {
627
+  content: "\e639";
628
+}
629
+
630
+.uniui-loop:before {
631
+  content: "\e633";
632
+}
633
+
634
+.uniui-pulldown:before {
635
+  content: "\e632";
636
+}
637
+
638
+.uniui-scan:before {
639
+  content: "\e62a";
640
+}
641
+
642
+.uniui-bars:before {
643
+  content: "\e627";
644
+}
645
+
646
+.uniui-checkbox:before {
647
+  content: "\e62b";
648
+}
649
+
650
+.uniui-checkbox-filled:before {
651
+  content: "\e62c";
652
+}
653
+
654
+.uniui-shop:before {
655
+  content: "\e62f";
656
+}
657
+
658
+.uniui-headphones:before {
659
+  content: "\e630";
660
+}
661
+
662
+.uniui-cart:before {
663
+  content: "\e631";
664
+}

BIN
uni_modules/uni-icons/components/uni-icons/uniicons.ttf Dosyayı Görüntüle


+ 664
- 0
uni_modules/uni-icons/components/uni-icons/uniicons_file.ts Dosyayı Görüntüle

@@ -0,0 +1,664 @@
1
+
2
+export type IconsData = {
3
+	id : string
4
+	name : string
5
+	font_family : string
6
+	css_prefix_text : string
7
+	description : string
8
+	glyphs : Array<IconsDataItem>
9
+}
10
+
11
+export type IconsDataItem = {
12
+	font_class : string
13
+	unicode : string
14
+}
15
+
16
+
17
+export const fontData = [
18
+  {
19
+    "font_class": "arrow-down",
20
+    "unicode": "\ue6be"
21
+  },
22
+  {
23
+    "font_class": "arrow-left",
24
+    "unicode": "\ue6bc"
25
+  },
26
+  {
27
+    "font_class": "arrow-right",
28
+    "unicode": "\ue6bb"
29
+  },
30
+  {
31
+    "font_class": "arrow-up",
32
+    "unicode": "\ue6bd"
33
+  },
34
+  {
35
+    "font_class": "auth",
36
+    "unicode": "\ue6ab"
37
+  },
38
+  {
39
+    "font_class": "auth-filled",
40
+    "unicode": "\ue6cc"
41
+  },
42
+  {
43
+    "font_class": "back",
44
+    "unicode": "\ue6b9"
45
+  },
46
+  {
47
+    "font_class": "bars",
48
+    "unicode": "\ue627"
49
+  },
50
+  {
51
+    "font_class": "calendar",
52
+    "unicode": "\ue6a0"
53
+  },
54
+  {
55
+    "font_class": "calendar-filled",
56
+    "unicode": "\ue6c0"
57
+  },
58
+  {
59
+    "font_class": "camera",
60
+    "unicode": "\ue65a"
61
+  },
62
+  {
63
+    "font_class": "camera-filled",
64
+    "unicode": "\ue658"
65
+  },
66
+  {
67
+    "font_class": "cart",
68
+    "unicode": "\ue631"
69
+  },
70
+  {
71
+    "font_class": "cart-filled",
72
+    "unicode": "\ue6d0"
73
+  },
74
+  {
75
+    "font_class": "chat",
76
+    "unicode": "\ue65d"
77
+  },
78
+  {
79
+    "font_class": "chat-filled",
80
+    "unicode": "\ue659"
81
+  },
82
+  {
83
+    "font_class": "chatboxes",
84
+    "unicode": "\ue696"
85
+  },
86
+  {
87
+    "font_class": "chatboxes-filled",
88
+    "unicode": "\ue692"
89
+  },
90
+  {
91
+    "font_class": "chatbubble",
92
+    "unicode": "\ue697"
93
+  },
94
+  {
95
+    "font_class": "chatbubble-filled",
96
+    "unicode": "\ue694"
97
+  },
98
+  {
99
+    "font_class": "checkbox",
100
+    "unicode": "\ue62b"
101
+  },
102
+  {
103
+    "font_class": "checkbox-filled",
104
+    "unicode": "\ue62c"
105
+  },
106
+  {
107
+    "font_class": "checkmarkempty",
108
+    "unicode": "\ue65c"
109
+  },
110
+  {
111
+    "font_class": "circle",
112
+    "unicode": "\ue65b"
113
+  },
114
+  {
115
+    "font_class": "circle-filled",
116
+    "unicode": "\ue65e"
117
+  },
118
+  {
119
+    "font_class": "clear",
120
+    "unicode": "\ue66d"
121
+  },
122
+  {
123
+    "font_class": "close",
124
+    "unicode": "\ue673"
125
+  },
126
+  {
127
+    "font_class": "closeempty",
128
+    "unicode": "\ue66c"
129
+  },
130
+  {
131
+    "font_class": "cloud-download",
132
+    "unicode": "\ue647"
133
+  },
134
+  {
135
+    "font_class": "cloud-download-filled",
136
+    "unicode": "\ue646"
137
+  },
138
+  {
139
+    "font_class": "cloud-upload",
140
+    "unicode": "\ue645"
141
+  },
142
+  {
143
+    "font_class": "cloud-upload-filled",
144
+    "unicode": "\ue648"
145
+  },
146
+  {
147
+    "font_class": "color",
148
+    "unicode": "\ue6cf"
149
+  },
150
+  {
151
+    "font_class": "color-filled",
152
+    "unicode": "\ue6c9"
153
+  },
154
+  {
155
+    "font_class": "compose",
156
+    "unicode": "\ue67f"
157
+  },
158
+  {
159
+    "font_class": "contact",
160
+    "unicode": "\ue693"
161
+  },
162
+  {
163
+    "font_class": "contact-filled",
164
+    "unicode": "\ue695"
165
+  },
166
+  {
167
+    "font_class": "down",
168
+    "unicode": "\ue6b8"
169
+  },
170
+	{
171
+	  "font_class": "bottom",
172
+	  "unicode": "\ue6b8"
173
+	},
174
+  {
175
+    "font_class": "download",
176
+    "unicode": "\ue68d"
177
+  },
178
+  {
179
+    "font_class": "download-filled",
180
+    "unicode": "\ue681"
181
+  },
182
+  {
183
+    "font_class": "email",
184
+    "unicode": "\ue69e"
185
+  },
186
+  {
187
+    "font_class": "email-filled",
188
+    "unicode": "\ue69a"
189
+  },
190
+  {
191
+    "font_class": "eye",
192
+    "unicode": "\ue651"
193
+  },
194
+  {
195
+    "font_class": "eye-filled",
196
+    "unicode": "\ue66a"
197
+  },
198
+  {
199
+    "font_class": "eye-slash",
200
+    "unicode": "\ue6b3"
201
+  },
202
+  {
203
+    "font_class": "eye-slash-filled",
204
+    "unicode": "\ue6b4"
205
+  },
206
+  {
207
+    "font_class": "fire",
208
+    "unicode": "\ue6a1"
209
+  },
210
+  {
211
+    "font_class": "fire-filled",
212
+    "unicode": "\ue6c5"
213
+  },
214
+  {
215
+    "font_class": "flag",
216
+    "unicode": "\ue65f"
217
+  },
218
+  {
219
+    "font_class": "flag-filled",
220
+    "unicode": "\ue660"
221
+  },
222
+  {
223
+    "font_class": "folder-add",
224
+    "unicode": "\ue6a9"
225
+  },
226
+  {
227
+    "font_class": "folder-add-filled",
228
+    "unicode": "\ue6c8"
229
+  },
230
+  {
231
+    "font_class": "font",
232
+    "unicode": "\ue6a3"
233
+  },
234
+  {
235
+    "font_class": "forward",
236
+    "unicode": "\ue6ba"
237
+  },
238
+  {
239
+    "font_class": "gear",
240
+    "unicode": "\ue664"
241
+  },
242
+  {
243
+    "font_class": "gear-filled",
244
+    "unicode": "\ue661"
245
+  },
246
+  {
247
+    "font_class": "gift",
248
+    "unicode": "\ue6a4"
249
+  },
250
+  {
251
+    "font_class": "gift-filled",
252
+    "unicode": "\ue6c4"
253
+  },
254
+  {
255
+    "font_class": "hand-down",
256
+    "unicode": "\ue63d"
257
+  },
258
+  {
259
+    "font_class": "hand-down-filled",
260
+    "unicode": "\ue63c"
261
+  },
262
+  {
263
+    "font_class": "hand-up",
264
+    "unicode": "\ue63f"
265
+  },
266
+  {
267
+    "font_class": "hand-up-filled",
268
+    "unicode": "\ue63e"
269
+  },
270
+  {
271
+    "font_class": "headphones",
272
+    "unicode": "\ue630"
273
+  },
274
+  {
275
+    "font_class": "heart",
276
+    "unicode": "\ue639"
277
+  },
278
+  {
279
+    "font_class": "heart-filled",
280
+    "unicode": "\ue641"
281
+  },
282
+  {
283
+    "font_class": "help",
284
+    "unicode": "\ue679"
285
+  },
286
+  {
287
+    "font_class": "help-filled",
288
+    "unicode": "\ue674"
289
+  },
290
+  {
291
+    "font_class": "home",
292
+    "unicode": "\ue662"
293
+  },
294
+  {
295
+    "font_class": "home-filled",
296
+    "unicode": "\ue663"
297
+  },
298
+  {
299
+    "font_class": "image",
300
+    "unicode": "\ue670"
301
+  },
302
+  {
303
+    "font_class": "image-filled",
304
+    "unicode": "\ue678"
305
+  },
306
+  {
307
+    "font_class": "images",
308
+    "unicode": "\ue650"
309
+  },
310
+  {
311
+    "font_class": "images-filled",
312
+    "unicode": "\ue64b"
313
+  },
314
+  {
315
+    "font_class": "info",
316
+    "unicode": "\ue669"
317
+  },
318
+  {
319
+    "font_class": "info-filled",
320
+    "unicode": "\ue649"
321
+  },
322
+  {
323
+    "font_class": "left",
324
+    "unicode": "\ue6b7"
325
+  },
326
+  {
327
+    "font_class": "link",
328
+    "unicode": "\ue6a5"
329
+  },
330
+  {
331
+    "font_class": "list",
332
+    "unicode": "\ue644"
333
+  },
334
+  {
335
+    "font_class": "location",
336
+    "unicode": "\ue6ae"
337
+  },
338
+  {
339
+    "font_class": "location-filled",
340
+    "unicode": "\ue6af"
341
+  },
342
+  {
343
+    "font_class": "locked",
344
+    "unicode": "\ue66b"
345
+  },
346
+  {
347
+    "font_class": "locked-filled",
348
+    "unicode": "\ue668"
349
+  },
350
+  {
351
+    "font_class": "loop",
352
+    "unicode": "\ue633"
353
+  },
354
+  {
355
+    "font_class": "mail-open",
356
+    "unicode": "\ue643"
357
+  },
358
+  {
359
+    "font_class": "mail-open-filled",
360
+    "unicode": "\ue63a"
361
+  },
362
+  {
363
+    "font_class": "map",
364
+    "unicode": "\ue667"
365
+  },
366
+  {
367
+    "font_class": "map-filled",
368
+    "unicode": "\ue666"
369
+  },
370
+  {
371
+    "font_class": "map-pin",
372
+    "unicode": "\ue6ad"
373
+  },
374
+  {
375
+    "font_class": "map-pin-ellipse",
376
+    "unicode": "\ue6ac"
377
+  },
378
+  {
379
+    "font_class": "medal",
380
+    "unicode": "\ue6a2"
381
+  },
382
+  {
383
+    "font_class": "medal-filled",
384
+    "unicode": "\ue6c3"
385
+  },
386
+  {
387
+    "font_class": "mic",
388
+    "unicode": "\ue671"
389
+  },
390
+  {
391
+    "font_class": "mic-filled",
392
+    "unicode": "\ue677"
393
+  },
394
+  {
395
+    "font_class": "micoff",
396
+    "unicode": "\ue67e"
397
+  },
398
+  {
399
+    "font_class": "micoff-filled",
400
+    "unicode": "\ue6b0"
401
+  },
402
+  {
403
+    "font_class": "minus",
404
+    "unicode": "\ue66f"
405
+  },
406
+  {
407
+    "font_class": "minus-filled",
408
+    "unicode": "\ue67d"
409
+  },
410
+  {
411
+    "font_class": "more",
412
+    "unicode": "\ue64d"
413
+  },
414
+  {
415
+    "font_class": "more-filled",
416
+    "unicode": "\ue64e"
417
+  },
418
+  {
419
+    "font_class": "navigate",
420
+    "unicode": "\ue66e"
421
+  },
422
+  {
423
+    "font_class": "navigate-filled",
424
+    "unicode": "\ue67a"
425
+  },
426
+  {
427
+    "font_class": "notification",
428
+    "unicode": "\ue6a6"
429
+  },
430
+  {
431
+    "font_class": "notification-filled",
432
+    "unicode": "\ue6c1"
433
+  },
434
+  {
435
+    "font_class": "paperclip",
436
+    "unicode": "\ue652"
437
+  },
438
+  {
439
+    "font_class": "paperplane",
440
+    "unicode": "\ue672"
441
+  },
442
+  {
443
+    "font_class": "paperplane-filled",
444
+    "unicode": "\ue675"
445
+  },
446
+  {
447
+    "font_class": "person",
448
+    "unicode": "\ue699"
449
+  },
450
+  {
451
+    "font_class": "person-filled",
452
+    "unicode": "\ue69d"
453
+  },
454
+  {
455
+    "font_class": "personadd",
456
+    "unicode": "\ue69f"
457
+  },
458
+  {
459
+    "font_class": "personadd-filled",
460
+    "unicode": "\ue698"
461
+  },
462
+  {
463
+    "font_class": "personadd-filled-copy",
464
+    "unicode": "\ue6d1"
465
+  },
466
+  {
467
+    "font_class": "phone",
468
+    "unicode": "\ue69c"
469
+  },
470
+  {
471
+    "font_class": "phone-filled",
472
+    "unicode": "\ue69b"
473
+  },
474
+  {
475
+    "font_class": "plus",
476
+    "unicode": "\ue676"
477
+  },
478
+  {
479
+    "font_class": "plus-filled",
480
+    "unicode": "\ue6c7"
481
+  },
482
+  {
483
+    "font_class": "plusempty",
484
+    "unicode": "\ue67b"
485
+  },
486
+  {
487
+    "font_class": "pulldown",
488
+    "unicode": "\ue632"
489
+  },
490
+  {
491
+    "font_class": "pyq",
492
+    "unicode": "\ue682"
493
+  },
494
+  {
495
+    "font_class": "qq",
496
+    "unicode": "\ue680"
497
+  },
498
+  {
499
+    "font_class": "redo",
500
+    "unicode": "\ue64a"
501
+  },
502
+  {
503
+    "font_class": "redo-filled",
504
+    "unicode": "\ue655"
505
+  },
506
+  {
507
+    "font_class": "refresh",
508
+    "unicode": "\ue657"
509
+  },
510
+  {
511
+    "font_class": "refresh-filled",
512
+    "unicode": "\ue656"
513
+  },
514
+  {
515
+    "font_class": "refreshempty",
516
+    "unicode": "\ue6bf"
517
+  },
518
+  {
519
+    "font_class": "reload",
520
+    "unicode": "\ue6b2"
521
+  },
522
+  {
523
+    "font_class": "right",
524
+    "unicode": "\ue6b5"
525
+  },
526
+  {
527
+    "font_class": "scan",
528
+    "unicode": "\ue62a"
529
+  },
530
+  {
531
+    "font_class": "search",
532
+    "unicode": "\ue654"
533
+  },
534
+  {
535
+    "font_class": "settings",
536
+    "unicode": "\ue653"
537
+  },
538
+  {
539
+    "font_class": "settings-filled",
540
+    "unicode": "\ue6ce"
541
+  },
542
+  {
543
+    "font_class": "shop",
544
+    "unicode": "\ue62f"
545
+  },
546
+  {
547
+    "font_class": "shop-filled",
548
+    "unicode": "\ue6cd"
549
+  },
550
+  {
551
+    "font_class": "smallcircle",
552
+    "unicode": "\ue67c"
553
+  },
554
+  {
555
+    "font_class": "smallcircle-filled",
556
+    "unicode": "\ue665"
557
+  },
558
+  {
559
+    "font_class": "sound",
560
+    "unicode": "\ue684"
561
+  },
562
+  {
563
+    "font_class": "sound-filled",
564
+    "unicode": "\ue686"
565
+  },
566
+  {
567
+    "font_class": "spinner-cycle",
568
+    "unicode": "\ue68a"
569
+  },
570
+  {
571
+    "font_class": "staff",
572
+    "unicode": "\ue6a7"
573
+  },
574
+  {
575
+    "font_class": "staff-filled",
576
+    "unicode": "\ue6cb"
577
+  },
578
+  {
579
+    "font_class": "star",
580
+    "unicode": "\ue688"
581
+  },
582
+  {
583
+    "font_class": "star-filled",
584
+    "unicode": "\ue68f"
585
+  },
586
+  {
587
+    "font_class": "starhalf",
588
+    "unicode": "\ue683"
589
+  },
590
+  {
591
+    "font_class": "trash",
592
+    "unicode": "\ue687"
593
+  },
594
+  {
595
+    "font_class": "trash-filled",
596
+    "unicode": "\ue685"
597
+  },
598
+  {
599
+    "font_class": "tune",
600
+    "unicode": "\ue6aa"
601
+  },
602
+  {
603
+    "font_class": "tune-filled",
604
+    "unicode": "\ue6ca"
605
+  },
606
+  {
607
+    "font_class": "undo",
608
+    "unicode": "\ue64f"
609
+  },
610
+  {
611
+    "font_class": "undo-filled",
612
+    "unicode": "\ue64c"
613
+  },
614
+  {
615
+    "font_class": "up",
616
+    "unicode": "\ue6b6"
617
+  },
618
+	{
619
+	  "font_class": "top",
620
+	  "unicode": "\ue6b6"
621
+	},
622
+  {
623
+    "font_class": "upload",
624
+    "unicode": "\ue690"
625
+  },
626
+  {
627
+    "font_class": "upload-filled",
628
+    "unicode": "\ue68e"
629
+  },
630
+  {
631
+    "font_class": "videocam",
632
+    "unicode": "\ue68c"
633
+  },
634
+  {
635
+    "font_class": "videocam-filled",
636
+    "unicode": "\ue689"
637
+  },
638
+  {
639
+    "font_class": "vip",
640
+    "unicode": "\ue6a8"
641
+  },
642
+  {
643
+    "font_class": "vip-filled",
644
+    "unicode": "\ue6c6"
645
+  },
646
+  {
647
+    "font_class": "wallet",
648
+    "unicode": "\ue6b1"
649
+  },
650
+  {
651
+    "font_class": "wallet-filled",
652
+    "unicode": "\ue6c2"
653
+  },
654
+  {
655
+    "font_class": "weibo",
656
+    "unicode": "\ue68b"
657
+  },
658
+  {
659
+    "font_class": "weixin",
660
+    "unicode": "\ue691"
661
+  }
662
+] as IconsDataItem[]
663
+
664
+// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)

+ 649
- 0
uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js Dosyayı Görüntüle

@@ -0,0 +1,649 @@
1
+
2
+export const fontData = [
3
+  {
4
+    "font_class": "arrow-down",
5
+    "unicode": "\ue6be"
6
+  },
7
+  {
8
+    "font_class": "arrow-left",
9
+    "unicode": "\ue6bc"
10
+  },
11
+  {
12
+    "font_class": "arrow-right",
13
+    "unicode": "\ue6bb"
14
+  },
15
+  {
16
+    "font_class": "arrow-up",
17
+    "unicode": "\ue6bd"
18
+  },
19
+  {
20
+    "font_class": "auth",
21
+    "unicode": "\ue6ab"
22
+  },
23
+  {
24
+    "font_class": "auth-filled",
25
+    "unicode": "\ue6cc"
26
+  },
27
+  {
28
+    "font_class": "back",
29
+    "unicode": "\ue6b9"
30
+  },
31
+  {
32
+    "font_class": "bars",
33
+    "unicode": "\ue627"
34
+  },
35
+  {
36
+    "font_class": "calendar",
37
+    "unicode": "\ue6a0"
38
+  },
39
+  {
40
+    "font_class": "calendar-filled",
41
+    "unicode": "\ue6c0"
42
+  },
43
+  {
44
+    "font_class": "camera",
45
+    "unicode": "\ue65a"
46
+  },
47
+  {
48
+    "font_class": "camera-filled",
49
+    "unicode": "\ue658"
50
+  },
51
+  {
52
+    "font_class": "cart",
53
+    "unicode": "\ue631"
54
+  },
55
+  {
56
+    "font_class": "cart-filled",
57
+    "unicode": "\ue6d0"
58
+  },
59
+  {
60
+    "font_class": "chat",
61
+    "unicode": "\ue65d"
62
+  },
63
+  {
64
+    "font_class": "chat-filled",
65
+    "unicode": "\ue659"
66
+  },
67
+  {
68
+    "font_class": "chatboxes",
69
+    "unicode": "\ue696"
70
+  },
71
+  {
72
+    "font_class": "chatboxes-filled",
73
+    "unicode": "\ue692"
74
+  },
75
+  {
76
+    "font_class": "chatbubble",
77
+    "unicode": "\ue697"
78
+  },
79
+  {
80
+    "font_class": "chatbubble-filled",
81
+    "unicode": "\ue694"
82
+  },
83
+  {
84
+    "font_class": "checkbox",
85
+    "unicode": "\ue62b"
86
+  },
87
+  {
88
+    "font_class": "checkbox-filled",
89
+    "unicode": "\ue62c"
90
+  },
91
+  {
92
+    "font_class": "checkmarkempty",
93
+    "unicode": "\ue65c"
94
+  },
95
+  {
96
+    "font_class": "circle",
97
+    "unicode": "\ue65b"
98
+  },
99
+  {
100
+    "font_class": "circle-filled",
101
+    "unicode": "\ue65e"
102
+  },
103
+  {
104
+    "font_class": "clear",
105
+    "unicode": "\ue66d"
106
+  },
107
+  {
108
+    "font_class": "close",
109
+    "unicode": "\ue673"
110
+  },
111
+  {
112
+    "font_class": "closeempty",
113
+    "unicode": "\ue66c"
114
+  },
115
+  {
116
+    "font_class": "cloud-download",
117
+    "unicode": "\ue647"
118
+  },
119
+  {
120
+    "font_class": "cloud-download-filled",
121
+    "unicode": "\ue646"
122
+  },
123
+  {
124
+    "font_class": "cloud-upload",
125
+    "unicode": "\ue645"
126
+  },
127
+  {
128
+    "font_class": "cloud-upload-filled",
129
+    "unicode": "\ue648"
130
+  },
131
+  {
132
+    "font_class": "color",
133
+    "unicode": "\ue6cf"
134
+  },
135
+  {
136
+    "font_class": "color-filled",
137
+    "unicode": "\ue6c9"
138
+  },
139
+  {
140
+    "font_class": "compose",
141
+    "unicode": "\ue67f"
142
+  },
143
+  {
144
+    "font_class": "contact",
145
+    "unicode": "\ue693"
146
+  },
147
+  {
148
+    "font_class": "contact-filled",
149
+    "unicode": "\ue695"
150
+  },
151
+  {
152
+    "font_class": "down",
153
+    "unicode": "\ue6b8"
154
+  },
155
+	{
156
+	  "font_class": "bottom",
157
+	  "unicode": "\ue6b8"
158
+	},
159
+  {
160
+    "font_class": "download",
161
+    "unicode": "\ue68d"
162
+  },
163
+  {
164
+    "font_class": "download-filled",
165
+    "unicode": "\ue681"
166
+  },
167
+  {
168
+    "font_class": "email",
169
+    "unicode": "\ue69e"
170
+  },
171
+  {
172
+    "font_class": "email-filled",
173
+    "unicode": "\ue69a"
174
+  },
175
+  {
176
+    "font_class": "eye",
177
+    "unicode": "\ue651"
178
+  },
179
+  {
180
+    "font_class": "eye-filled",
181
+    "unicode": "\ue66a"
182
+  },
183
+  {
184
+    "font_class": "eye-slash",
185
+    "unicode": "\ue6b3"
186
+  },
187
+  {
188
+    "font_class": "eye-slash-filled",
189
+    "unicode": "\ue6b4"
190
+  },
191
+  {
192
+    "font_class": "fire",
193
+    "unicode": "\ue6a1"
194
+  },
195
+  {
196
+    "font_class": "fire-filled",
197
+    "unicode": "\ue6c5"
198
+  },
199
+  {
200
+    "font_class": "flag",
201
+    "unicode": "\ue65f"
202
+  },
203
+  {
204
+    "font_class": "flag-filled",
205
+    "unicode": "\ue660"
206
+  },
207
+  {
208
+    "font_class": "folder-add",
209
+    "unicode": "\ue6a9"
210
+  },
211
+  {
212
+    "font_class": "folder-add-filled",
213
+    "unicode": "\ue6c8"
214
+  },
215
+  {
216
+    "font_class": "font",
217
+    "unicode": "\ue6a3"
218
+  },
219
+  {
220
+    "font_class": "forward",
221
+    "unicode": "\ue6ba"
222
+  },
223
+  {
224
+    "font_class": "gear",
225
+    "unicode": "\ue664"
226
+  },
227
+  {
228
+    "font_class": "gear-filled",
229
+    "unicode": "\ue661"
230
+  },
231
+  {
232
+    "font_class": "gift",
233
+    "unicode": "\ue6a4"
234
+  },
235
+  {
236
+    "font_class": "gift-filled",
237
+    "unicode": "\ue6c4"
238
+  },
239
+  {
240
+    "font_class": "hand-down",
241
+    "unicode": "\ue63d"
242
+  },
243
+  {
244
+    "font_class": "hand-down-filled",
245
+    "unicode": "\ue63c"
246
+  },
247
+  {
248
+    "font_class": "hand-up",
249
+    "unicode": "\ue63f"
250
+  },
251
+  {
252
+    "font_class": "hand-up-filled",
253
+    "unicode": "\ue63e"
254
+  },
255
+  {
256
+    "font_class": "headphones",
257
+    "unicode": "\ue630"
258
+  },
259
+  {
260
+    "font_class": "heart",
261
+    "unicode": "\ue639"
262
+  },
263
+  {
264
+    "font_class": "heart-filled",
265
+    "unicode": "\ue641"
266
+  },
267
+  {
268
+    "font_class": "help",
269
+    "unicode": "\ue679"
270
+  },
271
+  {
272
+    "font_class": "help-filled",
273
+    "unicode": "\ue674"
274
+  },
275
+  {
276
+    "font_class": "home",
277
+    "unicode": "\ue662"
278
+  },
279
+  {
280
+    "font_class": "home-filled",
281
+    "unicode": "\ue663"
282
+  },
283
+  {
284
+    "font_class": "image",
285
+    "unicode": "\ue670"
286
+  },
287
+  {
288
+    "font_class": "image-filled",
289
+    "unicode": "\ue678"
290
+  },
291
+  {
292
+    "font_class": "images",
293
+    "unicode": "\ue650"
294
+  },
295
+  {
296
+    "font_class": "images-filled",
297
+    "unicode": "\ue64b"
298
+  },
299
+  {
300
+    "font_class": "info",
301
+    "unicode": "\ue669"
302
+  },
303
+  {
304
+    "font_class": "info-filled",
305
+    "unicode": "\ue649"
306
+  },
307
+  {
308
+    "font_class": "left",
309
+    "unicode": "\ue6b7"
310
+  },
311
+  {
312
+    "font_class": "link",
313
+    "unicode": "\ue6a5"
314
+  },
315
+  {
316
+    "font_class": "list",
317
+    "unicode": "\ue644"
318
+  },
319
+  {
320
+    "font_class": "location",
321
+    "unicode": "\ue6ae"
322
+  },
323
+  {
324
+    "font_class": "location-filled",
325
+    "unicode": "\ue6af"
326
+  },
327
+  {
328
+    "font_class": "locked",
329
+    "unicode": "\ue66b"
330
+  },
331
+  {
332
+    "font_class": "locked-filled",
333
+    "unicode": "\ue668"
334
+  },
335
+  {
336
+    "font_class": "loop",
337
+    "unicode": "\ue633"
338
+  },
339
+  {
340
+    "font_class": "mail-open",
341
+    "unicode": "\ue643"
342
+  },
343
+  {
344
+    "font_class": "mail-open-filled",
345
+    "unicode": "\ue63a"
346
+  },
347
+  {
348
+    "font_class": "map",
349
+    "unicode": "\ue667"
350
+  },
351
+  {
352
+    "font_class": "map-filled",
353
+    "unicode": "\ue666"
354
+  },
355
+  {
356
+    "font_class": "map-pin",
357
+    "unicode": "\ue6ad"
358
+  },
359
+  {
360
+    "font_class": "map-pin-ellipse",
361
+    "unicode": "\ue6ac"
362
+  },
363
+  {
364
+    "font_class": "medal",
365
+    "unicode": "\ue6a2"
366
+  },
367
+  {
368
+    "font_class": "medal-filled",
369
+    "unicode": "\ue6c3"
370
+  },
371
+  {
372
+    "font_class": "mic",
373
+    "unicode": "\ue671"
374
+  },
375
+  {
376
+    "font_class": "mic-filled",
377
+    "unicode": "\ue677"
378
+  },
379
+  {
380
+    "font_class": "micoff",
381
+    "unicode": "\ue67e"
382
+  },
383
+  {
384
+    "font_class": "micoff-filled",
385
+    "unicode": "\ue6b0"
386
+  },
387
+  {
388
+    "font_class": "minus",
389
+    "unicode": "\ue66f"
390
+  },
391
+  {
392
+    "font_class": "minus-filled",
393
+    "unicode": "\ue67d"
394
+  },
395
+  {
396
+    "font_class": "more",
397
+    "unicode": "\ue64d"
398
+  },
399
+  {
400
+    "font_class": "more-filled",
401
+    "unicode": "\ue64e"
402
+  },
403
+  {
404
+    "font_class": "navigate",
405
+    "unicode": "\ue66e"
406
+  },
407
+  {
408
+    "font_class": "navigate-filled",
409
+    "unicode": "\ue67a"
410
+  },
411
+  {
412
+    "font_class": "notification",
413
+    "unicode": "\ue6a6"
414
+  },
415
+  {
416
+    "font_class": "notification-filled",
417
+    "unicode": "\ue6c1"
418
+  },
419
+  {
420
+    "font_class": "paperclip",
421
+    "unicode": "\ue652"
422
+  },
423
+  {
424
+    "font_class": "paperplane",
425
+    "unicode": "\ue672"
426
+  },
427
+  {
428
+    "font_class": "paperplane-filled",
429
+    "unicode": "\ue675"
430
+  },
431
+  {
432
+    "font_class": "person",
433
+    "unicode": "\ue699"
434
+  },
435
+  {
436
+    "font_class": "person-filled",
437
+    "unicode": "\ue69d"
438
+  },
439
+  {
440
+    "font_class": "personadd",
441
+    "unicode": "\ue69f"
442
+  },
443
+  {
444
+    "font_class": "personadd-filled",
445
+    "unicode": "\ue698"
446
+  },
447
+  {
448
+    "font_class": "personadd-filled-copy",
449
+    "unicode": "\ue6d1"
450
+  },
451
+  {
452
+    "font_class": "phone",
453
+    "unicode": "\ue69c"
454
+  },
455
+  {
456
+    "font_class": "phone-filled",
457
+    "unicode": "\ue69b"
458
+  },
459
+  {
460
+    "font_class": "plus",
461
+    "unicode": "\ue676"
462
+  },
463
+  {
464
+    "font_class": "plus-filled",
465
+    "unicode": "\ue6c7"
466
+  },
467
+  {
468
+    "font_class": "plusempty",
469
+    "unicode": "\ue67b"
470
+  },
471
+  {
472
+    "font_class": "pulldown",
473
+    "unicode": "\ue632"
474
+  },
475
+  {
476
+    "font_class": "pyq",
477
+    "unicode": "\ue682"
478
+  },
479
+  {
480
+    "font_class": "qq",
481
+    "unicode": "\ue680"
482
+  },
483
+  {
484
+    "font_class": "redo",
485
+    "unicode": "\ue64a"
486
+  },
487
+  {
488
+    "font_class": "redo-filled",
489
+    "unicode": "\ue655"
490
+  },
491
+  {
492
+    "font_class": "refresh",
493
+    "unicode": "\ue657"
494
+  },
495
+  {
496
+    "font_class": "refresh-filled",
497
+    "unicode": "\ue656"
498
+  },
499
+  {
500
+    "font_class": "refreshempty",
501
+    "unicode": "\ue6bf"
502
+  },
503
+  {
504
+    "font_class": "reload",
505
+    "unicode": "\ue6b2"
506
+  },
507
+  {
508
+    "font_class": "right",
509
+    "unicode": "\ue6b5"
510
+  },
511
+  {
512
+    "font_class": "scan",
513
+    "unicode": "\ue62a"
514
+  },
515
+  {
516
+    "font_class": "search",
517
+    "unicode": "\ue654"
518
+  },
519
+  {
520
+    "font_class": "settings",
521
+    "unicode": "\ue653"
522
+  },
523
+  {
524
+    "font_class": "settings-filled",
525
+    "unicode": "\ue6ce"
526
+  },
527
+  {
528
+    "font_class": "shop",
529
+    "unicode": "\ue62f"
530
+  },
531
+  {
532
+    "font_class": "shop-filled",
533
+    "unicode": "\ue6cd"
534
+  },
535
+  {
536
+    "font_class": "smallcircle",
537
+    "unicode": "\ue67c"
538
+  },
539
+  {
540
+    "font_class": "smallcircle-filled",
541
+    "unicode": "\ue665"
542
+  },
543
+  {
544
+    "font_class": "sound",
545
+    "unicode": "\ue684"
546
+  },
547
+  {
548
+    "font_class": "sound-filled",
549
+    "unicode": "\ue686"
550
+  },
551
+  {
552
+    "font_class": "spinner-cycle",
553
+    "unicode": "\ue68a"
554
+  },
555
+  {
556
+    "font_class": "staff",
557
+    "unicode": "\ue6a7"
558
+  },
559
+  {
560
+    "font_class": "staff-filled",
561
+    "unicode": "\ue6cb"
562
+  },
563
+  {
564
+    "font_class": "star",
565
+    "unicode": "\ue688"
566
+  },
567
+  {
568
+    "font_class": "star-filled",
569
+    "unicode": "\ue68f"
570
+  },
571
+  {
572
+    "font_class": "starhalf",
573
+    "unicode": "\ue683"
574
+  },
575
+  {
576
+    "font_class": "trash",
577
+    "unicode": "\ue687"
578
+  },
579
+  {
580
+    "font_class": "trash-filled",
581
+    "unicode": "\ue685"
582
+  },
583
+  {
584
+    "font_class": "tune",
585
+    "unicode": "\ue6aa"
586
+  },
587
+  {
588
+    "font_class": "tune-filled",
589
+    "unicode": "\ue6ca"
590
+  },
591
+  {
592
+    "font_class": "undo",
593
+    "unicode": "\ue64f"
594
+  },
595
+  {
596
+    "font_class": "undo-filled",
597
+    "unicode": "\ue64c"
598
+  },
599
+  {
600
+    "font_class": "up",
601
+    "unicode": "\ue6b6"
602
+  },
603
+	{
604
+	  "font_class": "top",
605
+	  "unicode": "\ue6b6"
606
+	},
607
+  {
608
+    "font_class": "upload",
609
+    "unicode": "\ue690"
610
+  },
611
+  {
612
+    "font_class": "upload-filled",
613
+    "unicode": "\ue68e"
614
+  },
615
+  {
616
+    "font_class": "videocam",
617
+    "unicode": "\ue68c"
618
+  },
619
+  {
620
+    "font_class": "videocam-filled",
621
+    "unicode": "\ue689"
622
+  },
623
+  {
624
+    "font_class": "vip",
625
+    "unicode": "\ue6a8"
626
+  },
627
+  {
628
+    "font_class": "vip-filled",
629
+    "unicode": "\ue6c6"
630
+  },
631
+  {
632
+    "font_class": "wallet",
633
+    "unicode": "\ue6b1"
634
+  },
635
+  {
636
+    "font_class": "wallet-filled",
637
+    "unicode": "\ue6c2"
638
+  },
639
+  {
640
+    "font_class": "weibo",
641
+    "unicode": "\ue68b"
642
+  },
643
+  {
644
+    "font_class": "weixin",
645
+    "unicode": "\ue691"
646
+  }
647
+]
648
+
649
+// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)

+ 89
- 0
uni_modules/uni-icons/package.json Dosyayı Görüntüle

@@ -0,0 +1,89 @@
1
+{
2
+  "id": "uni-icons",
3
+  "displayName": "uni-icons 图标",
4
+  "version": "2.0.10",
5
+  "description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
6
+  "keywords": [
7
+    "uni-ui",
8
+    "uniui",
9
+    "icon",
10
+    "图标"
11
+],
12
+  "repository": "https://github.com/dcloudio/uni-ui",
13
+  "engines": {
14
+    "HBuilderX": "^3.2.14"
15
+  },
16
+  "directories": {
17
+    "example": "../../temps/example_temps"
18
+  },
19
+"dcloudext": {
20
+    "sale": {
21
+      "regular": {
22
+        "price": "0.00"
23
+      },
24
+      "sourcecode": {
25
+        "price": "0.00"
26
+      }
27
+    },
28
+    "contact": {
29
+      "qq": ""
30
+    },
31
+    "declaration": {
32
+      "ads": "无",
33
+      "data": "无",
34
+      "permissions": "无"
35
+    },
36
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
37
+    "type": "component-vue"
38
+  },
39
+  "uni_modules": {
40
+    "dependencies": ["uni-scss"],
41
+    "encrypt": [],
42
+    "platforms": {
43
+      "cloud": {
44
+        "tcb": "y",
45
+        "aliyun": "y",
46
+        "alipay": "n"
47
+      },
48
+      "client": {
49
+        "App": {
50
+          "app-vue": "y",
51
+          "app-nvue": "y",
52
+          "app-uvue": "y"
53
+        },
54
+        "H5-mobile": {
55
+          "Safari": "y",
56
+          "Android Browser": "y",
57
+          "微信浏览器(Android)": "y",
58
+          "QQ浏览器(Android)": "y"
59
+        },
60
+        "H5-pc": {
61
+          "Chrome": "y",
62
+          "IE": "y",
63
+          "Edge": "y",
64
+          "Firefox": "y",
65
+          "Safari": "y"
66
+        },
67
+        "小程序": {
68
+          "微信": "y",
69
+          "阿里": "y",
70
+          "百度": "y",
71
+          "字节跳动": "y",
72
+          "QQ": "y",
73
+					"钉钉": "y",
74
+					"快手": "y",
75
+					"飞书": "y",
76
+					"京东": "y"
77
+        },
78
+        "快应用": {
79
+          "华为": "y",
80
+          "联盟": "y"
81
+        },
82
+        "Vue": {
83
+            "vue2": "y",
84
+            "vue3": "y"
85
+        }
86
+      }
87
+    }
88
+  }
89
+}

+ 8
- 0
uni_modules/uni-icons/readme.md Dosyayı Görüntüle

@@ -0,0 +1,8 @@
1
+## Icons 图标
2
+> **组件名:uni-icons**
3
+> 代码块: `uIcons`
4
+
5
+用于展示 icons 图标 。
6
+
7
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons)
8
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 

+ 27
- 0
uni_modules/uni-pagination/changelog.md Dosyayı Görüntüle

@@ -0,0 +1,27 @@
1
+## 1.2.4(2022-09-19)
2
+- 修复,未对主题色设置默认色,导致未引入 uni-scss 变量文件报错。
3
+- 修复,未对移动端当前页文字做主题色适配。
4
+## 1.2.3(2022-09-15)
5
+- 修复未使用 uni-scss 主题色的 bug。
6
+## 1.2.2(2022-07-06)
7
+- 修复 es 语言 i18n 错误
8
+## 1.2.1(2021-11-22)
9
+- 修复 vue3中某些scss变量无法找到的问题
10
+## 1.2.0(2021-11-19)
11
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
12
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-pagination](https://uniapp.dcloud.io/component/uniui/uni-pagination)
13
+## 1.1.2(2021-10-08)
14
+- 修复 current 、value 属性未监听,导致高亮样式失效的 bug
15
+## 1.1.1(2021-08-20)
16
+- 新增 支持国际化
17
+## 1.1.0(2021-07-30)
18
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
19
+## 1.0.7(2021-05-12)
20
+- 新增 组件示例地址
21
+## 1.0.6(2021-04-12)
22
+- 新增 PC 和 移动端适配不同的 ui 
23
+## 1.0.5(2021-02-05)
24
+- 优化 组件引用关系,通过uni_modules引用组件
25
+
26
+## 1.0.4(2021-02-05)
27
+- 调整为uni_modules目录规范

+ 5
- 0
uni_modules/uni-pagination/components/uni-pagination/i18n/en.json Dosyayı Görüntüle

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-pagination.prevText": "prev",
3
+	"uni-pagination.nextText": "next",
4
+	"uni-pagination.piecePerPage": "piece/page"
5
+}

+ 5
- 0
uni_modules/uni-pagination/components/uni-pagination/i18n/es.json Dosyayı Görüntüle

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-pagination.prevText": "anterior",
3
+	"uni-pagination.nextText": "prxima",
4
+	"uni-pagination.piecePerPage": "Art¨ªculo/P¨¢gina"
5
+}

+ 5
- 0
uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json Dosyayı Görüntüle

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-pagination.prevText": "précédente",
3
+	"uni-pagination.nextText": "suivante",
4
+	"uni-pagination.piecePerPage": "Articles/Pages"
5
+}

+ 12
- 0
uni_modules/uni-pagination/components/uni-pagination/i18n/index.js Dosyayı Görüntüle

@@ -0,0 +1,12 @@
1
+import en from './en.json'
2
+import es from './es.json'
3
+import fr from './fr.json'
4
+import zhHans from './zh-Hans.json'
5
+import zhHant from './zh-Hant.json'
6
+export default {
7
+	en,
8
+	es,
9
+	fr,
10
+	'zh-Hans': zhHans,
11
+	'zh-Hant': zhHant
12
+}

+ 5
- 0
uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json Dosyayı Görüntüle

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-pagination.prevText": "上一页",
3
+	"uni-pagination.nextText": "下一页",
4
+	"uni-pagination.piecePerPage": "条/页"
5
+}

+ 5
- 0
uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json Dosyayı Görüntüle

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-pagination.prevText": "上一頁",
3
+	"uni-pagination.nextText": "下一頁",
4
+	"uni-pagination.piecePerPage": "條/頁"
5
+}

+ 465
- 0
uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue Dosyayı Görüntüle

@@ -0,0 +1,465 @@
1
+<template>
2
+	<view class="uni-pagination">
3
+		<!-- #ifndef MP -->
4
+		<picker v-if="showPageSize === true || showPageSize === 'true'" class="select-picker" mode="selector"
5
+			:value="pageSizeIndex" :range="pageSizeRange" @change="pickerChange" @cancel="pickerClick"
6
+			@click.native="pickerClick">
7
+			<button type="default" size="mini" :plain="true">
8
+				<text>{{pageSizeRange[pageSizeIndex]}} {{piecePerPage}}</text>
9
+				<uni-icons class="select-picker-icon" type="arrowdown" size="12" color="#999"></uni-icons>
10
+			</button>
11
+		</picker>
12
+		<!-- #endif -->
13
+		<!-- #ifndef APP-NVUE -->
14
+		<view class="uni-pagination__total is-phone-hide">共 {{ total }} 条</view>
15
+		<!-- #endif -->
16
+		<view class="uni-pagination__btn"
17
+			:class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
18
+			:hover-class="currentIndex === 1 ? '' : 'uni-pagination--hover'" :hover-start-time="20"
19
+			:hover-stay-time="70" @click="clickLeft">
20
+			<template v-if="showIcon === true || showIcon === 'true'">
21
+				<uni-icons color="#666" size="24" type="left" />
22
+			</template>
23
+			<template v-else>
24
+				<text class="uni-pagination__child-btn">{{ prevPageText }}</text>
25
+			</template>
26
+		</view>
27
+		<view class="uni-pagination__num uni-pagination__num-flex-none">
28
+			<view class="uni-pagination__num-current">
29
+				<text class="uni-pagination__num-current-text is-pc-hide current-index-text">{{ currentIndex }}</text>
30
+				<text class="uni-pagination__num-current-text is-pc-hide">/{{ maxPage || 0 }}</text>
31
+				<!-- #ifndef APP-NVUE -->
32
+				<view v-for="(item, index) in paper" :key="index" :class="{ 'page--active': item === currentIndex }"
33
+					class="uni-pagination__num-tag tag--active is-phone-hide" @click.top="selectPage(item, index)">
34
+					<text>{{ item }}</text>
35
+				</view>
36
+				<!-- #endif -->
37
+
38
+			</view>
39
+		</view>
40
+		<view class="uni-pagination__btn"
41
+			:class="currentIndex >= maxPage ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
42
+			:hover-class="currentIndex === maxPage ? '' : 'uni-pagination--hover'" :hover-start-time="20"
43
+			:hover-stay-time="70" @click="clickRight">
44
+			<template v-if="showIcon === true || showIcon === 'true'">
45
+				<uni-icons color="#666" size="24" type="right" />
46
+			</template>
47
+			<template v-else>
48
+				<text class="uni-pagination__child-btn">{{ nextPageText }}</text>
49
+			</template>
50
+		</view>
51
+	</view>
52
+</template>
53
+
54
+<script>
55
+	/**
56
+	 * Pagination 分页器
57
+	 * @description 分页器组件,用于展示页码、请求数据等
58
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=32
59
+	 * @property {String} prevText 左侧按钮文字
60
+	 * @property {String} nextText 右侧按钮文字
61
+	 * @property {String} piecePerPageText 条/页文字
62
+	 * @property {Number} current 当前页
63
+	 * @property {Number} total 数据总量
64
+	 * @property {Number} pageSize 每页数据量
65
+	 * @property {Boolean} showIcon = [true|false] 是否以 icon 形式展示按钮
66
+	 * @property {Boolean} showPageSize = [true|false] 是否展示每页条数
67
+	 * @property {Array} pageSizeRange = [20, 50, 100, 500] 每页条数选框
68
+	 * @event {Function} change 点击页码按钮时触发 ,e={type,current} current为当前页,type值为:next/prev,表示点击的是上一页还是下一个
69
+	 * * @event {Function} pageSizeChange 当前每页条数改变时触发 ,e={pageSize} pageSize 为当前所选的每页条数
70
+	 */
71
+
72
+	import {
73
+		initVueI18n
74
+	} from '@dcloudio/uni-i18n'
75
+	import messages from './i18n/index.js'
76
+	const {
77
+		t
78
+	} = initVueI18n(messages)
79
+	export default {
80
+		name: 'UniPagination',
81
+		emits: ['update:modelValue', 'input', 'change', 'pageSizeChange'],
82
+		props: {
83
+			value: {
84
+				type: [Number, String],
85
+				default: 1
86
+			},
87
+			modelValue: {
88
+				type: [Number, String],
89
+				default: 1
90
+			},
91
+			prevText: {
92
+				type: String,
93
+			},
94
+			nextText: {
95
+				type: String,
96
+			},
97
+			piecePerPageText: {
98
+				type: String
99
+			},
100
+			current: {
101
+				type: [Number, String],
102
+				default: 1
103
+			},
104
+			total: {
105
+				// 数据总量
106
+				type: [Number, String],
107
+				default: 0
108
+			},
109
+			pageSize: {
110
+				// 每页数据量
111
+				type: [Number, String],
112
+				default: 10
113
+			},
114
+			showIcon: {
115
+				// 是否以 icon 形式展示按钮
116
+				type: [Boolean, String],
117
+				default: false
118
+			},
119
+			showPageSize: {
120
+				// 是否以 icon 形式展示按钮
121
+				type: [Boolean, String],
122
+				default: false
123
+			},
124
+			pagerCount: {
125
+				type: Number,
126
+				default: 5
127
+			},
128
+			pageSizeRange: {
129
+				type: Array,
130
+				default: () => [20, 50, 100, 500]
131
+			}
132
+		},
133
+		data() {
134
+			return {
135
+				pageSizeIndex: 0,
136
+				currentIndex: 1,
137
+				paperData: [],
138
+				pickerShow: false
139
+			}
140
+		},
141
+		computed: {
142
+			piecePerPage() {
143
+				return this.piecePerPageText || t('uni-pagination.piecePerPage')
144
+			},
145
+			prevPageText() {
146
+				return this.prevText || t('uni-pagination.prevText')
147
+			},
148
+			nextPageText() {
149
+				return this.nextText || t('uni-pagination.nextText')
150
+			},
151
+			maxPage() {
152
+				let maxPage = 1
153
+				let total = Number(this.total)
154
+				let pageSize = Number(this.pageSize)
155
+				if (total && pageSize) {
156
+					maxPage = Math.ceil(total / pageSize)
157
+				}
158
+				return maxPage
159
+			},
160
+			paper() {
161
+				const num = this.currentIndex
162
+				// TODO 最大页数
163
+				const pagerCount = this.pagerCount
164
+				// const total = 181
165
+				const total = this.total
166
+				const pageSize = this.pageSize
167
+				let totalArr = []
168
+				let showPagerArr = []
169
+				let pagerNum = Math.ceil(total / pageSize)
170
+				for (let i = 0; i < pagerNum; i++) {
171
+					totalArr.push(i + 1)
172
+				}
173
+				showPagerArr.push(1)
174
+				const totalNum = totalArr[totalArr.length - (pagerCount + 1) / 2]
175
+				totalArr.forEach((item, index) => {
176
+					if ((pagerCount + 1) / 2 >= num) {
177
+						if (item < pagerCount + 1 && item > 1) {
178
+							showPagerArr.push(item)
179
+						}
180
+					} else if (num + 2 <= totalNum) {
181
+						if (item > num - (pagerCount + 1) / 2 && item < num + (pagerCount + 1) / 2) {
182
+							showPagerArr.push(item)
183
+						}
184
+					} else {
185
+						if ((item > num - (pagerCount + 1) / 2 || pagerNum - pagerCount < item) && item < totalArr[
186
+								totalArr.length - 1]) {
187
+							showPagerArr.push(item)
188
+						}
189
+					}
190
+				})
191
+				if (pagerNum > pagerCount) {
192
+					if ((pagerCount + 1) / 2 >= num) {
193
+						showPagerArr[showPagerArr.length - 1] = '...'
194
+					} else if (num + 2 <= totalNum) {
195
+						showPagerArr[1] = '...'
196
+						showPagerArr[showPagerArr.length - 1] = '...'
197
+					} else {
198
+						showPagerArr[1] = '...'
199
+					}
200
+					showPagerArr.push(totalArr[totalArr.length - 1])
201
+				} else {
202
+					if ((pagerCount + 1) / 2 >= num) {} else if (num + 2 <= totalNum) {} else {
203
+						showPagerArr.shift()
204
+						showPagerArr.push(totalArr[totalArr.length - 1])
205
+					}
206
+				}
207
+
208
+				return showPagerArr
209
+			}
210
+		},
211
+		watch: {
212
+			current: {
213
+				immediate: true,
214
+				handler(val, old) {
215
+					if (val < 1) {
216
+						this.currentIndex = 1
217
+					} else {
218
+						this.currentIndex = val
219
+					}
220
+				}
221
+			},
222
+			value: {
223
+				immediate: true,
224
+				handler(val) {
225
+					if (Number(this.current) !== 1) return
226
+					if (val < 1) {
227
+						this.currentIndex = 1
228
+					} else {
229
+						this.currentIndex = val
230
+					}
231
+				}
232
+			},
233
+			pageSizeIndex(val) {
234
+				this.$emit('pageSizeChange', this.pageSizeRange[val])
235
+			}
236
+		},
237
+		methods: {
238
+			pickerChange(e) {
239
+				this.pageSizeIndex = e.detail.value
240
+				this.pickerClick()
241
+			},
242
+			pickerClick() {
243
+				// #ifdef H5
244
+				const body = document.querySelector('body')
245
+				if (!body) return
246
+
247
+				const className = 'uni-pagination-picker-show'
248
+				this.pickerShow = !this.pickerShow
249
+
250
+				if (this.pickerShow) {
251
+					body.classList.add(className)
252
+				} else {
253
+					setTimeout(() => body.classList.remove(className), 300)
254
+				}
255
+				// #endif
256
+			},
257
+			// 选择标签
258
+			selectPage(e, index) {
259
+				if (parseInt(e)) {
260
+					this.currentIndex = e
261
+					this.change('current')
262
+				} else {
263
+					let pagerNum = Math.ceil(this.total / this.pageSize)
264
+					// let pagerNum = Math.ceil(181 / this.pageSize)
265
+					// 上一页
266
+					if (index <= 1) {
267
+						if (this.currentIndex - 5 > 1) {
268
+							this.currentIndex -= 5
269
+						} else {
270
+							this.currentIndex = 1
271
+						}
272
+						return
273
+					}
274
+					// 下一页
275
+					if (index >= 6) {
276
+						if (this.currentIndex + 5 > pagerNum) {
277
+							this.currentIndex = pagerNum
278
+						} else {
279
+							this.currentIndex += 5
280
+						}
281
+						return
282
+					}
283
+				}
284
+			},
285
+			clickLeft() {
286
+				if (Number(this.currentIndex) === 1) {
287
+					return
288
+				}
289
+				this.currentIndex -= 1
290
+				this.change('prev')
291
+			},
292
+			clickRight() {
293
+				if (Number(this.currentIndex) >= this.maxPage) {
294
+					return
295
+				}
296
+				this.currentIndex += 1
297
+				this.change('next')
298
+			},
299
+			change(e) {
300
+				this.$emit('input', this.currentIndex)
301
+				this.$emit('update:modelValue', this.currentIndex)
302
+				this.$emit('change', {
303
+					type: e,
304
+					current: this.currentIndex
305
+				})
306
+			}
307
+		}
308
+	}
309
+</script>
310
+
311
+<style lang="scss" scoped>
312
+	$uni-primary: #2979ff !default;
313
+	.uni-pagination {
314
+		/* #ifndef APP-NVUE */
315
+		display: flex;
316
+		/* #endif */
317
+		position: relative;
318
+		overflow: hidden;
319
+		flex-direction: row;
320
+		justify-content: center;
321
+		align-items: center;
322
+	}
323
+
324
+	.uni-pagination__total {
325
+		font-size: 22px;
326
+		color: #999;
327
+		margin-right: 15px;
328
+	}
329
+
330
+	.uni-pagination__btn {
331
+		/* #ifndef APP-NVUE */
332
+		display: flex;
333
+		cursor: pointer;
334
+		/* #endif */
335
+		padding: 0 8px;
336
+		line-height: 30px;
337
+		font-size: 22px;
338
+		position: relative;
339
+		background-color: #F0F0F0;
340
+		flex-direction: row;
341
+		justify-content: center;
342
+		align-items: center;
343
+		text-align: center;
344
+		border-radius: 5px;
345
+		// border-width: 1px;
346
+		// border-style: solid;
347
+		// border-color: $uni-border-color;
348
+	}
349
+
350
+	.uni-pagination__child-btn {
351
+		/* #ifndef APP-NVUE */
352
+		display: flex;
353
+		/* #endif */
354
+		font-size: 22px;
355
+		position: relative;
356
+		flex-direction: row;
357
+		justify-content: center;
358
+		align-items: center;
359
+		text-align: center;
360
+		color: #666;
361
+		font-size: 22px;
362
+	}
363
+
364
+	.uni-pagination__num {
365
+		/* #ifndef APP-NVUE */
366
+		display: flex;
367
+		/* #endif */
368
+		width: 340px;
369
+		flex-direction: row;
370
+		justify-content: center;
371
+		align-items: center;
372
+		height: 30px;
373
+		line-height: 30px;
374
+		font-size: 22px;
375
+		color: #666;
376
+		margin: 0 5px;
377
+	}
378
+
379
+	.uni-pagination__num-tag {
380
+		/* #ifdef H5 */
381
+		cursor: pointer;
382
+		min-width: 40px;
383
+		/* #endif */
384
+		margin: 0 5px;
385
+		height: 30px;
386
+		text-align: center;
387
+		line-height: 30px;
388
+		// border: 1px red solid;
389
+		color: #999;
390
+		border-radius: 4px;
391
+		// border-width: 1px;
392
+		// border-style: solid;
393
+		// border-color: $uni-border-color;
394
+	}
395
+
396
+	.uni-pagination__num-current {
397
+		/* #ifndef APP-NVUE */
398
+		display: flex;
399
+		/* #endif */
400
+		flex-direction: row;
401
+	}
402
+
403
+	.uni-pagination__num-current-text {
404
+		font-size: 22px;
405
+	}
406
+
407
+	.current-index-text{
408
+		color: $uni-primary;
409
+	}
410
+
411
+	.uni-pagination--enabled {
412
+		color: #333333;
413
+		opacity: 1;
414
+	}
415
+
416
+	.uni-pagination--disabled {
417
+		opacity: 0.5;
418
+		/* #ifdef H5 */
419
+		cursor: default;
420
+		/* #endif */
421
+	}
422
+
423
+	.uni-pagination--hover {
424
+		color: rgba(0, 0, 0, 0.6);
425
+		background-color: #eee;
426
+	}
427
+
428
+	.tag--active:hover {
429
+		color: $uni-primary;
430
+	}
431
+
432
+	.page--active {
433
+		color: #fff;
434
+		background-color: $uni-primary;
435
+	}
436
+
437
+	.page--active:hover {
438
+		color: #fff;
439
+	}
440
+
441
+	/* #ifndef APP-NVUE */
442
+	.is-pc-hide {
443
+		display: block;
444
+	}
445
+
446
+	.is-phone-hide {
447
+		display: none;
448
+	}
449
+
450
+	@media screen and (min-width: 450px) {
451
+		.is-pc-hide {
452
+			display: none;
453
+		}
454
+
455
+		.is-phone-hide {
456
+			display: block;
457
+		}
458
+
459
+		.uni-pagination__num-flex-none {
460
+			flex: none;
461
+		}
462
+	}
463
+
464
+	/* #endif */
465
+</style>

+ 83
- 0
uni_modules/uni-pagination/package.json Dosyayı Görüntüle

@@ -0,0 +1,83 @@
1
+{
2
+  "id": "uni-pagination",
3
+  "displayName": "uni-pagination 分页器",
4
+  "version": "1.2.4",
5
+  "description": "Pagination 分页器组件,用于展示页码、请求数据等。",
6
+  "keywords": [
7
+    "uni-ui",
8
+    "uniui",
9
+    "分页器",
10
+    "页码"
11
+],
12
+  "repository": "https://github.com/dcloudio/uni-ui",
13
+  "engines": {
14
+    "HBuilderX": ""
15
+  },
16
+  "directories": {
17
+    "example": "../../temps/example_temps"
18
+  },
19
+"dcloudext": {
20
+    "sale": {
21
+      "regular": {
22
+        "price": "0.00"
23
+      },
24
+      "sourcecode": {
25
+        "price": "0.00"
26
+      }
27
+    },
28
+    "contact": {
29
+      "qq": ""
30
+    },
31
+    "declaration": {
32
+      "ads": "无",
33
+      "data": "无",
34
+      "permissions": "无"
35
+    },
36
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
37
+    "type": "component-vue"
38
+  },
39
+  "uni_modules": {
40
+    "dependencies": ["uni-scss","uni-icons"],
41
+    "encrypt": [],
42
+    "platforms": {
43
+      "cloud": {
44
+        "tcb": "y",
45
+        "aliyun": "y"
46
+      },
47
+      "client": {
48
+        "App": {
49
+          "app-vue": "y",
50
+          "app-nvue": "y"
51
+        },
52
+        "H5-mobile": {
53
+          "Safari": "y",
54
+          "Android Browser": "y",
55
+          "微信浏览器(Android)": "y",
56
+          "QQ浏览器(Android)": "y"
57
+        },
58
+        "H5-pc": {
59
+          "Chrome": "y",
60
+          "IE": "y",
61
+          "Edge": "y",
62
+          "Firefox": "y",
63
+          "Safari": "y"
64
+        },
65
+        "小程序": {
66
+          "微信": "y",
67
+          "阿里": "y",
68
+          "百度": "y",
69
+          "字节跳动": "y",
70
+          "QQ": "y"
71
+        },
72
+        "快应用": {
73
+          "华为": "u",
74
+          "联盟": "u"
75
+        },
76
+        "Vue": {
77
+            "vue2": "y",
78
+            "vue3": "y"
79
+        }
80
+      }
81
+    }
82
+  }
83
+}

+ 11
- 0
uni_modules/uni-pagination/readme.md Dosyayı Görüntüle

@@ -0,0 +1,11 @@
1
+
2
+
3
+## Pagination 分页器
4
+> **组件名:uni-pagination**
5
+> 代码块: `uPagination`
6
+
7
+
8
+分页器组件,用于展示页码、请求数据等。
9
+
10
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination)
11
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 

+ 84
- 0
uni_modules/uni-popup/changelog.md Dosyayı Görüntüle

@@ -0,0 +1,84 @@
1
+## 1.9.1(2024-04-02)
2
+- 修复 uni-popup-dialog vue3下使用value无法进行绑定的bug(双向绑定兼容旧写法)
3
+## 1.9.0(2024-03-28)
4
+- 修复 uni-popup-dialog 双向绑定时初始化逻辑修正
5
+## 1.8.9(2024-03-20)
6
+- 修复 uni-popup-dialog 数据输入时修正为双向绑定
7
+## 1.8.8(2024-02-20)
8
+- 修复 uni-popup 在微信小程序下出现文字向上闪动的bug
9
+## 1.8.7(2024-02-02)
10
+- 新增 uni-popup-dialog 新增属性focus:input模式下,是否自动自动聚焦
11
+## 1.8.6(2024-01-30)
12
+- 新增 uni-popup-dialog 新增属性maxLength:限制输入框字数
13
+## 1.8.5(2024-01-26)
14
+- 新增 uni-popup-dialog 新增属性showClose:控制关闭按钮的显示
15
+## 1.8.4(2023-11-15)
16
+- 新增 uni-popup 支持uni-app-x 注意暂时仅支持 `maskClick` `@open` `@close`
17
+## 1.8.3(2023-04-17)
18
+- 修复 uni-popup 重复打开时的 bug
19
+## 1.8.2(2023-02-02)
20
+- uni-popup-dialog 组件新增 inputType 属性
21
+## 1.8.1(2022-12-01)
22
+- 修复 nvue 下 v-show 报错
23
+## 1.8.0(2022-11-29)
24
+- 优化 主题样式
25
+## 1.7.9(2022-04-02)
26
+- 修复 弹出层内部无法滚动的bug
27
+## 1.7.8(2022-03-28)
28
+- 修复 小程序中高度错误的bug
29
+## 1.7.7(2022-03-17)
30
+- 修复 快速调用open出现问题的Bug
31
+## 1.7.6(2022-02-14)
32
+- 修复 safeArea 属性不能设置为false的bug
33
+## 1.7.5(2022-01-19)
34
+- 修复 isMaskClick 失效的bug
35
+## 1.7.4(2022-01-19)
36
+- 新增 cancelText \ confirmText 属性 ,可自定义文本
37
+- 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色
38
+- 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题
39
+## 1.7.3(2022-01-13)
40
+- 修复 设置 safeArea 属性不生效的bug
41
+## 1.7.2(2021-11-26)
42
+- 优化 组件示例
43
+## 1.7.1(2021-11-26)
44
+- 修复 vuedoc 文字错误
45
+## 1.7.0(2021-11-19)
46
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
47
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup)
48
+## 1.6.2(2021-08-24)
49
+- 新增 支持国际化
50
+## 1.6.1(2021-07-30)
51
+- 优化 vue3下事件警告的问题
52
+## 1.6.0(2021-07-13)
53
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
54
+## 1.5.0(2021-06-23)
55
+- 新增 mask-click 遮罩层点击事件
56
+## 1.4.5(2021-06-22)
57
+- 修复 nvue 平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug
58
+## 1.4.4(2021-06-18)
59
+- 修复 H5平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug
60
+## 1.4.3(2021-06-08)
61
+- 修复 错误的 watch 字段
62
+- 修复 safeArea 属性不生效的问题
63
+- 修复 点击内容,再点击遮罩无法关闭的Bug
64
+## 1.4.2(2021-05-12)
65
+- 新增 组件示例地址
66
+## 1.4.1(2021-04-29)
67
+- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题
68
+## 1.4.0 (2021-04-29)
69
+- 新增 type 属性的 left\right 值,支持左右弹出
70
+- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗
71
+- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色
72
+- 新增 safeArea 属性,是否适配底部安全区
73
+- 修复 App\h5\微信小程序底部安全区占位不对的Bug
74
+- 修复 App 端弹出等待的Bug
75
+- 优化 提升低配设备性能,优化动画卡顿问题
76
+- 优化 更简单的组件自定义方式
77
+## 1.2.9(2021-02-05)
78
+- 优化 组件引用关系,通过uni_modules引用组件
79
+## 1.2.8(2021-02-05)
80
+- 调整为uni_modules目录规范
81
+## 1.2.7(2021-02-05)
82
+- 调整为uni_modules目录规范
83
+- 新增 支持 PC 端
84
+- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端

+ 45
- 0
uni_modules/uni-popup/components/uni-popup-dialog/keypress.js Dosyayı Görüntüle

@@ -0,0 +1,45 @@
1
+// #ifdef H5
2
+export default {
3
+  name: 'Keypress',
4
+  props: {
5
+    disable: {
6
+      type: Boolean,
7
+      default: false
8
+    }
9
+  },
10
+  mounted () {
11
+    const keyNames = {
12
+      esc: ['Esc', 'Escape'],
13
+      tab: 'Tab',
14
+      enter: 'Enter',
15
+      space: [' ', 'Spacebar'],
16
+      up: ['Up', 'ArrowUp'],
17
+      left: ['Left', 'ArrowLeft'],
18
+      right: ['Right', 'ArrowRight'],
19
+      down: ['Down', 'ArrowDown'],
20
+      delete: ['Backspace', 'Delete', 'Del']
21
+    }
22
+    const listener = ($event) => {
23
+      if (this.disable) {
24
+        return
25
+      }
26
+      const keyName = Object.keys(keyNames).find(key => {
27
+        const keyName = $event.key
28
+        const value = keyNames[key]
29
+        return value === keyName || (Array.isArray(value) && value.includes(keyName))
30
+      })
31
+      if (keyName) {
32
+        // 避免和其他按键事件冲突
33
+        setTimeout(() => {
34
+          this.$emit(keyName, {})
35
+        }, 0)
36
+      }
37
+    }
38
+    document.addEventListener('keyup', listener)
39
+    this.$once('hook:beforeDestroy', () => {
40
+      document.removeEventListener('keyup', listener)
41
+    })
42
+  },
43
+	render: () => {}
44
+}
45
+// #endif

+ 316
- 0
uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue Dosyayı Görüntüle

@@ -0,0 +1,316 @@
1
+<template>
2
+	<view class="uni-popup-dialog">
3
+		<view class="uni-dialog-title">
4
+			<text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{titleText}}</text>
5
+		</view>
6
+		<view v-if="mode === 'base'" class="uni-dialog-content">
7
+			<slot>
8
+				<text class="uni-dialog-content-text">{{content}}</text>
9
+			</slot>
10
+		</view>
11
+		<view v-else class="uni-dialog-content">
12
+			<slot>
13
+				<input class="uni-dialog-input" :maxlength="maxlength" v-model="val" :type="inputType"
14
+					:placeholder="placeholderText" :focus="focus">
15
+			</slot>
16
+		</view>
17
+		<view class="uni-dialog-button-group">
18
+			<view class="uni-dialog-button" v-if="showClose" @click="closeDialog">
19
+				<text class="uni-dialog-button-text">{{closeText}}</text>
20
+			</view>
21
+			<view class="uni-dialog-button" :class="showClose?'uni-border-left':''" @click="onOk">
22
+				<text class="uni-dialog-button-text uni-button-color">{{okText}}</text>
23
+			</view>
24
+		</view>
25
+
26
+	</view>
27
+</template>
28
+
29
+<script>
30
+	import popup from '../uni-popup/popup.js'
31
+	import {
32
+		initVueI18n
33
+	} from '@dcloudio/uni-i18n'
34
+	import messages from '../uni-popup/i18n/index.js'
35
+	const {
36
+		t
37
+	} = initVueI18n(messages)
38
+	/**
39
+	 * PopUp 弹出层-对话框样式
40
+	 * @description 弹出层-对话框样式
41
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
42
+	 * @property {String} value input 模式下的默认值
43
+	 * @property {String} placeholder input 模式下输入提示
44
+	 * @property {Boolean} focus input模式下是否自动聚焦,默认为true
45
+	 * @property {String} type = [success|warning|info|error] 主题样式
46
+	 *  @value success 成功
47
+	 * 	@value warning 提示
48
+	 * 	@value info 消息
49
+	 * 	@value error 错误
50
+	 * @property {String} mode = [base|input] 模式、
51
+	 * 	@value base 基础对话框
52
+	 * 	@value input 可输入对话框
53
+	 * @showClose {Boolean} 是否显示关闭按钮
54
+	 * @property {String} content 对话框内容
55
+	 * @property {Boolean} beforeClose 是否拦截取消事件
56
+	 * @property {Number} maxlength 输入
57
+	 * @event {Function} confirm 点击确认按钮触发
58
+	 * @event {Function} close 点击取消按钮触发
59
+	 */
60
+
61
+	export default {
62
+		name: "uniPopupDialog",
63
+		mixins: [popup],
64
+		emits: ['confirm', 'close', 'update:modelValue', 'input'],
65
+		props: {
66
+			inputType: {
67
+				type: String,
68
+				default: 'text'
69
+			},
70
+			showClose: {
71
+				type: Boolean,
72
+				default: true
73
+			},
74
+			// #ifdef VUE2
75
+			value: {
76
+				type: [String, Number],
77
+				default: ''
78
+			},
79
+			// #endif
80
+			// #ifdef VUE3
81
+			modelValue: {
82
+				type: [Number, String],
83
+				default: ''
84
+			},
85
+			// #endif
86
+
87
+
88
+			placeholder: {
89
+				type: [String, Number],
90
+				default: ''
91
+			},
92
+			type: {
93
+				type: String,
94
+				default: 'error'
95
+			},
96
+			mode: {
97
+				type: String,
98
+				default: 'base'
99
+			},
100
+			title: {
101
+				type: String,
102
+				default: ''
103
+			},
104
+			content: {
105
+				type: String,
106
+				default: ''
107
+			},
108
+			beforeClose: {
109
+				type: Boolean,
110
+				default: false
111
+			},
112
+			cancelText: {
113
+				type: String,
114
+				default: ''
115
+			},
116
+			confirmText: {
117
+				type: String,
118
+				default: ''
119
+			},
120
+			maxlength: {
121
+				type: Number,
122
+				default: -1,
123
+			},
124
+			focus: {
125
+				type: Boolean,
126
+				default: true,
127
+			}
128
+		},
129
+		data() {
130
+			return {
131
+				dialogType: 'error',
132
+				val: ""
133
+			}
134
+		},
135
+		computed: {
136
+			okText() {
137
+				return this.confirmText || t("uni-popup.ok")
138
+			},
139
+			closeText() {
140
+				return this.cancelText || t("uni-popup.cancel")
141
+			},
142
+			placeholderText() {
143
+				return this.placeholder || t("uni-popup.placeholder")
144
+			},
145
+			titleText() {
146
+				return this.title || t("uni-popup.title")
147
+			}
148
+		},
149
+		watch: {
150
+			type(val) {
151
+				this.dialogType = val
152
+			},
153
+			mode(val) {
154
+				if (val === 'input') {
155
+					this.dialogType = 'info'
156
+				}
157
+			},
158
+			value(val) {
159
+				if (this.maxlength != -1 && this.mode === 'input') {
160
+					this.val = val.slice(0, this.maxlength);
161
+				} else {
162
+					this.val = val
163
+				}
164
+			},
165
+			val(val) {
166
+				// #ifdef VUE2
167
+				// TODO 兼容 vue2
168
+				this.$emit('input', val);
169
+				// #endif
170
+				// #ifdef VUE3
171
+				// TODO 兼容 vue3
172
+				this.$emit('update:modelValue', val);
173
+				// #endif
174
+			}
175
+		},
176
+		created() {
177
+			// 对话框遮罩不可点击
178
+			this.popup.disableMask()
179
+			// this.popup.closeMask()
180
+			if (this.mode === 'input') {
181
+				this.dialogType = 'info'
182
+				this.val = this.value;
183
+				// #ifdef VUE3
184
+				this.val = this.modelValue;
185
+				// #endif
186
+			} else {
187
+				this.dialogType = this.type
188
+			}
189
+		},
190
+		methods: {
191
+			/**
192
+			 * 点击确认按钮
193
+			 */
194
+			onOk() {
195
+				if (this.mode === 'input') {
196
+					this.$emit('confirm', this.val)
197
+				} else {
198
+					this.$emit('confirm')
199
+				}
200
+				if (this.beforeClose) return
201
+				this.popup.close()
202
+			},
203
+			/**
204
+			 * 点击取消按钮
205
+			 */
206
+			closeDialog() {
207
+				this.$emit('close')
208
+				if (this.beforeClose) return
209
+				this.popup.close()
210
+			},
211
+			close() {
212
+				this.popup.close()
213
+			}
214
+		}
215
+	}
216
+</script>
217
+
218
+<style lang="scss">
219
+	.uni-popup-dialog {
220
+		width: 300px;
221
+		border-radius: 11px;
222
+		background-color: #fff;
223
+	}
224
+
225
+	.uni-dialog-title {
226
+		/* #ifndef APP-NVUE */
227
+		display: flex;
228
+		/* #endif */
229
+		flex-direction: row;
230
+		justify-content: center;
231
+		padding-top: 25px;
232
+	}
233
+
234
+	.uni-dialog-title-text {
235
+		font-size: 20px;
236
+		font-weight: 600;
237
+	}
238
+
239
+	.uni-dialog-content {
240
+		/* #ifndef APP-NVUE */
241
+		display: flex;
242
+		/* #endif */
243
+		flex-direction: row;
244
+		justify-content: center;
245
+		align-items: center;
246
+		padding: 20px;
247
+	}
248
+
249
+	.uni-dialog-content-text {
250
+		font-size: 16px;
251
+		color: #6C6C6C;
252
+	}
253
+
254
+	.uni-dialog-button-group {
255
+		/* #ifndef APP-NVUE */
256
+		display: flex;
257
+		/* #endif */
258
+		flex-direction: row;
259
+		border-top-color: #f5f5f5;
260
+		border-top-style: solid;
261
+		border-top-width: 1px;
262
+	}
263
+
264
+	.uni-dialog-button {
265
+		/* #ifndef APP-NVUE */
266
+		display: flex;
267
+		/* #endif */
268
+
269
+		flex: 1;
270
+		flex-direction: row;
271
+		justify-content: center;
272
+		align-items: center;
273
+		height: 45px;
274
+	}
275
+
276
+	.uni-border-left {
277
+		border-left-color: #f0f0f0;
278
+		border-left-style: solid;
279
+		border-left-width: 1px;
280
+	}
281
+
282
+	.uni-dialog-button-text {
283
+		font-size: 16px;
284
+		color: #333;
285
+	}
286
+
287
+	.uni-button-color {
288
+		color: #007aff;
289
+	}
290
+
291
+	.uni-dialog-input {
292
+		flex: 1;
293
+		font-size: 16px;
294
+		border: 1px #eee solid;
295
+		height: 40px;
296
+		padding: 0 10px;
297
+		border-radius: 5px;
298
+		color: #555;
299
+	}
300
+
301
+	.uni-popup__success {
302
+		color: #4cd964;
303
+	}
304
+
305
+	.uni-popup__warn {
306
+		color: #f0ad4e;
307
+	}
308
+
309
+	.uni-popup__error {
310
+		color: #dd524d;
311
+	}
312
+
313
+	.uni-popup__info {
314
+		color: #909399;
315
+	}
316
+</style>

+ 143
- 0
uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue Dosyayı Görüntüle

@@ -0,0 +1,143 @@
1
+<template>
2
+	<view class="uni-popup-message">
3
+		<view class="uni-popup-message__box fixforpc-width" :class="'uni-popup__'+type">
4
+			<slot>
5
+				<text class="uni-popup-message-text" :class="'uni-popup__'+type+'-text'">{{message}}</text>
6
+			</slot>
7
+		</view>
8
+	</view>
9
+</template>
10
+
11
+<script>
12
+	import popup from '../uni-popup/popup.js'
13
+	/**
14
+	 * PopUp 弹出层-消息提示
15
+	 * @description 弹出层-消息提示
16
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
17
+	 * @property {String} type = [success|warning|info|error] 主题样式
18
+	 *  @value success 成功
19
+	 * 	@value warning 提示
20
+	 * 	@value info 消息
21
+	 * 	@value error 错误
22
+	 * @property {String} message 消息提示文字
23
+	 * @property {String} duration 显示时间,设置为 0 则不会自动关闭
24
+	 */
25
+
26
+	export default {
27
+		name: 'uniPopupMessage',
28
+		mixins:[popup],
29
+		props: {
30
+			/**
31
+			 * 主题 success/warning/info/error	  默认 success
32
+			 */
33
+			type: {
34
+				type: String,
35
+				default: 'success'
36
+			},
37
+			/**
38
+			 * 消息文字
39
+			 */
40
+			message: {
41
+				type: String,
42
+				default: ''
43
+			},
44
+			/**
45
+			 * 显示时间,设置为 0 则不会自动关闭
46
+			 */
47
+			duration: {
48
+				type: Number,
49
+				default: 3000
50
+			},
51
+			maskShow:{
52
+				type:Boolean,
53
+				default:false
54
+			}
55
+		},
56
+		data() {
57
+			return {}
58
+		},
59
+		created() {
60
+			this.popup.maskShow = this.maskShow
61
+			this.popup.messageChild = this
62
+		},
63
+		methods: {
64
+			timerClose(){
65
+				if(this.duration === 0) return
66
+				clearTimeout(this.timer) 
67
+				this.timer = setTimeout(()=>{
68
+					this.popup.close()
69
+				},this.duration)
70
+			}
71
+		}
72
+	}
73
+</script>
74
+<style lang="scss" >
75
+	.uni-popup-message {
76
+		/* #ifndef APP-NVUE */
77
+		display: flex;
78
+		/* #endif */
79
+		flex-direction: row;
80
+		justify-content: center;
81
+	}
82
+
83
+	.uni-popup-message__box {
84
+		background-color: #e1f3d8;
85
+		padding: 10px 15px;
86
+		border-color: #eee;
87
+		border-style: solid;
88
+		border-width: 1px;
89
+		flex: 1;
90
+	}
91
+
92
+	@media screen and (min-width: 500px) {
93
+		.fixforpc-width {
94
+			margin-top: 20px;
95
+			border-radius: 4px;
96
+			flex: none;
97
+			min-width: 380px;
98
+			/* #ifndef APP-NVUE */
99
+			max-width: 50%;
100
+			/* #endif */
101
+			/* #ifdef APP-NVUE */
102
+			max-width: 500px;
103
+			/* #endif */
104
+		}
105
+	}
106
+
107
+	.uni-popup-message-text {
108
+		font-size: 14px;
109
+		padding: 0;
110
+	}
111
+
112
+	.uni-popup__success {
113
+		background-color: #e1f3d8;
114
+	}
115
+
116
+	.uni-popup__success-text {
117
+		color: #67C23A;
118
+	}
119
+
120
+	.uni-popup__warn {
121
+		background-color: #faecd8;
122
+	}
123
+
124
+	.uni-popup__warn-text {
125
+		color: #E6A23C;
126
+	}
127
+
128
+	.uni-popup__error {
129
+		background-color: #fde2e2;
130
+	}
131
+
132
+	.uni-popup__error-text {
133
+		color: #F56C6C;
134
+	}
135
+
136
+	.uni-popup__info {
137
+		background-color: #F2F6FC;
138
+	}
139
+
140
+	.uni-popup__info-text {
141
+		color: #909399;
142
+	}
143
+</style>

+ 187
- 0
uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue Dosyayı Görüntüle

@@ -0,0 +1,187 @@
1
+<template>
2
+	<view class="uni-popup-share">
3
+		<view class="uni-share-title"><text class="uni-share-title-text">{{shareTitleText}}</text></view>
4
+		<view class="uni-share-content">
5
+			<view class="uni-share-content-box">
6
+				<view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)">
7
+					<image class="uni-share-image" :src="item.icon" mode="aspectFill"></image>
8
+					<text class="uni-share-text">{{item.text}}</text>
9
+				</view>
10
+
11
+			</view>
12
+		</view>
13
+		<view class="uni-share-button-box">
14
+			<button class="uni-share-button" @click="close">{{cancelText}}</button>
15
+		</view>
16
+	</view>
17
+</template>
18
+
19
+<script>
20
+	import popup from '../uni-popup/popup.js'
21
+	import {
22
+	initVueI18n
23
+	} from '@dcloudio/uni-i18n'
24
+	import messages from '../uni-popup/i18n/index.js'
25
+	const {	t	} = initVueI18n(messages)
26
+	export default {
27
+		name: 'UniPopupShare',
28
+		mixins:[popup],
29
+		emits:['select'],
30
+		props: {
31
+			title: {
32
+				type: String,
33
+				default: ''
34
+			},
35
+			beforeClose: {
36
+				type: Boolean,
37
+				default: false
38
+			}
39
+		},
40
+		data() {
41
+			return {
42
+				bottomData: [{
43
+						text: '微信',
44
+						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/c2b17470-50be-11eb-b680-7980c8a877b8.png',
45
+						name: 'wx'
46
+					},
47
+					{
48
+						text: '支付宝',
49
+						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png',
50
+						name: 'ali'
51
+					},
52
+					{
53
+						text: 'QQ',
54
+						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/e7a79520-50be-11eb-b997-9918a5dda011.png',
55
+						name: 'qq'
56
+					},
57
+					{
58
+						text: '新浪',
59
+						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/0dacdbe0-50bf-11eb-8ff1-d5dcf8779628.png',
60
+						name: 'sina'
61
+					},
62
+					// {
63
+					// 	text: '百度',
64
+					// 	icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png',
65
+					// 	name: 'copy'
66
+					// },
67
+					// {
68
+					// 	text: '其他',
69
+					// 	icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png',
70
+					// 	name: 'more'
71
+					// }
72
+				]
73
+			}
74
+		},
75
+		created() {},
76
+		computed: {
77
+			cancelText() {
78
+				return t("uni-popup.cancel")
79
+			},
80
+		shareTitleText() {
81
+				return this.title || t("uni-popup.shareTitle")
82
+			}
83
+		},
84
+		methods: {
85
+			/**
86
+			 * 选择内容
87
+			 */
88
+			select(item, index) {
89
+				this.$emit('select', {
90
+					item,
91
+					index
92
+				})
93
+				this.close()
94
+
95
+			},
96
+			/**
97
+			 * 关闭窗口
98
+			 */
99
+			close() {
100
+				if(this.beforeClose) return
101
+				this.popup.close()
102
+			}
103
+		}
104
+	}
105
+</script>
106
+<style lang="scss" >
107
+	.uni-popup-share {
108
+		background-color: #fff;
109
+		border-top-left-radius: 11px;
110
+		border-top-right-radius: 11px;
111
+	}
112
+	.uni-share-title {
113
+		/* #ifndef APP-NVUE */
114
+		display: flex;
115
+		/* #endif */
116
+		flex-direction: row;
117
+		align-items: center;
118
+		justify-content: center;
119
+		height: 40px;
120
+	}
121
+	.uni-share-title-text {
122
+		font-size: 14px;
123
+		color: #666;
124
+	}
125
+	.uni-share-content {
126
+		/* #ifndef APP-NVUE */
127
+		display: flex;
128
+		/* #endif */
129
+		flex-direction: row;
130
+		justify-content: center;
131
+		padding-top: 10px;
132
+	}
133
+
134
+	.uni-share-content-box {
135
+		/* #ifndef APP-NVUE */
136
+		display: flex;
137
+		/* #endif */
138
+		flex-direction: row;
139
+		flex-wrap: wrap;
140
+		width: 360px;
141
+	}
142
+
143
+	.uni-share-content-item {
144
+		width: 90px;
145
+		/* #ifndef APP-NVUE */
146
+		display: flex;
147
+		/* #endif */
148
+		flex-direction: column;
149
+		justify-content: center;
150
+		padding: 10px 0;
151
+		align-items: center;
152
+	}
153
+
154
+	.uni-share-content-item:active {
155
+		background-color: #f5f5f5;
156
+	}
157
+
158
+	.uni-share-image {
159
+		width: 30px;
160
+		height: 30px;
161
+	}
162
+
163
+	.uni-share-text {
164
+		margin-top: 10px;
165
+		font-size: 14px;
166
+		color: #3B4144;
167
+	}
168
+
169
+	.uni-share-button-box {
170
+		/* #ifndef APP-NVUE */
171
+		display: flex;
172
+		/* #endif */
173
+		flex-direction: row;
174
+		padding: 10px 15px;
175
+	}
176
+
177
+	.uni-share-button {
178
+		flex: 1;
179
+		border-radius: 50px;
180
+		color: #666;
181
+		font-size: 16px;
182
+	}
183
+
184
+	.uni-share-button::after {
185
+		border-radius: 50px;
186
+	}
187
+</style>

+ 7
- 0
uni_modules/uni-popup/components/uni-popup/i18n/en.json Dosyayı Görüntüle

@@ -0,0 +1,7 @@
1
+{
2
+	"uni-popup.cancel": "cancel",
3
+	"uni-popup.ok": "ok",
4
+	"uni-popup.placeholder": "pleace enter",
5
+	"uni-popup.title": "Hint",
6
+	"uni-popup.shareTitle": "Share to"
7
+}

+ 8
- 0
uni_modules/uni-popup/components/uni-popup/i18n/index.js Dosyayı Görüntüle

@@ -0,0 +1,8 @@
1
+import en from './en.json'
2
+import zhHans from './zh-Hans.json'
3
+import zhHant from './zh-Hant.json'
4
+export default {
5
+	en,
6
+	'zh-Hans': zhHans,
7
+	'zh-Hant': zhHant
8
+}

+ 7
- 0
uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json Dosyayı Görüntüle

@@ -0,0 +1,7 @@
1
+{
2
+	"uni-popup.cancel": "取消",
3
+	"uni-popup.ok": "确定",
4
+	"uni-popup.placeholder": "请输入",
5
+		"uni-popup.title": "提示",
6
+		"uni-popup.shareTitle": "分享到"
7
+}

+ 7
- 0
uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json Dosyayı Görüntüle

@@ -0,0 +1,7 @@
1
+{
2
+	"uni-popup.cancel": "取消",
3
+	"uni-popup.ok": "確定",
4
+	"uni-popup.placeholder": "請輸入",
5
+	"uni-popup.title": "提示",
6
+	"uni-popup.shareTitle": "分享到"
7
+}

+ 45
- 0
uni_modules/uni-popup/components/uni-popup/keypress.js Dosyayı Görüntüle

@@ -0,0 +1,45 @@
1
+// #ifdef H5
2
+export default {
3
+  name: 'Keypress',
4
+  props: {
5
+    disable: {
6
+      type: Boolean,
7
+      default: false
8
+    }
9
+  },
10
+  mounted () {
11
+    const keyNames = {
12
+      esc: ['Esc', 'Escape'],
13
+      tab: 'Tab',
14
+      enter: 'Enter',
15
+      space: [' ', 'Spacebar'],
16
+      up: ['Up', 'ArrowUp'],
17
+      left: ['Left', 'ArrowLeft'],
18
+      right: ['Right', 'ArrowRight'],
19
+      down: ['Down', 'ArrowDown'],
20
+      delete: ['Backspace', 'Delete', 'Del']
21
+    }
22
+    const listener = ($event) => {
23
+      if (this.disable) {
24
+        return
25
+      }
26
+      const keyName = Object.keys(keyNames).find(key => {
27
+        const keyName = $event.key
28
+        const value = keyNames[key]
29
+        return value === keyName || (Array.isArray(value) && value.includes(keyName))
30
+      })
31
+      if (keyName) {
32
+        // 避免和其他按键事件冲突
33
+        setTimeout(() => {
34
+          this.$emit(keyName, {})
35
+        }, 0)
36
+      }
37
+    }
38
+    document.addEventListener('keyup', listener)
39
+    // this.$once('hook:beforeDestroy', () => {
40
+    //   document.removeEventListener('keyup', listener)
41
+    // })
42
+  },
43
+	render: () => {}
44
+}
45
+// #endif

+ 0
- 0
uni_modules/uni-popup/components/uni-popup/popup.js Dosyayı Görüntüle


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor

Loading…
İptal
Kaydet