nvue3 1.1.21 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <view class="fixBtn row middle" :style="css">
3
+ <x-icon class="flex1 center" icon="&#xe708;" size="10" color="#333" />
4
+ <x-icon class="flex1 center" icon="&#xe66a;" size="20" color="#333" />
5
+ </view>
6
+ </template>
7
+
8
+ <script setup>
9
+ import { computed } from 'vue';
10
+ const { windowWidth } = uni.getWindowInfo();
11
+
12
+ const css = computed(() => {
13
+ const css = {};
14
+ css.left = (windowWidth - 87 - 14) + 'px';
15
+ css.right = (windowWidth - 7) + 'px';
16
+ return css;
17
+ })
18
+ </script>
19
+
20
+ <style lang="scss" scoped>
21
+ .fixBtn {
22
+ position: fixed;
23
+ z-index: 12345;
24
+ background-color: #ffffff77;
25
+ border-radius: 50px;
26
+ top: 24px;
27
+ width: 87px;
28
+ height: 32px;
29
+ padding: 0 0 0 5px;
30
+ }
31
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nvue3",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "for uniapp & vue3",
5
5
  "main": "src/kernel.js",
6
6
  "scripts": {
package/src/soft.js CHANGED
@@ -54,47 +54,42 @@ export default class {
54
54
  this.appid = base.appId; //这是uniAPP的ID,不是小程序的ID
55
55
  this.version = base.appVersion; //APP的版本号,也就是在manifest中设置的版本号,小程序为提交申核的版本号
56
56
  this.theme = base.theme; //主体色
57
- }
58
- // #endif
59
57
 
60
- // #ifdef MP-WEIXIN || APP || H5
61
- if (!this.singlePage) {
62
58
  const device = uni.getDeviceInfo();
63
59
  this.brand = (device.brand || 'unknow').toLowerCase(); //手机品牌
64
60
  this.model = device.model || 'unknow'; //手机品牌下的型号
65
61
  this.devid = device.deviceId || 'unknow'; //设备唯一编码
66
62
  this.system = device.system || 'unknow'; //操作系统及版本
63
+ }
64
+ // #endif
67
65
 
66
+ // #ifdef MP-WEIXIN || APP || H5
67
+ if (!this.singlePage) {
68
68
  const windows = uni.getWindowInfo();
69
69
  this.size.windowWidth = windows.windowWidth; //可使用窗口宽度
70
70
  this.size.windowHeight = windows.windowHeight; //
71
-
72
71
  this.size.width = windows.windowWidth; //可使用窗口宽度
73
72
  this.size.height = windows.windowHeight;
74
-
75
73
  this.size.screenWidth = windows.screenWidth; //屏幕尺寸
76
74
  this.size.screenHeight = windows.screenHeight;
77
-
78
75
  this.size.top = windows.statusBarHeight || 25; //顶部状态栏高度,css中直接用var(--status-bar-height)
79
76
  this.size.ratio = windows.pixelRatio; //设备像素比
80
-
81
- this.size.navigation = 44; //导航栏高度
82
- this.size.bodyHeight = windows.screenHeight - this.size.top - this.size.navigation; //除去顶部和菜单的高度
83
77
  }
84
78
  else {
85
79
  //单页模式下,只有这个能获取到尺寸
86
80
  const system = uni.getSystemInfoSync();
87
81
  this.size.windowWidth = system.windowWidth; //可使用窗口宽度
88
82
  this.size.windowHeight = system.windowHeight; //
89
- this.size.top = system.statusBarHeight || 26; //顶部状态栏高度
90
- this.size.ratio = system.pixelRatio; //设备像素比
91
- this.size.screenWidth = system.screenWidth; //屏幕尺寸
92
- this.size.screenHeight = system.screenHeight;
93
83
  this.size.width = system.windowWidth; //屏幕尺寸
94
84
  this.size.height = system.windowHeight;
95
- this.size.navigation = 44; //导航栏高度
96
- this.size.bodyHeight = system.screenHeight - this.size.top - this.size.navigation; //除去顶部和菜单的高度
85
+ this.size.screenWidth = system.screenWidth; //屏幕尺寸
86
+ this.size.screenHeight = system.screenHeight;
87
+ this.size.top = system.statusBarHeight || 26; //顶部状态栏高度
88
+ this.size.ratio = system.pixelRatio; //设备像素比
97
89
  }
90
+
91
+ this.size.navigation = 44; //导航栏高度
92
+ this.size.bodyHeight = system.screenHeight - this.size.top - this.size.navigation; //除去顶部和菜单的高度
98
93
  // #endif
99
94
 
100
95
 
@@ -133,7 +128,6 @@ export default class {
133
128
  }
134
129
  //#endif
135
130
 
136
-
137
131
  // #ifdef MP-WEIXIN||MP-ALIPAY||MP-BAIDU||MP-QQ||MP-KUAISHOU
138
132
  const accountInfo = uni.getAccountInfoSync();
139
133
  this.appid = accountInfo.miniProgram.appId; //小程序的appID,抖音、飞书、百度,不支持
@@ -149,21 +143,17 @@ export default class {
149
143
  // #endif
150
144
 
151
145
 
152
- // #ifdef MP-WEIXIN||MP-ALIPAY||MP-BAIDU||MP-TOUTIAO||MP-QQ
153
146
  //胶囊按钮
147
+ // #ifdef MP-WEIXIN||MP-ALIPAY||MP-BAIDU||MP-TOUTIAO||MP-QQ
154
148
  this.size.button = uni.getMenuButtonBoundingClientRect();
155
- this.size.navbar = this.size.button.bottom;
156
149
  // #endif
157
150
 
158
151
  // #ifdef H5
159
- this.size.button = { bottom: 56, height: 32, left: 281, right: 368, top: 24, width: 87 };
160
- this.size.navbar = this.size.button.bottom;
152
+ const { width } = this.size;
153
+ this.size.button = { bottom: 56, height: 32, left: (width - 94), right: (width - 7), top: 24, width: 87 };
161
154
  // #endif
162
- // console.log('this.size.button', this.size.button)
163
155
 
164
156
  // #ifdef APP-PLUS
165
- // console.log('plus.os', plus.os)
166
- // console.log('plus.runtime', plus.runtime)
167
157
  this.os = plus.os.name.toLowerCase(); //操作系统,android或ios
168
158
  this.osver = plus.os.version; //操作系统版本号
169
159
  this.version = import.meta.env.VITE_VERSION; //热更包版本号
@@ -171,11 +161,6 @@ export default class {
171
161
 
172
162
  this.packName = plus.weex.config.env.appName; //包名
173
163
  this.appid = plus.runtime.appid; //如:__UNI__123456
174
- // this.debug = !!plus.weex.config.env.debugMode; //开发环境
175
- // this.option = plus.runtime.arguments;
176
- //调用plus.device.imei、plus.device.imsi、plus.device.uuid 不会触发授权提示框
177
- // console.log('plus.runtimeplus.runtimeplus.runtimeplus.runtime')
178
- // console.log(plus.runtime)
179
164
 
180
165
  if (this.os === 'android') {
181
166
  plus.device.getOAID({