jufubao-base 1.0.169-beta5 → 1.0.169-beta7
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/JfbBaseTfkCardBind/Api.js +49 -30
- package/src/components/JfbBaseTfkCardBind/Attr.js +25 -1
- package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +139 -7
- package/src/components/JfbBaseTfkCardBind/Mock.js +19 -9
- package/src/components/JfbBaseTfkCardDetail/Api.js +11 -0
- package/src/components/JfbBaseTfkCardDetail/Attr.js +74 -0
- package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +141 -8
- package/src/components/JfbBaseTfkCardLogin/Attr.js +182 -0
- package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +250 -33
- package/src/components/JfbBaseTfkCardLogin/Mock.js +1 -1
- package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +68 -16
- package/src/components/JfbBaseTfkSearch/AllList.vue +231 -0
- package/src/components/JfbBaseTfkSearch/Api.js +11 -42
- package/src/components/JfbBaseTfkSearch/Attr.js +125 -2
- package/src/components/JfbBaseTfkSearch/ContentCinema.vue +12 -2
- package/src/components/JfbBaseTfkSearch/{ContentItem.vue → ContentFilm.vue} +18 -4
- package/src/components/JfbBaseTfkSearch/ContentProduct.vue +308 -0
- package/src/components/JfbBaseTfkSearch/ContentShop.vue +184 -0
- package/src/components/JfbBaseTfkSearch/CusAttr.js +2 -0
- package/src/components/JfbBaseTfkSearch/CustomList.vue +181 -28
- package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +132 -20
- package/src/components/JfbBaseTfkSearch/Mock.js +90 -11
- package/src/components/JfbBaseTfkSearch/SkeletonCinema.vue +1 -2
- package/src/components/JfbBaseTfkSearch/SkeletonProduct.vue +98 -72
- package/src/components/JfbBaseTfkSearch/handleKeyword.js +24 -0
- package/src/components/JfbBaseTfkSearch/listMixins.js +71 -0
- package/src/components/JfbBaseTfkSearch/search.js +270 -152
|
@@ -18,22 +18,26 @@
|
|
|
18
18
|
}">
|
|
19
19
|
<view class="menu_wrap" :style="menuBoxStyle">
|
|
20
20
|
<view class="menu_list">
|
|
21
|
-
<view class="menu_item"
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
<view class="menu_item"
|
|
22
|
+
:style="{
|
|
23
|
+
marginRight: menuItemMargin + 'px'
|
|
24
|
+
}"
|
|
25
|
+
@click="changeMenu('card')"
|
|
26
|
+
>
|
|
24
27
|
<view class="menu_item_inner"
|
|
25
28
|
:style="[menuType === 'card' ? menuItemActiveStyle : menuItemStyle, menuItemBoxStyle]">我的票券包</view>
|
|
26
29
|
</view>
|
|
27
|
-
<view class="menu_item">
|
|
30
|
+
<view class="menu_item" @click="changeMenu('coupon')">
|
|
28
31
|
<view class="menu_item_inner"
|
|
29
32
|
:style="[menuType === 'coupon' ? menuItemActiveStyle : menuItemStyle, menuItemBoxStyle]">我的优惠券</view>
|
|
30
33
|
</view>
|
|
31
34
|
</view>
|
|
32
|
-
<view @click="toBindCard">
|
|
35
|
+
<view class="bind_card" :style="bindCardBoxStyle" @click="toBindCard">
|
|
33
36
|
<xd-font-icon :icon="bindCardIcon.icon"
|
|
34
37
|
:color="bindCardIcon.color"
|
|
35
|
-
:
|
|
38
|
+
:size="bindCardIcon.size"
|
|
36
39
|
></xd-font-icon>
|
|
40
|
+
<view v-if="bindCardText" :style="getBindCardTextStyle">{{ bindCardText }}</view>
|
|
37
41
|
</view>
|
|
38
42
|
</view>
|
|
39
43
|
<view class="JfbBaseNotice">
|
|
@@ -78,10 +82,14 @@
|
|
|
78
82
|
<view v-if="loadingList">
|
|
79
83
|
<view class="bind_list skeleton-wrap">
|
|
80
84
|
<view class="bind_item" v-for="i in 5" :key="i" :style="cardItemBoxStyle">
|
|
81
|
-
<view
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
<view>
|
|
86
|
+
<view class="bind_point"></view>
|
|
87
|
+
<view class="bind_deduct"></view>
|
|
88
|
+
</view>
|
|
89
|
+
<view>
|
|
90
|
+
<view class="bind_number"></view>
|
|
91
|
+
<view class="bind_time"></view>
|
|
92
|
+
</view>
|
|
85
93
|
<view class="bind_type"></view>
|
|
86
94
|
<view class="bind_btn"></view>
|
|
87
95
|
</view>
|
|
@@ -90,24 +98,43 @@
|
|
|
90
98
|
<view v-else>
|
|
91
99
|
<view v-if="cardList.length" class="bind_list">
|
|
92
100
|
<view class="bind_item" v-for="(item, i) in cardList" :key="i"
|
|
93
|
-
:style="cardItemBoxStyle">
|
|
94
|
-
<view
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
101
|
+
:style="cardItemBoxStyle" @click="toCardDetail(item)">
|
|
102
|
+
<view>
|
|
103
|
+
<view class="bind_point">
|
|
104
|
+
<xd-unit
|
|
105
|
+
:unitFontSize="24"
|
|
106
|
+
:fontSize="48"
|
|
107
|
+
:price="item.card_point"
|
|
108
|
+
:isOld="false"
|
|
109
|
+
:unit="item.unit || ''"
|
|
110
|
+
:colorNew="'#333333'"
|
|
111
|
+
></xd-unit>
|
|
112
|
+
</view>
|
|
113
|
+
<view v-if="item.other_card_point && item.card_point_type !== 1" class="bind_deduct">
|
|
114
|
+
兑换其他商品可抵:{{ item.other_card_point }}
|
|
115
|
+
</view>
|
|
116
|
+
</view>
|
|
117
|
+
<view>
|
|
118
|
+
<view class="bind_number">{{ item.card_number }}</view>
|
|
119
|
+
<view class="bind_time">{{ item.end_time }}到期</view>
|
|
120
|
+
</view>
|
|
98
121
|
<view class="bind_type" :style="{
|
|
99
122
|
top: cardPadding.top + 'rpx',
|
|
100
123
|
right: cardPadding.right + 'rpx',
|
|
101
124
|
}">
|
|
102
|
-
<view
|
|
103
|
-
<view>(可转票券)</view>
|
|
125
|
+
<view>{{ item.card_type_name }}</view>
|
|
126
|
+
<view v-if="item.is_exchange === 'Y'">(可转票券)</view>
|
|
104
127
|
</view>
|
|
105
|
-
<view class="bind_btn"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
128
|
+
<view class="bind_btn"
|
|
129
|
+
:style="[{
|
|
130
|
+
right: cardPadding.right + 'rpx',
|
|
131
|
+
bottom: cardPadding.bottom + 'rpx',
|
|
132
|
+
borderRadius: cardBtnRadius + 'rpx',
|
|
133
|
+
padding: bindCardBtnPadding,
|
|
134
|
+
minWidth: cardBtnMinWidth + 'rpx',
|
|
135
|
+
}, item.is_login === 'Y' ? bindCardActiveStyle : bindCardBtnStyle]"
|
|
136
|
+
@click.stop="doCardLogin(item)"
|
|
137
|
+
>{{ item.is_login === 'Y' ? '已登录' : '登录'}}</view>
|
|
111
138
|
</view>
|
|
112
139
|
<view v-if="!hasCardList" class="no_more_card">没有更多券了,查看失效的票券 ></view>
|
|
113
140
|
</view>
|
|
@@ -128,6 +155,8 @@
|
|
|
128
155
|
:couponBtnRadius="couponBtnRadius"
|
|
129
156
|
:couponBtnTextStyle="couponBtnTextStyle"
|
|
130
157
|
:couponLeftBgColor="couponLeftBgColor"
|
|
158
|
+
:item="item"
|
|
159
|
+
@useCoupon="doCardLogin(item)"
|
|
131
160
|
></xd-coupon-item>
|
|
132
161
|
<view v-if="!hasCouponList" class="no_more_card">没有更多券了,查看失效的票券 ></view>
|
|
133
162
|
</view>
|
|
@@ -144,6 +173,7 @@
|
|
|
144
173
|
|
|
145
174
|
<script>
|
|
146
175
|
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
176
|
+
import XdUnit from "@/components/XdUnit/XdUnit";
|
|
147
177
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
148
178
|
import JfbBaseTfkCardLoginMixin from "./JfbBaseTfkCardLoginMixin";
|
|
149
179
|
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
@@ -153,25 +183,35 @@
|
|
|
153
183
|
import XdNoticeBar from "@/components/XdNoticeBar/XdNoticeBar";
|
|
154
184
|
import XdCouponItem from "./XdCouponItem";
|
|
155
185
|
import Color from "color"
|
|
186
|
+
import { mapState, mapActions } from "vuex";
|
|
156
187
|
export default {
|
|
157
188
|
name: "JfbBaseTfkCardLogin",
|
|
158
189
|
components: {
|
|
159
190
|
XdFontIcon,
|
|
160
191
|
XdNoticeBar,
|
|
161
192
|
XdCouponItem,
|
|
193
|
+
XdUnit
|
|
162
194
|
},
|
|
163
195
|
mixins: [
|
|
164
196
|
componentsMixins, extsMixins, JfbBaseTfkCardLoginMixin
|
|
165
197
|
],
|
|
166
198
|
data() {
|
|
167
199
|
return {
|
|
168
|
-
menuType: "
|
|
169
|
-
loadingList:
|
|
170
|
-
cardList: [
|
|
171
|
-
couponList: [
|
|
200
|
+
menuType: "card", // card, coupon
|
|
201
|
+
loadingList: true,
|
|
202
|
+
cardList: [],
|
|
203
|
+
couponList: [],
|
|
172
204
|
hasCardList: false,
|
|
173
205
|
hasCouponList: false,
|
|
174
206
|
|
|
207
|
+
inCallbackUrlOrg:'',//是否带有回调地址
|
|
208
|
+
inCallback: null, //内部跳转地址
|
|
209
|
+
allEntryPath: "", //综合福利入口页
|
|
210
|
+
cardDetailPath: "", //我的票券包详情页
|
|
211
|
+
|
|
212
|
+
options: {},
|
|
213
|
+
showDisabled: 'Y',
|
|
214
|
+
|
|
175
215
|
//todo
|
|
176
216
|
previewCurrent: "",
|
|
177
217
|
isPreview: false,
|
|
@@ -204,9 +244,23 @@
|
|
|
204
244
|
noticeMargin: {},
|
|
205
245
|
noticePadding: {},
|
|
206
246
|
noticeFont: {},
|
|
247
|
+
bindCardText: "",
|
|
248
|
+
bindCardTextStyle: {},
|
|
249
|
+
bindCardShowType: "",
|
|
250
|
+
bindCardBtnRadius: 16,
|
|
251
|
+
cardBorder: {},
|
|
252
|
+
cardShadow: {},
|
|
253
|
+
cardImageMode: "",
|
|
254
|
+
entryGroupId: "",
|
|
255
|
+
cardHeight: 270,
|
|
256
|
+
cardBtnMinWidth: 100,
|
|
207
257
|
}
|
|
208
258
|
},
|
|
209
259
|
computed: {
|
|
260
|
+
...mapState({
|
|
261
|
+
jwxSDK: (state) => state.jwxSDK,
|
|
262
|
+
jfbAuthorize: (state) => state.jfbAuthorize,
|
|
263
|
+
}),
|
|
210
264
|
menuBoxStyle(){
|
|
211
265
|
let padding = `${this.checkValue(this.menuPadding.top, 20)}rpx`;
|
|
212
266
|
padding = `${padding} ${this.checkValue(this.menuPadding.right, 20)}rpx`;
|
|
@@ -291,6 +345,21 @@
|
|
|
291
345
|
}
|
|
292
346
|
return this.styleObjectToString(styleObj)
|
|
293
347
|
},
|
|
348
|
+
bindCardBoxStyle(){
|
|
349
|
+
return this.styleObjectToString({
|
|
350
|
+
border: `1px solid ${this.bindCardShowType == 'button' ? this.bindCardTextStyle.color : 'transparent'}`,
|
|
351
|
+
borderRadius: this.bindCardBtnRadius + 'rpx',
|
|
352
|
+
})
|
|
353
|
+
},
|
|
354
|
+
getBindCardTextStyle(){
|
|
355
|
+
let styleObj = {
|
|
356
|
+
color: this.bindCardTextStyle['color'] || '#333',
|
|
357
|
+
fontSize: this.bindCardTextStyle['fontSize'] || '30rpx',
|
|
358
|
+
fontWeight: this.bindCardTextStyle['fontWeight'] || 'normal',
|
|
359
|
+
marginLeft: this.bindCardIcon.icon ? '10rpx' : 0,
|
|
360
|
+
}
|
|
361
|
+
return this.styleObjectToString(styleObj)
|
|
362
|
+
},
|
|
294
363
|
getCardBgImage(){
|
|
295
364
|
let bg = '';
|
|
296
365
|
if(this.$xdUniHelper.checkVarType(this.cardImageUrl) === 'object'
|
|
@@ -304,18 +373,35 @@
|
|
|
304
373
|
},
|
|
305
374
|
cardItemBoxStyle(){
|
|
306
375
|
let image = {};
|
|
376
|
+
let border = "none";
|
|
377
|
+
let boxShadow = "none";
|
|
378
|
+
if(this.cardBorder && this.cardBorder.type === 'Y'){
|
|
379
|
+
let { width, color } = this.cardBorder.value;
|
|
380
|
+
border = `${width}rpx solid ${color}`;
|
|
381
|
+
}
|
|
382
|
+
if(this.cardShadow && this.cardShadow.type === 'Y'){
|
|
383
|
+
let { width, color } = this.cardShadow.value;
|
|
384
|
+
boxShadow = `0 0 ${width}rpx ${color}`;
|
|
385
|
+
}
|
|
307
386
|
if(this.cardImageUrl) image = {
|
|
308
387
|
backgroundImage: `url(${this.getCardBgImage})`,
|
|
309
388
|
backgroundSize: '100%',
|
|
310
389
|
backgroundRepeat: 'no-repeat',
|
|
311
390
|
}
|
|
391
|
+
if(this.cardImageMode) image['backgroundSize'] = this.cardImageMode;
|
|
392
|
+
|
|
312
393
|
let padding = `${this.checkValue(this.cardPadding.top, 20)}rpx`;
|
|
313
394
|
padding = `${padding} ${this.checkValue(this.cardPadding.right, 20)}rpx`;
|
|
314
395
|
padding = `${padding} ${this.checkValue(this.cardPadding.bottom, 20)}rpx`;
|
|
315
396
|
padding = `${padding} ${this.checkValue(this.cardPadding.left, 20)}rpx`;
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
397
|
+
return this.styleObjectToString({
|
|
398
|
+
...image,
|
|
399
|
+
padding: padding,
|
|
400
|
+
borderRadius: this.cardRadius + 'rpx',
|
|
401
|
+
border: border,
|
|
402
|
+
boxShadow: boxShadow,
|
|
403
|
+
height: this.cardHeight + 'rpx',
|
|
404
|
+
})
|
|
319
405
|
},
|
|
320
406
|
listBoxStyle(){
|
|
321
407
|
let padding = `${this.checkValue(this.cardListPadding.top, 20)}rpx`;
|
|
@@ -387,6 +473,22 @@
|
|
|
387
473
|
},
|
|
388
474
|
methods: {
|
|
389
475
|
onJfbLoad(options) {
|
|
476
|
+
this.options = options;
|
|
477
|
+
let { inCallback } = options;
|
|
478
|
+
if(!inCallback) this.$storage.remove("inCallback"); //作为入口
|
|
479
|
+
else {
|
|
480
|
+
this.$storage.set("inCallback", inCallback);
|
|
481
|
+
try{
|
|
482
|
+
inCallback = Base64.decode(inCallback);
|
|
483
|
+
this.inCallbackUrlOrg = options.inCallback;
|
|
484
|
+
}catch (e){
|
|
485
|
+
inCallback = null;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
//登录成功调整地址优先级
|
|
489
|
+
this.inCallback = inCallback || this.allEntryPath || this.settings.index;
|
|
490
|
+
|
|
491
|
+
this.getCardList();
|
|
390
492
|
this.getContent();
|
|
391
493
|
},
|
|
392
494
|
/**
|
|
@@ -421,13 +523,108 @@
|
|
|
421
523
|
this.noticeMargin = getContainerPropsValue(value, "content.noticeMargin", {top: 20, left: 20, right: 20, bottom: 20});
|
|
422
524
|
this.noticePadding = getContainerPropsValue(value, "content.noticePadding", {top: 20, left: 20, right: 20, bottom: 20});
|
|
423
525
|
this.noticeFont = getContainerPropsValue(value, "content.noticeFont", {});
|
|
526
|
+
this.bindCardText = getContainerPropsValue(value, "content.bindCardText", "");
|
|
527
|
+
this.bindCardTextStyle = getContainerPropsValue(value, "content.bindCardTextStyle", {});
|
|
528
|
+
this.bindCardShowType = getContainerPropsValue(value, "content.bindCardShowType", 'text');
|
|
529
|
+
this.bindCardBtnRadius = getContainerPropsValue(value, "content.bindCardBtnRadius", 16);
|
|
530
|
+
this.cardBorder = getContainerPropsValue(value, "content.cardBorder", {});
|
|
531
|
+
this.cardShadow = getContainerPropsValue(value, "content.cardShadow", {});
|
|
532
|
+
this.cardImageMode = getContainerPropsValue(value, "content.cardImageMode", '');
|
|
533
|
+
this.allEntryPath = getContainerPropsValue(value, "content.allEntryPath", {value: ""}).value;
|
|
534
|
+
this.cardDetailPath = getContainerPropsValue(value, "content.cardDetailPath", {value: "/tfktest/system/card/tkfDetail"}).value;
|
|
535
|
+
// this.entryGroupId = getContainerPropsValue(value,"content.entryGroupId","default");
|
|
536
|
+
this.cardHeight = getContainerPropsValue(value, "content.cardHeight", 270);
|
|
537
|
+
this.cardBtnMinWidth = getContainerPropsValue(value, "content.cardBtnMinWidth", 100);
|
|
424
538
|
|
|
425
|
-
console.log(this.
|
|
539
|
+
console.log(this.cardShadow, 'cardShadow')
|
|
540
|
+
if(this.bindCardTextStyle && !this.bindCardTextStyle.color){
|
|
541
|
+
this.bindCardTextStyle.color = this.mainColor;
|
|
542
|
+
}
|
|
543
|
+
if(this.bindCardIcon && !this.bindCardIcon.color){
|
|
544
|
+
this.bindCardIcon.color = this.mainColor;
|
|
545
|
+
}
|
|
546
|
+
if(this.menuTabColor && !this.menuTabColor.actColor){
|
|
547
|
+
this.menuTabColor.actColor = this.mainColor;
|
|
548
|
+
}
|
|
549
|
+
if(this.cardBtnTextStyle){
|
|
550
|
+
if(!this.cardBtnTextStyle.actBgColor){
|
|
551
|
+
this.cardBtnTextStyle.actBgColor = this.mainColor;
|
|
552
|
+
}
|
|
553
|
+
if(!this.cardBtnTextStyle.bgColor){
|
|
554
|
+
this.cardBtnTextStyle.bgColor = this.mainColor;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
426
557
|
|
|
427
558
|
if(this.$configProject.isPreview){
|
|
428
559
|
this.menuType = this.previewCurrent;
|
|
429
560
|
}
|
|
430
561
|
},
|
|
562
|
+
toCardDetail(item){
|
|
563
|
+
this.$xdUniHelper.navigateTo({
|
|
564
|
+
url: this.cardDetailPath + `?card_number=${item["card_number"]}`
|
|
565
|
+
},false)
|
|
566
|
+
},
|
|
567
|
+
doCardLogin(item){
|
|
568
|
+
this.$xdShowLoading({});
|
|
569
|
+
jfbRootExec("loginTfkCardBind", {
|
|
570
|
+
vm: this,
|
|
571
|
+
data: {
|
|
572
|
+
card_number: item["card_number"]
|
|
573
|
+
}
|
|
574
|
+
}).then(res => {
|
|
575
|
+
this.$xdHideLoading();
|
|
576
|
+
//#ifdef MP-WEIXIN
|
|
577
|
+
if (this.jfbAuthorize !== null) {
|
|
578
|
+
this.jfbAuthorize.setCardToken(res);
|
|
579
|
+
}
|
|
580
|
+
//#endif
|
|
581
|
+
|
|
582
|
+
if (this.$configProject.isPreview) {
|
|
583
|
+
console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
|
|
584
|
+
} else {
|
|
585
|
+
this.$xdUniHelper.redirectTo({
|
|
586
|
+
url: this.inCallback,
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
}).catch((res) => {
|
|
590
|
+
this.$xdHideLoading();
|
|
591
|
+
});
|
|
592
|
+
},
|
|
593
|
+
changeMenu(menu){
|
|
594
|
+
this.menuType = menu;
|
|
595
|
+
this.getCardList();
|
|
596
|
+
},
|
|
597
|
+
getCardList(){
|
|
598
|
+
let show_type = this.menuType === 'coupon' ? 'coupon' : 'normal';
|
|
599
|
+
let params = {show_type};
|
|
600
|
+
|
|
601
|
+
// let params = {is_all: 'Y', is_show_entry_settings: 'Y'};
|
|
602
|
+
// if(options['jfb_business_code']) {
|
|
603
|
+
// params['card_business_code'] = options['jfb_business_code'];
|
|
604
|
+
// }
|
|
605
|
+
// if(this.entryGroupId) params['group_id'] = this.entryGroupId;
|
|
606
|
+
this.$xdShowLoading({});
|
|
607
|
+
jfbRootExec("getTfkListCardBind", {
|
|
608
|
+
vm: this,
|
|
609
|
+
data: params,
|
|
610
|
+
}).then(res => {
|
|
611
|
+
this.loadingList = false;
|
|
612
|
+
this.$xdHideLoading();
|
|
613
|
+
this.showDisabled = res.is_show_invalid_card_entrance;
|
|
614
|
+
|
|
615
|
+
let list = res.list.map(item => {
|
|
616
|
+
item.other_card_point = item.other_card_point ? this.$xdUniHelper.divisionFloatNumber(item.other_card_point, 100) : 0
|
|
617
|
+
return item;
|
|
618
|
+
})
|
|
619
|
+
if(show_type === 'coupon'){
|
|
620
|
+
this.couponList = list;
|
|
621
|
+
}
|
|
622
|
+
if(show_type === 'normal'){
|
|
623
|
+
this.cardList = list;
|
|
624
|
+
}
|
|
625
|
+
})
|
|
626
|
+
.catch(() => this.$xdHideLoading());
|
|
627
|
+
},
|
|
431
628
|
toBindCard(){
|
|
432
629
|
this.$xdUniHelper.navigateTo({
|
|
433
630
|
url: this.cardBindPath
|
|
@@ -497,6 +694,12 @@
|
|
|
497
694
|
border-bottom: 1px solid transparent;
|
|
498
695
|
}
|
|
499
696
|
}
|
|
697
|
+
.bind_card{
|
|
698
|
+
display: flex;
|
|
699
|
+
align-items: center;
|
|
700
|
+
padding: 8rpx 20rpx;
|
|
701
|
+
border-radius: 16rpx;
|
|
702
|
+
}
|
|
500
703
|
}
|
|
501
704
|
&-notice {
|
|
502
705
|
width: 100%;
|
|
@@ -540,12 +743,23 @@
|
|
|
540
743
|
padding: 32rpx;
|
|
541
744
|
background: #fff;
|
|
542
745
|
border-radius: 16rpx;
|
|
543
|
-
|
|
746
|
+
box-sizing: border-box;
|
|
544
747
|
margin: var(--card-list-margin) 0;
|
|
545
748
|
position: relative;
|
|
749
|
+
display: flex;
|
|
750
|
+
flex-direction: column;
|
|
751
|
+
justify-content: space-between;
|
|
546
752
|
.bind_point{
|
|
547
|
-
color: #
|
|
753
|
+
color: #333333;
|
|
548
754
|
font-size: 48rpx;
|
|
755
|
+
::v-deep .xd-unit{
|
|
756
|
+
height: auto !important;
|
|
757
|
+
font-weight: bold;
|
|
758
|
+
align-items: flex-end;
|
|
759
|
+
.xd-unit__unit{
|
|
760
|
+
line-height: 1.7 !important;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
549
763
|
}
|
|
550
764
|
.bind_deduct{
|
|
551
765
|
font-size: 28rpx;
|
|
@@ -587,6 +801,9 @@
|
|
|
587
801
|
background: #ddd;
|
|
588
802
|
padding: 16rpx 60rpx;
|
|
589
803
|
border-radius: 12rpx;
|
|
804
|
+
display: flex;
|
|
805
|
+
align-items: center;
|
|
806
|
+
justify-content: center;
|
|
590
807
|
}
|
|
591
808
|
}
|
|
592
809
|
}
|
|
@@ -3,31 +3,58 @@
|
|
|
3
3
|
<view class="coupon_left" :style="{
|
|
4
4
|
background: couponLeftBgColor
|
|
5
5
|
}">
|
|
6
|
-
<view class="_point">
|
|
7
|
-
|
|
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.card_use_rule }}</view>
|
|
8
18
|
</view>
|
|
9
19
|
<view class="coupon_right" :style="couponRightItemBoxStyle">
|
|
10
20
|
<view class="cont_top" :style="{
|
|
11
21
|
background: couponTitleBgColor
|
|
12
|
-
}"
|
|
22
|
+
}">{{ item.card_type_name }}</view>
|
|
13
23
|
<view class="cont_main">
|
|
14
|
-
<view class="cou_number">券号:
|
|
15
|
-
<view class="cou_time">有效期:
|
|
16
|
-
<view class="cou_point"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
<view class="cou_number">券号:{{ item.card_number }}</view>
|
|
25
|
+
<view class="cou_time">有效期:{{ item.end_time }}</view>
|
|
26
|
+
<view class="cou_point">
|
|
27
|
+
余额:
|
|
28
|
+
<xd-unit
|
|
29
|
+
:unitFontSize="24"
|
|
30
|
+
:fontSize="28"
|
|
31
|
+
:price="item.card_point"
|
|
32
|
+
:isOld="false"
|
|
33
|
+
:unit="item.unit || ''"
|
|
34
|
+
:colorNew="'#333333'"
|
|
35
|
+
></xd-unit>
|
|
36
|
+
</view>
|
|
37
|
+
<view class="cou_btn"
|
|
38
|
+
:style="[
|
|
39
|
+
item.is_login === 'Y' ? couponBtnActiveStyle : couponBtnStyle,
|
|
40
|
+
{
|
|
41
|
+
padding: couponBtnPadding,
|
|
42
|
+
borderRadius: couponBtnRadius + 'rpx'
|
|
43
|
+
}
|
|
44
|
+
]"
|
|
45
|
+
@click="goToUseCoupon"
|
|
46
|
+
>{{item.is_login === 'Y' ? '已登录' : '去使用'}}</view>
|
|
21
47
|
</view>
|
|
22
48
|
<view class="cont_bottom">
|
|
23
|
-
<view class="switch_rule">
|
|
49
|
+
<view class="switch_rule" @click="switchRule">
|
|
24
50
|
<view>使用规则</view>
|
|
25
51
|
<view>
|
|
26
|
-
<xd-font-icon icon="iconxia_down" size="24"></xd-font-icon>
|
|
52
|
+
<xd-font-icon v-if="!expand" icon="iconxia_down" size="24"></xd-font-icon>
|
|
53
|
+
<xd-font-icon v-else icon="iconshang_up" size="24"></xd-font-icon>
|
|
27
54
|
</view>
|
|
28
55
|
</view>
|
|
29
|
-
<view class="expand_rule">
|
|
30
|
-
|
|
56
|
+
<view v-if="expand" class="expand_rule">
|
|
57
|
+
{{ item.card_use_rule }}
|
|
31
58
|
</view>
|
|
32
59
|
</view>
|
|
33
60
|
</view>
|
|
@@ -35,13 +62,18 @@
|
|
|
35
62
|
</template>
|
|
36
63
|
<script>
|
|
37
64
|
import getServiceUrl from '@/common/getServiceUrl'
|
|
65
|
+
import XdUnit from "@/components/XdUnit/XdUnit";
|
|
38
66
|
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
39
67
|
export default{
|
|
40
68
|
name: "XdCouponItem",
|
|
41
69
|
components: {
|
|
42
|
-
XdFontIcon
|
|
70
|
+
XdFontIcon,
|
|
71
|
+
XdUnit
|
|
43
72
|
},
|
|
44
73
|
props: {
|
|
74
|
+
item:{
|
|
75
|
+
type: Object,
|
|
76
|
+
},
|
|
45
77
|
couponRadius: {
|
|
46
78
|
type: String,
|
|
47
79
|
default: "16"
|
|
@@ -86,7 +118,7 @@
|
|
|
86
118
|
},
|
|
87
119
|
data() {
|
|
88
120
|
return {
|
|
89
|
-
|
|
121
|
+
expand: false,
|
|
90
122
|
}
|
|
91
123
|
},
|
|
92
124
|
computed: {
|
|
@@ -111,6 +143,14 @@
|
|
|
111
143
|
}
|
|
112
144
|
return this.styleObjectToString(styleObj)
|
|
113
145
|
},
|
|
146
|
+
couponBtnActiveStyle(){
|
|
147
|
+
return this.styleObjectToString({
|
|
148
|
+
color: this.couponBtnTextStyle['actColor'] || '#fff',
|
|
149
|
+
background: this.couponBtnTextStyle['actBgColor'] || '#ff5722',
|
|
150
|
+
fontSize: this.couponBtnTextStyle['actFontSize'] || '30rpx',
|
|
151
|
+
fontWeight: this.couponBtnTextStyle['actFontWeight'] || 'normal',
|
|
152
|
+
})
|
|
153
|
+
},
|
|
114
154
|
couponRightItemBoxStyle(){
|
|
115
155
|
let image = {};
|
|
116
156
|
if(this.cardImageUrl) image = {
|
|
@@ -133,6 +173,12 @@
|
|
|
133
173
|
},
|
|
134
174
|
},
|
|
135
175
|
methods: {
|
|
176
|
+
switchRule(){
|
|
177
|
+
this.expand = !this.expand;
|
|
178
|
+
},
|
|
179
|
+
goToUseCoupon(){
|
|
180
|
+
this.$emit('useCoupon', this.item);
|
|
181
|
+
},
|
|
136
182
|
checkValue(value, dValue = 0){
|
|
137
183
|
if(value === undefined || value === '' || value === null) return dValue;
|
|
138
184
|
return Number(value || 0);
|
|
@@ -177,6 +223,7 @@
|
|
|
177
223
|
.cont_main{
|
|
178
224
|
position: relative;
|
|
179
225
|
padding: 28rpx 20rpx 28rpx 40rpx;
|
|
226
|
+
color: #333333;
|
|
180
227
|
.cou_number{
|
|
181
228
|
font-size: 32rpx;
|
|
182
229
|
font-weight: bold;
|
|
@@ -187,6 +234,8 @@
|
|
|
187
234
|
}
|
|
188
235
|
.cou_point{
|
|
189
236
|
font-size: 28rpx;
|
|
237
|
+
display: flex;
|
|
238
|
+
align-items: center;
|
|
190
239
|
}
|
|
191
240
|
.cou_btn{
|
|
192
241
|
position: absolute;
|
|
@@ -204,10 +253,13 @@
|
|
|
204
253
|
align-items: center;
|
|
205
254
|
justify-content: space-between;
|
|
206
255
|
padding: 12rpx 40rpx;
|
|
256
|
+
font-size: 24rpx;
|
|
257
|
+
color: #666666;
|
|
207
258
|
}
|
|
208
259
|
.expand_rule{
|
|
209
260
|
padding: 12rpx 40rpx;
|
|
210
261
|
font-size: 20rpx;
|
|
262
|
+
color: #333333;
|
|
211
263
|
overflow: hidden;
|
|
212
264
|
white-space: nowrap;
|
|
213
265
|
text-overflow: ellipsis;
|