jufubao-base 1.0.168 → 1.0.169-beta2
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/JfbBaseLogin/Attr.js +1109 -510
- package/src/components/JfbBaseLogin/JfbBaseLogin.vue +364 -63
- package/src/components/JfbBaseTfkCardBind/Attr.js +579 -33
- package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +453 -18
- package/src/components/JfbBaseTfkCardDetail/Api.js +13 -37
- package/src/components/JfbBaseTfkCardDetail/Attr.js +589 -33
- package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +497 -23
- package/src/components/JfbBaseTfkCardDetail/Mock.js +151 -11
- package/src/components/JfbBaseTfkCardLogin/Api.js +19 -34
- package/src/components/JfbBaseTfkCardLogin/Attr.js +609 -33
- package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +488 -17
- package/src/components/JfbBaseTfkCardLogin/Mock.js +721 -11
- package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +219 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="xd-coupon_item" :style="couponItemBoxStyle">
|
|
3
|
+
<view class="coupon_left" :style="{
|
|
4
|
+
background: couponLeftBgColor
|
|
5
|
+
}">
|
|
6
|
+
<view class="_point">200<text style="font-size: 24rpx;">点</text></view>
|
|
7
|
+
<view class="_rule">满100减40</view>
|
|
8
|
+
</view>
|
|
9
|
+
<view class="coupon_right" :style="couponRightItemBoxStyle">
|
|
10
|
+
<view class="cont_top" :style="{
|
|
11
|
+
background: couponTitleBgColor
|
|
12
|
+
}">众福优选-众选全场通兑次票60档(上海)</view>
|
|
13
|
+
<view class="cont_main">
|
|
14
|
+
<view class="cou_number">券号:923974909815654</view>
|
|
15
|
+
<view class="cou_time">有效期:2023-09-09</view>
|
|
16
|
+
<view class="cou_point">余额:120</view>
|
|
17
|
+
<view class="cou_btn" :style="[couponBtnStyle, {
|
|
18
|
+
padding: couponBtnPadding,
|
|
19
|
+
borderRadius: couponBtnRadius + 'rpx'
|
|
20
|
+
}]">去使用</view>
|
|
21
|
+
</view>
|
|
22
|
+
<view class="cont_bottom">
|
|
23
|
+
<view class="switch_rule">
|
|
24
|
+
<view>使用规则</view>
|
|
25
|
+
<view>
|
|
26
|
+
<xd-font-icon icon="iconxia_down" size="24"></xd-font-icon>
|
|
27
|
+
</view>
|
|
28
|
+
</view>
|
|
29
|
+
<view class="expand_rule">
|
|
30
|
+
这是一段文字规则描述,不知道又多长多长长...
|
|
31
|
+
</view>
|
|
32
|
+
</view>
|
|
33
|
+
</view>
|
|
34
|
+
</view>
|
|
35
|
+
</template>
|
|
36
|
+
<script>
|
|
37
|
+
import getServiceUrl from '@/common/getServiceUrl'
|
|
38
|
+
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
39
|
+
export default{
|
|
40
|
+
name: "XdCouponItem",
|
|
41
|
+
components: {
|
|
42
|
+
XdFontIcon
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
couponRadius: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "16"
|
|
48
|
+
},
|
|
49
|
+
couponLeftBgColor: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'linear-gradient(180deg, #FFA852 0%, #FF5733 100%)'
|
|
52
|
+
},
|
|
53
|
+
couponImageUrl: {
|
|
54
|
+
type: Object | String
|
|
55
|
+
},
|
|
56
|
+
couponTitleBgColor: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "rgba(255, 87, 51, 0.1)"
|
|
59
|
+
},
|
|
60
|
+
couponUseBtnPadding: {
|
|
61
|
+
type: Object,
|
|
62
|
+
default(){
|
|
63
|
+
return {
|
|
64
|
+
top: 20,
|
|
65
|
+
right: 20,
|
|
66
|
+
bottom: 10,
|
|
67
|
+
left: 20
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
couponBtnRadius: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: "16"
|
|
74
|
+
},
|
|
75
|
+
couponBtnTextStyle: {
|
|
76
|
+
type: Object,
|
|
77
|
+
default(){
|
|
78
|
+
return {
|
|
79
|
+
color: '#fff',
|
|
80
|
+
bgColor: '#ff5722',
|
|
81
|
+
fontSize: '30rpx',
|
|
82
|
+
fontWeight: 'normal'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
computed: {
|
|
93
|
+
couponItemBoxStyle(){
|
|
94
|
+
return this.styleObjectToString({
|
|
95
|
+
borderRadius: this.couponRadius + 'rpx',
|
|
96
|
+
})
|
|
97
|
+
},
|
|
98
|
+
couponBtnPadding(){
|
|
99
|
+
let padding = `${this.checkValue(this.couponUseBtnPadding.top, 20)}rpx`;
|
|
100
|
+
padding = `${padding} ${this.checkValue(this.couponUseBtnPadding.right, 20)}rpx`;
|
|
101
|
+
padding = `${padding} ${this.checkValue(this.couponUseBtnPadding.bottom, 20)}rpx`;
|
|
102
|
+
padding = `${padding} ${this.checkValue(this.couponUseBtnPadding.left, 20)}rpx`;
|
|
103
|
+
return padding;
|
|
104
|
+
},
|
|
105
|
+
couponBtnStyle(){
|
|
106
|
+
let styleObj = {
|
|
107
|
+
color: this.couponBtnTextStyle['color'] || '#333',
|
|
108
|
+
background: this.couponBtnTextStyle['bgColor'] || '#fff',
|
|
109
|
+
fontSize: this.couponBtnTextStyle['fontSize'] || '30rpx',
|
|
110
|
+
fontWeight: this.couponBtnTextStyle['fontWeight'] || 'normal',
|
|
111
|
+
}
|
|
112
|
+
return this.styleObjectToString(styleObj)
|
|
113
|
+
},
|
|
114
|
+
couponRightItemBoxStyle(){
|
|
115
|
+
let image = {};
|
|
116
|
+
if(this.cardImageUrl) image = {
|
|
117
|
+
backgroundImage: `url(${this.getCouponBgImage})`,
|
|
118
|
+
backgroundSize: '100%',
|
|
119
|
+
backgroundRepeat: 'no-repeat',
|
|
120
|
+
}
|
|
121
|
+
return this.styleObjectToString(image)
|
|
122
|
+
},
|
|
123
|
+
getCouponBgImage(){
|
|
124
|
+
let bg = '';
|
|
125
|
+
if(this.$xdUniHelper.checkVarType(this.couponImageUrl) === 'object'
|
|
126
|
+
|| this.$xdUniHelper.checkVarType(this.couponImageUrl) === 'array'
|
|
127
|
+
) {
|
|
128
|
+
if(!this.$xdUniHelper.isEmpty(this.couponImageUrl)) {
|
|
129
|
+
return getServiceUrl(this.couponImageUrl.url)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return bg
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
methods: {
|
|
136
|
+
checkValue(value, dValue = 0){
|
|
137
|
+
if(value === undefined || value === '' || value === null) return dValue;
|
|
138
|
+
return Number(value || 0);
|
|
139
|
+
},
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
</script>
|
|
144
|
+
<style lang="less" scoped>
|
|
145
|
+
.xd-coupon_item{
|
|
146
|
+
display: flex;
|
|
147
|
+
margin: 20rpx 0;
|
|
148
|
+
border-radius: 16rpx;
|
|
149
|
+
background: #FFFFFF;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
.coupon_left{
|
|
152
|
+
color: #FFFFFF;
|
|
153
|
+
width: 170rpx;
|
|
154
|
+
display: flex;
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
align-items: center;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
|
|
159
|
+
._point{
|
|
160
|
+
font-size: 48rpx;
|
|
161
|
+
}
|
|
162
|
+
._rule{
|
|
163
|
+
font-size: 24rpx;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
.coupon_right{
|
|
167
|
+
flex: 1;
|
|
168
|
+
width: 530rpx;
|
|
169
|
+
.cont_top{
|
|
170
|
+
background: rgba(255, 87, 51, 0.1);
|
|
171
|
+
padding: 8rpx 40rpx;
|
|
172
|
+
font-size: 24rpx;
|
|
173
|
+
overflow: hidden;
|
|
174
|
+
white-space: nowrap;
|
|
175
|
+
text-overflow: ellipsis;
|
|
176
|
+
}
|
|
177
|
+
.cont_main{
|
|
178
|
+
position: relative;
|
|
179
|
+
padding: 28rpx 20rpx 28rpx 40rpx;
|
|
180
|
+
.cou_number{
|
|
181
|
+
font-size: 32rpx;
|
|
182
|
+
font-weight: bold;
|
|
183
|
+
}
|
|
184
|
+
.cou_time{
|
|
185
|
+
font-size: 28rpx;
|
|
186
|
+
margin: 16rpx 0;
|
|
187
|
+
}
|
|
188
|
+
.cou_point{
|
|
189
|
+
font-size: 28rpx;
|
|
190
|
+
}
|
|
191
|
+
.cou_btn{
|
|
192
|
+
position: absolute;
|
|
193
|
+
padding: 10rpx 30rpx;
|
|
194
|
+
background-color: #ddd;
|
|
195
|
+
border-radius: 12rpx;
|
|
196
|
+
right: 20rpx;
|
|
197
|
+
bottom: 20rpx;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
.cont_bottom{
|
|
201
|
+
background: #EEEEEE;
|
|
202
|
+
.switch_rule{
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: space-between;
|
|
206
|
+
padding: 12rpx 40rpx;
|
|
207
|
+
}
|
|
208
|
+
.expand_rule{
|
|
209
|
+
padding: 12rpx 40rpx;
|
|
210
|
+
font-size: 20rpx;
|
|
211
|
+
overflow: hidden;
|
|
212
|
+
white-space: nowrap;
|
|
213
|
+
text-overflow: ellipsis;
|
|
214
|
+
background-color: #F5F5F5;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
</style>
|