@gmcb/uv-ui 0.2.26
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/CHANGELOG.md +295 -0
- package/LICENSE +21 -0
- package/README.md +164 -0
- package/components/uv-action-sheet/props.js +50 -0
- package/components/uv-action-sheet/uv-action-sheet.vue +280 -0
- package/components/uv-album/uv-album.vue +312 -0
- package/components/uv-alert/props.js +45 -0
- package/components/uv-alert/uv-alert.vue +246 -0
- package/components/uv-avatar/props.js +85 -0
- package/components/uv-avatar/uv-avatar.vue +182 -0
- package/components/uv-avatar-group/props.js +53 -0
- package/components/uv-avatar-group/uv-avatar-group.vue +106 -0
- package/components/uv-back-top/props.js +58 -0
- package/components/uv-back-top/uv-back-top.vue +116 -0
- package/components/uv-badge/props.js +73 -0
- package/components/uv-badge/uv-badge.vue +176 -0
- package/components/uv-button/nvue.scss +46 -0
- package/components/uv-button/props.js +163 -0
- package/components/uv-button/uv-button.vue +529 -0
- package/components/uv-button/vue.scss +93 -0
- package/components/uv-calendar/calendar.js +546 -0
- package/components/uv-calendar/header.vue +104 -0
- package/components/uv-calendar/month.vue +616 -0
- package/components/uv-calendar/props.js +145 -0
- package/components/uv-calendar/uv-calendar.vue +390 -0
- package/components/uv-calendars/calendar-body.vue +376 -0
- package/components/uv-calendars/calendar-item.vue +248 -0
- package/components/uv-calendars/calendar.js +546 -0
- package/components/uv-calendars/i18n/en.json +12 -0
- package/components/uv-calendars/i18n/index.js +8 -0
- package/components/uv-calendars/i18n/zh-Hans.json +12 -0
- package/components/uv-calendars/i18n/zh-Hant.json +12 -0
- package/components/uv-calendars/util.js +435 -0
- package/components/uv-calendars/uv-calendars.vue +452 -0
- package/components/uv-cell/props.js +116 -0
- package/components/uv-cell/uv-cell.vue +209 -0
- package/components/uv-cell-group/props.js +15 -0
- package/components/uv-cell-group/uv-cell-group.vue +63 -0
- package/components/uv-checkbox/props.js +70 -0
- package/components/uv-checkbox/uv-checkbox.vue +371 -0
- package/components/uv-checkbox-group/props.js +84 -0
- package/components/uv-checkbox-group/uv-checkbox-group.vue +119 -0
- package/components/uv-code/props.js +35 -0
- package/components/uv-code/uv-code.vue +136 -0
- package/components/uv-code-input/props.js +83 -0
- package/components/uv-code-input/uv-code-input.vue +272 -0
- package/components/uv-col/props.js +30 -0
- package/components/uv-col/uv-col.vue +165 -0
- package/components/uv-collapse/props.js +20 -0
- package/components/uv-collapse/uv-collapse.vue +86 -0
- package/components/uv-collapse-item/props.js +60 -0
- package/components/uv-collapse-item/uv-collapse-item.vue +228 -0
- package/components/uv-column-notice/props.js +61 -0
- package/components/uv-column-notice/uv-column-notice.vue +176 -0
- package/components/uv-count-down/props.js +25 -0
- package/components/uv-count-down/utils.js +62 -0
- package/components/uv-count-down/uv-count-down.vue +169 -0
- package/components/uv-count-to/props.js +60 -0
- package/components/uv-count-to/uv-count-to.vue +187 -0
- package/components/uv-datetime-picker/props.js +130 -0
- package/components/uv-datetime-picker/uv-datetime-picker.vue +355 -0
- package/components/uv-divider/props.js +45 -0
- package/components/uv-divider/uv-divider.vue +113 -0
- package/components/uv-drop-down/uv-drop-down.vue +135 -0
- package/components/uv-drop-down-item/uv-drop-down-item.vue +169 -0
- package/components/uv-drop-down-popup/uv-drop-down-popup.vue +242 -0
- package/components/uv-empty/props.js +60 -0
- package/components/uv-empty/uv-empty.vue +126 -0
- package/components/uv-form/props.js +46 -0
- package/components/uv-form/uv-form.vue +209 -0
- package/components/uv-form/valid.js +1343 -0
- package/components/uv-form-item/props.js +49 -0
- package/components/uv-form-item/uv-form-item.vue +226 -0
- package/components/uv-gap/props.js +25 -0
- package/components/uv-gap/uv-gap.vue +36 -0
- package/components/uv-grid/props.js +20 -0
- package/components/uv-grid/uv-grid.vue +100 -0
- package/components/uv-grid-item/props.js +15 -0
- package/components/uv-grid-item/uv-grid-item.vue +223 -0
- package/components/uv-icon/icons.js +160 -0
- package/components/uv-icon/props.js +90 -0
- package/components/uv-icon/uv-icon.vue +226 -0
- package/components/uv-icon/uvicons.ttf +0 -0
- package/components/uv-image/props.js +100 -0
- package/components/uv-image/uv-image.vue +296 -0
- package/components/uv-index-anchor/props.js +30 -0
- package/components/uv-index-anchor/uv-index-anchor.vue +98 -0
- package/components/uv-index-item/uv-index-item.vue +87 -0
- package/components/uv-index-list/props.js +30 -0
- package/components/uv-index-list/uv-index-list.vue +461 -0
- package/components/uv-input/props.js +175 -0
- package/components/uv-input/uv-input.vue +348 -0
- package/components/uv-keyboard/props.js +95 -0
- package/components/uv-keyboard/uv-keyboard.vue +180 -0
- package/components/uv-keyboard-car/props.js +24 -0
- package/components/uv-keyboard-car/uv-keyboard-car.vue +347 -0
- package/components/uv-keyboard-number/props.js +19 -0
- package/components/uv-keyboard-number/uv-keyboard-number.vue +201 -0
- package/components/uv-line/props.js +34 -0
- package/components/uv-line/uv-line.vue +60 -0
- package/components/uv-line-progress/props.js +29 -0
- package/components/uv-line-progress/uv-line-progress.vue +146 -0
- package/components/uv-link/props.js +40 -0
- package/components/uv-link/uv-link.vue +83 -0
- package/components/uv-list/uv-list.vue +147 -0
- package/components/uv-list-item/uv-list-item.vue +535 -0
- package/components/uv-load-more/props.js +95 -0
- package/components/uv-load-more/uv-load-more.vue +152 -0
- package/components/uv-loading-icon/props.js +67 -0
- package/components/uv-loading-icon/uv-loading-icon.vue +347 -0
- package/components/uv-loading-page/props.js +55 -0
- package/components/uv-loading-page/uv-loading-page.vue +96 -0
- package/components/uv-modal/props.js +90 -0
- package/components/uv-modal/uv-modal.vue +245 -0
- package/components/uv-navbar/props.js +89 -0
- package/components/uv-navbar/uv-navbar.vue +245 -0
- package/components/uv-no-network/props.js +20 -0
- package/components/uv-no-network/uv-no-network.vue +222 -0
- package/components/uv-notice-bar/props.js +76 -0
- package/components/uv-notice-bar/uv-notice-bar.vue +110 -0
- package/components/uv-notify/props.js +45 -0
- package/components/uv-notify/uv-notify.vue +220 -0
- package/components/uv-number-box/props.js +118 -0
- package/components/uv-number-box/uv-number-box.vue +397 -0
- package/components/uv-overlay/props.js +25 -0
- package/components/uv-overlay/uv-overlay.vue +85 -0
- package/components/uv-parse/node/node.vue +576 -0
- package/components/uv-parse/parser.js +1335 -0
- package/components/uv-parse/uv-parse.vue +498 -0
- package/components/uv-pick-color/colors.js +217 -0
- package/components/uv-pick-color/props.js +47 -0
- package/components/uv-pick-color/uv-pick-color.vue +551 -0
- package/components/uv-picker/props.js +95 -0
- package/components/uv-picker/uv-picker.vue +329 -0
- package/components/uv-popup/keypress.js +45 -0
- package/components/uv-popup/uv-popup.vue +537 -0
- package/components/uv-preview-video/uv-preview-video.vue +52 -0
- package/components/uv-qrcode/cache.js +1 -0
- package/components/uv-qrcode/gcanvas/bridge/bridge-weex.js +241 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleLinearGradient.js +18 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStylePattern.js +8 -0
- package/components/uv-qrcode/gcanvas/context-2d/FillStyleRadialGradient.js +17 -0
- package/components/uv-qrcode/gcanvas/context-2d/RenderingContext.js +666 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ActiveInfo.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Buffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Framebuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLenum.js +298 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLmethod.js +142 -0
- package/components/uv-qrcode/gcanvas/context-webgl/GLtype.js +23 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Program.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Renderbuffer.js +21 -0
- package/components/uv-qrcode/gcanvas/context-webgl/RenderingContext.js +1191 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Shader.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/ShaderPrecisionFormat.js +11 -0
- package/components/uv-qrcode/gcanvas/context-webgl/Texture.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/UniformLocation.js +22 -0
- package/components/uv-qrcode/gcanvas/context-webgl/classUtils.js +3 -0
- package/components/uv-qrcode/gcanvas/env/canvas.js +74 -0
- package/components/uv-qrcode/gcanvas/env/image.js +96 -0
- package/components/uv-qrcode/gcanvas/env/tool.js +24 -0
- package/components/uv-qrcode/gcanvas/index.js +39 -0
- package/components/uv-qrcode/props.js +85 -0
- package/components/uv-qrcode/qrcode.js +34 -0
- package/components/uv-qrcode/queue.js +41 -0
- package/components/uv-qrcode/uv-qrcode.vue +1038 -0
- package/components/uv-radio/props.js +65 -0
- package/components/uv-radio/uv-radio.vue +349 -0
- package/components/uv-radio-group/props.js +89 -0
- package/components/uv-radio-group/uv-radio-group.vue +115 -0
- package/components/uv-rate/props.js +73 -0
- package/components/uv-rate/uv-rate.vue +274 -0
- package/components/uv-read-more/props.js +62 -0
- package/components/uv-read-more/uv-read-more.vue +162 -0
- package/components/uv-row/props.js +20 -0
- package/components/uv-row/uv-row.vue +95 -0
- package/components/uv-row-notice/props.js +40 -0
- package/components/uv-row-notice/uv-row-notice.vue +341 -0
- package/components/uv-safe-bottom/uv-safe-bottom.vue +67 -0
- package/components/uv-scroll-list/nvue.js +29 -0
- package/components/uv-scroll-list/props.js +35 -0
- package/components/uv-scroll-list/scrollWxs.wxs +51 -0
- package/components/uv-scroll-list/uv-scroll-list.vue +218 -0
- package/components/uv-search/props.js +127 -0
- package/components/uv-search/uv-search.vue +311 -0
- package/components/uv-skeleton/props.js +65 -0
- package/components/uv-skeleton/uv-skeleton.vue +250 -0
- package/components/uv-skeletons/uv-skeletons.vue +247 -0
- package/components/uv-slider/props.js +58 -0
- package/components/uv-slider/uv-slider.vue +58 -0
- package/components/uv-status-bar/props.js +8 -0
- package/components/uv-status-bar/uv-status-bar.vue +54 -0
- package/components/uv-steps/props.js +40 -0
- package/components/uv-steps/uv-steps.vue +83 -0
- package/components/uv-steps-item/props.js +25 -0
- package/components/uv-steps-item/uv-steps-item.vue +347 -0
- package/components/uv-sticky/props.js +41 -0
- package/components/uv-sticky/uv-sticky.vue +223 -0
- package/components/uv-subsection/props.js +54 -0
- package/components/uv-subsection/uv-subsection.vue +269 -0
- package/components/uv-swipe-action/props.js +10 -0
- package/components/uv-swipe-action/uv-swipe-action.vue +65 -0
- package/components/uv-swipe-action-item/index - backup.wxs +256 -0
- package/components/uv-swipe-action-item/index.wxs +225 -0
- package/components/uv-swipe-action-item/nvue - backup.js +264 -0
- package/components/uv-swipe-action-item/nvue.js +182 -0
- package/components/uv-swipe-action-item/props.js +40 -0
- package/components/uv-swipe-action-item/uv-swipe-action-item.vue +200 -0
- package/components/uv-swipe-action-item/wxs.js +15 -0
- package/components/uv-swiper/props.js +136 -0
- package/components/uv-swiper/uv-swiper.vue +263 -0
- package/components/uv-swiper-indicator/props.js +30 -0
- package/components/uv-swiper-indicator/uv-swiper-indicator.vue +112 -0
- package/components/uv-switch/props.js +58 -0
- package/components/uv-switch/uv-switch.vue +182 -0
- package/components/uv-tabbar/props.js +50 -0
- package/components/uv-tabbar/uv-tabbar.vue +146 -0
- package/components/uv-tabbar-item/props.js +40 -0
- package/components/uv-tabbar-item/uv-tabbar-item.vue +146 -0
- package/components/uv-tabs/props.js +71 -0
- package/components/uv-tabs/uv-tabs.vue +391 -0
- package/components/uv-tags/props.js +104 -0
- package/components/uv-tags/uv-tags.vue +379 -0
- package/components/uv-text/props.js +113 -0
- package/components/uv-text/uv-text.vue +218 -0
- package/components/uv-text/value.js +87 -0
- package/components/uv-textarea/props.js +138 -0
- package/components/uv-textarea/uv-textarea.vue +238 -0
- package/components/uv-toast/uv-toast.vue +292 -0
- package/components/uv-toolbar/props.js +40 -0
- package/components/uv-toolbar/uv-toolbar.vue +109 -0
- package/components/uv-tooltip/props.js +60 -0
- package/components/uv-tooltip/uv-tooltip.vue +372 -0
- package/components/uv-transition/createAnimation.js +131 -0
- package/components/uv-transition/props.js +31 -0
- package/components/uv-transition/uv-transition.vue +320 -0
- package/components/uv-upload/mixin.js +22 -0
- package/components/uv-upload/props.js +130 -0
- package/components/uv-upload/utils.js +151 -0
- package/components/uv-upload/uv-upload.vue +488 -0
- package/components/uv-vtabs/props.js +79 -0
- package/components/uv-vtabs/uv-vtabs.vue +438 -0
- package/components/uv-vtabs-item/uv-vtabs-item.vue +68 -0
- package/components/uv-waterfall/props.js +69 -0
- package/components/uv-waterfall/uv-waterfall.vue +265 -0
- package/index.js +82 -0
- package/index.scss +7 -0
- package/libs/config/config.js +34 -0
- package/libs/css/color.scss +32 -0
- package/libs/css/common.scss +100 -0
- package/libs/css/components.scss +23 -0
- package/libs/css/variable.scss +111 -0
- package/libs/css/vue.scss +40 -0
- package/libs/function/colorGradient.js +134 -0
- package/libs/function/compress.js +27 -0
- package/libs/function/debounce.js +29 -0
- package/libs/function/digit.js +167 -0
- package/libs/function/index.js +734 -0
- package/libs/function/platform.js +75 -0
- package/libs/function/test.js +287 -0
- package/libs/function/throttle.js +30 -0
- package/libs/luch-request/adapters/index.js +132 -0
- package/libs/luch-request/core/InterceptorManager.js +51 -0
- package/libs/luch-request/core/Request.js +201 -0
- package/libs/luch-request/core/buildFullPath.js +20 -0
- package/libs/luch-request/core/defaults.js +33 -0
- package/libs/luch-request/core/dispatchRequest.js +6 -0
- package/libs/luch-request/core/mergeConfig.js +126 -0
- package/libs/luch-request/core/settle.js +16 -0
- package/libs/luch-request/helpers/buildURL.js +64 -0
- package/libs/luch-request/helpers/combineURLs.js +14 -0
- package/libs/luch-request/helpers/isAbsoluteURL.js +14 -0
- package/libs/luch-request/index.d.ts +197 -0
- package/libs/luch-request/index.js +2 -0
- package/libs/luch-request/utils/clone.js +264 -0
- package/libs/luch-request/utils.js +135 -0
- package/libs/mixin/button.js +13 -0
- package/libs/mixin/mixin.js +172 -0
- package/libs/mixin/mpMixin.js +8 -0
- package/libs/mixin/mpShare.js +13 -0
- package/libs/mixin/openType.js +47 -0
- package/libs/mixin/touch.js +59 -0
- package/libs/util/dayjs.js +216 -0
- package/libs/util/route.js +126 -0
- package/package.json +28 -0
- package/theme.scss +43 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="uv-line-progress"
|
|
4
|
+
:style="[$uv.addStyle(customStyle)]"
|
|
5
|
+
>
|
|
6
|
+
<view
|
|
7
|
+
class="uv-line-progress__background"
|
|
8
|
+
ref="uv-line-progress__background"
|
|
9
|
+
:style="[{
|
|
10
|
+
backgroundColor: inactiveColor,
|
|
11
|
+
height: $uv.addUnit($uv.getPx(height))
|
|
12
|
+
}]"
|
|
13
|
+
>
|
|
14
|
+
</view>
|
|
15
|
+
<view
|
|
16
|
+
class="uv-line-progress__line"
|
|
17
|
+
:style="[progressStyle]"
|
|
18
|
+
>
|
|
19
|
+
<slot>
|
|
20
|
+
<text v-if="showText && percentage >= 10" class="uv-line-progress__text">{{innserPercentage + '%'}}</text>
|
|
21
|
+
</slot>
|
|
22
|
+
</view>
|
|
23
|
+
</view>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
28
|
+
import mixin from '../../libs/mixin/mixin.js'
|
|
29
|
+
import props from './props.js';
|
|
30
|
+
// #ifdef APP-NVUE
|
|
31
|
+
const dom = uni.requireNativePlugin('dom')
|
|
32
|
+
// #endif
|
|
33
|
+
/**
|
|
34
|
+
* lineProgress 线型进度条
|
|
35
|
+
* @description 展示操作或任务的当前进度,比如上传文件,是一个线形的进度条。
|
|
36
|
+
* @tutorial https://www.uvui.cn/components/lineProgress.html
|
|
37
|
+
* @property {String} activeColor 激活部分的颜色 ( 默认 '#19be6b' )
|
|
38
|
+
* @property {String} inactiveColor 背景色 ( 默认 '#ececec' )
|
|
39
|
+
* @property {String | Number} percentage 进度百分比,数值 ( 默认 0 )
|
|
40
|
+
* @property {Boolean} showText 是否在进度条内部显示百分比的值 ( 默认 true )
|
|
41
|
+
* @property {String | Number} height 进度条的高度,单位px ( 默认 12 )
|
|
42
|
+
*
|
|
43
|
+
* @example <uv-line-progress :percent="70" :show-percent="true"></uv-line-progress>
|
|
44
|
+
*/
|
|
45
|
+
export default {
|
|
46
|
+
name: "uv-line-progress",
|
|
47
|
+
mixins: [mpMixin, mixin, props],
|
|
48
|
+
data() {
|
|
49
|
+
return {
|
|
50
|
+
lineWidth: 0,
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
watch: {
|
|
54
|
+
percentage(n) {
|
|
55
|
+
this.resizeProgressWidth()
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
computed: {
|
|
59
|
+
progressStyle() {
|
|
60
|
+
let style = {}
|
|
61
|
+
style.width = this.lineWidth
|
|
62
|
+
style.backgroundColor = this.activeColor
|
|
63
|
+
style.height = this.$uv.addUnit(this.$uv.getPx(this.height))
|
|
64
|
+
return style
|
|
65
|
+
},
|
|
66
|
+
innserPercentage() {
|
|
67
|
+
// 控制范围在0-100之间
|
|
68
|
+
return this.$uv.range(0, 100, this.percentage)
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
mounted() {
|
|
72
|
+
this.init()
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
init() {
|
|
76
|
+
this.$uv.sleep(20).then(() => {
|
|
77
|
+
this.resizeProgressWidth()
|
|
78
|
+
})
|
|
79
|
+
},
|
|
80
|
+
getProgressWidth() {
|
|
81
|
+
// #ifndef APP-NVUE
|
|
82
|
+
return this.$uvGetRect('.uv-line-progress__background')
|
|
83
|
+
// #endif
|
|
84
|
+
|
|
85
|
+
// #ifdef APP-NVUE
|
|
86
|
+
// 返回一个promise
|
|
87
|
+
return new Promise(resolve => {
|
|
88
|
+
dom.getComponentRect(this.$refs['uv-line-progress__background'], (res) => {
|
|
89
|
+
resolve(res.size)
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
// #endif
|
|
93
|
+
},
|
|
94
|
+
resizeProgressWidth() {
|
|
95
|
+
this.getProgressWidth().then(size => {
|
|
96
|
+
const {
|
|
97
|
+
width
|
|
98
|
+
} = size
|
|
99
|
+
// 通过设置的percentage值,计算其所占总长度的百分比
|
|
100
|
+
this.lineWidth = width * this.innserPercentage / 100 + 'px'
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<style lang="scss" scoped>
|
|
108
|
+
@import '../../libs/css/components.scss';
|
|
109
|
+
|
|
110
|
+
.uv-line-progress {
|
|
111
|
+
align-items: stretch;
|
|
112
|
+
position: relative;
|
|
113
|
+
@include flex(row);
|
|
114
|
+
flex: 1;
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
border-radius: 100px;
|
|
117
|
+
|
|
118
|
+
&__background {
|
|
119
|
+
background-color: #ececec;
|
|
120
|
+
border-radius: 100px;
|
|
121
|
+
flex: 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&__line {
|
|
125
|
+
position: absolute;
|
|
126
|
+
top: 0;
|
|
127
|
+
left: 0;
|
|
128
|
+
bottom: 0;
|
|
129
|
+
align-items: center;
|
|
130
|
+
@include flex(row);
|
|
131
|
+
color: #ffffff;
|
|
132
|
+
border-radius: 100px;
|
|
133
|
+
transition: width 0.5s ease;
|
|
134
|
+
justify-content: flex-end;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&__text {
|
|
138
|
+
font-size: 10px;
|
|
139
|
+
align-items: center;
|
|
140
|
+
text-align: right;
|
|
141
|
+
color: #FFFFFF;
|
|
142
|
+
margin-right: 5px;
|
|
143
|
+
transform: scale(0.9);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
// 文字颜色
|
|
4
|
+
color: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: ''
|
|
7
|
+
},
|
|
8
|
+
// 字体大小,单位px
|
|
9
|
+
fontSize: {
|
|
10
|
+
type: [String, Number],
|
|
11
|
+
default: 14
|
|
12
|
+
},
|
|
13
|
+
// 是否显示下划线
|
|
14
|
+
underLine: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
// 要跳转的链接
|
|
19
|
+
href: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ''
|
|
22
|
+
},
|
|
23
|
+
// 小程序中复制到粘贴板的提示语
|
|
24
|
+
mpTips: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: '链接已复制,请在浏览器打开'
|
|
27
|
+
},
|
|
28
|
+
// 下划线颜色
|
|
29
|
+
lineColor: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
// 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
|
|
34
|
+
text: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ''
|
|
37
|
+
},
|
|
38
|
+
...uni.$uv?.props?.link
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<text
|
|
3
|
+
class="uv-link"
|
|
4
|
+
@tap.stop="openLink"
|
|
5
|
+
:style="[linkStyle, $uv.addStyle(customStyle)]"
|
|
6
|
+
>{{text}}</text>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
11
|
+
import mixin from '../../libs/mixin/mixin.js'
|
|
12
|
+
import props from './props.js';
|
|
13
|
+
/**
|
|
14
|
+
* link 超链接
|
|
15
|
+
* @description 该组件为超链接组件,在不同平台有不同表现形式:在APP平台会通过plus环境打开内置浏览器,在小程序中把链接复制到粘贴板,同时提示信息,在H5中通过window.open打开链接。
|
|
16
|
+
* @tutorial https://www.uvui.cn/components/link.html
|
|
17
|
+
* @property {String} color 文字颜色 (默认 color['uv-primary'] )
|
|
18
|
+
* @property {String | Number} fontSize 字体大小,单位px (默认 15 )
|
|
19
|
+
* @property {Boolean} underLine 是否显示下划线 (默认 false )
|
|
20
|
+
* @property {String} href 跳转的链接,要带上http(s)
|
|
21
|
+
* @property {String} mpTips 各个小程序平台把链接复制到粘贴板后的提示语(默认“链接已复制,请在浏览器打开”)
|
|
22
|
+
* @property {String} lineColor 下划线颜色,默认同color参数颜色
|
|
23
|
+
* @property {String} text 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
|
|
24
|
+
* @property {Object} customStyle 定义需要用到的外部样式
|
|
25
|
+
*
|
|
26
|
+
* @example <uv-link href="http://www.uvui.cn">蜀道难,难于上青天</uv-link>
|
|
27
|
+
*/
|
|
28
|
+
export default {
|
|
29
|
+
name: "uv-link",
|
|
30
|
+
emits:['click'],
|
|
31
|
+
mixins: [mpMixin, mixin, props],
|
|
32
|
+
computed: {
|
|
33
|
+
linkStyle() {
|
|
34
|
+
const style = {
|
|
35
|
+
color: this.color,
|
|
36
|
+
fontSize: this.$uv.addUnit(this.fontSize),
|
|
37
|
+
// line-height设置为比字体大小多2px
|
|
38
|
+
lineHeight: this.$uv.addUnit(this.$uv.getPx(this.fontSize) + 2),
|
|
39
|
+
textDecoration: this.underLine ? 'underline' : 'none'
|
|
40
|
+
}
|
|
41
|
+
return style
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
openLink() {
|
|
46
|
+
// #ifdef APP-PLUS
|
|
47
|
+
plus.runtime.openURL(this.href)
|
|
48
|
+
// #endif
|
|
49
|
+
// #ifdef H5
|
|
50
|
+
window.open(this.href)
|
|
51
|
+
// #endif
|
|
52
|
+
// #ifdef MP
|
|
53
|
+
uni.setClipboardData({
|
|
54
|
+
data: this.href,
|
|
55
|
+
success: () => {
|
|
56
|
+
uni.hideToast();
|
|
57
|
+
this.$nextTick(() => {
|
|
58
|
+
this.$uv.toast(this.mpTips);
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// #endif
|
|
63
|
+
this.$emit('click')
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style lang="scss" scoped>
|
|
70
|
+
@import '../../libs/css/components.scss';
|
|
71
|
+
@import '../../libs/css/color.scss';
|
|
72
|
+
$uv-link-line-height:1 !default;
|
|
73
|
+
|
|
74
|
+
.uv-link {
|
|
75
|
+
/* #ifndef APP-NVUE */
|
|
76
|
+
line-height: $uv-link-line-height;
|
|
77
|
+
/* #endif */
|
|
78
|
+
@include flex;
|
|
79
|
+
flex-wrap: wrap;
|
|
80
|
+
flex: 1;
|
|
81
|
+
color: $uv-primary;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- #ifndef APP-NVUE -->
|
|
3
|
+
<view
|
|
4
|
+
class="uv-list"
|
|
5
|
+
:style="[$uv.addStyle(customStyle)]"
|
|
6
|
+
>
|
|
7
|
+
<view
|
|
8
|
+
v-if="border"
|
|
9
|
+
class="uv-list--border-top"
|
|
10
|
+
:style="[{ 'background-color': borderColor }]"
|
|
11
|
+
></view>
|
|
12
|
+
<slot />
|
|
13
|
+
<view
|
|
14
|
+
v-if="border"
|
|
15
|
+
class="uv-list--border-bottom"
|
|
16
|
+
:style="[{ 'background-color': borderColor }]"
|
|
17
|
+
></view>
|
|
18
|
+
</view>
|
|
19
|
+
<!-- #endif -->
|
|
20
|
+
<!-- #ifdef APP-NVUE -->
|
|
21
|
+
<list
|
|
22
|
+
:bounce="true"
|
|
23
|
+
:scrollable="true"
|
|
24
|
+
show-scrollbar
|
|
25
|
+
:render-reverse="false"
|
|
26
|
+
class="uv-list"
|
|
27
|
+
:class="{ 'uv-list--border': border }"
|
|
28
|
+
:style="[
|
|
29
|
+
{ 'border-top-color': borderColor, 'border-bottom-color':borderColor },
|
|
30
|
+
$uv.addStyle(customStyle)
|
|
31
|
+
]"
|
|
32
|
+
:enableBackToTop="false"
|
|
33
|
+
:loadmoreoffset="15"
|
|
34
|
+
@scroll="scroll"
|
|
35
|
+
@loadmore="loadMore">
|
|
36
|
+
<slot />
|
|
37
|
+
</list>
|
|
38
|
+
<!-- #endif -->
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
43
|
+
import mixin from '../../libs/mixin/mixin.js'
|
|
44
|
+
/**
|
|
45
|
+
* List 列表
|
|
46
|
+
* @description 列表组件
|
|
47
|
+
* @tutorial https://www.uvui.cn/components/list.html
|
|
48
|
+
* @property {Boolean} border = [true|false] 是否显示边框
|
|
49
|
+
* @property {String} borderColor 边框颜色
|
|
50
|
+
* @property {String} direction 排版方向,默认row,列表里面使用其他组件 最好设置成column
|
|
51
|
+
*/
|
|
52
|
+
export default {
|
|
53
|
+
name: 'uv-list',
|
|
54
|
+
mixins: [mpMixin, mixin],
|
|
55
|
+
'mp-weixin': {
|
|
56
|
+
options: {
|
|
57
|
+
multipleSlots: false
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
props: {
|
|
61
|
+
border: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
borderColor: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: '#dadbde'
|
|
68
|
+
},
|
|
69
|
+
// 排版方向,默认row,列表里面使用其他组件 最好设置成column
|
|
70
|
+
direction: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: 'row'
|
|
73
|
+
},
|
|
74
|
+
// 内边距
|
|
75
|
+
padding: {
|
|
76
|
+
type: [String,Number],
|
|
77
|
+
default: '20rpx 30rpx'
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
created() {
|
|
81
|
+
this.firstChildAppend = false;
|
|
82
|
+
},
|
|
83
|
+
computed: {
|
|
84
|
+
parentData() {
|
|
85
|
+
return [this.direction,this.padding];
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
loadMore(e) {
|
|
90
|
+
this.$emit('scrolltolower');
|
|
91
|
+
},
|
|
92
|
+
scroll(e) {
|
|
93
|
+
this.$emit('scroll', e);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
<style lang="scss" scoped>
|
|
99
|
+
@import '../../libs/css/components.scss';
|
|
100
|
+
@import '../../libs/css/color.scss';
|
|
101
|
+
|
|
102
|
+
.uv-list {
|
|
103
|
+
position: relative;
|
|
104
|
+
@include flex(column);
|
|
105
|
+
background-color: #fff;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.uv-list--border {
|
|
109
|
+
position: relative;
|
|
110
|
+
/* #ifdef APP-NVUE */
|
|
111
|
+
border-top-color: $uv-border-color;
|
|
112
|
+
border-top-style: solid;
|
|
113
|
+
border-top-width: 0.5px;
|
|
114
|
+
border-bottom-color: $uv-border-color;
|
|
115
|
+
border-bottom-style: solid;
|
|
116
|
+
border-bottom-width: 0.5px;
|
|
117
|
+
/* #endif */
|
|
118
|
+
z-index: -1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* #ifndef APP-NVUE */
|
|
122
|
+
|
|
123
|
+
.uv-list--border-top {
|
|
124
|
+
position: absolute;
|
|
125
|
+
top: 0;
|
|
126
|
+
right: 0;
|
|
127
|
+
left: 0;
|
|
128
|
+
height: 1px;
|
|
129
|
+
-webkit-transform: scaleY(0.5);
|
|
130
|
+
transform: scaleY(0.5);
|
|
131
|
+
background-color: $uv-border-color;
|
|
132
|
+
z-index: 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.uv-list--border-bottom {
|
|
136
|
+
position: absolute;
|
|
137
|
+
bottom: 0;
|
|
138
|
+
right: 0;
|
|
139
|
+
left: 0;
|
|
140
|
+
height: 1px;
|
|
141
|
+
-webkit-transform: scaleY(0.5);
|
|
142
|
+
transform: scaleY(0.5);
|
|
143
|
+
background-color: $uv-border-color;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* #endif */
|
|
147
|
+
</style>
|