jufubao-base 1.0.197-beta3 → 1.0.197-beta4

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.
@@ -31,7 +31,7 @@
31
31
  </view>
32
32
  <view v-if="showPartnerName==='Y'" class="name" :style="{color: textColor}">{{partnerName}}</view>
33
33
  </view>
34
- <view v-if="loaded && showLocation==='Y'" class="header_wrap-city">
34
+ <view v-if="loaded && showLocation==='Y' && searchBoxPosition==='out'" class="header_wrap-city">
35
35
  <xd-city-show-api
36
36
  @done="handleCityDone"
37
37
  @onChange="handleCityChange"
@@ -46,9 +46,21 @@
46
46
  @click="toSearch"
47
47
  :style="{
48
48
  background:inputBackgroundColor,
49
- color:inputTextColor
49
+ color:inputTextColor,
50
+ borderRadius: searchBoxRadius + 'rpx'
50
51
  }"
51
52
  >
53
+ <view v-if="loaded && showLocation==='Y' && searchBoxPosition==='in'" class="header-city-in">
54
+ <xd-city-show-api
55
+ @done="handleCityDone"
56
+ @onChange="handleCityChange"
57
+ :color="textColor"
58
+ :icon="locationIcon"
59
+ :bgColor="locationBackgroundColor"
60
+ :key="showLocationKey"
61
+ ></xd-city-show-api>
62
+ </view>
63
+ <xd-font-icon v-if="searchIconPosition==='left'" :icon="icon" :color="iconColor" size="32"/>
52
64
  <input
53
65
  v-if="useSearch==='Y'"
54
66
  :placeholder="placeholder"
@@ -59,8 +71,18 @@
59
71
  :placeholder-style="'color:' + inputTextColor"
60
72
  />
61
73
  <view v-else class="search_placeholder">{{placeholder}}</view>
62
- <xd-font-icon :icon="icon" :color="iconColor" size="32"/>
74
+ <xd-font-icon v-if="searchIconPosition==='right'" :icon="icon" :color="iconColor" size="32"/>
75
+ <view v-if="showSearchBtn==='Y' && searchBtnPosition==='in'"
76
+ :style="[searchBtnStyle]"
77
+ style="padding: 4rpx 32rpx;"
78
+ @click="doSearch"
79
+ >{{searchBtnText || '搜索'}}</view>
63
80
  </view>
81
+ <view v-if="showSearchBtn==='Y' && searchBtnPosition==='out'"
82
+ style="margin-left: 4px;padding: 8rpx 32rpx;"
83
+ :style="[searchBtnStyle]"
84
+ @click="doSearch"
85
+ >{{searchBtnText || '搜索'}}</view>
64
86
  </view>
65
87
  </view>
66
88
  </view>
@@ -94,6 +116,13 @@
94
116
  boxBorder() {
95
117
  if (this.is_border === 'Y') return `${this.is_border_w}rpx solid ${this.is_border_c}`;
96
118
  else return '0';
119
+ },
120
+ searchBtnStyle(){
121
+ return {
122
+ background: this.searchBtnBgColor,
123
+ color: this.searchBtnTextColor,
124
+ borderRadius: this.searchBtnRadius + 'rpx'
125
+ }
97
126
  }
98
127
  },
99
128
  data() {
@@ -141,9 +170,18 @@
141
170
 
142
171
  //定位ICON
143
172
  locationIcon: "",
144
- locationBackgroundColor: ""
173
+ locationBackgroundColor: "",
145
174
 
146
175
  //
176
+ searchBoxPosition: "out",
177
+ searchIconPosition: "right",
178
+ showSearchBtn: "",
179
+ searchBtnPosition: "out",
180
+ searchBtnText: "",
181
+ searchBtnBgColor: "",
182
+ searchBtnTextColor: "",
183
+ searchBtnRadius: 0,
184
+ searchBoxRadius: 30,
147
185
  }
148
186
  },
