jufubao-base 1.0.203 → 1.0.204

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.
@@ -170,116 +170,132 @@
170
170
  v-if="tabIndex === 1 && (cardList && cardList.length > 0)"
171
171
  class="jfb-base-card-entry__body-card"
172
172
  >
173
- <view
174
- v-for="(item,index) in cardList"
175
- :data-index="item.card_number"
176
- :data-idx="index"
177
- :data-top="item.top"
178
- class="card-list"
179
- :key="item.card_number"
180
- @click="toDetail(item)"
181
- v-if="setCardItemShow(item,index)"
182
- :style="{
183
- background: item['theme']['color'],
184
- backgroundSize: '100%',
185
- height: subTabIndex !== 3 ? item.height + 'px' : '300rpx'
186
- }"
187
- >
188
- <view class="card-list-warp" :style="{backgroundImage: 'url('+ item['theme']['image'] +')'}">
189
- <view class="card-list__title">
190
- <view>
191
- <view>{{item['card_type_name']}}</view>
192
- <view v-if="item['is_login'] === 'Y'"><text></text><text>已登录</text></view>
193
- </view>
194
- </view>
195
- <view class="card-list__content">
196
- <view>
197
- <text>券号:</text>
198
- <text>{{item.card_number}}{{showIndex?(':' + index):''}}</text>
199
- </view>
200
- <view @click.stop="toDetail(item)" v-if="subTabIndex !== 3&&isShowCode === 'Y'&&!force">
173
+ <template v-if="cardType==='default'">
174
+ <view
175
+ v-for="(item,index) in cardList"
176
+ :data-index="item.card_number"
177
+ :data-idx="index"
178
+ :data-top="item.top"
179
+ class="card-list"
180
+ :key="item.card_number"
181
+ @click="toDetail(item)"
182
+ v-if="setCardItemShow(item,index)"
183
+ :style="{
184
+ background: item['theme']['color'],
185
+ backgroundSize: '100%',
186
+ height: subTabIndex !== 3 ? item.height + 'px' : '300rpx'
187
+ }"
188
+ >
189
+ <view class="card-list-warp" :style="{backgroundImage: 'url('+ item['theme']['image'] +')'}">
190
+ <view class="card-list__title">
201
191
  <view>
202
- <xd-font-icon icon="iconerweima" width="56" height="56" size="50" color="#fff"></xd-font-icon>
192
+ <view>{{item['card_type_name']}}</view>
193
+ <view v-if="item['is_login'] === 'Y'"><text></text><text>已登录</text></view>
203
194
  </view>
204
- <view>点击查看</view>
205
195
  </view>
206
- </view>
207
- <view class="card-list__date">
208
- <text>有效期:</text>
209
- <text>{{item.end_time}}</text>
210
- </view>
211
- <view class="card-list__yue">
212
- <text>余额:</text>
213
- <text>{{item.card_point}} {{ item.unit }}</text>
214
- </view>
215
- <view class="card-list__other" v-if="item.other_card_point && item.card_point_type === 2">
216
- <view><text>购买其他物品可抵:</text><text>{{item.other_card_point}} {{ item.unit }}</text></view>
217
- </view>
218
- <template v-if="subTabIndex === 1">
219
- <view class="card-list__entry" v-if="item.is_login==='N'&&force">
220
- <view
221
- @click.stop="handleBindLogin(item,item['entries'][0])"
222
- :style="{
223
- background: '#fff',
224
- color: item['theme']['color']}"
225
- >
226
- 登录
196
+ <view class="card-list__content">
197
+ <view>
198
+ <text>券号:</text>
199
+ <text>{{item.card_number}}{{showIndex?(':' + index):''}}</text>
200
+ </view>
201
+ <view @click.stop="toDetail(item)" v-if="subTabIndex !== 3&&isShowCode === 'Y'&&!force">
202
+ <view>
203
+ <xd-font-icon icon="iconerweima" width="56" height="56" size="50" color="#fff"></xd-font-icon>
204
+ </view>
205
+ <view>点击查看</view>
227
206
  </view>
228
207
  </view>
229
- <view class="card-list__entry" v-if="item.entries.length === 1&&!force">
230
- <view
231
- @click.stop="handleBindLogin(item,item['entries'][0])"
232
- :style="{color: item['theme']['color']}"
233
- >进入{{item['entries'][0]['entry_name']}}</view>
208
+ <view class="card-list__date">
209
+ <text>有效期:</text>
210
+ <text>{{item.end_time}}</text>
211
+ </view>
212
+ <view class="card-list__yue">
213
+ <text>余额:</text>
214
+ <text>{{item.card_point}} {{ item.unit }}</text>
234
215
  </view>
