jufubao-base 1.0.290-beta3 → 1.0.291-beta4
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/package.json +1 -1
- package/src/components/CusCouponChose/CusCouponChose.vue +1027 -0
- package/src/components/CusCouponItem/CusCouponItem.vue +298 -0
- package/src/components/CusEnter/CusEnter.vue +360 -0
- package/src/components/CusPoster/CusPoster.vue +212 -0
- package/src/components/CusPoster/CusSwiperDot.vue +234 -0
- package/src/components/CusProduct/CusProduct.vue +372 -0
- package/src/components/CusShops/CusShops.vue +518 -0
- package/src/components/CusSwiperDot/CusSwiperDot.vue +234 -0
- package/src/components/CusTab/CusTab.vue +411 -0
- package/src/components/CusVideo/CusVideo.vue +170 -0
- package/src/components/JfbBaseFooter/Attr.js +10 -155
- package/src/components/JfbBaseFooter/JfbBaseFooter.vue +107 -46
- package/src/components/JfbBaseFooter/XdFooterBar.vue +325 -0
- package/src/components/JfbBaseFooter/cusAttr/advanced.js +12 -0
- package/src/components/JfbBaseFooter/cusAttr/content.js +471 -0
- package/src/components/JfbBaseFooter/cusAttr/style.js +7 -0
- package/src/components/JfbBaseFooter/cusAttr/tools.js +17 -0
- package/src/components/JfbBaseTfkSearch/Api.js +15 -0
- package/src/components/JfbBaseTfkSearch/CustomList.vue +10 -0
- package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +255 -7
- package/src/components/JfbBaseTfkSearch/XdQueryFilter.vue +347 -0
- package/src/components/JfbBaseTfkSearch/XdQuerySort.vue +192 -0
- package/src/components/JfbBaseTfkSearch/listMixins.js +8 -6
- package/src/components/JfbBaseUserInfo/Attr.js +12 -0
- package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +8 -2
- package/src/mixins/componentsMixins.js +363 -55
- package/src/mixins/posterMixins.js +27 -199
- package/src/mixins/productCompMixins.js +252 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="uni-swiper__warp">
|
|
3
|
+
<slot />
|
|
4
|
+
<view v-if="mode === 'default'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='default'>
|
|
5
|
+
<view v-for="(item,index) in info" @click="clickItem(index)" :style="{
|
|
6
|
+
'width': (index === current? dots.width*1.7: dots.width ) + 'px','height':dots.width*(2/5) +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border-radius':'0px'}"
|
|
7
|
+
:key="index" class="uni-swiper__dots-item uni-swiper__dots-bar" />
|
|
8
|
+
</view>
|
|
9
|
+
<view v-if="mode === 'dot'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='dot'>
|
|
10
|
+
<view v-for="(item,index) in info" @click="clickItem(index)" :style="{
|
|
11
|
+
'width': dots.width + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
|
|
12
|
+
:key="index" class="uni-swiper__dots-item" />
|
|
13
|
+
</view>
|
|
14
|
+
<view v-if="mode === 'round'" :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box" key='round'>
|
|
15
|
+
<view v-for="(item,index) in info" @click="clickItem(index)" :class="[index === current&&'uni-swiper__dots-long']" :style="{
|
|
16
|
+
'width':(index === current? dots.width*3:dots.width ) + 'px','height':dots.height +'px' ,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
|
|
17
|
+
:key="index" class="uni-swiper__dots-item " />
|
|
18
|
+
</view>
|
|
19
|
+
<view v-if="mode === 'nav'" key='nav' :style="{'background-color':dotsStyles.backgroundColor,'bottom':'0'}" class="uni-swiper__dots-box uni-swiper__dots-nav">
|
|
20
|
+
<text :style="{'color':dotsStyles.color}" class="uni-swiper__dots-nav-item">{{ (current+1)+"/"+info.length }}</text>
|
|
21
|
+
</view>
|
|
22
|
+
<view v-if="mode === 'indexes'" key='indexes' :style="{'bottom':dots.bottom + 'px'}" class="uni-swiper__dots-box">
|
|
23
|
+
<view v-for="(item,index) in info" @click="clickItem(index)" :style="{
|
|
24
|
+
'width':dots.width + 'rpx','height':dots.height +'rpx' ,'color':index === current?dots.selectedColor:dots.color,'background-color':index !== current?dots.backgroundColor:dots.selectedBackgroundColor,'border':index !==current ? dots.border:dots.selectedBorder}"
|
|
25
|
+
:key="index" class="uni-swiper__dots-item uni-swiper__dots-indexes"><text class="uni-swiper__dots-indexes-text">{{ index+1 }}</text></view>
|
|
26
|
+
</view>
|
|
27
|
+
</view>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* XdSwiperDot 轮播图指示点
|
|
34
|
+
* @description 自定义轮播图指示点
|
|
35
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=284
|
|
36
|
+
* @property {Number} current 当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`
|
|
37
|
+
* @property {String} mode = [default|round|nav|indexes] 指示点的类型
|
|
38
|
+
* @value defualt 默认指示点
|
|
39
|
+
* @value round 圆形指示点
|
|
40
|
+
* @value nav 条形指示点
|
|
41
|
+
* @value indexes 索引指示点
|
|
42
|
+
* @property {String} field mode 为 nav 时,显示的内容字段(mode = nav 时必填)
|
|
43
|
+
* @property {String} info 轮播图的数据,通过数组长度决定指示点个数
|
|
44
|
+
* @property {Object} dotsStyles 指示点样式
|
|
45
|
+
* @event {Function} clickItem 组件触发点击事件时触发,e={currentIndex}
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
name: 'XdSwiperDot',
|
|
50
|
+
emits:['clickItem'],
|
|
51
|
+
props: {
|
|
52
|
+
info: {
|
|
53
|
+
type: Array,
|
|
54
|
+
default () {
|
|
55
|
+
return []
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
current: {
|
|
59
|
+
type: Number,
|
|
60
|
+
default: 0
|
|
61
|
+
},
|
|
62
|
+
dotsStyles: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default () {
|
|
65
|
+
return {}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
// 类型 :default(默认) indexes long nav
|
|
69
|
+
mode: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: 'default'
|
|
72
|
+
},
|
|
73
|
+
// 只在 nav 模式下生效,变量名称
|
|
74
|
+
field: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: ''
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
dotsSource: {
|
|
82
|
+
width: 8,
|
|
83
|
+
height: 8,
|
|
84
|
+
bottom: 7,
|
|
85
|
+
color: '#fff',
|
|
86
|
+
backgroundColor: 'rgba(0, 0, 0, .3)',
|
|
87
|
+
border: '1px rgba(0, 0, 0, .3) solid',
|
|
88
|
+
selectedBackgroundColor: '#333',
|
|
89
|
+
selectedBorder: '1px rgba(0, 0, 0, .9) solid'
|
|
90
|
+
},
|
|
91
|
+
dots: { }
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
watch: {
|
|
95
|
+
dotsStyles(newVal) {
|
|
96
|
+
this.init(newVal)
|
|
97
|
+
},
|
|
98
|
+
mode() {
|
|
99
|
+
this.init(this.dotsStyles)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
},
|
|
103
|
+
created() {
|
|
104
|
+
this.init(this.dotsStyles)
|
|
105
|
+
},
|
|
106
|
+
methods: {
|
|
107
|
+
clickItem(index) {
|
|
108
|
+
this.$emit('clickItem', index)
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
init(value){
|
|
112
|
+
let dot = {};
|
|
113
|
+
if (this.mode === 'indexes') {
|
|
114
|
+
dot = {
|
|
115
|
+
width: 34,
|
|
116
|
+
height: 34,
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
this.dots = Object.assign(
|
|
120
|
+
JSON.parse(JSON.stringify(this.dotsSource)),
|
|
121
|
+
JSON.parse(JSON.stringify(value)),
|
|
122
|
+
dot
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<style lang="scss" scoped>
|
|
131
|
+
.uni-swiper__warp {
|
|
132
|
+
/* #ifndef APP-NVUE */
|
|
133
|
+
display: flex;
|
|
134
|
+
/* #endif */
|
|
135
|
+
flex: 1;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
position: relative;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.uni-swiper__dots-box {
|
|
142
|
+
position: absolute;
|
|
143
|
+
bottom: 10px;
|
|
144
|
+
left: 0;
|
|
145
|
+
right: 0;
|
|
146
|
+
/* #ifndef APP-NVUE */
|
|
147
|
+
display: flex;
|
|
148
|
+
/* #endif */
|
|
149
|
+
flex: 1;
|
|
150
|
+
flex-direction: row;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
align-items: center;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.uni-swiper__dots-item {
|
|
156
|
+
width: 8px;
|
|
157
|
+
border-radius: 100px;
|
|
158
|
+
margin-left: 6px;
|
|
159
|
+
background-color: $uni-bg-color-mask;
|
|
160
|
+
/* #ifndef APP-NVUE */
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
/* #endif */
|
|
163
|
+
/* #ifdef H5 */
|
|
164
|
+
// border-width: 5px 0;
|
|
165
|
+
// border-style: solid;
|
|
166
|
+
// border-color: transparent;
|
|
167
|
+
// background-clip: padding-box;
|
|
168
|
+
/* #endif */
|
|
169
|
+
// transition: width 0.2s linear; 不要取消注释,不然会不能变色
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.uni-swiper__dots-item:first-child {
|
|
173
|
+
margin: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.uni-swiper__dots-default {
|
|
177
|
+
border-radius: 100px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.uni-swiper__dots-long {
|
|
181
|
+
border-radius: 50px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.uni-swiper__dots-bar {
|
|
185
|
+
border-radius: 50px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.uni-swiper__dots-nav {
|
|
189
|
+
bottom: 10rpx!important;
|
|
190
|
+
height: 38rpx;
|
|
191
|
+
line-height: 38rpx;
|
|
192
|
+
position: absolute;
|
|
193
|
+
right: 0;
|
|
194
|
+
left: initial;
|
|
195
|
+
/* #ifndef APP-NVUE */
|
|
196
|
+
display: flex;
|
|
197
|
+
/* #endif */
|
|
198
|
+
flex: 1;
|
|
199
|
+
flex-direction: row;
|
|
200
|
+
justify-content: flex-start;
|
|
201
|
+
align-items: center;
|
|
202
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
203
|
+
border-radius: 6rpx 0 0 6rpx;
|
|
204
|
+
|
|
205
|
+
& > text {
|
|
206
|
+
font-size: 20rpx;
|
|
207
|
+
padding: 0 10px!important;
|
|
208
|
+
margin: 0;
|
|
209
|
+
text-align: center;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.uni-swiper__dots-nav-item {
|
|
214
|
+
/* overflow: hidden;
|
|
215
|
+
text-overflow: ellipsis;
|
|
216
|
+
white-space: nowrap; */
|
|
217
|
+
font-size: $uni-font-size-base;
|
|
218
|
+
color: #fff;
|
|
219
|
+
margin: 0 15px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.uni-swiper__dots-indexes {
|
|
223
|
+
/* #ifndef APP-NVUE */
|
|
224
|
+
display: flex;
|
|
225
|
+
/* #endif */
|
|
226
|
+
// flex: 1;
|
|
227
|
+
justify-content: center;
|
|
228
|
+
align-items: center;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.uni-swiper__dots-indexes-text {
|
|
232
|
+
font-size: $uni-font-size-sm;
|
|
233
|
+
}
|
|
234
|
+
</style>
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="xd-tab"
|
|
4
|
+
:class="{noBorder: noBorder}"
|
|
5
|
+
:style="{background:bgColor}"
|
|
6
|
+
>
|
|
7
|
+
<scroll-view
|
|
8
|
+
class="tab-scroll"
|
|
9
|
+
scroll-x
|
|
10
|
+
:scroll-with-animation="scrollWithAnimation"
|
|
11
|
+
:scroll-into-view="toView"
|
|
12
|
+
:style="{
|
|
13
|
+
width: 'calc(100% - '+ getSettingWidth + 'px)',
|
|
14
|
+
height: height + 'rpx'
|
|
15
|
+
}"
|
|
16
|
+
|
|
17
|
+
>
|
|
18
|
+
<view class="tab-scroll__box">
|
|
19
|
+
<view
|
|
20
|
+
:id="`tab-scroll__index-${index}`"
|
|
21
|
+
v-for="(item, index) in list"
|
|
22
|
+
:key="index"
|
|
23
|
+
:style="{color: activeIndex === index? (actColor||styleMainColor): color, height: height + 'rpx'}"
|
|
24
|
+
class="tab-scroll__item"
|
|
25
|
+
:class="{active:activeIndex === index}"
|
|
26
|
+
@click="clickTab(item, index)"
|
|
27
|
+
>
|
|
28
|
+
<view
|
|
29
|
+
:style="[{
|
|
30
|
+
fontWeight: activeIndex === index? actFontWeight: fontWeight,
|
|
31
|
+
fontSize: (activeIndex === index ? actFontSize : fontSize) + 'rpx',
|
|
32
|
+
height:(xAbsolute === 'none' && item.subName)?(height/2 + 'rpx'):(height + 'rpx'),
|
|
33
|
+
lineHeight:(xAbsolute === 'none' && item.subName)?(height/2 + 'rpx'):(height + 'rpx')
|
|
34
|
+
}]">{{item.name}}</view>
|
|
35
|
+
<view
|
|
36
|
+
class="xAbsolute"
|
|
37
|
+
v-if="xAbsolute === 'absolute'"
|
|
38
|
+
:style="[
|
|
39
|
+
footerStyleComp,
|
|
40
|
+
{backgroundColor: activeIndex === index? (actColor||styleMainColor): ''},
|
|
41
|
+
]"
|
|
42
|
+
>
|
|
43
|
+
<view
|
|
44
|
+
v-if="activeIndex === index && styleSolid === 'N'"
|
|
45
|
+
:style="[footerStyleSolidComp]"
|
|
46
|
+
class="styleSolid"
|
|
47
|
+
></view>
|
|
48
|
+
</view>
|
|
49
|
+
<view
|
|
50
|
+
v-if="xAbsolute === 'none' && item.subName"
|
|
51
|
+
class="none"
|
|
52
|
+
:style="[activeIndex === index?subActNameComp:subNameComp]"
|
|
53
|
+
>{{item.subName}}</view>
|
|
54
|
+
</view>
|
|
55
|
+
</view>
|
|
56
|
+
</scroll-view>
|
|
57
|
+
<view
|
|
58
|
+
class="tab-icons"
|
|
59
|
+
@click="handleClickSetting"
|
|
60
|
+
:style="{width: settingWidth + 'rpx'}"
|
|
61
|
+
v-if="showSetting"
|
|
62
|
+
>
|
|
63
|
+
<xd-font-icon
|
|
64
|
+
icon="iconshezhi1"
|
|
65
|
+
color="#666"
|
|
66
|
+
size="40"
|
|
67
|
+
width="50"
|
|
68
|
+
height="50"
|
|
69
|
+
></xd-font-icon>
|
|
70
|
+
</view>
|
|
71
|
+
</view>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<script>
|
|
75
|
+
|
|
76
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
77
|
+
import {
|
|
78
|
+
getParentsStyle, //获取页面风格单个键值值
|
|
79
|
+
} from '@/utils/xd.base';
|
|
80
|
+
|
|
81
|
+
export default {
|
|
82
|
+
name: 'CusTab',
|
|
83
|
+
components: {
|
|
84
|
+
XdFontIcon
|
|
85
|
+
},
|
|
86
|
+
props: {
|
|
87
|
+
subNameStyle:{
|
|
88
|
+
type: Object,
|
|
89
|
+
default(){
|
|
90
|
+
return {}
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
settingWidth: {
|
|
94
|
+
type: Number,
|
|
95
|
+
default: 70
|
|
96
|
+
},
|
|
97
|
+
showSetting: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false,
|
|
100
|
+
},
|
|
101
|
+
list: {
|
|
102
|
+
type: Array,
|
|
103
|
+
default() {
|
|
104
|
+
return []
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
tabIndex: {
|
|
108
|
+
type: Number,
|
|
109
|
+
default: 0
|
|
110
|
+
},
|
|
111
|
+
footerStyle:{
|
|
112
|
+
type: String,
|
|
113
|
+
default: 'line-4-8-s'
|
|
114
|
+
},
|
|
115
|
+
showFooterLine: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: false
|
|
118
|
+
},
|
|
119
|
+
scrollWithAnimation:{
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: true
|
|
122
|
+
},
|
|
123
|
+
noBorder: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: true
|
|
126
|
+
},
|
|
127
|
+
color: {
|
|
128
|
+
type: String,
|
|
129
|
+
default: '#333'
|
|
130
|
+
},
|
|
131
|
+
bgColor: {
|
|
132
|
+
type: String,
|
|
133
|
+
default: '#fff'
|
|
134
|
+
},
|
|
135
|
+
fontSize: {
|
|
136
|
+
type: Number | String, //rpx
|
|
137
|
+
default: 30
|
|
138
|
+
},
|
|
139
|
+
actFontSize:{
|
|
140
|
+
type: Number | String, //rpx
|
|
141
|
+
default: 38
|
|
142
|
+
},
|
|
143
|
+
fontWeight: {
|
|
144
|
+
type: Number | String, //rpx
|
|
145
|
+
default: 100
|
|
146
|
+
},
|
|
147
|
+
actFontWeight: {
|
|
148
|
+
type: Number | String, //rpx
|
|
149
|
+
default: 500
|
|
150
|
+
},
|
|
151
|
+
height: {
|
|
152
|
+
type: Number | String, //rpx
|
|
153
|
+
default: 90
|
|
154
|
+
},
|
|
155
|
+
lineBottom: {
|
|
156
|
+
type: Number | String, //rpx
|
|
157
|
+
default: 10
|
|
158
|
+
},
|
|
159
|
+
actColor: {
|
|
160
|
+
type: String,
|
|
161
|
+
default: ''
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
data() {
|
|
165
|
+
return {
|
|
166
|
+
activeIndex: 0,
|
|
167
|
+
toView: null,
|
|
168
|
+
styleMainColor: '', //插件主题风格样式
|
|
169
|
+
styleType: 'line',
|
|
170
|
+
styleHeight: 0,
|
|
171
|
+
styleWidth: 0,
|
|
172
|
+
styleRadius:'0',
|
|
173
|
+
styleLong: '0',//长短
|
|
174
|
+
|
|
175
|
+
xAbsolute: 'absolute',//绝对定位|无
|
|
176
|
+
styleSolid: 'Y',
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
computed: {
|
|
181
|
+
getSettingWidth() {
|
|
182
|
+
if (this.showSetting) {
|
|
183
|
+
return 100 * this.$rpxNum;
|
|
184
|
+
}
|
|
185
|
+
return 0;
|
|
186
|
+
},
|
|
187
|
+
footerStyleComp(){
|
|
188
|
+
//circle/line/none/trigon/desc
|
|
189
|
+
let temp = {};
|
|
190
|
+
temp['bottom'] = this.lineBottom + 'rpx';
|
|
191
|
+
if(this.styleType === 'line') {
|
|
192
|
+
temp['height'] = this.styleHeight + 'rpx';
|
|
193
|
+
temp['left'] = this.styleLong;
|
|
194
|
+
temp['right'] = this.styleLong;
|
|
195
|
+
temp['borderRadius'] = this.styleRadius;
|
|
196
|
+
}
|
|
197
|
+
if(this.styleType === 'circle'){
|
|
198
|
+
temp['height'] = this.styleHeight + 'rpx';
|
|
199
|
+
temp['width'] = this.styleHeight + 'rpx';
|
|
200
|
+
temp['left'] = '50%';
|
|
201
|
+
temp['marginLeft'] = -this.styleHeight/2 + 'rpx'
|
|
202
|
+
temp['borderRadius'] = this.styleRadius;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return temp
|
|
206
|
+
},
|
|
207
|
+
footerStyleSolidComp(){
|
|
208
|
+
let temp = {};
|
|
209
|
+
temp['height'] = (this.styleHeight - 4) + 'rpx';
|
|
210
|
+
temp['width'] = (this.styleHeight - 4) + 'rpx';
|
|
211
|
+
temp['backgroundColor'] = '#fff';
|
|
212
|
+
if(this.styleType === 'circle'){
|
|
213
|
+
temp['borderRadius'] = '50%';
|
|
214
|
+
|
|
215
|
+
}
|
|
216
|
+
return temp
|
|
217
|
+
},
|
|
218
|
+
subNameComp(){
|
|
219
|
+
let temp = {
|
|
220
|
+
fontSize: '22rpx',
|
|
221
|
+
color:'#333',
|
|
222
|
+
};
|
|
223
|
+
if(this.subNameStyle['bgColor']) temp['backgroundColor'] = this.subNameStyle['bgColor'];
|
|
224
|
+
if(this.subNameStyle['color']) temp['color'] = this.subNameStyle['color'];
|
|
225
|
+
if(this.subNameStyle['fontSize']) temp['fontSize'] = this.subNameStyle['fontSize'];
|
|
226
|
+
if(this.subNameStyle['fontWeight']) temp['fontWeight'] = this.subNameStyle['fontWeight'];
|
|
227
|
+
return temp
|
|
228
|
+
},
|
|
229
|
+
subActNameComp(){
|
|
230
|
+
let temp = {
|
|
231
|
+
backgroundColor: this.actColor,
|
|
232
|
+
fontSize: '22rpx',
|
|
233
|
+
color:'#fff',
|
|
234
|
+
};
|
|
235
|
+
if(this.subNameStyle['actBgColor']) temp['backgroundColor'] = this.subNameStyle['actBgColor'];
|
|
236
|
+
if(this.subNameStyle['actColor']) temp['color'] = this.subNameStyle['actColor'];
|
|
237
|
+
if(this.subNameStyle['actFontSize']) temp['fontSize'] = this.subNameStyle['actFontSize'];
|
|
238
|
+
if(this.subNameStyle['actFontWeight']) temp['fontWeight'] = this.subNameStyle['actFontWeight'];
|
|
239
|
+
return temp
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
watch: {
|
|
243
|
+
tabIndex(newVal, oldVal) {
|
|
244
|
+
if(newVal !== oldVal) {
|
|
245
|
+
this.activeIndex = newVal;
|
|
246
|
+
this.toView = `tab-scroll__index-${newVal}`;
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
footerStyle(){
|
|
250
|
+
this.initStyle();
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
async created() {
|
|
254
|
+
this.initStyle();
|
|
255
|
+
this.styleMainColor = await getParentsStyle(this.$parent, '$mainColor');
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
mounted(){
|
|
259
|
+
this.$nextTick(()=>{
|
|
260
|
+
this.toView = 'tab-scroll__index-0'
|
|
261
|
+
if(this.scrollWithAnimation) {
|
|
262
|
+
setTimeout(() => {
|
|
263
|
+
this.activeIndex = this.tabIndex;
|
|
264
|
+
this.toView = `tab-scroll__index-${this.tabIndex}`;
|
|
265
|
+
this.$emit('onInit', this.list[this.activeIndex], this.activeIndex);
|
|
266
|
+
}, 50);
|
|
267
|
+
}
|
|
268
|
+
else{
|
|
269
|
+
this.activeIndex = this.tabIndex;
|
|
270
|
+
this.toView = `tab-scroll__index-${this.tabIndex}`;
|
|
271
|
+
this.$emit('onInit', this.list[this.activeIndex], this.activeIndex);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
methods: {
|
|
277
|
+
initStyle(){
|
|
278
|
+
let arr = this.footerStyle.split('-');
|
|
279
|
+
this.styleType = arr[0];
|
|
280
|
+
this.xAbsolute = 'absolute';
|
|
281
|
+
if(this.styleType === 'desc') {
|
|
282
|
+
this.xAbsolute = 'none';
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
//圆与三角
|
|
286
|
+
if(arr.length === 3) {
|
|
287
|
+
this.styleHeight = this.styleWidth = Number(arr[1])
|
|
288
|
+
this.styleSolid = arr[2] === 'k'?'N':'Y'
|
|
289
|
+
if(this.styleType === 'circle') {
|
|
290
|
+
this.styleRadius = '50%'
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
//线
|
|
295
|
+
if(arr.length === 4) {
|
|
296
|
+
this.styleHeight = arr[2];
|
|
297
|
+
this.styleRadius = arr[1] + 'rpx';
|
|
298
|
+
if(arr[3] === 'l') this.styleLong = '20rpx'
|
|
299
|
+
else this.styleLong = '35%'
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
},
|
|
303
|
+
|
|
304
|
+
clickTab(item, index) {
|
|
305
|
+
this.activeIndex = index;
|
|
306
|
+
this.toView = `tab-scroll__index-${this.activeIndex}`;
|
|
307
|
+
this.$emit('onTab', item, index);
|
|
308
|
+
},
|
|
309
|
+
handleClickSetting(){
|
|
310
|
+
this.$emit('onSetting');
|
|
311
|
+
},
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
</script>
|
|
315
|
+
|
|
316
|
+
<style lang="less">
|
|
317
|
+
.xd-tab {
|
|
318
|
+
display: flex;
|
|
319
|
+
flex-direction: row;
|
|
320
|
+
justify-content: space-between;
|
|
321
|
+
align-items: center;
|
|
322
|
+
flex-wrap: wrap;
|
|
323
|
+
overflow: hidden;
|
|
324
|
+
padding: 0;
|
|
325
|
+
height: unit(100, rpx);
|
|
326
|
+
&.noBorder {
|
|
327
|
+
border-bottom: 1px #f5f5f5 solid;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.tab-scroll {
|
|
331
|
+
.tab-scroll__box {
|
|
332
|
+
display: flex;
|
|
333
|
+
align-items: center;
|
|
334
|
+
flex-wrap: nowrap;
|
|
335
|
+
box-sizing: border-box;
|
|
336
|
+
|
|
337
|
+
.tab-scroll__item {
|
|
338
|
+
flex-shrink: 0;
|
|
339
|
+
padding: 0 unit(20, rpx);
|
|
340
|
+
color: #333;
|
|
341
|
+
font-size: unit(30, rpx);
|
|
342
|
+
height: unit(100, rpx);
|
|
343
|
+
position: relative;
|
|
344
|
+
display: flex;
|
|
345
|
+
align-items: center;
|
|
346
|
+
align-content: center;
|
|
347
|
+
flex-flow: column;
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
&.active {
|
|
351
|
+
color: @xd-base-color;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
& > view.xAbsolute {
|
|
356
|
+
position: absolute;
|
|
357
|
+
bottom: unit(10,rpx);
|
|
358
|
+
display: flex;
|
|
359
|
+
justify-content: center;
|
|
360
|
+
align-items: center;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
& > view.none {
|
|
364
|
+
padding: 0 10rpx;
|
|
365
|
+
color:#000;
|
|
366
|
+
border-radius:20rpx;
|
|
367
|
+
font-size: 20rpx;
|
|
368
|
+
line-height: 1.2rem;
|
|
369
|
+
margin-top: 4rpx;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.tab-icons {
|
|
376
|
+
position: relative;
|
|
377
|
+
justify-content: flex-end;
|
|
378
|
+
display: flex;
|
|
379
|
+
align-items: center;
|
|
380
|
+
height: unit(100, rpx);
|
|
381
|
+
|
|
382
|
+
/deep/ span {
|
|
383
|
+
font-size: unit(40, rpx) !important;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.tab-icons-box {
|
|
387
|
+
width: unit(60, rpx);
|
|
388
|
+
height: unit(60, rpx);
|
|
389
|
+
line-height: unit(60, rpx);
|
|
390
|
+
text-align: center;
|
|
391
|
+
vertical-align: middle;
|
|
392
|
+
display: block;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
&::after {
|
|
396
|
+
content: '';
|
|
397
|
+
position: absolute;
|
|
398
|
+
top: unit(30, rpx);
|
|
399
|
+
bottom: unit(30, rpx);
|
|
400
|
+
left: 0;
|
|
401
|
+
width: 1px;
|
|
402
|
+
background-color: #ddd;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
.styleSolid {
|
|
406
|
+
flex-shrink: 0;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
</style>
|