jufubao-base 1.0.169-beta5 → 1.0.169-beta6
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 +133 -8
- package/src/components/JfbBaseTfkCardLogin/Attr.js +160 -0
- package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +215 -27
- package/src/components/JfbBaseTfkCardLogin/Mock.js +1 -1
- package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +68 -16
- package/src/components/JfbBaseTfkSearch/CustomList.vue +3 -11
- package/src/components/JfbBaseTfkSearch/SkeletonProduct.vue +63 -8
|
@@ -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">
|
|
@@ -90,24 +94,37 @@
|
|
|
90
94
|
<view v-else>
|
|
91
95
|
<view v-if="cardList.length" class="bind_list">
|
|
92
96
|
<view class="bind_item" v-for="(item, i) in cardList" :key="i"
|
|
93
|
-
:style="cardItemBoxStyle">
|
|
94
|
-
<view class="bind_point">
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
:style="cardItemBoxStyle" @click="toCardDetail(item)">
|
|
98
|
+
<view class="bind_point">
|
|
99
|
+
<xd-unit
|
|
100
|
+
:unitFontSize="24"
|
|
101
|
+
:fontSize="48"
|
|
102
|
+
:price="item.card_point"
|
|
103
|
+
:isOld="false"
|
|
104
|
+
:unit="item.unit || ''"
|
|
105
|
+
></xd-unit>
|
|
106
|
+
</view>
|
|
107
|
+
<view v-if="item.other_card_point && item.card_point_type !== 1" class="bind_deduct">
|
|
108
|
+
兑换其他商品可抵:{{ item.other_card_point }}
|
|
109
|
+
</view>
|
|
110
|
+
<view class="bind_number">{{ item.card_number }}</view>
|
|
111
|
+
<view class="bind_time">{{ item.end_time }}到期</view>
|
|
98
112
|
<view class="bind_type" :style="{
|
|
99
113
|
top: cardPadding.top + 'rpx',
|
|
100
114
|
right: cardPadding.right + 'rpx',
|
|
101
115
|
}">
|
|
102
|
-
<view
|
|
103
|
-
<view>(可转票券)</view>
|
|
116
|
+
<view>{{ item.card_type_name }}</view>
|
|
117
|
+
<view v-if="item.is_exchange === 'Y'">(可转票券)</view>
|
|
104
118
|
</view>
|
|
105
|
-
<view class="bind_btn"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
<view class="bind_btn"
|
|
120
|
+
:style="[{
|
|
121
|
+
right: cardPadding.right + 'rpx',
|
|
122
|
+
bottom: cardPadding.bottom + 'rpx',
|
|
123
|
+
borderRadius: cardBtnRadius + 'rpx',
|
|
124
|
+
padding: bindCardBtnPadding
|
|
125
|
+
}, item.is_login === 'Y' ? bindCardActiveStyle : bindCardBtnStyle]"
|
|
126
|
+
@click.stop="doCardLogin(item)"
|
|
127
|
+
>{{ item.is_login === 'Y' ? '已登录' : '登录'}}</view>
|
|
111
128
|
</view>
|
|
112
129
|
<view v-if="!hasCardList" class="no_more_card">没有更多券了,查看失效的票券 ></view>
|
|
113
130
|
</view>
|
|
@@ -128,6 +145,8 @@
|
|
|
128
145
|
:couponBtnRadius="couponBtnRadius"
|
|
129
146
|
:couponBtnTextStyle="couponBtnTextStyle"
|
|
130
147
|
:couponLeftBgColor="couponLeftBgColor"
|
|
148
|
+
:item="item"
|
|
149
|
+
@useCoupon="doCardLogin(item)"
|
|
131
150
|
></xd-coupon-item>
|
|
132
151
|
<view v-if="!hasCouponList" class="no_more_card">没有更多券了,查看失效的票券 ></view>
|
|
133
152
|
</view>
|
|
@@ -144,6 +163,7 @@
|
|
|
144
163
|
|
|
145
164
|
<script>
|
|
146
165
|
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
166
|
+
import XdUnit from "@/components/XdUnit/XdUnit";
|
|
147
167
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
148
168
|
import JfbBaseTfkCardLoginMixin from "./JfbBaseTfkCardLoginMixin";
|
|
149
169
|
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
@@ -153,25 +173,35 @@
|
|
|
153
173
|
import XdNoticeBar from "@/components/XdNoticeBar/XdNoticeBar";
|
|
154
174
|
import XdCouponItem from "./XdCouponItem";
|
|
155
175
|
import Color from "color"
|
|
176
|
+
import { mapState, mapActions } from "vuex";
|
|
156
177
|
export default {
|
|
157
178
|
name: "JfbBaseTfkCardLogin",
|
|
158
179
|
components: {
|
|
159
180
|
XdFontIcon,
|
|
160
181
|
XdNoticeBar,
|
|
161
182
|
XdCouponItem,
|
|
183
|
+
XdUnit
|
|
162
184
|
},
|
|
163
185
|
mixins: [
|
|
164
186
|
componentsMixins, extsMixins, JfbBaseTfkCardLoginMixin
|
|
165
187
|
],
|
|
166
188
|
data() {
|
|
167
189
|
return {
|
|
168
|
-
menuType: "
|
|
169
|
-
loadingList:
|
|
170
|
-
cardList: [
|
|
171
|
-
couponList: [
|
|
190
|
+
menuType: "card", // card, coupon
|
|
191
|
+
loadingList: true,
|
|
192
|
+
cardList: [],
|
|
193
|
+
couponList: [],
|
|
172
194
|
hasCardList: false,
|
|
173
195
|
hasCouponList: false,
|
|
174
196
|
|
|
197
|
+
inCallbackUrlOrg:'',//是否带有回调地址
|
|
198
|
+
inCallback: null, //内部跳转地址
|
|
199
|
+
allEntryPath: "", //综合福利入口页
|
|
200
|
+
cardDetailPath: "", //我的票券包详情页
|
|
201
|
+
|
|
202
|
+
options: {},
|
|
203
|
+
showDisabled: 'Y',
|
|
204
|
+
|
|
175
205
|
//todo
|
|
176
206
|
previewCurrent: "",
|
|
177
207
|
isPreview: false,
|
|
@@ -204,9 +234,21 @@
|
|
|
204
234
|
noticeMargin: {},
|
|
205
235
|
noticePadding: {},
|
|
206
236
|
noticeFont: {},
|
|
237
|
+
bindCardText: "",
|
|
238
|
+
bindCardTextStyle: {},
|
|
239
|
+
bindCardShowType: "",
|
|
240
|
+
bindCardBtnRadius: 16,
|
|
241
|
+
cardBorder: {},
|
|
242
|
+
cardShadow: {},
|
|
243
|
+
cardImageMode: "",
|
|
244
|
+
entryGroupId: "",
|
|
207
245
|
}
|
|
208
246
|
},
|
|
209
247
|
computed: {
|
|
248
|
+
...mapState({
|
|
249
|
+
jwxSDK: (state) => state.jwxSDK,
|
|
250
|
+
jfbAuthorize: (state) => state.jfbAuthorize,
|
|
251
|
+
}),
|
|
210
252
|
menuBoxStyle(){
|
|
211
253
|
let padding = `${this.checkValue(this.menuPadding.top, 20)}rpx`;
|
|
212
254
|
padding = `${padding} ${this.checkValue(this.menuPadding.right, 20)}rpx`;
|
|
@@ -291,6 +333,21 @@
|
|
|
291
333
|
}
|
|
292
334
|
return this.styleObjectToString(styleObj)
|
|
293
335
|
},
|
|
336
|
+
bindCardBoxStyle(){
|
|
337
|
+
return this.styleObjectToString({
|
|
338
|
+
border: `1px solid ${this.bindCardShowType == 'button' ? this.bindCardTextStyle.color : 'transparent'}`,
|
|
339
|
+
borderRadius: this.bindCardBtnRadius + 'rpx',
|
|
340
|
+
})
|
|
341
|
+
},
|
|
342
|
+
getBindCardTextStyle(){
|
|
343
|
+
let styleObj = {
|
|
344
|
+
color: this.bindCardTextStyle['color'] || '#333',
|
|
345
|
+
fontSize: this.bindCardTextStyle['fontSize'] || '30rpx',
|
|
346
|
+
fontWeight: this.bindCardTextStyle['fontWeight'] || 'normal',
|
|
347
|
+
marginLeft: this.bindCardIcon.icon ? '10rpx' : 0,
|
|
348
|
+
}
|
|
349
|
+
return this.styleObjectToString(styleObj)
|
|
350
|
+
},
|
|
294
351
|
getCardBgImage(){
|
|
295
352
|
let bg = '';
|
|
296
353
|
if(this.$xdUniHelper.checkVarType(this.cardImageUrl) === 'object'
|
|
@@ -304,18 +361,34 @@
|
|
|
304
361
|
},
|
|
305
362
|
cardItemBoxStyle(){
|
|
306
363
|
let image = {};
|
|
364
|
+
let border = "none";
|
|
365
|
+
let boxShadow = "none";
|
|
366
|
+
if(this.cardBorder && this.cardBorder.type === 'Y'){
|
|
367
|
+
let { width, color } = this.cardBorder.value;
|
|
368
|
+
border = `${width}rpx solid ${color}`;
|
|
369
|
+
}
|
|
370
|
+
if(this.cardShadow && this.cardShadow.type === 'Y'){
|
|
371
|
+
let { width, color } = this.cardShadow.value;
|
|
372
|
+
boxShadow = `0 0 ${width}rpx ${color}`;
|
|
373
|
+
}
|
|
307
374
|
if(this.cardImageUrl) image = {
|
|
308
375
|
backgroundImage: `url(${this.getCardBgImage})`,
|
|
309
376
|
backgroundSize: '100%',
|
|
310
377
|
backgroundRepeat: 'no-repeat',
|
|
311
378
|
}
|
|
379
|
+
if(this.cardImageMode) image['backgroundSize'] = this.cardImageMode;
|
|
380
|
+
|
|
312
381
|
let padding = `${this.checkValue(this.cardPadding.top, 20)}rpx`;
|
|
313
382
|
padding = `${padding} ${this.checkValue(this.cardPadding.right, 20)}rpx`;
|
|
314
383
|
padding = `${padding} ${this.checkValue(this.cardPadding.bottom, 20)}rpx`;
|
|
315
384
|
padding = `${padding} ${this.checkValue(this.cardPadding.left, 20)}rpx`;
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
385
|
+
return this.styleObjectToString({
|
|
386
|
+
...image,
|
|
387
|
+
padding: padding,
|
|
388
|
+
borderRadius: this.cardRadius + 'rpx',
|
|
389
|
+
border: border,
|
|
390
|
+
boxShadow: boxShadow,
|
|
391
|
+
})
|
|
319
392
|
},
|
|
320
393
|
listBoxStyle(){
|
|
321
394
|
let padding = `${this.checkValue(this.cardListPadding.top, 20)}rpx`;
|
|
@@ -387,6 +460,22 @@
|
|
|
387
460
|
},
|
|
388
461
|
methods: {
|
|
389
462
|
onJfbLoad(options) {
|
|
463
|
+
this.options = options;
|
|
464
|
+
let { inCallback } = options;
|
|
465
|
+
if(!inCallback) this.$storage.remove("inCallback"); //作为入口
|
|
466
|
+
else {
|
|
467
|
+
this.$storage.set("inCallback", inCallback);
|
|
468
|
+
try{
|
|
469
|
+
inCallback = Base64.decode(inCallback);
|
|
470
|
+
this.inCallbackUrlOrg = options.inCallback;
|
|
471
|
+
}catch (e){
|
|
472
|
+
inCallback = null;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
//登录成功调整地址优先级
|
|
476
|
+
this.inCallback = inCallback || this.allEntryPath || this.settings.index;
|
|
477
|
+
|
|
478
|
+
this.getCardList();
|
|
390
479
|
this.getContent();
|
|
391
480
|
},
|
|
392
481
|
/**
|
|
@@ -421,13 +510,106 @@
|
|
|
421
510
|
this.noticeMargin = getContainerPropsValue(value, "content.noticeMargin", {top: 20, left: 20, right: 20, bottom: 20});
|
|
422
511
|
this.noticePadding = getContainerPropsValue(value, "content.noticePadding", {top: 20, left: 20, right: 20, bottom: 20});
|
|
423
512
|
this.noticeFont = getContainerPropsValue(value, "content.noticeFont", {});
|
|
513
|
+
this.bindCardText = getContainerPropsValue(value, "content.bindCardText", "");
|
|
514
|
+
this.bindCardTextStyle = getContainerPropsValue(value, "content.bindCardTextStyle", {});
|
|
515
|
+
this.bindCardShowType = getContainerPropsValue(value, "content.bindCardShowType", 'text');
|
|
516
|
+
this.bindCardBtnRadius = getContainerPropsValue(value, "content.bindCardBtnRadius", 16);
|
|
517
|
+
this.cardBorder = getContainerPropsValue(value, "content.cardBorder", {});
|
|
518
|
+
this.cardShadow = getContainerPropsValue(value, "content.cardShadow", {});
|
|
519
|
+
this.cardImageMode = getContainerPropsValue(value, "content.cardImageMode", '');
|
|
520
|
+
this.allEntryPath = getContainerPropsValue(value, "content.allEntryPath", {value: ""}).value;
|
|
521
|
+
this.cardDetailPath = getContainerPropsValue(value, "content.cardDetailPath", {value: "/tfktest/system/card/tkfDetail"}).value;
|
|
522
|
+
// this.entryGroupId = getContainerPropsValue(value,"content.entryGroupId","default");
|
|
424
523
|
|
|
425
|
-
console.log(this.
|
|
524
|
+
console.log(this.cardShadow, 'cardShadow')
|
|
525
|
+
if(this.bindCardTextStyle && !this.bindCardTextStyle.color){
|
|
526
|
+
this.bindCardTextStyle.color = this.mainColor;
|
|
527
|
+
}
|
|
528
|
+
if(this.bindCardIcon && !this.bindCardIcon.color){
|
|
529
|
+
this.bindCardIcon.color = this.mainColor;
|
|
530
|
+
}
|
|
531
|
+
if(this.menuTabColor && !this.menuTabColor.actColor){
|
|
532
|
+
this.menuTabColor.actColor = this.mainColor;
|
|
533
|
+
}
|
|
534
|
+
if(this.cardBtnTextStyle){
|
|
535
|
+
if(!this.cardBtnTextStyle.actBgColor){
|
|
536
|
+
this.cardBtnTextStyle.actBgColor = this.mainColor;
|
|
537
|
+
}
|
|
538
|
+
if(!this.cardBtnTextStyle.bgColor){
|
|
539
|
+
this.cardBtnTextStyle.bgColor = this.mainColor;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
426
542
|
|
|
427
543
|
if(this.$configProject.isPreview){
|
|
428
544
|
this.menuType = this.previewCurrent;
|
|
429
545
|
}
|
|
430
546
|
},
|
|
547
|
+
toCardDetail(item){
|
|
548
|
+
this.$xdUniHelper.navigateTo({
|
|
549
|
+
url: this.cardDetailPath + `?card_number=${item["card_number"]}`
|
|
550
|
+
},false)
|
|
551
|
+
},
|
|
552
|
+
doCardLogin(item){
|
|
553
|
+
this.$xdShowLoading({});
|
|
554
|
+
jfbRootExec("loginTfkCardBind", {
|
|
555
|
+
vm: this,
|
|
556
|
+
data: {
|
|
557
|
+
card_number: item["card_number"]
|
|
558
|
+
}
|
|
559
|
+
}).then(res => {
|
|
560
|
+
this.$xdHideLoading();
|
|
561
|
+
//#ifdef MP-WEIXIN
|
|
562
|
+
if (this.jfbAuthorize !== null) {
|
|
563
|
+
this.jfbAuthorize.setCardToken(res);
|
|
564
|
+
}
|
|
565
|
+
//#endif
|
|
566
|
+
|
|
567
|
+
if (this.$configProject.isPreview) {
|
|
568
|
+
console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
|
|
569
|
+
} else {
|
|
570
|
+
this.$xdUniHelper.redirectTo({
|
|
571
|
+
url: this.inCallback,
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
}).catch((res) => {
|
|
575
|
+
this.$xdHideLoading();
|
|
576
|
+
});
|
|
577
|
+
},
|
|
578
|
+
changeMenu(menu){
|
|
579
|
+
this.menuType = menu;
|
|
580
|
+
this.getCardList();
|
|
581
|
+
},
|
|
582
|
+
getCardList(){
|
|
583
|
+
let show_type = this.menuType === 'coupon' ? 'coupon' : 'normal';
|
|
584
|
+
let params = {show_type};
|
|
585
|
+
|
|
586
|
+
// let params = {is_all: 'Y', is_show_entry_settings: 'Y'};
|
|
587
|
+
// if(options['jfb_business_code']) {
|
|
588
|
+
// params['card_business_code'] = options['jfb_business_code'];
|
|
589
|
+
// }
|
|
590
|
+
// if(this.entryGroupId) params['group_id'] = this.entryGroupId;
|
|
591
|
+
this.$xdShowLoading({});
|
|
592
|
+
jfbRootExec("getTfkListCardBind", {
|
|
593
|
+
vm: this,
|
|
594
|
+
data: params,
|
|
595
|
+
}).then(res => {
|
|
596
|
+
this.loadingList = false;
|
|
597
|
+
this.$xdHideLoading();
|
|
598
|
+
this.showDisabled = res.is_show_invalid_card_entrance;
|
|
599
|
+
|
|
600
|
+
let list = res.list.map(item => {
|
|
601
|
+
item.other_card_point = item.other_card_point ? this.$xdUniHelper.divisionFloatNumber(item.other_card_point, 100) : 0
|
|
602
|
+
return item;
|
|
603
|
+
})
|
|
604
|
+
if(show_type === 'coupon'){
|
|
605
|
+
this.couponList = list;
|
|
606
|
+
}
|
|
607
|
+
if(show_type === 'normal'){
|
|
608
|
+
this.cardList = list;
|
|
609
|
+
}
|
|
610
|
+
})
|
|
611
|
+
.catch(() => this.$xdHideLoading());
|
|
612
|
+
},
|
|
431
613
|
toBindCard(){
|
|
432
614
|
this.$xdUniHelper.navigateTo({
|
|
433
615
|
url: this.cardBindPath
|
|
@@ -497,6 +679,12 @@
|
|
|
497
679
|
border-bottom: 1px solid transparent;
|
|
498
680
|
}
|
|
499
681
|
}
|
|
682
|
+
.bind_card{
|
|
683
|
+
display: flex;
|
|
684
|
+
align-items: center;
|
|
685
|
+
padding: 8rpx 20rpx;
|
|
686
|
+
border-radius: 16rpx;
|
|
687
|
+
}
|
|
500
688
|
}
|
|
501
689
|
&-notice {
|
|
502
690
|
width: 100%;
|
|
@@ -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;
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
>
|
|
20
20
|
<skeleton-product
|
|
21
21
|
:cell="type_other"
|
|
22
|
-
v-if="type_code === 'product'"
|
|
23
|
-
:product-config="productConfig"
|
|
22
|
+
v-if="$parentVm.productConfig !== null && type_code === 'product'"
|
|
23
|
+
:product-config="$parentVm.productConfig"
|
|
24
|
+
:out-spacing="$parentVm.outSpacing"
|
|
24
25
|
></skeleton-product>
|
|
25
26
|
<skeleton-shop v-if="type_code === 'show'" :out-spacing="$parentVm.outSpacing"></skeleton-shop>
|
|
26
27
|
<skeleton-film v-if="type_code === 'film'" :out-spacing="$parentVm.outSpacing"></skeleton-film>
|
|
@@ -103,15 +104,6 @@ export default {
|
|
|
103
104
|
num = num - this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20) - this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20);
|
|
104
105
|
return num - this.$parentVm.contBorderWidth * 2
|
|
105
106
|
},
|
|
106
|
-
productConfig(){
|
|
107
|
-
if(this.$parentVm === null) {
|
|
108
|
-
return null
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
is_show_brand: this.$parentVm.is_show_brand,
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
107
|
},
|
|
116
108
|
data(){
|
|
117
109
|
return {
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="skeleton-wrap-item">
|
|
2
|
+
<view class="skeleton-wrap-item" :class="{display: cell===1}">
|
|
3
3
|
<template v-if="cell===1">
|
|
4
|
-
|
|
4
|
+
<view class="image skeleton-item" :style="{marginRight:outSpacing + 'rpx'}"></view>
|
|
5
|
+
<view class="content">
|
|
6
|
+
<view class="top">
|
|
7
|
+
<view class="title skeleton-item"></view>
|
|
8
|
+
<view class="brand skeleton-item"></view>
|
|
9
|
+
<view class="tags skeleton-item"></view>
|
|
10
|
+
</view>
|
|
11
|
+
<view class="bottom">
|
|
12
|
+
<view class="price skeleton-item"></view>
|
|
13
|
+
<view class="orgPrice skeleton-item"></view>
|
|
14
|
+
<view class="cart skeleton-item"></view>
|
|
15
|
+
</view>
|
|
16
|
+
</view>
|
|
5
17
|
</template>
|
|
6
18
|
<template v-if="cell===2">
|
|
7
19
|
|
|
@@ -21,8 +33,9 @@ export default {
|
|
|
21
33
|
type: Number|String,
|
|
22
34
|
required: true
|
|
23
35
|
},
|
|
24
|
-
productConfig
|
|
25
|
-
|
|
36
|
+
productConfig:{
|
|
37
|
+
type:Object|null,
|
|
38
|
+
default: null
|
|
26
39
|
},
|
|
27
40
|
}
|
|
28
41
|
}
|
|
@@ -32,10 +45,52 @@ export default {
|
|
|
32
45
|
|
|
33
46
|
<style scoped lang="less">
|
|
34
47
|
.skeleton-wrap-item {
|
|
35
|
-
height:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
min-height: 200rpx;
|
|
49
|
+
|
|
50
|
+
&.display {
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: space-between;
|
|
53
|
+
align-items: center;
|
|
54
|
+
align-content: space-between;
|
|
55
|
+
|
|
56
|
+
& .image {
|
|
57
|
+
.skeleton-item(200rpx, 200rpx);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
& .content {
|
|
61
|
+
flex: 1;
|
|
62
|
+
min-height: 200rpx;
|
|
63
|
+
|
|
64
|
+
.top {
|
|
65
|
+
height: 140rpx;
|
|
66
|
+
|
|
67
|
+
& .title {
|
|
68
|
+
.skeleton-item(100%, 60rpx);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
.bottom {
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: flex-start;
|
|
74
|
+
align-content: center;
|
|
75
|
+
align-items: center;
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 60rpx;
|
|
78
|
+
|
|
79
|
+
& .price {
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
.skeleton-item(100rpx, 35rpx);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
& .orgPrice {
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
margin-left: 20rpx;
|
|
87
|
+
.skeleton-item(130rpx, 20rpx);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
39
94
|
|
|
40
95
|
//影片列表骨架
|
|
41
96
|
&-image {
|