235
- <view class="card-list__nodata" v-if="item.entries.length === 0&&!force">暂无支持服务列表</view>
236
- <view class="card-list__entrys" v-if="item.entries.length > 1&&!force" @click.stop>
237
- <view class="card-list__entrys-title">
238
- <view>可兑换权益</view>
239
- <view @click.stop="toDetail(item, false)">
240
- <text>查看详情</text>
241
- <xd-font-icon icon="iconxiangyou_xian" color="#999" size="20"></xd-font-icon>
216
+ <view class="card-list__other" v-if="item.other_card_point && item.card_point_type === 2">
217
+ <view><text>购买其他物品可抵:</text><text>{{item.other_card_point}} {{ item.unit }}</text></view>
218
+ </view>
219
+ <template v-if="subTabIndex === 1">
220
+ <view class="card-list__entry" v-if="item.is_login==='N'&&force">
221
+ <view
222
+ @click.stop="handleBindLogin(item,item['entries'][0])"
223
+ :style="{
224
+ background: '#fff',
225
+ color: item['theme']['color']}"
226
+ >
227
+ 登录
242
228
  </view>
243
229
  </view>
244
- <view class="card-list__entrys-list">
245
- <scroll-view scroll-x class="card-list__entrys-scroll">
246
- <view class="card-list__entrys-item">
247
- <view
248
- v-for="(entry,idx) in item.entries"
249
- :key="idx"
250
- @click.stop="handleBindLogin(item, entry)"
251
- >
252
- <view><image :src="entry.image_url"></image></view>
253
- <view>{{entry|cutstr}}</view>
254
- <view>
255
- <text>去兑换</text>
256
- <xd-font-icon icon="iconxiangyou_xian" color="#999" size="20"></xd-font-icon>
230
+ <view class="card-list__entry" v-if="item.entries.length === 1&&!force">
231
+ <view
232
+ @click.stop="handleBindLogin(item,item['entries'][0])"
233
+ :style="{color: item['theme']['color']}"
234
+ >进入{{item['entries'][0]['entry_name']}}</view>
235
+ </view>
236
+ <view class="card-list__nodata" v-if="item.entries.length === 0&&!force">暂无支持服务列表</view>
237
+ <view class="card-list__entrys" v-if="item.entries.length > 1&&!force" @click.stop>
238
+ <view class="card-list__entrys-title">
239
+ <view>可兑换权益</view>
240
+ <view @click.stop="toDetail(item, false)">
241
+ <text>查看详情</text>
242
+ <xd-font-icon icon="iconxiangyou_xian" color="#999" size="20"></xd-font-icon>
243
+ </view>
244
+ </view>
245
+ <view class="card-list__entrys-list">
246
+ <scroll-view scroll-x class="card-list__entrys-scroll">
247
+ <view class="card-list__entrys-item">
248
+ <view
249
+ v-for="(entry,idx) in item.entries"
250
+ :key="idx"
251
+ @click.stop="handleBindLogin(item, entry)"
252
+ >
253
+ <view><image :src="entry.image_url"></image></view>
254
+ <view>{{entry|cutstr}}</view>
255
+ <view>
256
+ <text>去兑换</text>
257
+ <xd-font-icon icon="iconxiangyou_xian" color="#999" size="20"></xd-font-icon>
258
+ </view>
257
259
  </view>
258
260
  </view>
259
- </view>
260
- </scroll-view>
261
+ </scroll-view>
262
+ </view>
261
263
  </view>
264
+ </template>
265
+ <view class="card-list__entry" v-else-if="subTabIndex===2">
266
+ <view
267
+ @click.stop="handleBindLogin(item,item['entries'][0])"
268
+ :style="{color: item['theme']['color']}"
269
+ >票券转换</view>
262
270
  </view>
263
- </template>
264
- <view class="card-list__entry" v-else-if="subTabIndex===2">
265
- <view
266
- @click.stop="handleBindLogin(item,item['entries'][0])"
267
- :style="{color: item['theme']['color']}"
268
- >票券转换</view>
269
271
  </view>
270
272
  </view>
