jufubao-base 1.0.311-beta101 → 1.0.311-beta3
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/JfbBaseBlock/Attr.js +34 -167
- package/src/components/JfbBaseBlock/JfbBaseBlock.vue +9 -12
- package/src/components/JfbBaseCardDetail/Attr.js +12 -0
- package/src/components/JfbBaseCardDetail/JfbBaseCardDetail.vue +162 -1
- package/src/components/JfbBaseCardDetailEntry/Attr.js +12 -0
- package/src/components/JfbBaseCardDetailEntry/JfbBaseCardDetailEntry.vue +163 -2
- package/src/components/JfbBaseCardInfo/JfbBaseCardInfo.vue +2 -2
- package/src/components/JfbBaseCardInfoEntry/JfbBaseCardInfoEntry.vue +3 -3
- package/src/components/JfbBaseEntry/Attr.js +72 -5
- package/src/components/JfbBaseEntry/JfbBaseEntry.vue +47 -183
- package/src/components/JfbBaseImageBlock/Attr.js +23 -150
- package/src/components/JfbBaseImageBlock/JfbBaseImageBlock.vue +27 -29
- package/src/components/JfbBaseNotice/Attr.js +512 -5
- package/src/components/JfbBaseNotice/JfbBaseNotice.vue +181 -188
- package/src/components/JfbBaseVideo/Attr.js +297 -5
- package/src/components/JfbBaseVideo/JfbBaseVideo.vue +62 -36
- package/src/components/JfbBaseEntry/cusAttr/content.js +0 -77
- package/src/components/JfbBaseEntry/cusAttr/style.js +0 -288
- package/src/components/JfbBaseNotice/cusAttr/content.js +0 -308
- package/src/components/JfbBaseNotice/cusAttr/cssOne.js +0 -395
- package/src/components/JfbBaseNotice/cusAttr/cssThree.js +0 -101
- package/src/components/JfbBaseNotice/cusAttr/cssTwo.js +0 -208
- package/src/components/JfbBaseNotice/cusAttr/style.js +0 -31
- package/src/components/JfbBaseVideo/cusAttr/content.js +0 -236
- package/src/components/JfbBaseVideo/cusAttr/image.js +0 -213
- package/src/components/JfbBaseVideo/cusAttr/style.js +0 -172
|
@@ -108,6 +108,49 @@
|
|
|
108
108
|
</view>
|
|
109
109
|
</view>
|
|
110
110
|
</view>
|
|
111
|
+
<xd-down-drawer
|
|
112
|
+
:show.sync="showDialog"
|
|
113
|
+
height="50vh"
|
|
114
|
+
>
|
|
115
|
+
<template>
|
|
116
|
+
<view class="top_title">请务必先关联,否则影响此卡使用</view>
|
|
117
|
+
<view class="method_item">
|
|
118
|
+
<view class="method_item_top">
|
|
119
|
+
<view class="method_title">方法一</view>
|
|
120
|
+
<view>复制文本,打开支付宝APP</view>
|
|
121
|
+
</view>
|
|
122
|
+
<view class="method_item_bottom">
|
|
123
|
+
<view class="method_item_bottom_left">吱口令:{{share_code}}</view>
|
|
124
|
+
<view class="method_item_bottom_right" @click="copy(share_code)">复制吱口令</view>
|
|
125
|
+
</view>
|
|
126
|
+
</view>
|
|
127
|
+
<view class="method_item">
|
|
128
|
+
<view class="method_item_top">
|
|
129
|
+
<view class="method_title">方法二</view>
|
|
130
|
+
<view>复制链接,在默认浏览器打开</view>
|
|
131
|
+
</view>
|
|
132
|
+
<view class="method_item_bottom">
|
|
133
|
+
<view class="method_item_bottom_left">{{sign_url}}</view>
|
|
134
|
+
<view class="method_item_bottom_right" @click="copy(sign_url)">复制链接</view>
|
|
135
|
+
</view>
|
|
136
|
+
</view>
|
|
137
|
+
<view class="method_item">
|
|
138
|
+
<view class="method_item_top">
|
|
139
|
+
<view class="method_title">方法三</view>
|
|
140
|
+
<view>保存图片,使用支付宝APP扫码</view>
|
|
141
|
+
</view>
|
|
142
|
+
<view class="method_item_bottom code_img">
|
|
143
|
+
<view>打开支付宝APP,点击扫一扫直接扫码或点击相册中保存图片</view>
|
|
144
|
+
<view class="code_box">
|
|
145
|
+
<view class="qr_code">
|
|
146
|
+
<image mode="aspectFit" :src="sign_url_qrcode"></image>
|
|
147
|
+
</view>
|
|
148
|
+
<view>长按保存二维码</view>
|
|
149
|
+
</view>
|
|
150
|
+
</view>
|
|
151
|
+
</view>
|
|
152
|
+
</template>
|
|
153
|
+
</xd-down-drawer>
|
|
111
154
|
</view>
|
|
112
155
|
</template>
|
|
113
156
|
|
|
@@ -126,6 +169,7 @@ import XdPwPay from "./XdPwPay";
|
|
|
126
169
|
import XdEditPwd from "./XdEditPwd";
|
|
127
170
|
import XdUnit from "@/components/XdUnit/XdUnit";
|
|
128
171
|
import XdButton from '@/components/XdButton/XdButton'
|
|
172
|
+
import XdDownDrawer from "@/components/XdDownDrawer/XdDownDrawer"
|
|
129
173
|
import {parsePath} from "@/utils/linkUrl";
|
|
130
174
|
export default {
|
|
131
175
|
name: "JfbBaseCardDetailEntry",
|
|
@@ -134,7 +178,8 @@ export default {
|
|
|
134
178
|
XdPwPay,
|
|
135
179
|
XdEditPwd,
|
|
136
180
|
XdUnit,
|
|
137
|
-
XdButton
|
|
181
|
+
XdButton,
|
|
182
|
+
XdDownDrawer,
|
|
138
183
|
},
|
|
139
184
|
mixins: [
|
|
140
185
|
componentsMixins,extsMixins,JfbBaseCardDetailEntryMixin,colorCardMixins,
|
|
@@ -176,7 +221,13 @@ export default {
|
|
|
176
221
|
isBrandLogo: false,
|
|
177
222
|
isShowUnbind: false, //是否启动绑定按钮
|
|
178
223
|
headerBg: {},
|
|
179
|
-
give_url: ""
|
|
224
|
+
give_url: "",
|
|
225
|
+
collect_phone_url: "",//收集手机号地址
|
|
226
|
+
showDialog:false,
|
|
227
|
+
sign_url:'',
|
|
228
|
+
share_code:'',
|
|
229
|
+
sign_url_qrcode:'',
|
|
230
|
+
toCollectPhoneUrl:'',
|
|
180
231
|
};
|
|
181
232
|
},
|
|
182
233
|
watch: {
|
|
@@ -193,6 +244,15 @@ export default {
|
|
|
193
244
|
},
|
|
194
245
|
},
|
|
195
246
|
created() {
|
|
247
|
+
// ifDef小程序拼接问题
|
|
248
|
+
let url = this.$xdUniHelper.parseURL();
|
|
249
|
+
// #ifdef MP-WEIXIN
|
|
250
|
+
this.toCollectPhoneUrl = url.relative
|
|
251
|
+
// #endif
|
|
252
|
+
// #ifdef H5
|
|
253
|
+
this.toCollectPhoneUrl = '@site_domain@'+''+url.relative
|
|
254
|
+
// #endif
|
|
255
|
+
console.log(this.toCollectPhoneUrl,encodeURIComponent(this.toCollectPhoneUrl),'this.toCollectPhoneUrl')
|
|
196
256
|
this.init(this.container)
|
|
197
257
|
},
|
|
198
258
|
methods: {
|
|
@@ -228,6 +288,8 @@ export default {
|
|
|
228
288
|
this.backUrl = getContainerPropsValue(container, "content.back_url", { value: "" }).value;
|
|
229
289
|
this.shift_url = getContainerPropsValue(container, "content.shift_url", { value: "" }).value;
|
|
230
290
|
this.give_url = getContainerPropsValue(container, "content.give_url", { value: "" }).value;
|
|
291
|
+
this.collect_phone_url = getContainerPropsValue(container, "content.collect_phone_url", { value: "" }).value;
|
|
292
|
+
console.log(this.collect_phone_url,'collect_phone_url')
|
|
231
293
|
//'wechat_mini_program|default'
|
|
232
294
|
this.entryGroupId = getContainerPropsValue(container,"content.entryGroupId","default");
|
|
233
295
|
},
|
|
@@ -279,6 +341,19 @@ export default {
|
|
|
279
341
|
this.show = false;
|
|
280
342
|
console.log(this.getCardThemes(res.card_type_name),'this.getCardThemes(res.card_type_name)');
|
|
281
343
|
this.headerBg = this.getCardThemes(res.card_type_name);
|
|
344
|
+
//支付宝弹框
|
|
345
|
+
if(res.enterprise_info&&res.enterprise_info.is_need_activate==='Y'){
|
|
346
|
+
this.share_code = res.enterprise_info.share_code;
|
|
347
|
+
this.sign_url = res.enterprise_info.sign_url;
|
|
348
|
+
this.sign_url_qrcode = res.enterprise_info.sign_url_qrcode;
|
|
349
|
+
if(res.enterprise_info.is_need_collect_phone_number==='Y'){
|
|
350
|
+
let url = `${this.collect_phone_url}?callback_url=${encodeURIComponent(this.toCollectPhoneUrl)}`
|
|
351
|
+
this.$xdUniHelper.navigateTo({
|
|
352
|
+
url:url,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
this.showDialog = true;
|
|
356
|
+
}
|
|
282
357
|
})
|
|
283
358
|
.catch((err) => {
|
|
284
359
|
// this.$refs["pwPay"].clearPwd();
|
|
@@ -558,6 +633,26 @@ export default {
|
|
|
558
633
|
clearTimeout(this.refrushTimeer);
|
|
559
634
|
}
|
|
560
635
|
},
|
|
636
|
+
/**
|
|
637
|
+
*@description 复制功能
|
|
638
|
+
* @param text
|
|
639
|
+
*/
|
|
640
|
+
copy(text) {
|
|
641
|
+
// #ifdef H5
|
|
642
|
+
this.$copyText(text).then((res) => {
|
|
643
|
+
this.$xdAlert({ content: "复制成功" });
|
|
644
|
+
});
|
|
645
|
+
// #endif
|
|
646
|
+
// #ifndef H5
|
|
647
|
+
uni.setClipboardData({
|
|
648
|
+
data: text,
|
|
649
|
+
showToast: false,
|
|
650
|
+
success: () => {
|
|
651
|
+
//this.$xdAlert({ content: "复制成功" });
|
|
652
|
+
},
|
|
653
|
+
});
|
|
654
|
+
// #endif
|
|
655
|
+
},
|
|
561
656
|
},
|
|
562
657
|
};
|
|
563
658
|
</script>
|
|
@@ -1008,5 +1103,71 @@ export default {
|
|
|
1008
1103
|
|
|
1009
1104
|
}
|
|
1010
1105
|
}
|
|
1106
|
+
.method_item{
|
|
1107
|
+
padding: unit(32, rpx);
|
|
1108
|
+
border-bottom: 1px solid #F8F8F8;
|
|
1109
|
+
color: #333333;
|
|
1110
|
+
font-size: unit(28,rpx);
|
|
1111
|
+
&_top{
|
|
1112
|
+
display: flex;
|
|
1113
|
+
align-items: center;
|
|
1114
|
+
}
|
|
1115
|
+
&_bottom{
|
|
1116
|
+
display: flex;
|
|
1117
|
+
justify-content: space-between;
|
|
1118
|
+
align-items: flex-start;
|
|
1119
|
+
margin-top: unit(16, rpx);
|
|
1120
|
+
height: unit(32,rpx);
|
|
1121
|
+
line-height: unit(32,rpx);
|
|
1122
|
+
font-size: unit(24,rpx);
|
|
1123
|
+
color: #666666;
|
|
1124
|
+
&_right{
|
|
1125
|
+
min-width: unit(180,rpx);
|
|
1126
|
+
text-align: right;
|
|
1127
|
+
color: #FF8D1A;
|
|
1128
|
+
}
|
|
1129
|
+
&_left{
|
|
1130
|
+
color: #666666;
|
|
1131
|
+
white-space: nowrap;
|
|
1132
|
+
overflow: hidden;
|
|
1133
|
+
text-overflow: ellipsis;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
.code_img{
|
|
1137
|
+
height: auto!important;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
}
|
|
1141
|
+
.method_title{
|
|
1142
|
+
color: #fff;
|
|
1143
|
+
background-color: #FF8D1A;
|
|
1144
|
+
width: unit(120,rpx);
|
|
1145
|
+
height: unit(50,rpx);
|
|
1146
|
+
line-height: unit(50,rpx);
|
|
1147
|
+
border-radius: unit(25,rpx);
|
|
1148
|
+
text-align: center;
|
|
1149
|
+
margin-right: unit(20,rpx);
|
|
1150
|
+
font-size: unit(24,rpx);
|
|
1151
|
+
}
|
|
1152
|
+
.top_title{
|
|
1153
|
+
height: unit(100,rpx);
|
|
1154
|
+
text-align: center;
|
|
1155
|
+
line-height:unit(100,rpx);
|
|
1156
|
+
color:#333333;
|
|
1157
|
+
font-size:unit(32,rpx);
|
|
1158
|
+
border-bottom: 1px solid #F8F8F8;
|
|
1159
|
+
}
|
|
1160
|
+
.code_box{
|
|
1161
|
+
text-align: center;
|
|
1162
|
+
.qr_code{
|
|
1163
|
+
width: unit(168,rpx);
|
|
1164
|
+
height: unit(168,rpx);
|
|
1165
|
+
image{
|
|
1166
|
+
width: 100%;
|
|
1167
|
+
height: 100%;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1011
1172
|
}
|
|
1012
1173
|
</style>
|
|
@@ -248,7 +248,7 @@ export default {
|
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
let path = this.getUrlCallback(this.my_card_url || this.backUrl)
|
|
251
|
+
let path = this.getUrlCallback(this.my_card_url || this.backUrl)+`?card_number=${this.card_number}`;
|
|
252
252
|
//有优惠券处理
|
|
253
253
|
if(this.hasCon){
|
|
254
254
|
this.toShowCouponDialog();
|
|
@@ -285,7 +285,7 @@ export default {
|
|
|
285
285
|
showClose: false,
|
|
286
286
|
success: (res) => {
|
|
287
287
|
if (res.confirm) {
|
|
288
|
-
let path = this.getUrlCallback(this.my_card_url || this.backUrl)
|
|
288
|
+
let path = this.getUrlCallback(this.my_card_url || this.backUrl)+`?card_number=${this.card_number}`;
|
|
289
289
|
this.$xdUniHelper.redirectTo({ url: path});
|
|
290
290
|
}else{
|
|
291
291
|
}
|
|
@@ -271,7 +271,7 @@ export default {
|
|
|
271
271
|
this.toShowCouponDialog();
|
|
272
272
|
this.$bus.$on("onCloseConDialog",(container_id) => {
|
|
273
273
|
if(container_id === this.hasCon){
|
|
274
|
-
let path = this.getUrlCallback(this.backUrl)
|
|
274
|
+
let path = this.getUrlCallback(this.backUrl)+`?card_number=${this.card_number}`
|
|
275
275
|
this.$xdUniHelper.redirectTo({
|
|
276
276
|
url: path,
|
|
277
277
|
});
|
|
@@ -281,7 +281,7 @@ export default {
|
|
|
281
281
|
this.$xdAlert({
|
|
282
282
|
content: "票券绑定成功",
|
|
283
283
|
close: () => {
|
|
284
|
-
let path = this.getUrlCallback(this.backUrl)
|
|
284
|
+
let path = this.getUrlCallback(this.backUrl)+`?card_number=${this.card_number}`
|
|
285
285
|
this.$xdUniHelper.redirectTo({
|
|
286
286
|
url: path,
|
|
287
287
|
});
|
|
@@ -300,7 +300,7 @@ export default {
|
|
|
300
300
|
showClose: false,
|
|
301
301
|
success: (res) => {
|
|
302
302
|
if (res.confirm) {
|
|
303
|
-
let path = this.getUrlCallback(this.my_card_url || this.backUrl)
|
|
303
|
+
let path = this.getUrlCallback(this.my_card_url || this.backUrl)+`?card_number=${this.card_number}`
|
|
304
304
|
this.$xdUniHelper.redirectTo({
|
|
305
305
|
url: path,
|
|
306
306
|
});
|
|
@@ -1,16 +1,83 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import content from "./cusAttr/content";
|
|
3
|
-
import style from "./cusAttr/style";
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* @description 当表单组件中有联动操作时候,使用方法进行返回
|
|
7
5
|
*/
|
|
8
6
|
export default {
|
|
9
7
|
style: [],
|
|
10
|
-
content: (data
|
|
8
|
+
content: (data) => {
|
|
11
9
|
return [
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
{
|
|
11
|
+
label: '选择综合入口类型:',
|
|
12
|
+
ele: 'xd-site-select-list',
|
|
13
|
+
valueKey: 'entryType',
|
|
14
|
+
value: data['entryType'],
|
|
15
|
+
placeholder: '请选择综合入口类型',
|
|
16
|
+
multiple: false,
|
|
17
|
+
groupKey:'content',
|
|
18
|
+
className: 'input50',
|
|
19
|
+
rules: [
|
|
20
|
+
{required: true, message: '请选择综合入口类型', trigger: ['blur', 'change']}
|
|
21
|
+
],
|
|
22
|
+
handleCustom({action, data}) {
|
|
23
|
+
XdBus.getParentApi('getEntryGroupOption')({key: Date.now()})
|
|
24
|
+
.then(res => {
|
|
25
|
+
data.cb(res.list)
|
|
26
|
+
})
|
|
27
|
+
.catch(error => {
|
|
28
|
+
console.error(error);
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: '每行显示数量',
|
|
34
|
+
ele: 'xd-radio',
|
|
35
|
+
valueKey: 'rowNum',
|
|
36
|
+
groupKey: 'content',
|
|
37
|
+
value: data.rowNum || 1,
|
|
38
|
+
rules: [
|
|
39
|
+
{required: true, message: '请选择', trigger: ['blur', 'change']}
|
|
40
|
+
],
|
|
41
|
+
list: [
|
|
42
|
+
{"label": "一行一列", "value": 1},
|
|
43
|
+
{"label": "一行二列", "value": 2},
|
|
44
|
+
{"label": "一行三列", "value": 3},
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: '背景颜色:',
|
|
49
|
+
ele: 'xd-color',
|
|
50
|
+
valueKey: 'bgcolor',
|
|
51
|
+
value: data.bgcolor || '',
|
|
52
|
+
groupKey: 'style',
|
|
53
|
+
placeholder: '请输入背景颜色',
|
|
54
|
+
classNmae: 'input80',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: '间隔边距',
|
|
58
|
+
ele: 'el-input',
|
|
59
|
+
type: 'number',
|
|
60
|
+
valueKey: "paddingInput",
|
|
61
|
+
groupKey: 'style',
|
|
62
|
+
value: data.paddingInput || '',
|
|
63
|
+
placeholder: '请输入间隔边距',
|
|
64
|
+
inline: false,
|
|
65
|
+
className:'input60',
|
|
66
|
+
notice: '设置间隔边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: '边距设置:',
|
|
70
|
+
ele: 'xd-margin-padding',
|
|
71
|
+
valueKey: 'margin',
|
|
72
|
+
groupKey:'style',
|
|
73
|
+
value: data.margin || null,
|
|
74
|
+
setting: {
|
|
75
|
+
type: 'margin',
|
|
76
|
+
},
|
|
77
|
+
placeholder: '请设置边距设置',
|
|
78
|
+
inline: false,
|
|
79
|
+
notice: '设置边距设置,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">0</span> 像素',
|
|
80
|
+
},
|
|
14
81
|
].filter(i=>i)
|
|
15
82
|
},
|
|
16
83
|
advanced: [
|
|
@@ -13,40 +13,30 @@
|
|
|
13
13
|
<view class="jfb-base-entry__edit-icon" @click="delEdit">删除</view>
|
|
14
14
|
</view>
|
|
15
15
|
<!-- #endif -->
|
|
16
|
-
<view class="jfb-base-entry__body">
|
|
17
|
-
<view
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
v-if="entryList === null"
|
|
21
|
-
class="entry_list skeleton-wrap"
|
|
22
|
-
:class="{rowNum1: rowNum ===1,rowNum2: rowNum ===2,rowNum3: rowNum ===3}"
|
|
23
|
-
>
|
|
24
|
-
<view
|
|
25
|
-
v-for="i in 5"
|
|
26
|
-
:key="i"
|
|
16
|
+
<view class="jfb-base-entry__body" :style="bodyStyle">
|
|
17
|
+
<view :style="{ margin:marginUi}">
|
|
18
|
+
<view v-if="loadingList" class="entry_list skeleton-wrap" :style="entryStyle">
|
|
19
|
+
<view v-for="i in 5" :key="i"
|
|
27
20
|
:class="'row_num_'+rowNum"
|
|
28
21
|
class="entry_item"
|
|
29
|
-
:style="[entryItemSkeStyleComp]"
|
|
30
22
|
>
|
|
23
|
+
<image v-if="rowNum == 1" style="height: 260rpx;"/>
|
|
24
|
+
<image v-if="rowNum == 2" style="height: 200rpx;"/>
|
|
25
|
+
<image v-if="rowNum == 3" style="height: 150rpx;"/>
|
|
31
26
|
</view>
|
|
32
27
|
</view>
|
|
33
|
-
<view
|
|
34
|
-
v-else
|
|
35
|
-
class="entry_list"
|
|
36
|
-
:class="{rowNum1: rowNum ===1,rowNum2: rowNum ===2,rowNum3: rowNum ===3}"
|
|
37
|
-
>
|
|
28
|
+
<view v-else class="entry_list" :style="entryStyle">
|
|
38
29
|
<view
|
|
39
|
-
:style="[entryItemStyleComp]"
|
|
40
30
|
v-if="entryList.length > 0"
|
|
41
31
|
v-for="(item,i) in entryList"
|
|
42
32
|
:key="i"
|
|
43
33
|
class="entry_item"
|
|
44
|
-
:class="'row_num_'+
|
|
34
|
+
:class="'row_num_'+rowNum"
|
|
45
35
|
@click="toLink(item)"
|
|
46
36
|
>
|
|
47
|
-
<image v-if="rowNum
|
|
48
|
-
<image v-if="rowNum
|
|
49
|
-
<image v-if="rowNum
|
|
37
|
+
<image v-if="rowNum == 1" :src="item.image_url" mode="widthFix"/>
|
|
38
|
+
<image v-if="rowNum == 2" :src="item.image_url2" mode="widthFix"/>
|
|
39
|
+
<image v-if="rowNum == 3" :src="item.image_url3" mode="widthFix"/>
|
|
50
40
|
</view>
|
|
51
41
|
<xd-no-data
|
|
52
42
|
icon-type="empty"
|
|
@@ -63,7 +53,7 @@
|
|
|
63
53
|
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
64
54
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
65
55
|
import JfbBaseEntryMixin from "./JfbBaseEntryMixin";
|
|
66
|
-
import {
|
|
56
|
+
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
67
57
|
import componentsMixins from "@/mixins/componentsMixins";
|
|
68
58
|
import extsMixins from "@/mixins/extsMixins";
|
|
69
59
|
import getServiceUrl from "@/common/getServiceUrl";
|
|
@@ -80,147 +70,61 @@
|
|
|
80
70
|
],
|
|
81
71
|
data() {
|
|
82
72
|
return {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
rowNum: 1, //列数
|
|
73
|
+
entryList: [],
|
|
74
|
+
bgcolor: "",
|
|
75
|
+
rowNum: 1,
|
|
76
|
+
paddingInput: 20,
|
|
77
|
+
loadingList: true,
|
|
78
|
+
margin: {},
|
|
90
79
|
entryType: '',
|
|
91
|
-
|
|
92
|
-
//style
|
|
93
|
-
radius:0,
|
|
94
|
-
bgcolor: "", //背景色
|
|
95
|
-
bgImage:{}, //背景图
|
|
96
|
-
paddingInput: 20, //间距
|
|
97
|
-
margin: {}, //边距
|
|
98
|
-
contRadius:0,//圆角
|
|
99
|
-
padding:{},//填充
|
|
100
80
|
}
|
|
101
81
|
},
|
|
102
82
|
computed: {
|
|
103
83
|
...mapState(['brandInfo']),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
let paddingTB = this.getPMValue(this.padding, 'TB', 0);
|
|
107
|
-
let bodyMinHeight = this.layoutInfo.bodyMinHeightRpx - (marginTB + paddingTB)
|
|
108
|
-
let url = {};
|
|
109
|
-
if(this.bgImage && this.bgImage.url) {
|
|
110
|
-
url = {
|
|
111
|
-
backgroundImage: `url(${getServiceUrl(this.bgImage.url)})`,
|
|
112
|
-
backgroundSize: '100%',
|
|
113
|
-
backgroundRepeat: 'repeat-y',
|
|
114
|
-
backgroundPosition: 'top center'
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
84
|
+
bodyStyle(){
|
|
85
|
+
return this.styleObjectToString({
|
|
118
86
|
backgroundColor: this.bgcolor,
|
|
119
|
-
minHeight: bodyMinHeight
|
|
120
|
-
|
|
121
|
-
padding: this.getMarginAndPadding(this.padding, 0),
|
|
122
|
-
borderRadius: this.radius + 'rpx',
|
|
123
|
-
...url
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
getWidthComp(){
|
|
127
|
-
let marginRL = this.getPMValue(this.margin, 'RL', 0);
|
|
128
|
-
let paddingRL = this.getPMValue(this.padding, 'RL', 0);
|
|
129
|
-
return (750 - (Number(this.paddingInput)*(this.rowNum-1) + marginRL + paddingRL)) / this.rowNum
|
|
130
|
-
},
|
|
131
|
-
getMarginRight(){
|
|
132
|
-
let marginRight = 0;
|
|
133
|
-
if([2,3].includes(this.rowNum)) marginRight = this.paddingInput + 'rpx';
|
|
134
|
-
return marginRight
|
|
87
|
+
minHeight: this.layoutInfo.bodyMinHeight,
|
|
88
|
+
})
|
|
135
89
|
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
marginTop: this.paddingInput + 'rpx',
|
|
143
|
-
marginRight: this.getMarginRight,
|
|
144
|
-
height,
|
|
145
|
-
width: width + 'rpx'
|
|
146
|
-
}
|
|
90
|
+
entryStyle(){
|
|
91
|
+
return this.styleObjectToString({
|
|
92
|
+
gridTemplateColumns: `repeat(${this.rowNum}, 1fr)`,
|
|
93
|
+
gap: this.paddingInput + 'rpx',
|
|
94
|
+
padding: this.paddingInput + 'rpx'
|
|
95
|
+
})
|
|
147
96
|
},
|
|
148
|
-
|
|
149
|
-
let
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
marginRight: this.getMarginRight,
|
|
155
|
-
height: width * this.height/this.width + 'rpx',
|
|
156
|
-
overflow: 'hidden'
|
|
157
|
-
}
|
|
97
|
+
marginUi(){
|
|
98
|
+
let str = `${this.checkValue(this.margin.top, 0)}rpx`;
|
|
99
|
+
str = `${str} ${this.checkValue(this.margin.right, 0)}rpx`;
|
|
100
|
+
str = `${str} ${this.checkValue(this.margin.bottom, 0)}rpx`;
|
|
101
|
+
str = `${str} ${this.checkValue(this.margin.left, 0)}rpx`;
|
|
102
|
+
return str
|
|
158
103
|
}
|
|
159
104
|
},
|
|
160
105
|
watch: {
|
|
161
106
|
container(value,oldValue) {
|
|
162
107
|
if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
163
|
-
if (this.$configProject['isPreview'])
|
|
164
|
-
this.init(value);
|
|
165
|
-
this.onJfbLoad()
|
|
166
|
-
}
|
|
108
|
+
if (this.$configProject['isPreview']) this.init(value)
|
|
167
109
|
},
|
|
168
110
|
},
|
|
169
111
|
created() {
|
|
170
112
|
this.init(this.container);
|
|
171
113
|
},
|
|
172
114
|
methods: {
|
|
173
|
-
onJfbLoad() {
|
|
115
|
+
onJfbLoad(options) {
|
|
174
116
|
this.getEntrySetting();
|
|
175
117
|
},
|
|
176
|
-
|
|
177
|
-
getImageInfo(entryList){
|
|
178
|
-
return new Promise((resolve,reject)=>{
|
|
179
|
-
let heightAll = 0,widthAll = 0, counter = 0, allCouter = 0;
|
|
180
|
-
let len = entryList.length;
|
|
181
|
-
entryList.map(item=>{
|
|
182
|
-
let imgUrl = item['image_url'];
|
|
183
|
-
if(this.rowNum === 2) imgUrl = item['image_url2'];
|
|
184
|
-
if(this.rowNum === 3) imgUrl = item['image_url3'];
|
|
185
|
-
uni.getImageInfo({
|
|
186
|
-
src:imgUrl,
|
|
187
|
-
success:({width,height})=>{
|
|
188
|
-
heightAll += height;
|
|
189
|
-
widthAll += width;
|
|
190
|
-
allCouter++;
|
|
191
|
-
counter++;
|
|
192
|
-
if(len === allCouter){
|
|
193
|
-
resolve({height:heightAll/counter, width: widthAll/counter})
|
|
194
|
-
}
|
|
195
|
-
},fail:()=>{
|
|
196
|
-
allCouter++;
|
|
197
|
-
if(len === allCouter){
|
|
198
|
-
resolve({height:heightAll/counter, width: widthAll/counter})
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
})
|
|
202
|
-
})
|
|
203
|
-
})
|
|
204
|
-
},
|
|
205
|
-
|
|
206
118
|
/**
|
|
207
119
|
* @description 监听事件变化
|
|
208
120
|
* @param container {object} 业务组件对象自己
|
|
209
121
|
*/
|
|
210
122
|
init(container) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
this.
|
|
214
|
-
this.
|
|
215
|
-
|
|
216
|
-
//style
|
|
217
|
-
this.bgcolor = gCPVal(container, 'bgcolor', 'rgba(0,0,0,0)',{sKey:'bgStatus',fields:['bgcolor','bgImage']});
|
|
218
|
-
this.bgImage = gCPVal(container, 'bgImage', {},{sKey:'bgStatus',fields:['bgcolor','bgImage']});
|
|
219
|
-
this.paddingInput = gCPVal(container, 'paddingInput', [16,20], {sKey:'paddingInputStatus',fields:['paddingInput'] });
|
|
220
|
-
this.margin = gCPVal(container, 'margin', 0, {sKey: 'marginStatus',fields:['margin'], isPMR: true});
|
|
221
|
-
this.padding = gCPVal(container, 'padding', 0, {sKey: 'paddingStatus',fields:['padding'], isPMR: true});
|
|
222
|
-
this.contRadius = gCPVal(container, 'contRadius', [this.gStyleValue.radius,0],{sKey: 'contRadiusStatus', fields: ['contRadius']})||0;
|
|
223
|
-
this.radius = gCPVal(container, 'radius', [this.gStyleValue.radius,0],{sKey: 'radiusStatus', fields: ['radius']})||0;
|
|
123
|
+
this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
|
|
124
|
+
this.rowNum = getContainerPropsValue(container, 'content.rowNum', 1);
|
|
125
|
+
this.paddingInput = getContainerPropsValue(container, 'content.paddingInput', 20);
|
|
126
|
+
this.margin = getContainerPropsValue(container, 'content.margin', {});
|
|
127
|
+
this.entryType = getContainerPropsValue(container, 'content.entryType', 'default');
|
|
224
128
|
},
|
|
225
129
|
|
|
226
130
|
getCardPath(custom_redirect_data = {}){
|
|
@@ -248,7 +152,6 @@
|
|
|
248
152
|
else return null;
|
|
249
153
|
//#endif
|
|
250
154
|
},
|
|
251
|
-
|
|
252
155
|
getEntrySetting(){
|
|
253
156
|
this.$xdShowLoading({});
|
|
254
157
|
jfbRootExec("getEntrySetting", {
|
|
@@ -256,7 +159,8 @@
|
|
|
256
159
|
data: {
|
|
257
160
|
group_id:this.entryType || 'default'
|
|
258
161
|
}
|
|
259
|
-
}).then(
|
|
162
|
+
}).then(res => {
|
|
163
|
+
this.loadingList = false;
|
|
260
164
|
this.$xdHideLoading();
|
|
261
165
|
let isH5FilterEntryList = [];
|
|
262
166
|
let isMpFilterEntryList = [];
|
|
@@ -322,11 +226,6 @@
|
|
|
322
226
|
return item;
|
|
323
227
|
});
|
|
324
228
|
|
|
325
|
-
//获取平均高度
|
|
326
|
-
let {width, height} = await this.getImageInfo(entryList);
|
|
327
|
-
this.width = width;
|
|
328
|
-
this.height = height;
|
|
329
|
-
|
|
330
229
|
//#ifdef MP-WEIXIN
|
|
331
230
|
console.warn(`微信小程序端被过滤的入口列表:${JSON.stringify(isMpFilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
|
|
332
231
|
//#endif
|
|
@@ -340,18 +239,15 @@
|
|
|
340
239
|
this.toLink(entryList[0]);
|
|
341
240
|
return
|
|
342
241
|
}
|
|
343
|
-
|
|
344
242
|
//无数据提示
|
|
345
243
|
if(res.list.length === 0) {
|
|
346
244
|
this.$xdAlert({content: '当前票券暂无支持服务'})
|
|
347
245
|
return;
|
|
348
246
|
}
|
|
349
|
-
|
|
350
247
|
//复制
|
|
351
|
-
this.entryList = entryList
|
|
248
|
+
this.entryList = entryList;
|
|
352
249
|
})
|
|
353
250
|
},
|
|
354
|
-
|
|
355
251
|
toLink(item){
|
|
356
252
|
let path = "";
|
|
357
253
|
try{
|
|
@@ -375,43 +271,11 @@
|
|
|
375
271
|
|
|
376
272
|
<style scoped lang="less">
|
|
377
273
|
@import "./JfbBaseEntryLess.less";
|
|
378
|
-
|
|
274
|
+
|
|
379
275
|
.jfb-base-entry {
|
|
380
276
|
&__body{
|
|
381
277
|
.entry_list{
|
|
382
|
-
|
|
383
|
-
& >view:first-child {
|
|
384
|
-
margin-top: 0!important;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
&.rowNum2,&.rowNum3 {
|
|
388
|
-
display: flex;
|
|
389
|
-
justify-content: flex-start;
|
|
390
|
-
align-items: center;
|
|
391
|
-
flex-flow: wrap;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
&.rowNum2 {
|
|
395
|
-
& > view:nth-child(1),& > view:nth-child(2) {
|
|
396
|
-
margin-top: 0!important;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
&.rowNum2 > view:nth-child(2n) {
|
|
401
|
-
margin-right: 0!important;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
&.rowNum3 > view:nth-child(3n) {
|
|
405
|
-
margin-right: 0!important;
|
|
406
|
-
}
|
|
407
|
-
&.rowNum3 {
|
|
408
|
-
& > view:nth-child(1),
|
|
409
|
-
& > view:nth-child(2),
|
|
410
|
-
& > view:nth-child(3) {
|
|
411
|
-
margin-top: 0!important;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
|
|
278
|
+
display: grid;
|
|
415
279
|
&.skeleton-wrap{
|
|
416
280
|
.entry_item{
|
|
417
281
|
.skeleton-item(100%, auto);
|