chore(组件): 引入DiyMinx的js及修复组件错误
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
<template>
|
||||
<view :style="componentStyle">
|
||||
<scroll-view
|
||||
:class="['graphic-nav', value.showStyle == 'fixed' ? 'fixed-layout' : value.showStyle]"
|
||||
:scroll-x="value.showStyle == 'singleSlide'"
|
||||
>
|
||||
<scroll-view :class="['graphic-nav', value.showStyle == 'fixed' ? 'fixed-layout' : value.showStyle]"
|
||||
:scroll-x="value.showStyle == 'singleSlide'">
|
||||
<view class="uni-scroll-view-content">
|
||||
<view
|
||||
v-for="(item, index) in value.list"
|
||||
:key="index"
|
||||
<view v-for="(item, index) in value.list" :key="index"
|
||||
:class="['graphic-nav-item', value.mode, value.mode === 'text' ? 'newright' : '']"
|
||||
:style="{ width: (100 / value.rowCount + '%') + ';' }"
|
||||
>
|
||||
:style="{ width: (100 / value.rowCount + '%') + ';' }">
|
||||
<view style="display:flex;">
|
||||
<view :style="{
|
||||
'line-height': '1.2;',
|
||||
@@ -18,14 +13,8 @@
|
||||
'font-weight': '600;',
|
||||
'color': value.font.titlecolor + ';'
|
||||
}">
|
||||
<uv-count-to
|
||||
:ref="`countTo-${index}`"
|
||||
:autoplay="true"
|
||||
:startVal="30"
|
||||
:endVal="item.title"
|
||||
:decimals="getvalue(item.title)"
|
||||
decimal="."
|
||||
></uv-count-to>
|
||||
<uv-count-to :ref="`countTo-${index}`" :autoplay="true" :startVal="30" :endVal="item.title"
|
||||
:decimals="getvalue(item.title)" decimal="."></uv-count-to>
|
||||
<text :style="{
|
||||
'margin-left': '4rpx;',
|
||||
'font-size': (value.font.unitsize * 2 + 'rpx') + ';',
|
||||
@@ -51,7 +40,8 @@
|
||||
<script>
|
||||
import uvCountTo from '@/components/uv-count-to/uv-count-to.vue'
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue'
|
||||
|
||||
import DiyMinx from './minx.js'
|
||||
// 自定义数字展示
|
||||
export default {
|
||||
name: 'diy-digit',
|
||||
components: {
|
||||
@@ -64,6 +54,7 @@ export default {
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
mixins: [DiyMinx],
|
||||
data() {
|
||||
return {
|
||||
pageWidth: '',
|
||||
@@ -83,17 +74,17 @@ export default {
|
||||
componentStyle() {
|
||||
let style = '';
|
||||
style += 'background-image:url(' + this.$util.img(this.value.imageUrl) + ');background-size:100% 100%;';
|
||||
|
||||
|
||||
if (this.value.componentAngle == 'round') {
|
||||
style += 'border-top-left-radius:' + (2 * this.value.topAroundRadius) + 'rpx;';
|
||||
style += 'border-top-right-radius:' + (2 * this.value.topAroundRadius) + 'rpx;';
|
||||
style += 'border-bottom-left-radius:' + (2 * this.value.bottomAroundRadius) + 'rpx;';
|
||||
style += 'border-bottom-right-radius:' + (2 * this.value.bottomAroundRadius) + 'rpx;';
|
||||
}
|
||||
|
||||
|
||||
style += 'box-shadow:' + (this.value.ornament.type == 'shadow' ? '0 0 10rpx ' + this.value.ornament.color : '') + ';';
|
||||
style += 'border:' + (this.value.ornament.type == 'stroke' ? '2rpx solid ' + this.value.ornament.color : '') + ';';
|
||||
|
||||
|
||||
return style;
|
||||
}
|
||||
},
|
||||
@@ -102,7 +93,7 @@ export default {
|
||||
getvalue(value) {
|
||||
return value % 1 !== 0 ? 2 : 0;
|
||||
},
|
||||
|
||||
|
||||
// 页面跳转
|
||||
redirectTo(item) {
|
||||
if (!item.wap_url || this.$util.getCurrRoute() != 'pages/member/index' || this.storeToken) {
|
||||
@@ -112,7 +103,7 @@ export default {
|
||||
this.$refs.login.open(item.wap_url);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 轮播切换
|
||||
swiperChange(event) {
|
||||
this.swiperCurrent = event.detail.current;
|
||||
@@ -125,31 +116,31 @@ export default {
|
||||
.graphic-nav {
|
||||
padding: 16rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
&.fixed-layout {
|
||||
.uni-scroll-view-content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.singleSlide {
|
||||
.uni-scroll-view-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
||||
.graphic-nav-item {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.pageSlide {
|
||||
position: relative;
|
||||
|
||||
|
||||
.uni-swiper-dots-horizontal {
|
||||
bottom: 0rpx;
|
||||
}
|
||||
|
||||
|
||||
&.straightLine {
|
||||
.uni-swiper-dot {
|
||||
width: 30rpx;
|
||||
@@ -157,7 +148,7 @@ export default {
|
||||
height: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.circle {
|
||||
.uni-swiper-dot {
|
||||
width: 14rpx;
|
||||
@@ -165,21 +156,21 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.graphic-nav-wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
.graphic-nav-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 14rpx 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
.graphic-text {
|
||||
line-height: 1.3;
|
||||
white-space: nowrap;
|
||||
@@ -187,18 +178,18 @@ export default {
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
|
||||
|
||||
&.alone {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.text {
|
||||
.graphic-text {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.graphic-img {
|
||||
position: relative;
|
||||
display: flex;
|
||||
@@ -207,7 +198,7 @@ export default {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
font-size: 90rpx;
|
||||
|
||||
|
||||
.tag {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
@@ -221,14 +212,14 @@ export default {
|
||||
line-height: 1;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
|
||||
.icon {
|
||||
font-size: 50rpx;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.pageSlide {
|
||||
.graphic-nav-item {
|
||||
flex-shrink: 0;
|
||||
@@ -247,16 +238,16 @@ export default {
|
||||
justify-content: center;
|
||||
margin-top: -20rpx;
|
||||
padding-bottom: 8rpx;
|
||||
|
||||
|
||||
.swiper-dot {
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
margin: 8rpx;
|
||||
|
||||
|
||||
&.active {
|
||||
background-color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.straightLine {
|
||||
.swiper-dot {
|
||||
width: 30rpx;
|
||||
@@ -264,7 +255,7 @@ export default {
|
||||
height: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.circle {
|
||||
.swiper-dot {
|
||||
width: 15rpx;
|
||||
|
||||
Reference in New Issue
Block a user