149
187
  watch: {
@@ -193,7 +231,15 @@
193
231
  this.is_border_c = getContainerPropsValue(container, 'content.is_border_c', '#fff');
194
232
  this.is_border_w = getContainerPropsValue(container, 'content.is_border_w', '2');
195
233
 
196
-
234
+ this.searchBoxPosition = getContainerPropsValue(container, 'content.searchBoxPosition', "out");
235
+ this.searchIconPosition = getContainerPropsValue(container, 'content.searchIconPosition', "right");
236
+ this.showSearchBtn = getContainerPropsValue(container, 'content.showSearchBtn', "");
237
+ this.searchBtnPosition = getContainerPropsValue(container, 'content.searchBtnPosition', "out");
238
+ this.searchBtnText = getContainerPropsValue(container, 'content.searchBtnText', "");
239
+ this.searchBtnBgColor = getContainerPropsValue(container, 'content.searchBtnBgColor', "");
240
+ this.searchBtnTextColor = getContainerPropsValue(container, 'content.searchBtnTextColor', "");
241
+ this.searchBtnRadius = getContainerPropsValue(container, 'content.searchBtnRadius', 0);
242
+ this.searchBoxRadius = getContainerPropsValue(container, 'content.searchBoxRadius', 30);
197
243
 
198
244
  let name , logo, platform_logo;
199
245
  if (this.projectAttr['site_name']) name = this.projectAttr['site_name'];
@@ -208,11 +254,22 @@
208
254
  },
209
255
  handleInput(e){
210
256
  this.keyword = e.detail.value;
257
+ //如果有搜索按钮,则不自动执行搜索
258
+ if(this.showSearchBtn === 'Y') return;
211
259
  if(this.timer) clearTimeout(this.timer);
212
260
  this.timer = setTimeout(() => {
213
261
  jfbRootFnExec(this, 'onCustomEvent')("baseHeader@search", e.detail.value);
214
262
  }, 300)
215
263
  },
