lxui-uni 0.0.4 → 0.0.6
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.
- package/components/lx-header/lx-header.vue +4 -3
- package/components/lx-list/lx-list.vue +3 -3
- package/components/lx-operate-bottom/lx-operate-bottom.vue +22 -13
- package/index.ts +39 -9
- package/libs/config/index.ts +13 -0
- package/{util → libs/util}/index.ts +2 -2
- package/package.json +1 -1
- package/types/index.d.ts +25 -0
- package/vite.config.ts +0 -1
- /package/{util/useListLoadClass.ts → libs/hooks/useListLoadClass/index.ts} +0 -0
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
* @date: 2023-07-16 09:32:09
|
|
8
8
|
* @version: V1.0.2
|
|
9
9
|
*/
|
|
10
|
-
import { goToPage } from '../../util'
|
|
11
|
-
import { type CSSProperties, computed,
|
|
10
|
+
import { goToPage } from '../../libs/util'
|
|
11
|
+
import { type CSSProperties, computed, ref, watchEffect } from 'vue'
|
|
12
12
|
|
|
13
13
|
type headerInt = {
|
|
14
|
+
title: string
|
|
14
15
|
// 头部高度 默认为44px (微信小程序不可用)
|
|
15
16
|
headerHeight?: number
|
|
16
17
|
// 是否显示左侧内容
|
|
@@ -20,7 +21,6 @@ type headerInt = {
|
|
|
20
21
|
backgroundColor2?: string
|
|
21
22
|
textColor?: string
|
|
22
23
|
textFontSize?: number
|
|
23
|
-
title: string
|
|
24
24
|
// 是否需要生成和头部高度相同的盒子
|
|
25
25
|
isShowHeaderBox?: boolean
|
|
26
26
|
positionState?: string
|
|
@@ -248,3 +248,4 @@ const backIconW = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAAC
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
</style>
|
|
251
|
+
../../libs/util
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
* @update: 2023-10-13 10:34:03
|
|
17
17
|
* @version: V1.0.1
|
|
18
18
|
*/
|
|
19
|
-
import { LoadData } from '../../
|
|
20
|
-
import { debounce } from '../../util'
|
|
19
|
+
import { LoadData } from '../../libs/hooks/useListLoadClass'
|
|
20
|
+
import { debounce } from '../../libs/util'
|
|
21
21
|
import { toRefs, ref } from 'vue';
|
|
22
22
|
import lxListState from '../lx-list-state/lx-list-state.vue'
|
|
23
23
|
interface listPropsInt {
|
|
@@ -159,4 +159,4 @@ const scrolltolower = () => {
|
|
|
159
159
|
position: absolute;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
</style>
|
|
162
|
+
</style>
|
|
@@ -8,16 +8,17 @@
|
|
|
8
8
|
* @version: V1.0.0
|
|
9
9
|
*/
|
|
10
10
|
interface PropsInt {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
tipType: 'price' | 'discount' | 'custom'
|
|
12
|
+
customTxt?: string
|
|
13
|
+
rightConfirmTxt?: string
|
|
14
|
+
rightCancelTxt?: string
|
|
15
|
+
discount?: string | number
|
|
16
|
+
amount?: string | number
|
|
17
|
+
tip?: string
|
|
16
18
|
}
|
|
17
19
|
withDefaults(defineProps<PropsInt>(), {
|
|
18
|
-
|
|
20
|
+
customTxt: '',
|
|
19
21
|
rightConfirmTxt: '',
|
|
20
|
-
rightCancelTxt: '',
|
|
21
22
|
discount: '',
|
|
22
23
|
amount: ''
|
|
23
24
|
})
|
|
@@ -29,11 +30,16 @@ const cancelClick = () => emit('cancel')
|
|
|
29
30
|
<view class="lx_safety_bottom flex-center-between">
|
|
30
31
|
<view class="bottom_left_box">
|
|
31
32
|
<slot name="left">
|
|
32
|
-
<view class="amount_box flex-center" v-if="
|
|
33
|
+
<view class="amount_box flex-center" v-if="tipType === 'price'">
|
|
34
|
+
<view class="amount_tip">{{ tip }}</view>
|
|
35
|
+
<view class="amount">¥{{ amount }}</view>
|
|
36
|
+
<view class="discount" v-if="discount">¥{{ discount }}</view>
|
|
37
|
+
</view>
|
|
38
|
+
<view class="amount_box flex-center" v-if="tipType === 'discount'">
|
|
33
39
|
<view class="amount">¥{{ amount }}</view>
|
|
34
40
|
<view class="discount">¥{{ discount }}</view>
|
|
35
41
|
</view>
|
|
36
|
-
<view v-if="
|
|
42
|
+
<view v-if="tipType === 'custom' && customTxt" class="left_txt text-ellipsis">{{ customTxt }}</view>
|
|
37
43
|
</slot>
|
|
38
44
|
</view>
|
|
39
45
|
<view class="bottom_right_box">
|
|
@@ -75,15 +81,18 @@ const cancelClick = () => emit('cancel')
|
|
|
75
81
|
// max-width: 70%;
|
|
76
82
|
// 普通文本
|
|
77
83
|
.left_txt {
|
|
78
|
-
font-size: $font-size-
|
|
79
|
-
font-weight:
|
|
84
|
+
font-size: $font-size-36;
|
|
85
|
+
font-weight: 600;
|
|
80
86
|
color: $main-color;
|
|
81
87
|
}
|
|
82
88
|
// 金额+优惠金额
|
|
83
89
|
.amount_box {
|
|
84
|
-
font-size: $font-size-
|
|
90
|
+
font-size: $font-size-36;
|
|
91
|
+
.amount_tip {
|
|
92
|
+
color: #000;
|
|
93
|
+
}
|
|
85
94
|
.amount {
|
|
86
|
-
font-weight:
|
|
95
|
+
font-weight: 600;
|
|
87
96
|
color: $main-color;
|
|
88
97
|
}
|
|
89
98
|
.discount {
|
package/index.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import type { App } from 'vue'
|
|
1
|
+
// import type { App } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
goToPage,
|
|
4
|
+
formatTime,
|
|
5
|
+
debounce,
|
|
6
|
+
throttle,
|
|
7
|
+
saveImgData,
|
|
8
|
+
setClipboardData
|
|
9
|
+
} from './libs/util'
|
|
10
|
+
import config from './libs/config'
|
|
2
11
|
import lxHeader from './components/lx-header/lx-header.vue'
|
|
3
12
|
import lxHello from './components/lx-hello/lx-hello.vue'
|
|
4
13
|
import lxImage from './components/lx-image/lx-image.vue'
|
|
@@ -9,11 +18,32 @@ import lxSubmitBtn from './components/lx-submit-btn/lx-submit-btn.vue'
|
|
|
9
18
|
import lxUpload from './components/lx-upload/lx-upload.vue'
|
|
10
19
|
|
|
11
20
|
export { lxHello, lxImage, lxHeader, lxList, lxListState, lxOperateBottom, lxSubmitBtn, lxUpload }
|
|
12
|
-
const coms = [
|
|
13
|
-
export default {
|
|
14
|
-
install(app: App){
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
21
|
+
// const coms = [lxHello, lxImage, lxHeader, lxList, lxListState, lxOperateBottom, lxSubmitBtn, lxUpload]
|
|
22
|
+
// export default {
|
|
23
|
+
// install(app: App) {
|
|
24
|
+
// coms.forEach((commponent) => {
|
|
25
|
+
// // 将lxHello开头的组件都变为lx-hello将lx后边的组件名都转为小写
|
|
26
|
+
// commponent.name = commponent.name.replace(/^lx/, 'lx-').toLowerCase()
|
|
27
|
+
// app.component(commponent.name as string, commponent)
|
|
28
|
+
// })
|
|
29
|
+
// }
|
|
30
|
+
// }
|
|
31
|
+
|
|
32
|
+
const $util = {
|
|
33
|
+
goToPage,
|
|
34
|
+
formatTime,
|
|
35
|
+
debounce,
|
|
36
|
+
throttle,
|
|
37
|
+
saveImgData,
|
|
38
|
+
setClipboardData,
|
|
39
|
+
config
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
uni.goToPage = goToPage
|
|
43
|
+
uni.$util = $util
|
|
44
|
+
|
|
45
|
+
const install = (Vue: any) => {
|
|
46
|
+
Vue.config.globalProperties.$util = $util
|
|
47
|
+
Vue.config.globalProperties.goToPage = goToPage
|
|
48
|
+
}
|
|
49
|
+
export default { install }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const version = '3'
|
|
2
|
+
|
|
3
|
+
// 开发环境才提示,生产环境不会提示
|
|
4
|
+
if (process.env.NODE_ENV === 'development') {
|
|
5
|
+
console.log(`\n %c lxui-uni V${version} %c https://blog.csdn.net/qq_51091386/article/details/138125947 \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
|
|
6
|
+
}
|
|
7
|
+
const setConfig = (config: any) => {
|
|
8
|
+
console.log(config)
|
|
9
|
+
}
|
|
10
|
+
export default {
|
|
11
|
+
version,
|
|
12
|
+
setConfig
|
|
13
|
+
}
|
|
@@ -41,7 +41,7 @@ export const goToPage = ({ url, mode = 'navigateTo', params = {} }: goToPageInt)
|
|
|
41
41
|
// }
|
|
42
42
|
const queryStr = !isEmpty(params) ? '?' + urlEncode(params) : ''
|
|
43
43
|
const obj = { url: `/${url}${queryStr}` }
|
|
44
|
-
console.log('obj', obj)
|
|
44
|
+
// console.log('obj', obj)
|
|
45
45
|
switch (mode) {
|
|
46
46
|
case 'navigateTo':
|
|
47
47
|
uni.navigateTo(obj)
|
|
@@ -191,7 +191,7 @@ export const isTimeIn = (start: string, end: string) => {
|
|
|
191
191
|
* @returns { void }
|
|
192
192
|
*/
|
|
193
193
|
export const debounce = <T extends (...args: any[]) => any>(fn: T, wait: number = 1000): ((...args: Parameters<T>) => void) => {
|
|
194
|
-
let timer:
|
|
194
|
+
let timer: any
|
|
195
195
|
|
|
196
196
|
return function (this: any, ...args: Parameters<T>) {
|
|
197
197
|
if (timer) clearTimeout(timer)
|
package/package.json
CHANGED
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare module 'lxui-uni' {
|
|
2
|
+
export function install(): void //必要
|
|
3
|
+
type pageMode = 'navigateTo' | 'redirectTo' | 'reLaunch' | 'switchTab'
|
|
4
|
+
interface goToPageInt {
|
|
5
|
+
url: string
|
|
6
|
+
mode?: pageMode
|
|
7
|
+
params?: {
|
|
8
|
+
[key: string]: string | number | boolean
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
global {
|
|
13
|
+
interface Uni {
|
|
14
|
+
goToPage({ url, mode, params }: goToPageInt): void;
|
|
15
|
+
$util: {
|
|
16
|
+
formatTime: any,
|
|
17
|
+
debounce: any,
|
|
18
|
+
throttle: any,
|
|
19
|
+
saveImgData: any,
|
|
20
|
+
setClipboardData: any,
|
|
21
|
+
config: any
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/vite.config.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
File without changes
|