271
- </view>
272
- <view
273
- class="card-content-empty card-list"
274
- :data-index="item.card_number"
275
- :data-idx="index"
276
- :data-top="item.top"
277
- v-else
278
- :style="{
279
- height: item.height + 'px',
280
- backgroundImage: 'url('+ (tabIndex===2 || item.entries.length <= 1 ? cardItem: cardItemEntry) +')'
281
- }"
282
- ></view>
273
+ <view
274
+ class="card-content-empty card-list"
275
+ :data-index="item.card_number"
276
+ :data-idx="index"
277
+ :data-top="item.top"
278
+ v-else
279
+ :style="{
280
+ height: item.height + 'px',
281
+ backgroundImage: 'url('+ (tabIndex===2 || item.entries.length <= 1 ? cardItem: cardItemEntry) +')'
282
+ }"
283
+ ></view>
284
+ </template>
285
+ <template v-if="cardType==='style2'">
286
+
287
+ <view v-for="(item,index) in cardList" :key="item.card_number">
288
+ <xd-card-new
289
+ :item="item"
290
+ :tabIndex="subTabIndex"
291
+ :cardBgColor="cardBgColor"
292
+ :cardFontColor="cardFontColor"
293
+ :mainColor="mainColor"
294
+ @onLogin="handleBindLogin(item,item['entries'][0])"
295
+ @onClick="toDetail(item)"
296
+ ></xd-card-new>
297
+ </view>
298
+ </template>
283
299
  </view>
284
300
  <view v-if="tabIndex===2&&(couponList&&couponList.length)">
285
301
  <view v-if="couponList.length" class="coupon_list">
@@ -425,6 +441,7 @@
425
441
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
426
442
  import XdButton from "@/components/XdButton/XdButton";
427
443
  import XdCardV2 from "@/components/XdCardV2/XdCardV2";
444
+ import XdCardNew from "./XdCardNew.vue"
428
445
  import { jfbRootExec } from "@/utils/xd.event";
429
446
  import JfbBaseCardEntryMixin from "./JfbBaseCardEntryMixin";
430
447
  import componentsMixins from "@/mixins/componentsMixins";
@@ -447,7 +464,8 @@ export default {
447
464
  XdButton,
448
465
  XdNoticeBar,
449
466
  XdCardV2,
450
- CusCouponItem
467
+ CusCouponItem,
468
+ XdCardNew,
451
469
  },
452
470
  mixins: [componentsMixins, extsMixins, JfbBaseCardEntryMixin, colorCardMixins, cardListMixins],
453
471
  computed: {
@@ -517,6 +535,7 @@ export default {
517
535
  showCardList: false,
518
536
  showIndex:false,
519
537
  isQrCode: false,
538
+ cardType: 'default',
520
539
 
521
540
  //活动
522
541
  dialogEvent: false,
@@ -557,7 +576,10 @@ export default {
557
576
  card_use_rule: '满50减1',
558
577
  is_transfering: 'N'
559
578
  },
560
- ]
579
+ ],
580
+
581
+ cardBgColor: "",
582
+ cardFontColor: "",
561
583
  };
562
584
  },