264
+ doSearch(){
265
+ if(this.useSearch === "N"){
266
+ this.$xdUniHelper.navigateTo({
267
+ url: this.searchPagePath
268
+ })
269
+ }else{
270
+ jfbRootFnExec(this, 'onCustomEvent')("baseHeader@search", this.keyword);
271
+ }
272
+ },
216
273
  toSearch(){
217
274
  if(this.useSearch === 'N'){
218
275
  this.$xdUniHelper.navigateTo({
@@ -317,18 +374,37 @@
317
374
  .search_wrap{
318
375
  margin-left: unit(20, rpx);
319
376
  flex: 1;
320
- padding: 12rpx 20rpx;
377
+ padding: 0rpx 20rpx;
378
+ height: 64rpx;
321
379
  border-radius: unit(50, rpx);
322
380
  display: flex;
323
381
  align-items: center;
382
+ .header-city-in{
383
+ position: relative;
384
+ padding-right: 28rpx;
385
+ margin-right: 20rpx;
386
+ &::before{
387
+ content: " ";
388
+ position: absolute;
389
+ width: 2rpx;
390
+ height: 100%;
391
+ background-color: #CCCCCC;
392
+ right: -0rpx;
393
+ top: 0rpx;
394
+ }
395
+ ::v-deep .xd-city{
396
+ padding: 0;
397
+ }
398
+ }
324
399
  .search_input{
325
400
  flex: 1;
326
- text-align: center;
401
+ text-align: left;
327
402
  font-size: unit(28,rpx);
403
+ padding-left: 20rpx;
328
404
  }
329
405
  .search_placeholder{
330
406
  width: 100%;
331
- text-align: center;
407
+ text-align: left;
332
408
  font-size: unit(28, rpx);
333
409
  }
334
410
  }
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+ /**
3
+ * @description 接口配置,
4
+ * 在设置方法名字当时候,别忘记加上【模块名字】:Header
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ mapFnName: 'getListPosterContent', //自定义方法名字(必选)
10
+ title: '获取内容',
11
+ path: '/cms/v1/ad-content',
12
+ isRule: false,
13
+ params: {
14
+ scene: ['使用场景', 'String', '选填'],
15
+ container_id: ['插件ID', 'String', '必填'],
16
+ page_id: ['页面ID', 'String', '必填'],
17
+ page_size: ['记录条数', 'Number', '必填'],
18
+ },
19
+ isConsole: true,
20
+ disabled: true,
21
+ },
22
+ ];
@@ -0,0 +1,488 @@
1
+ 'use strict';
2
+ import ICONS from "@/ICONS.js"
3
+
4
+ /**
5
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
6
+ */
7
+ export default {
8
+ style: [],
9
+ content: (data) => {
10
+ return [
11
+ {
12
+ label: "logo设置",
13
+ ele: "xd-radio",
14
+ valueKey: "showLogoType",
15
+ value: data.showLogoType,
16
+ list: [
17
+ { label: "使用应用logo", value: 'default' },
18
+ { label: "自定义logo", value: 'self' },
19
+ ],
20
+ groupKey: "content"
21
+ },
22
+ {
23
+ label: '上传自定义logo:',
24
+ ele: 'xd-upload',
25
+ valueKey: 'selfLogo',
26
+ groupKey:'content',
27
+ value: data.selfLogo || {},
28
+ defaultValue: data.selfLogo || null,
29
+ slot: true,
30
+ oneWidth: 100,
31
+ oneHeight: 100,
32
+ elinputClassName: 'input40',
33
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.建议高度为<span style="color:red">100px</span>,宽度自适应',
34
+ type: ['jpg', 'png', 'jpeg'],
35
+ styleType: 'one',
36
+ uploadType: 'aliyun',
37
+ size: 5,
38
+ action: 'action',
39
+ sort: true,
40
+ maxlen: 100,
41
+ hidden: data.showLogoType !== 'self'
42
+ },
43
+ {
44
+ label: "是否站点名称:",
45
+ ele: "xd-radio",
46
+ valueKey: "showSiteName",
47
+ value: data.showSiteName || "Y",
48
+ list: [
49
+ { label: "展示", value: "Y" },
50
+ { label: "隐藏", value: "N" },
51
+ ],
52
+ groupKey:'content',
53
+ },
54
+ {
55
+ label: '是否分类入口:',
56
+ ele: 'xd-radio',
57
+ valueKey: 'showCategory',
58
+ value: data.showCategory || "Y",
59
+ list: [
60
+ { label: "展示", value: "Y" },
61
+ { label: "隐藏", value: "N" },
62
+ ],
63
+ groupKey:'content'
64
+ },
65
+ {
66
+ label: "分类ICON:",
67
+ ele: "xd-select-list",
68
+ valueKey: "categoryIcon",
69
+ value: data.categoryIcon,
70
+ list: ICONS,
71
+ groupKey:'content',
72
+ className: "input80",
73
+ hidden: data.showCategory !== "Y"
74
+ },
75
+
76
+ {
77
+ label: "导航配置",
78
+ ele: "title",
79
+ groupKey:'content',
80
+ size: "small",
81
+ hidden: data.showCategory !== "Y"
82
+ },
83
+ {
84
+ label: "是否展开导航(预览调试):",
85
+ ele: "xd-radio",
86
+ valueKey: "navExpand",
87
+ value: data.navExpand || "Y",
88
+ list: [
89
+ { label: "展开", value: "Y" },
90
+ { label: "收起", value: "N" },
91
+ ],
92
+ groupKey:'content',
93
+ hidden: data.showCategory !== "Y"
94
+ },
95
+ {
96
+ label: '导航列表配置:',
97
+ ele: 'xd-site-poster',
98
+ valueKey: 'poster',
99
+ className: 'input80',
100
+ value: data.poster || {},
101
+ groupKey:'content',
102
+ setting: {
103
+ count: 1,
104
+ scene: {label: '广告', value: 'normal'}
105
+ },
106
+ handleCustom({action, data}) {
107
+ //设置场景参数
108
+ if(data) {
109
+ data.params = Object.assign({}, {scene: 'normal'}, data.params || {})
110
+ }
111
+
112
+ //获取显示内容
113
+ if (action === 'screenList') {
114
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'editx_base_ad_split_screen'})
115
+ .then(res => {
116
+ data.cb(res['list'])
117
+ })
118
+ .catch(error => {
119
+ console.error(error);
120
+ });
121
+ return
122
+ }
123
+
124
+ //获取返回参数(广告位高度必选项)
125
+ if (action === 'getPosterInfo') {
126
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
127
+ .then(res => {
128
+ data.cb({list: res.list, selectId: res.selected})
129
+ })
130
+ .catch(error => {
131
+ console.error(error);
132
+ });
133
+ return
134
+ }
135
+
136
+ //使用内容分类
137
+ if (action === 'cmsPublishEditxContent') {
138
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
139
+ .then(res => {
140
+ data.cb(res)
141
+ })
142
+ .catch(error => {
143
+ console.error(error);
144
+ });
145
+ return
146
+ }
147
+
148
+ let loading = XdBus.getParentApi('loading')({});
149
+ //位置列表
150
+ if (action === 'getListPostion') {
151
+ XdBus.getParentApi('getListPosterPosition')(data.params)
152
+ .then(res => {
153
+ loading.close();
154
+ data.cb(res)
155
+ })
156
+ .catch(error => {
157
+ loading.close();
158
+ console.error(error);
159
+ });
160
+ }
161
+
162
+ //位置创建
163
+ if (action === 'addPostion') {
164
+ XdBus.getParentApi('addPosterPosition')(data.params)
165
+ .then(res => {
166
+ loading.close();
167
+ data.cb(true)
168
+ })
169
+ .catch(error => {
170
+ console.error(error);
171
+ loading.close();
172
+ data.cb(false)
173
+ });
174
+ }
175
+
176
+ //位置编辑
177
+ if (action === 'editPostion') {
178
+ XdBus.getParentApi('updatePosterPosition')(data.params)
179
+ .then(res => {
180
+ loading.close();
181
+ data.cb(true)
182
+ })
183
+ .catch(error => {
184
+ console.error(error);
185
+ loading.close();
186
+ data.cb(false)
187
+ });
188
+ }
189
+
190
+ //位置删除
191
+ if (action === 'deleltePostion') {
192
+ XdBus.getParentApi('deletePosterPosition')(data.params)
193
+ .then(res => {
194
+ loading.close();
195
+ data.cb(true)
196
+ })
197
+ .catch(error => {
198
+ console.error(error);
199
+ loading.close();
200
+ data.cb(false)
201
+ });
202
+ }
203
+
204
+ //获取广告位内容列表
205
+ if (action === 'getListContent') {
206
+ XdBus.getParentApi('getListPosterContent')(data.params)
207
+ .then(res => {
208
+ loading.close();
209
+ data.cb(res)
210
+ })
211
+ .catch(error => {
212
+ loading.close();
213
+ console.error(error);
214
+ });
215
+ }
216
+
217
+ //广告内容创建
218
+ if (action === 'addContent') {
219
+ XdBus.getParentApi('addPosterContent')(data.params)
220
+ .then(res => {
221
+ loading.close();
222
+ data.cb(true)
223
+ })
224
+ .catch(error => {
225
+ console.error(error);
226
+ loading.close();
227
+ data.cb(false)
228
+ });
229
+ }
230
+
231
+ //广告内容编辑
232
+ if (action === 'editContent') {
233
+ XdBus.getParentApi('updatePosterContent')(data.params)
234
+ .then(res => {
235
+ loading.close();
236
+ data.cb(true)
237
+ })
238
+ .catch(error => {
239
+ console.error(error);
240
+ loading.close();
241
+ data.cb(false)
242
+ });
243
+ }
244
+
245
+ //广告内容删除
246
+ if (action === 'deleteContent') {
247
+ XdBus.getParentApi('deletePosterContent')(data.params)
248
+ .then(res => {
249
+ loading.close();
250
+ data.cb(true)
251
+ })
252
+ .catch(error => {
253
+ console.error(error);
254
+ loading.close();
255
+ data.cb(false)
256
+ });
257
+ }
258
+
259
+ //获取广告内容跳转地址类型
260
+ if (action === 'jumpPosterContentType') {
261
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: "cms_setting"})
262
+ .then(res => {
263
+ loading.close();
264
+ data.cb(res['redirect_type'])
265
+ })
266
+ .catch(error => {
267
+ loading.close();
268
+ console.error(error);
269
+ });
270
+ }
271
+
272
+ //发布
273
+ if (action === 'publish') {
274
+ console.log('publish', data.params)
275
+ XdBus.getParentApi('cmsPublishContent')(data.params)
276
+ .then(res => {
277
+ loading.close();
278
+ data.cb(res)
279
+ })
280
+ .catch(error => {
281
+ loading.close();
282
+ console.error(error);
283
+ });
284
+ }
285
+
286
+ //获取站内页面地址
287
+ if (action === 'router') {
288
+ loading.close()
289
+ return XdBus.getParentApi('getPagesTree');
290
+
291
+ }
292
+
293
+ //通知页面进行刷新
294
+ if(action === 'update') {
295
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
296
+ loading.close()
297
+ }
298
+ },
299
+ rules: [{
300
+ required: true,
301
+ validator: (rule, value, callback) => {
302
+ let message = '请设置广告相关内容';
303
+ if(!value) {
304
+ callback(message);
305
+ return;
306
+ }
307
+ if(value.size && !value.size.height){
308
+ callback(message);
309
+ return
310
+ }
311
+
312
+ if(value.size && !value.size.width){
313
+ callback(message);
314
+ return
315
+ }
316
+ callback()
317
+ },trigger: ['blur', 'change']
318
+ }],
319
+ },
320
+ {
321
+ label: "导航内容显示列数:",
322
+ ele: "xd-select-list",
323
+ valueKey: "navColumn",
324
+ value: data.navColumn || 4,
325
+ list: [
326
+ { label: "3列", value: 3 },
327
+ { label: "4列", value: 4 },
328
+ { label: "5列", value: 5 },
329
+ { label: "6列", value: 6 },
330
+ ],
331
+ className: "input80",
332
+ groupKey:'content',
333
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
334
+ },
335
+ {
336
+ label: "导航内容显示行数:",
337
+ ele: "xd-select-list",
338
+ valueKey: "navRow",
339
+ value: data.navRow || 2,
340
+ list: [
341
+ { label: "1行", value: 1 },
342
+ { label: "2行", value: 2 },
343
+ { label: "3行", value: 3 },
344
+ { label: "4行", value: 4 },
345
+ ],
346
+ className: "input80",
347
+ groupKey:'content',
348
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
349
+ },
350
+ {
351
+ label: "导航内边距配置:",
352
+ ele: "xd-margin-padding",
353
+ valueKey: "navPadding",
354
+ value: data.navPadding,
355
+ groupKey:'content',
356
+ setting: {
357
+ type: "padding"
358
+ },
359
+ inline: false,
360
+ notice: '设置内填充,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
361
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
362
+ },
363
+ {
364
+ label: '导航ICON宽度:',
365
+ ele: "el-input",
366
+ valueKey: "iconWidth",
367
+ value: data.iconWidth || 100,
368
+ className: "input80",
369
+ groupKey:'content',
370
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
371
+ },
372
+ {
373
+ label: "导航ICON高度:",
374
+ ele: "el-input",
375
+ valueKey: "iconHeight",
376
+ value: data.iconHeight || 100,
377
+ className: "input80",
378
+ groupKey:'content',
379
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
380
+ },
381
+ {
382
+ label: "导航ICON外边距:",
383
+ ele: "xd-margin-padding",
384
+ valueKey: "iconMargin",
385
+ value: data.iconMargin,
386
+ groupKey:'content',
387
+ setting: {
388
+ type: "margin"
389
+ },
390
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
391
+ },
392
+ {
393
+ label: "单个导航背景色:",
394
+ ele: "xd-color",
395
+ valueKey: "navBgColor",
396
+ value: data.navBgColor,
397
+ groupKey:'content',
398
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
399
+ },
400
+ {
401
+ label: "导航横向间距:",
402
+ ele: "el-input",
403
+ valueKey: "navColumnGap",
404
+ value: data.navColumnGap || 10,
405
+ className: "input80",
406
+ groupKey:'content',
407
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
408
+ },
409
+ {
410
+ label: "导航垂直间距:",
411
+ ele: "el-input",
412
+ valueKey: "navRowGap",
413
+ value: data.navRowGap || 10,
414
+ className: "input80",
415
+ groupKey:'content',
416
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
417
+ },
418
+ {
419
+ label: "导航ICON圆角:",
420
+ ele: 'xd-site-select-list',
421
+ valueKey: 'navRadius',
422
+ groupKey:'content',
423
+ value: data.navRadius || '20',
424
+ placeholder: '请选择导航圆角设置',
425
+ multiple: false,
426
+ className: 'input80',
427
+ handleCustom({action, data}) {
428
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
429
+ .then(res => {
430
+ data.cb(res.list)
431
+ })
432
+ .catch(error => {
433
+ console.error(error);
434
+ });
435
+ },
436
+ },
437
+ {
438
+ label: "导航ICON阴影:",
439
+ ele: "xd-shadow",
440
+ valueKey: "navShadow",
441
+ value: data.navShadow,
442
+ groupKey:'content',
443
+ handleCustom({action, data}) {
444
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
445
+ .then(res => {
446
+ data.cb(res.list)
447
+ })
448
+ .catch(error => {
449
+ console.error(error);
450
+ data.cb([])
451
+ });
452
+ },
453
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
454
+ },
455
+ {
456
+ label: "背景颜色:",
457
+ ele: "xd-color",
458
+ valueKey: "bgColor",
459
+ value: data.bgColor,
460
+ groupKey:'style'
461
+ },
462
+ {
463
+ label: "站点名称字体设置:",
464
+ ele: "xd-font",
465
+ valueKey: "siteNameFont",
466
+ value: data.siteNameFont,
467
+ groupKey:'style',
468
+ setting: {
469
+ align: false,
470
+ lineHeight: false,
471
+ },
472
+ handleCustom({action, data}) {
473
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_font_size'})
474
+ .then(res => {
475
+ data.cb(res.list)
476
+ })
477
+ .catch(error => {
478
+ data.cb([])
479
+ console.error(error);
480
+ });
481
+ },
482
+ inline: false,
483
+ hidden: data.showSiteName !== "Y"
484
+ }
485
+ ].filter(i=>i)
486
+ },
487
+ advanced: [],
488
+ };