jufubao-base 1.0.290-beta3 → 1.0.290
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 +98 -44
- package/src/components/JfbBaseFooter/XdFooterBar.vue +324 -0
- package/src/components/JfbBaseFooter/cusAttr/advanced.js +12 -0
- package/src/components/JfbBaseFooter/cusAttr/content.js +475 -0
- package/src/components/JfbBaseFooter/cusAttr/style.js +7 -0
- package/src/components/JfbBaseFooter/cusAttr/tools.js +17 -0
- package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +3 -15
- 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,298 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view @click="toDetail" class="xd-coupon_item" :style="couponItemBoxStyle">
|
|
3
|
+
<view class="coupon_left" :style="{
|
|
4
|
+
background: couponLeftBgColor
|
|
5
|
+
}">
|
|
6
|
+
<view class="_point">
|
|
7
|
+
<xd-unit
|
|
8
|
+
:unitFontSize="24"
|
|
9
|
+
:fontSize="48"
|
|
10
|
+
:price="item.card_point"
|
|
11
|
+
:isOld="false"
|
|
12
|
+
:unit="item.unit || ''"
|
|
13
|
+
:colorNew="'#ffffff'"
|
|
14
|
+
></xd-unit>
|
|
15
|
+
<!-- <text style="font-size: 24rpx;">{{ item.unit }}</text> -->
|
|
16
|
+
</view>
|
|
17
|
+
<view class="_rule">{{ item.show_name }}</view>
|
|
18
|
+
</view>
|
|
19
|
+
<view class="coupon_right" :style="couponRightItemBoxStyle">
|
|
20
|
+
<view class="cont_top" :style="{
|
|
21
|
+
background: couponTitleBgColor,
|
|
22
|
+
color: mainColor
|
|
23
|
+
}">{{ item.card_type_name }}</view>
|
|
24
|
+
<view class="cont_main">
|
|
25
|
+
<view class="cou_number">券号:{{ item.card_number }}</view>
|
|
26
|
+
<view class="cou_time">有效期:{{getTimeFormat(item.end_time) }}</view>
|
|
27
|
+
<view class="cou_point">
|
|
28
|
+
余额:
|
|
29
|
+
<xd-unit
|
|
30
|
+
:unitFontSize="24"
|
|
31
|
+
:fontSize="28"
|
|
32
|
+
:price="item.card_point"
|
|
33
|
+
:isOld="false"
|
|
34
|
+
:unit="item.unit || ''"
|
|
35
|
+
:colorNew="'#333333'"
|
|
36
|
+
></xd-unit>
|
|
37
|
+
</view>
|
|
38
|
+
<slot name="btn">
|
|
39
|
+
<view class="cou_btn"
|
|
40
|
+
:style="[
|
|
41
|
+
item.is_login === 'Y' ? couponBtnActiveStyle : couponBtnStyle,
|
|
42
|
+
{
|
|
43
|
+
padding: couponBtnPadding,
|
|
44
|
+
borderRadius: couponBtnRadius + 'rpx'
|
|
45
|
+
}
|
|
46
|
+
]"
|
|
47
|
+
@click.stop="goToUseCoupon"
|
|
48
|
+
>{{item.is_login === 'Y' ? '已登录' : '去使用'}}</view>
|
|
49
|
+
</slot>
|
|
50
|
+
</view>
|
|
51
|
+
<view class="cont_bottom">
|
|
52
|
+
<view class="switch_rule" @click.stop="switchRule">
|
|
53
|
+
<view>使用规则</view>
|
|
54
|
+
<view>
|
|
55
|
+
<xd-font-icon v-if="!expand" icon="iconxia_down" size="24"></xd-font-icon>
|
|
56
|
+
<xd-font-icon v-else icon="iconshang_up" size="24"></xd-font-icon>
|
|
57
|
+
</view>
|
|
58
|
+
</view>
|
|
59
|
+
<view v-if="expand" class="expand_rule">
|
|
60
|
+
{{ item.card_use_rule }}
|
|
61
|
+
</view>
|
|
62
|
+
</view>
|
|
63
|
+
</view>
|
|
64
|
+
</view>
|
|
65
|
+
</template>
|
|
66
|
+
<script>
|
|
67
|
+
import getServiceUrl from '@/common/getServiceUrl'
|
|
68
|
+
import XdUnit from "@/components/XdUnit/XdUnit";
|
|
69
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
70
|
+
export default{
|
|
71
|
+
name: "CusCouponItem",
|
|
72
|
+
components: {
|
|
73
|
+
XdFontIcon,
|
|
74
|
+
XdUnit
|
|
75
|
+
},
|
|
76
|
+
props: {
|
|
77
|
+
item:{
|
|
78
|
+
type: Object,
|
|
79
|
+
},
|
|
80
|
+
couponRadius: {
|
|
81
|
+
type: String | Number,
|
|
82
|
+
default: "16"
|
|
83
|
+
},
|
|
84
|
+
couponLeftBgColor: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: 'linear-gradient(180deg, #FFA852 0%, #FF5733 100%)'
|
|
87
|
+
},
|
|
88
|
+
couponImageUrl: {
|
|
89
|
+
type: Object | String
|
|
90
|
+
},
|
|
91
|
+
couponTitleBgColor: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: "rgba(255, 87, 51, 0.1)"
|
|
94
|
+
},
|
|
95
|
+
mainColor: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: "#000"
|
|
98
|
+
},
|
|
99
|
+
couponUseBtnPadding: {
|
|
100
|
+
type: Object,
|
|
101
|
+
default(){
|
|
102
|
+
return {
|
|
103
|
+
top: 20,
|
|
104
|
+
right: 20,
|
|
105
|
+
bottom: 10,
|
|
106
|
+
left: 20
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
couponBtnRadius: {
|
|
111
|
+
type: String | Number,
|
|
112
|
+
default: "16"
|
|
113
|
+
},
|
|
114
|
+
couponBtnTextStyle: {
|
|
115
|
+
type: Object,
|
|
116
|
+
default(){
|
|
117
|
+
return {
|
|
118
|
+
color: '#fff',
|
|
119
|
+
bgColor: '#ff5722',
|
|
120
|
+
fontSize: '30rpx',
|
|
121
|
+
fontWeight: 'normal'
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
data() {
|
|
127
|
+
return {
|
|
128
|
+
expand: false,
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
computed: {
|
|
132
|
+
couponItemBoxStyle(){
|
|
133
|
+
return this.styleObjectToString({
|
|
134
|
+
borderRadius: this.couponRadius + 'rpx',
|
|
135
|
+
})
|
|
136
|
+
},
|
|
137
|
+
couponBtnPadding(){
|
|
138
|
+
let padding = `${this.checkValue(this.couponUseBtnPadding.top, 20)}rpx`;
|
|
139
|
+
padding = `${padding} ${this.checkValue(this.couponUseBtnPadding.right, 20)}rpx`;
|
|
140
|
+
padding = `${padding} ${this.checkValue(this.couponUseBtnPadding.bottom, 20)}rpx`;
|
|
141
|
+
padding = `${padding} ${this.checkValue(this.couponUseBtnPadding.left, 20)}rpx`;
|
|
142
|
+
return padding;
|
|
143
|
+
},
|
|
144
|
+
couponBtnStyle(){
|
|
145
|
+
let styleObj = {
|
|
146
|
+
color: this.couponBtnTextStyle['color'] || '#333',
|
|
147
|
+
background: this.couponBtnTextStyle['bgColor'] || '#fff',
|
|
148
|
+
fontSize: this.couponBtnTextStyle['fontSize'] || '30rpx',
|
|
149
|
+
fontWeight: this.couponBtnTextStyle['fontWeight'] || 'normal',
|
|
150
|
+
}
|
|
151
|
+
return this.styleObjectToString(styleObj)
|
|
152
|
+
},
|
|
153
|
+
couponBtnActiveStyle(){
|
|
154
|
+
return this.styleObjectToString({
|
|
155
|
+
color: this.couponBtnTextStyle['actColor'] || '#fff',
|
|
156
|
+
background: this.couponBtnTextStyle['actBgColor'] || '#ff5722',
|
|
157
|
+
fontSize: this.couponBtnTextStyle['actFontSize'] || '30rpx',
|
|
158
|
+
fontWeight: this.couponBtnTextStyle['actFontWeight'] || 'normal',
|
|
159
|
+
})
|
|
160
|
+
},
|
|
161
|
+
couponRightItemBoxStyle(){
|
|
162
|
+
let image = {};
|
|
163
|
+
if(this.cardImageUrl) image = {
|
|
164
|
+
backgroundImage: `url(${this.getCouponBgImage})`,
|
|
165
|
+
backgroundSize: '100%',
|
|
166
|
+
backgroundRepeat: 'no-repeat',
|
|
167
|
+
}
|
|
168
|
+
return this.styleObjectToString(image)
|
|
169
|
+
},
|
|
170
|
+
getCouponBgImage(){
|
|
171
|
+
let bg = '';
|
|
172
|
+
if(this.$xdUniHelper.checkVarType(this.couponImageUrl) === 'object'
|
|
173
|
+
|| this.$xdUniHelper.checkVarType(this.couponImageUrl) === 'array'
|
|
174
|
+
) {
|
|
175
|
+
if(!this.$xdUniHelper.isEmpty(this.couponImageUrl)) {
|
|
176
|
+
return getServiceUrl(this.couponImageUrl.url)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return bg
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
methods: {
|
|
183
|
+
switchRule(){
|
|
184
|
+
this.expand = !this.expand;
|
|
185
|
+
},
|
|
186
|
+
getTimeFormat(time) {
|
|
187
|
+
let date = null;
|
|
188
|
+
if (time == +time) {
|
|
189
|
+
if ((time + "").length <= 10) date = new Date(+time * 1000);
|
|
190
|
+
else date = new Date(+time);
|
|
191
|
+
return (
|
|
192
|
+
date.getFullYear() +
|
|
193
|
+
"-" +
|
|
194
|
+
(date.getMonth() + 1) +
|
|
195
|
+
"-" +
|
|
196
|
+
date.getDate()
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
return time;
|
|
200
|
+
},
|
|
201
|
+
toDetail(){
|
|
202
|
+
this.$emit('toDetail', this.item);
|
|
203
|
+
},
|
|
204
|
+
goToUseCoupon(){
|
|
205
|
+
this.$emit('useCoupon', this.item);
|
|
206
|
+
},
|
|
207
|
+
checkValue(value, dValue = 0){
|
|
208
|
+
if(value === undefined || value === '' || value === null) return dValue;
|
|
209
|
+
return Number(value || 0);
|
|
210
|
+
},
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
</script>
|
|
215
|
+
<style lang="less" scoped>
|
|
216
|
+
.xd-coupon_item{
|
|
217
|
+
display: flex;
|
|
218
|
+
margin: 20rpx 0;
|
|
219
|
+
border-radius: 16rpx;
|
|
220
|
+
background: #FFFFFF;
|
|
221
|
+
overflow: hidden;
|
|
222
|
+
border: 2rpx solid #eee;
|
|
223
|
+
.coupon_left{
|
|
224
|
+
color: #FFFFFF;
|
|
225
|
+
width: 170rpx;
|
|
226
|
+
flex-shrink: 0;
|
|
227
|
+
display: flex;
|
|
228
|
+
flex-direction: column;
|
|
229
|
+
align-items: center;
|
|
230
|
+
justify-content: center;
|
|
231
|
+
|
|
232
|
+
._point{
|
|
233
|
+
font-size: 48rpx;
|
|
234
|
+
}
|
|
235
|
+
._rule{
|
|
236
|
+
font-size: 24rpx;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
.coupon_right{
|
|
240
|
+
flex: 1;
|
|
241
|
+
width: 0;
|
|
242
|
+
.cont_top{
|
|
243
|
+
background: rgba(255, 87, 51, 0.1);
|
|
244
|
+
padding: 8rpx 40rpx;
|
|
245
|
+
font-size: 24rpx;
|
|
246
|
+
overflow: hidden;
|
|
247
|
+
white-space: nowrap;
|
|
248
|
+
text-overflow: ellipsis;
|
|
249
|
+
}
|
|
250
|
+
.cont_main{
|
|
251
|
+
position: relative;
|
|
252
|
+
padding: 28rpx 20rpx 28rpx 40rpx;
|
|
253
|
+
color: #333333;
|
|
254
|
+
.cou_number{
|
|
255
|
+
font-size: 32rpx;
|
|
256
|
+
font-weight: bold;
|
|
257
|
+
}
|
|
258
|
+
.cou_time{
|
|
259
|
+
font-size: 28rpx;
|
|
260
|
+
margin: 16rpx 0;
|
|
261
|
+
}
|
|
262
|
+
.cou_point{
|
|
263
|
+
font-size: 28rpx;
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
}
|
|
267
|
+
.cou_btn{
|
|
268
|
+
position: absolute;
|
|
269
|
+
padding: 10rpx 30rpx;
|
|
270
|
+
background-color: #ddd;
|
|
271
|
+
border-radius: 12rpx;
|
|
272
|
+
right: 20rpx;
|
|
273
|
+
bottom: 20rpx;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
.cont_bottom{
|
|
277
|
+
background: #EEEEEE;
|
|
278
|
+
.switch_rule{
|
|
279
|
+
display: flex;
|
|
280
|
+
align-items: center;
|
|
281
|
+
justify-content: space-between;
|
|
282
|
+
padding: 12rpx 40rpx;
|
|
283
|
+
font-size: 24rpx;
|
|
284
|
+
color: #666666;
|
|
285
|
+
}
|
|
286
|
+
.expand_rule{
|
|
287
|
+
padding: 12rpx 40rpx;
|
|
288
|
+
font-size: 20rpx;
|
|
289
|
+
color: #333333;
|
|
290
|
+
overflow: hidden;
|
|
291
|
+
white-space: nowrap;
|
|
292
|
+
text-overflow: ellipsis;
|
|
293
|
+
background-color: #F5F5F5;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
</style>
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="list-poster"
|
|
4
|
+
v-if="enterList !== null && enterList.length > 0"
|
|
5
|
+
>
|
|
6
|
+
<!--静态显示-->
|
|
7
|
+
<view class="list-poster-one" v-if="0"></view>
|
|
8
|
+
<!--静态显示-->
|
|
9
|
+
<view class="list-poster-more" v-else>
|
|
10
|
+
<cus-swiper-dot
|
|
11
|
+
:style="[outStyleBoxComp]"
|
|
12
|
+
:current="current"
|
|
13
|
+
:info="enterListComp"
|
|
14
|
+
field="content_name"
|
|
15
|
+
:mode="mode"
|
|
16
|
+
:dots-styles="dotStyleData"
|
|
17
|
+
>
|
|
18
|
+
<swiper
|
|
19
|
+
class="swiper xd-swiper-content"
|
|
20
|
+
:style="[inStyleBoxComp]"
|
|
21
|
+
:indicator-dots="false"
|
|
22
|
+
:autoplay="time > 0"
|
|
23
|
+
:interval="time"
|
|
24
|
+
:duration="500"
|
|
25
|
+
:current="current"
|
|
26
|
+
circular
|
|
27
|
+
@animationfinish="handleAnimationFinish"
|
|
28
|
+
@change="handleChange"
|
|
29
|
+
>
|
|
30
|
+
<swiper-item
|
|
31
|
+
v-for="(item,index) in enterListComp"
|
|
32
|
+
:key="index"
|
|
33
|
+
>
|
|
34
|
+
<view :style="[boxStyleComp]" class="swiper-list">
|
|
35
|
+
<view
|
|
36
|
+
v-for="(brand,idx) in item"
|
|
37
|
+
:key="brand.value"
|
|
38
|
+
:style="[
|
|
39
|
+
itemStyleComp,
|
|
40
|
+
{marginRight:(idx>0&&(idx+1)%column===0)?0:(columnSpacing + 'rpx')},
|
|
41
|
+
{marginTop:idx<column?0:(rowSpacing + 'rpx')}
|
|
42
|
+
]"
|
|
43
|
+
@click.stop="handlePosterClick(brand,index)"
|
|
44
|
+
>
|
|
45
|
+
<view :style="[itemImageComp]" class="list-image" >
|
|
46
|
+
<image v-if="brand['error-status']===false" :style="[config['iconStyle']]" :src="brand.brand_icon" :alt="brand.label"></image>
|
|
47
|
+
<image v-else :style="[config['iconStyle']]" :src="iconErrorUrl" :alt="brand.label"></image>
|
|
48
|
+
</view>
|
|
49
|
+
<view class="list-title" :style="[config['titleStyle']]">{{brand.label}}</view>
|
|
50
|
+
</view>
|
|
51
|
+
</view>
|
|
52
|
+
</swiper-item>
|
|
53
|
+
</swiper>
|
|
54
|
+
</cus-swiper-dot>
|
|
55
|
+
</view>
|
|
56
|
+
</view>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script>
|
|
60
|
+
|
|
61
|
+
import CusSwiperDot from "@/components/CusSwiperDot/CusSwiperDot.vue";
|
|
62
|
+
import Color from "color";
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: "CusEnter",
|
|
66
|
+
components: {
|
|
67
|
+
CusSwiperDot
|
|
68
|
+
},
|
|
69
|
+
props:{
|
|
70
|
+
config: {
|
|
71
|
+
type: Object,
|
|
72
|
+
default(){
|
|
73
|
+
return {
|
|
74
|
+
outWidth: uni.getSystemInfoSync().safeArea.width,//(px)
|
|
75
|
+
column: 5,//列
|
|
76
|
+
row: 2, //行
|
|
77
|
+
wrapperPadding:0, //盒子填充(有投影时候设置) (rpx)
|
|
78
|
+
wrapperPaddingRL: 0, //内容盒子左右边距和
|
|
79
|
+
wrapperPaddingTB: 0, //内容盒子上下边距和
|
|
80
|
+
wrapperBorderRadius:0, //内容盒子圆角设置
|
|
81
|
+
iconBoxStyle: {}, //图片icon外壳样式
|
|
82
|
+
titleStyle: {}, //图标下文字样式
|
|
83
|
+
columnSpacing: 0, //列间距 (rpx)
|
|
84
|
+
rowSpacing: 0, //行间距 (rpx)
|
|
85
|
+
iconStyle: { //icon样式
|
|
86
|
+
borderRadius: 0, // (rpx)
|
|
87
|
+
iconPadding: 0 // (rpx)
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* @description 是否为广告模式,非广告模式使用事件通知上层进行页面跳转
|
|
94
|
+
*/
|
|
95
|
+
isPoster:{
|
|
96
|
+
type:Boolean,
|
|
97
|
+
default: false,
|
|
98
|
+
},
|
|
99
|
+
iconErrorUrl: {
|
|
100
|
+
type:String,
|
|
101
|
+
required: true,
|
|
102
|
+
},
|
|
103
|
+
time:{
|
|
104
|
+
type: Number,
|
|
105
|
+
default: 5
|
|
106
|
+
},
|
|
107
|
+
enterList:{
|
|
108
|
+
type: Array|null,
|
|
109
|
+
default: null
|
|
110
|
+
},
|
|
111
|
+
mode:{
|
|
112
|
+
type: String,
|
|
113
|
+
default:'round'
|
|
114
|
+
},
|
|
115
|
+
mainColor:{
|
|
116
|
+
type:String,
|
|
117
|
+
required: true
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
computed:{
|
|
122
|
+
//maps
|
|
123
|
+
columnSpacing(){
|
|
124
|
+
return this.config.columnSpacing
|
|
125
|
+
},
|
|
126
|
+
rowSpacing(){
|
|
127
|
+
return this.config.rowSpacing
|
|
128
|
+
},
|
|
129
|
+
column(){
|
|
130
|
+
return this.config.column
|
|
131
|
+
},
|
|
132
|
+
row(){
|
|
133
|
+
return this.config.row
|
|
134
|
+
},
|
|
135
|
+
//外填充样式
|
|
136
|
+
boxStyleComp(){
|
|
137
|
+
return {
|
|
138
|
+
padding: this.config.wrapperPadding,
|
|
139
|
+
boxSizing:'border-box'
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
dotStyleData(){
|
|
143
|
+
return this.dotStyleDataConf()[this.mode];
|
|
144
|
+
},
|
|
145
|
+
enterListComp(){
|
|
146
|
+
let temp = [];
|
|
147
|
+
let page_token = this.column * this.row;
|
|
148
|
+
let len = Math.ceil(this.enterList.length/page_token);
|
|
149
|
+
for(let i=0; i < len; i++) {
|
|
150
|
+
temp.push(this.$xdUniHelper.getLocalPaginationData(this.enterList, i+1,page_token));
|
|
151
|
+
}
|
|
152
|
+
return temp;
|
|
153
|
+
},
|
|
154
|
+
//icon盒子样式设置
|
|
155
|
+
itemImageComp(){
|
|
156
|
+
return {
|
|
157
|
+
width: this.itemWidth + 'px',
|
|
158
|
+
height: this.itemWidth + 'px',
|
|
159
|
+
padding: this.iconSize + 'rpx',
|
|
160
|
+
boxSizing:'border-box',
|
|
161
|
+
...this.config.iconBoxStyle
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
//图标列表宽度
|
|
166
|
+
itemWidth(){
|
|
167
|
+
return (this.config.outWidth - (this.column - 1) * this.columnSpacing * this.$rpxNum)/this.column;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
//图标列表样式
|
|
171
|
+
itemStyleComp(){
|
|
172
|
+
return {
|
|
173
|
+
width: this.itemWidth + 'px',
|
|
174
|
+
height: (this.itemWidth + this.textHeight*this.$rpxNum) + 'px',
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
outStyleBoxComp(){
|
|
179
|
+
return this.styleBox();
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
inStyleBoxComp(){
|
|
183
|
+
return this.styleBox('in');
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
data(){
|
|
190
|
+
return {
|
|
191
|
+
current:0,
|
|
192
|
+
dotStyleDataConf(){
|
|
193
|
+
let alpha = 0.6;
|
|
194
|
+
let selectedColor = `rgba(${Color(this.mainColor).alpha(alpha).array().join(',')})`;
|
|
195
|
+
let textColor = `rgba(${Color(this.mainColor).alpha(0.2).array().join(',')})`;
|
|
196
|
+
return {
|
|
197
|
+
dot: {
|
|
198
|
+
backgroundColor: 'rgba(166,166,166,.5)',
|
|
199
|
+
border: '0px rgba(166,166,166,.5) solid',
|
|
200
|
+
color: '#fff',
|
|
201
|
+
selectedBackgroundColor: selectedColor,
|
|
202
|
+
selectedBorder: `0px this.mainColor solid`
|
|
203
|
+
},
|
|
204
|
+
default: {
|
|
205
|
+
width: 16,
|
|
206
|
+
backgroundColor: 'rgba(200,200,200,.45)',
|
|
207
|
+
border: '1px rgba(200,200,200,.45) solid',
|
|
208
|
+
color: '#fff',
|
|
209
|
+
selectedBackgroundColor: selectedColor,
|
|
210
|
+
selectedBorder: `1px this.mainColor solid`
|
|
211
|
+
},
|
|
212
|
+
round: {
|
|
213
|
+
backgroundColor: 'rgba(166,166,166,.5)',
|
|
214
|
+
border: '0px rgba(166,166,166,.5) solid',
|
|
215
|
+
color: '#fff',
|
|
216
|
+
selectedBackgroundColor: selectedColor,
|
|
217
|
+
selectedBorder: `0px this.mainColor solid`
|
|
218
|
+
},
|
|
219
|
+
nav: {
|
|
220
|
+
backgroundColor: selectedColor,
|
|
221
|
+
border: '1px rgba(0,0,0,.2) solid',
|
|
222
|
+
color: '#fff',
|
|
223
|
+
selectedBackgroundColor: selectedColor,
|
|
224
|
+
selectedBorder: '1px rgba(255, 255, 255 1) solid'
|
|
225
|
+
},
|
|
226
|
+
indexes: {
|
|
227
|
+
backgroundColor: textColor,
|
|
228
|
+
border: '0px rgba(0,0,0,.2) solid',
|
|
229
|
+
color: '#fff',
|
|
230
|
+
selectedBackgroundColor: selectedColor,
|
|
231
|
+
selectedBorder: '0px rgba(0,0,0,.8) solid',
|
|
232
|
+
selectedColor: '#fff',
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
textHeight: 40,
|
|
237
|
+
indexHeight: 46,
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
methods:{
|
|
241
|
+
styleBox(out='out'){
|
|
242
|
+
let boxPaddingBT = this.config.wrapperPaddingTB * this.$rpxNum
|
|
243
|
+
let height = this.itemWidth * (this.row);
|
|
244
|
+
let text = this.textHeight * this.row * this.$rpxNum;
|
|
245
|
+
let columnSpacings = this.rowSpacing * (this.row -1) * this.$rpxNum;
|
|
246
|
+
let modeHeight = this.indexHeight * this.$rpxNum;
|
|
247
|
+
if(this.mode === "normal") modeHeight = 10 * this.$rpxNum;
|
|
248
|
+
if(out === 'in') modeHeight = 0;
|
|
249
|
+
|
|
250
|
+
return {
|
|
251
|
+
width: '100%',
|
|
252
|
+
height: (height + columnSpacings + modeHeight + text + boxPaddingBT) + 'px'
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
handlePosterClick(item,index){
|
|
257
|
+
if(!this.isPoster) {
|
|
258
|
+
this.$emit('on-detail', {item,index});
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if(!item.redirect_data) {
|
|
263
|
+
console.warn(`未配置链接地址: ${item.redirect_data}`);
|
|
264
|
+
console.error(`未配置链接地址: ${item.redirect_data}`);
|
|
265
|
+
return
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
//内部链接跳转地址
|
|
269
|
+
if (item.redirect_type === 'INN') {
|
|
270
|
+
try {
|
|
271
|
+
let url = JSON.parse(item.redirect_data);
|
|
272
|
+
let params = '';
|
|
273
|
+
if(url.page) {
|
|
274
|
+
if (item['redirect_params']) params = `?${item['redirect_params']}`;
|
|
275
|
+
this.$xdUniHelper.navigateTo({url: url.page + params})
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
console.error(`应用链接配置错误: ${url.page}`)
|
|
279
|
+
}
|
|
280
|
+
} catch (e) {
|
|
281
|
+
console.error(`应用链接配置错误: ${item.redirect_data}`)
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
//外部链接
|
|
286
|
+
if (item.redirect_type === 'URL') {
|
|
287
|
+
let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
|
|
288
|
+
let spReg = /(-apiuri\/v)/;
|
|
289
|
+
//#ifdef MP-WEIXIN
|
|
290
|
+
try {
|
|
291
|
+
let url = JSON.parse(item.redirect_data);
|
|
292
|
+
if (reg.test(url.url) || spReg.test(url.url)) {
|
|
293
|
+
console.warn(`广告跳转外站: ${url.url}`)
|
|
294
|
+
this.$xdUniHelper.navigateTo(url);
|
|
295
|
+
} else {
|
|
296
|
+
console.error(`广告跳转外站配置错误: ${url.url}`)
|
|
297
|
+
}
|
|
298
|
+
} catch (e) {
|
|
299
|
+
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
300
|
+
}
|
|
301
|
+
//#endif
|
|
302
|
+
//#ifdef H5
|
|
303
|
+
try {
|
|
304
|
+
let url = JSON.parse(item.redirect_data);
|
|
305
|
+
console.warn(`广告跳转外站: ${url.url}`);
|
|
306
|
+
this.$xdUniHelper.redirectTo(url, false)
|
|
307
|
+
} catch (e) {
|
|
308
|
+
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
309
|
+
}
|
|
310
|
+
//#endif
|
|
311
|
+
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
//无跳转地址
|
|
315
|
+
if(item.redirect_type === 'EMP') {
|
|
316
|
+
console.warn(`无跳转地址`);
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
|
|
320
|
+
handleChange(e){
|
|
321
|
+
this.current = e.detail.current;
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
handleAnimationFinish(e){
|
|
325
|
+
},
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
</script>
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
<style scoped lang="less">
|
|
333
|
+
.swiper-list {
|
|
334
|
+
display: flex;
|
|
335
|
+
justify-content: flex-start;
|
|
336
|
+
align-items: flex-start;
|
|
337
|
+
flex-flow: wrap;
|
|
338
|
+
flex-shrink: 0;
|
|
339
|
+
|
|
340
|
+
.list-image {
|
|
341
|
+
display: flex;
|
|
342
|
+
justify-content: center;
|
|
343
|
+
align-items: center;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.list-title {
|
|
347
|
+
text-align: center;
|
|
348
|
+
font-size: 24rpx;
|
|
349
|
+
color: #666;
|
|
350
|
+
line-height: 40rpx;
|
|
351
|
+
.uni-one-cut(40);
|
|
352
|
+
padding: 0 6rpx;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
& image {
|
|
356
|
+
width:100%;
|
|
357
|
+
height: 100%;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
</style>
|