563
585
  created() {
@@ -596,6 +618,7 @@ export default {
596
618
  this.isShowCode = getContainerPropsValue(container, "content.isShowCode", "Y");
597
619
  this.isShowCoupon = getContainerPropsValue(container, "content.isShowCoupon", "N");
598
620
  this.bindCard = getContainerPropsValue(container,"content.bindCard","1");
621
+ this.cardType = getContainerPropsValue(container,"content.cardType","default");
599
622
  //'wechat_mini_program|default'
600
623
  this.entryGroupId = getContainerPropsValue(container,"content.entryGroupId","default");
601
624
  this.couponBtnRadius = getContainerPropsValue(container, "content.couponBtnRadius", 16);
@@ -610,6 +633,8 @@ export default {
610
633
  this.couponRadius = getContainerPropsValue(container, "content.couponRadius", 16);
611
634
  this.couponLeftBgColor = getContainerPropsValue(container, "content.couponLeftBgColor", "linear-gradient(180deg, #FFA852 0%, #FF5733 100%)");
612
635
  this.couponImageUrl = getContainerPropsValue(container, "content.couponImageUrl", "");
636
+ this.cardBgColor = getContainerPropsValue(container, "content.cardBgColor", "");
637
+ this.cardFontColor = getContainerPropsValue(container, "content.cardFontColor", "");
613
638
  if(this.isPreview) {
614
639
  this.tabIndex = this.isShowCoupon==='Y'?2:1;
615
640
  }
@@ -714,6 +739,7 @@ export default {
714
739
  this.$xdShowLoading({});
715
740
  //转换卡跳转
716
741
  if(this.subTabIndex===2){
742
+ this.$xdHideLoading();
717
743
  this.$xdUniHelper.navigateTo({
718
744
  url: `${this.changeUrl}?card_number=${item["card_number"]}`
719
745
  }, false);
@@ -58,6 +58,7 @@ module.exports = {
58
58
  "other_card_point": 0,
59
59
  "is_exchange": "N",
60
60
  "is_transfering":"N",
61
+ "is_login":'Y',
61
62
  "card_point_type": 1,
62
63
  "business_codes": ["cake"]
63
64
  }, {
@@ -0,0 +1,135 @@
1
+ <!-- #小象风格 -->
2
+ <template>
3
+ <view class="xd-card-new" :style="{
4
+ backgroundColor: cardBgColor,
5
+ color: cardFontColor,
6
+ '--alpha-color': alphaColor
7
+ }" @click="onClick">
8
+ <view class="card-top">
9
+ <view class="card_name">{{item.card_type_name}}</view>
10
+ <view class="card_number">ID:{{ item.card_number }}</view>
11
+ </view>
12
+ <view class="card-center">
13
+ <view><text class="_b">{{item.card_point}}</text>{{item.unit}}</view>
14
+ <view>
15
+ <xd-button type="primary" size="small"
16
+ :class="'is_login_' + item['is_login']"
17
+ :style="{
18
+ backgroundColor: item['is_login'] === 'Y' ? alphaColor: mainColor,
19
+ }"
20
+ @click.stop="doLogin"
21
+ >
22
+ {{ tabIndex === 1 ? (item['is_login'] === 'Y' ? "已登录" : "登录") : "票券转换"}}
23
+ </xd-button>
24
+ </view>
25
+ </view>
26
+ <view class="card-bottom">
27
+ <view>有效期:{{item.end_time}}</view>
28
+ <view class="see_scope">查看使用范围</view>
29
+ </view>
30
+ </view>
31
+ </template>
32
+
33
+ <script>
34
+ import XdButton from "@/components/XdButton/XdButton.vue"
35
+ import Color from "color"
36
+ export default {
37
+ // #ifdef MP-WEIXIN
38
+ options: { styleIsolation: 'shared' },
39
+ // #endif
40
+ components: {
41
+ XdButton,
42
+ },
43
+ props: {
44
+ item: {
45
+ type: Object,
46
+ default () {
47
+ return {}
48
+ }
49
+ },
50
+ cardBgColor: {
51
+ type: String,
52
+ },
53
+ cardFontColor: {
54
+ type: String,
55
+ },
56
+ loggedBgColor: {
57
+ type: String,
58
+ },
59
+ mainColor: {
60
+ type: String,
61
+ },
62
+ tabIndex: {
63
+ type: Number,
64
+ },
65
+ },
66
+ data(){
67
+ return {
68
+ alphaColor: "",
69
+ }
70
+ },
71
+ created(){
72
+ this.alphaColor = Color(this.mainColor).alpha(0.5).toString();
73
+ },
74
+ methods: {
75
+ doLogin(){
76
+ this.$emit('onLogin', this.item)
77
+ },
78
+ onClick(){
79
+ this.$emit('onClick')
80
+ }
81
+ }
82
+ }
83
+ </script>
84
+
85
+ <style lang="less" scoped>
86
+ .xd-card-new{
87
+ background-color: #EEE;
88
+ margin-top: 20rpx;
89
+ border-radius: 10rpx;
90
+ padding: 20rpx;
91
+ .card-top{
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: space-between;
95
+ font-size: 26rpx;
96
+ .card_name{
97
+ font-size: 24rpx;
98
+ font-weight: 400;
99
+ }
100
+ .card_number{
101
+ font-weight: 28rpx;
102
+ font-weight: 500;
103
+ }
104
+ }
105
+ .card-center{
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: space-between;
109
+ margin: 40rpx 0 40rpx 0;
110
+ font-size: 28rpx;
111
+ font-weight: 400;
112
+
113
+ ::v-deep .is_login_Y{
114
+ .xd-button{
115
+ background-color: var(--alpha-color) !important;
116
+ }
117
+ }
118
+ ._b{
119
+ font-size: 48rpx;
120
+ margin-right: 4rpx;
121
+ font-weight: 700;
122
+ }
123
+ }
124
+ .card-bottom{
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: space-between;
128
+ font-size: 24rpx;
129
+ font-weight: 500;
130
+ .see_scope{
131
+ font-weight: 400;
132
+ }
133
+ }
134
+ }
135
+ </style>