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.
@@ -46,6 +46,18 @@ export default {
46
46
  {label: "不显示", value: "N"}
47
47
  ]
48
48
  },
49
+ {
50
+ label: "定位样式",
51
+ ele: "xd-radio",
52
+ valueKey: "searchBoxPosition",
53
+ value: data.searchBoxPosition || "out",
54
+ list: [
55
+ {label: "搜索框外", value: "out"},
56
+ {label: "搜索框内", value: "in"}
57
+ ],
58
+ groupKey:'content',
59
+ hidden: data.showLocation !== 'Y'
60
+ },
49
61
  {
50
62
  label: "是否显示站点信息",
51
63
  ele: "xd-radio",
@@ -77,6 +89,108 @@ export default {
77
89
  value: data.placeholder || '',
78
90
  className: "input80"
79
91
  },
92
+ {
93
+ label: '搜索框圆角',
94
+ ele: 'xd-site-select-list',
95
+ valueKey: 'searchBoxRadius',
96
+ value: data.searchBoxRadius || 30,
97
+ groupKey:'content',
98
+ placeholder: '请选择内容圆角设置',
99
+ multiple: false,
100
+ className: 'input80',
101
+ handleCustom({ action, data }) {
102
+ XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
103
+ .then(res => {
104
+ data.cb(res.list)
105
+ })
106
+ .catch(error => {
107
+ console.error(error);
108
+ });
109
+ },
110
+ },
111
+ {
112
+ label: "放大镜位置",
113
+ ele: "xd-radio",
114
+ valueKey: "searchIconPosition",
115
+ value: data.searchIconPosition || "right",
116
+ list: [
117
+ {label: "靠左", value: "left"},
118
+ {label: "靠右", value: "right"},
119
+ {label: "隐藏", value: "hidden"}
120
+ ],
121
+ groupKey:'content',
122
+ },
123
+ {
124
+ label: "右侧是否展示搜索",
125
+ ele: "xd-radio",
126
+ valueKey: "showSearchBtn",
127
+ value: data.showSearchBtn,
128
+ list: [
129
+ {label: "展示", value: "Y"},
130
+ {label: "隐藏", value: "N"}
131
+ ],
132
+ groupKey:'content',
133
+ },
134
+ {
135
+ label: "搜索位置",
136
+ ele: "xd-radio",
137
+ valueKey: "searchBtnPosition",
138
+ value: data.searchBtnPosition || "out",
139
+ list: [
140
+ {label: "搜索框内", value: "in"},
141
+ {label: "搜索框外", value: "out"}
142
+ ],
143
+ groupKey:'content',
144
+ hidden: data.showSearchBtn !== 'Y'
145
+ },
146
+ {
147
+ label: "右侧搜索按钮文案自定义",
148
+ ele: "el-input",
149
+ placeholder: '请输入搜索按钮文案',
150
+ valueKey: "searchBtnText",
151
+ groupKey:'content',
152
+ value: data.searchBtnText || '',
153
+ className: "input80",
154
+ hidden: data.showSearchBtn !== 'Y'
155
+ },
156
+ {
157
+ label: "搜索按钮背景颜色",
158
+ ele: "xd-color",
159
+ placeholder: '请输入搜索按钮背景颜色',
160
+ valueKey: "searchBtnBgColor",
161
+ groupKey:'content',
162
+ value: data.searchBtnBgColor || '',
163
+ hidden: data.showSearchBtn !== 'Y'
164
+ },
165
+ {
166
+ label: "搜索按钮文字颜色",
167
+ ele: "xd-color",
168
+ placeholder: '请输入搜索按钮文字颜色',
169
+ valueKey: "searchBtnTextColor",
170
+ groupKey:'content',
171
+ value: data.searchBtnTextColor || '',
172
+ hidden: data.showSearchBtn !== 'Y'
173
+ },
174
+ {
175
+ label: "搜索按钮圆角",
176
+ ele: 'xd-site-select-list',
177
+ valueKey: 'searchBtnRadius',
178
+ value: data.searchBtnRadius || 0,
179
+ groupKey:'content',
180
+ placeholder: '请选择内容圆角设置',
181
+ multiple: false,
182
+ className: 'input80',
183
+ handleCustom({ action, data }) {
184
+ XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
185
+ .then(res => {
186
+ data.cb(res.list)
187
+ })
188
+ .catch(error => {
189
+ console.error(error);
190
+ });
191
+ },
192
+ hidden: data.showSearchBtn !== 'Y'
193
+ },
80
194
  {
81
195
  label: '背景颜色:',
82
196
  ele: 'xd-color',
@@ -86,6 +200,14 @@ export default {
86
200
  classNmae: 'input80',
87
201
  groupKey:'style',
88
202
  },
203
+ {
204
+ label: "底部边框设置:",
205
+ ele: "xd-border",
206
+ valueKey: "bottomBorder",
207
+ value: data['bottomBorder'] || {},
208
+ className: 'input80',
209
+ groupKey: 'style',
210
+ },
89
211
  {
90
212
  ele: 'title',
91
213
  label: '定位功能样式设置',
@@ -152,7 +274,7 @@ export default {
152
274
  value: data['inputBackgroundColor'] || '',
153
275
  groupKey:'style',
154
276
  placeholder: '请选择背景颜色',
155
- classNmae: 'input80',
277
+ className: 'input80',
156
278
  },
157
279
  {
158
280
  label: '输入框文字颜色:',
@@ -161,64 +283,22 @@ export default {
161
283
  groupKey:'style',
162
284
  value: data['inputTextColor'] || '',
163
285
  placeholder: '请选择输入框文字颜色',
164
- classNmae: 'input80',
165
- },
166
- {
167
- ele: 'title',
168
- label: '投影设置',
169
- size: 'small',
170
- groupKey:'style',
171
- },
172
- {
173
- label: '是否有投影:',
174
- ele: 'xd-radio',
175
- valueKey: 'is_shadow',
176
- value: data['is_shadow'] || 'N',
177
- placeholder: '请选择是否投影',
178
- groupKey:'style',
179
- multiple: false,
180
286
  className: 'input80',
181
- list: [
182
- {label: '是', value: 'Y'},
183
- {label: '否', value: 'N'},
184
- ]
185
- },
186
- data['is_shadow'] === 'Y' && {
187
- label: '投影颜色:',
188
- ele: 'xd-color',
189
- valueKey: 'is_shadow_bg',
190
- value: data['is_shadow_bg'] || '',
191
- groupKey:'style',
192
- placeholder: '请选择投影颜色',
193
- classNmae: 'input80',
194
287
  },
195
- data['is_shadow'] === 'Y' && {
196
- label: '投影范围:',
197
- ele: 'xd-site-select-list',
198
- groupKey:'style',
199
- valueKey: 'is_shadow_w',
200
- value: data['is_shadow_w'] || '10',
201
- placeholder: '请选择投影范围',
202
- multiple: false,
288
+ {
289
+ label: "输入框边框设置:",
290
+ ele: "xd-border",
291
+ valueKey: "inputBorder",
292
+ value: data['inputBorder'] || {},
203
293
  className: 'input80',
204
- handleCustom({action, data}) {
205
- XdBus.getParentApi('getOptionsSettingList')({
206
- setting_id: 'edtix_style_radius',
207
- key: Date.now()
208
- })
209
- .then(res => {
210
- data.cb(res.list)
211
- })
212
- .catch(error => {
213
- console.error(error);
214
- });
215
- },
294
+ groupKey: 'style',
216
295
  },
217
296
  {
218
297
  ele: 'title',
219
298
  label: '边框设置',
220
299
  size: 'small',
221
300
  groupKey:'style',
301
+ hidden: true,
222
302
  },
223
303
  {
224
304
  label: '是否有边框:',
@@ -232,7 +312,8 @@ export default {
232
312
  list: [
233
313
  {label: '是', value: 'Y'},
234
314
  {label: '否', value: 'N'},
235
- ]
315
+ ],
316
+ hidden: true,
236
317
  },
237
318
  data['is_border'] === 'Y' && {
238
319
  label: '边框颜色:',
@@ -242,6 +323,7 @@ export default {
242
323
  value: data['is_border_c'] || '',
243
324
  placeholder: '请选择边框颜色',
244
325
  classNmae: 'input80',
326
+ hidden: true,
245
327
  },
246
328
  data['is_border'] === 'Y' && {
247
329
  label: '边框大小:',
@@ -252,6 +334,7 @@ export default {
252
334
  value: data['is_border_w'] || '',
253
335
  placeholder: '请输入边框颜色',
254
336
  className: 'input80',
337
+ hidden: true,
255
338
  },
256
339
  {
257
340
  label: '搜索页面链接:',
@@ -18,8 +18,7 @@
18
18
  class="header_wrap"
19
19
  :style="{
20
20
  background: backgroundColor,
21
- boxShadow,
22
- borderBottom:boxBorder
21
+ borderBottom: bottomBorder
23
22
  }"
24
23
  >
25
24
  <view class="header_wrap-back" @click="onJfbBack" v-if="showBack==='Y'">
@@ -31,7 +30,7 @@
31
30
  </view>
32
31
  <view v-if="showPartnerName==='Y'" class="name" :style="{color: textColor}">{{partnerName}}</view>
33
32
  </view>
34
- <view v-if="loaded && showLocation==='Y'" class="header_wrap-city">
33
+ <view v-if="loaded && showLocation==='Y' && searchBoxPosition==='out'" class="header_wrap-city">
35
34
  <xd-city-show-api
36
35
  @done="handleCityDone"
37
36
  @onChange="handleCityChange"
@@ -46,9 +45,22 @@
46
45
  @click="toSearch"
47
46
  :style="{
48
47
  background:inputBackgroundColor,
49
- color:inputTextColor
48
+ color:inputTextColor,
49
+ borderRadius: searchBoxRadius + 'rpx',
50
+ border: inputBorder
50
51
  }"
51
52
  >
53
+ <view v-if="loaded && showLocation==='Y' && searchBoxPosition==='in'" class="header-city-in" @click.stop>
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
+ class="search_btn_in"
77
+ :style="[searchBtnStyle]"
78
+ @click.stop="doSearch"
79
+ >{{searchBtnText || '搜索'}}</view>
63
80
  </view>
81
+ <view v-if="showSearchBtn==='Y' && searchBtnPosition==='out'"
82
+ class="search_btn_out"
83
+ :style="[searchBtnStyle]"
84
+ @click="doSearch"
85
+ >{{searchBtnText || '搜索'}}</view>
64
86
  </view>
65
87
  </view>
66
88
  </view>
@@ -86,14 +108,12 @@
86
108
  mixins: [componentsMixins,extsMixins,JfbBaseHeaderMixin],
87
109
  computed:{
88
110
  ...mapState(['siteInfo']),
89
-
90
- boxShadow() {
91
- if (this.is_shadow === 'Y') return `0 0 ${this.is_shadow_w}rpx ${this.is_shadow_bg}`;
92
- else return '0 0 0 rgba(0,0,0,0)';
93
- },
94
- boxBorder() {
95
- if (this.is_border === 'Y') return `${this.is_border_w}rpx solid ${this.is_border_c}`;
96
- else return '0';
111
+ searchBtnStyle(){
112
+ return {
113
+ background: this.searchBtnBgColor,
114
+ color: this.searchBtnTextColor,
115
+ borderRadius: this.searchBtnRadius + 'rpx'
116
+ }
97
117
  }
98
118
  },
99
119
  data() {
@@ -102,6 +122,7 @@
102
122
  saveKey: 'xd_user_current_access_city', //用户选中城市存储key
103
123
  loaded: false,
104
124
  keyword: "",
125
+ isPreview: false,
105
126
 
106
127
  //面板
107
128
  showLocation: "",
@@ -128,12 +149,6 @@
128
149
  icon: '',
129
150
  iconColor: '',
130
151
 
131
- //投影
132
- is_shadow: 'Y',
133
- is_shadow_bg: 0,
134
- is_shadow_w: 0,
135
-
136
-
137
152
  //边框
138
153
  is_border: 'Y',
139
154
  is_border_w: 0,
@@ -141,9 +156,20 @@
141
156
 
142
157
  //定位ICON
143
158
  locationIcon: "",
144
- locationBackgroundColor: ""
159
+ locationBackgroundColor: "",
145
160
 
146
161
  //
162
+ searchBoxPosition: "out",
163
+ searchIconPosition: "right",
164
+ showSearchBtn: "",
165
+ searchBtnPosition: "out",
166
+ searchBtnText: "",
167
+ searchBtnBgColor: "",
168
+ searchBtnTextColor: "",
169
+ searchBtnRadius: 0,
170
+ searchBoxRadius: 30,
171
+ bottomBorder: "",
172
+ inputBorder: "",
147
173
  }
148
174
  },
149
175
  watch: {
@@ -154,6 +180,7 @@
154
180
  },
155
181
  created() {
156
182
  this.init(this.container);
183
+ this.isPreview = this.$configProject['isPreview'];
157
184
  },
158
185
  methods: {
159
186
  ...mapMutations(['setShowSwitchCity', 'setCityInfo']),
@@ -185,15 +212,23 @@
185
212
  this.locationIcon = getContainerPropsValue(container, "content.locationIcon", "icondizhitubiao")
186
213
  this.locationBackgroundColor = getContainerPropsValue(container, "content.locationBackgroundColor", "")
187
214
 
188
- this.is_shadow = getContainerPropsValue(container, 'content.is_shadow', 'N');
189
- this.is_shadow_bg = getContainerPropsValue(container, 'content.is_shadow_bg', '#fff');
190
- this.is_shadow_w = getContainerPropsValue(container, 'content.is_shadow_w', '10');
191
-
192
215
  this.is_border = getContainerPropsValue(container, 'content.is_border', 'N');
193
216
  this.is_border_c = getContainerPropsValue(container, 'content.is_border_c', '#fff');
194
217
  this.is_border_w = getContainerPropsValue(container, 'content.is_border_w', '2');
195
218
 
196
-
219
+ this.searchBoxPosition = getContainerPropsValue(container, 'content.searchBoxPosition', "out");
220
+ this.searchIconPosition = getContainerPropsValue(container, 'content.searchIconPosition', "right");
221
+ this.showSearchBtn = getContainerPropsValue(container, 'content.showSearchBtn', "");
222
+ this.searchBtnPosition = getContainerPropsValue(container, 'content.searchBtnPosition', "out");
223
+ this.searchBtnText = getContainerPropsValue(container, 'content.searchBtnText', "");
224
+ this.searchBtnBgColor = getContainerPropsValue(container, 'content.searchBtnBgColor', "");
225
+ this.searchBtnTextColor = getContainerPropsValue(container, 'content.searchBtnTextColor', "");
226
+ this.searchBtnRadius = getContainerPropsValue(container, 'content.searchBtnRadius', 100);
227
+ this.searchBoxRadius = getContainerPropsValue(container, 'content.searchBoxRadius', 30);
228
+ let bottomBorder = getContainerPropsValue(container, 'content.bottomBorder', "Y");
229
+ console.log("this.bottomBorder", this.bottomBorder)
230
+ this.bottomBorder = this.getBorderCompatibleOldStyle(bottomBorder, {})
231
+ this.inputBorder = this.getXdBorder({}, getContainerPropsValue(container, 'content.inputBorder', {}))
197
232
 
198
233
  let name , logo, platform_logo;
199
234
  if (this.projectAttr['site_name']) name = this.projectAttr['site_name'];
@@ -203,16 +238,28 @@
203
238
  this.logo = platform_logo || logo || '//dummyimage.com/100x100';
204
239
  this.partnerName = name || '聚福宝福利';
205
240
 
206
-
207
-
241
+ if(this.isPreview){
242
+ document.querySelector('.xd-Layout__top').style.zIndex = 149099;
243
+ }
208
244
  },
209
245
  handleInput(e){
210
246
  this.keyword = e.detail.value;
247
+ //如果有搜索按钮,则不自动执行搜索
248
+ if(this.showSearchBtn === 'Y') return;
211
249
  if(this.timer) clearTimeout(this.timer);
212
250
  this.timer = setTimeout(() => {
213
251
  jfbRootFnExec(this, 'onCustomEvent')("baseHeader@search", e.detail.value);
214
252
  }, 300)
215
253
  },
254
+ doSearch(){
255
+ if(this.useSearch === "N"){
256
+ this.$xdUniHelper.navigateTo({
257
+ url: this.searchPagePath
258
+ })
259
+ }else{
260
+ jfbRootFnExec(this, 'onCustomEvent')("baseHeader@search", this.keyword);
261
+ }
262
+ },
216
263
  toSearch(){
217
264
  if(this.useSearch === 'N'){
218
265
  this.$xdUniHelper.navigateTo({
@@ -283,7 +330,7 @@
283
330
 
284
331
  &-city {
285
332
  height: unit(110, rpx);
286
- padding-left: unit(20, rpx);
333
+ // padding-left: unit(20, rpx);
287
334
  display: flex;
288
335
  justify-content: center;
289
336
  align-items: center;
@@ -317,21 +364,61 @@
317
364
  .search_wrap{
318
365
  margin-left: unit(20, rpx);
319
366
  flex: 1;
320
- padding: 12rpx 20rpx;
367
+ padding: 0rpx 20rpx;
368
+ height: 64rpx;
321
369
  border-radius: unit(50, rpx);
322
370
  display: flex;
323
371
  align-items: center;
372
+ .header-city-in{
373
+ position: relative;
374
+ padding-right: 28rpx;
375
+ margin-right: 20rpx;
376
+ &::before{
377
+ content: " ";
378
+ position: absolute;
379
+ width: 2rpx;
380
+ height: 100%;
381
+ background-color: #CCCCCC;
382
+ right: -0rpx;
383
+ top: 0rpx;
384
+ }
385
+ ::v-deep .xd-city{
386
+ padding: 0;
387
+ }
388
+ }
324
389
  .search_input{
325
390
  flex: 1;
326
- text-align: center;
391
+ text-align: left;
327
392
  font-size: unit(28,rpx);
393
+ padding-left: 20rpx;
328
394
  }
329
395
  .search_placeholder{
396
+ flex: 1;
330
397
  width: 100%;
331
- text-align: center;
398
+ text-align: left;
332
399
  font-size: unit(28, rpx);
400
+ padding-left: 20rpx;
401
+ }
402
+ .search_btn_in{
403
+ height: 48rpx;
404
+ display: flex;
405
+ align-items: center;
406
+ justify-content: center;
407
+ padding: 4rpx 32rpx;
408
+ font-size: 28rpx;
409
+ box-sizing: border-box;
333
410
  }
334
411
  }
412
+ .search_btn_out{
413
+ height: 64rpx;
414
+ margin-left: 4px;
415
+ padding: 8rpx 32rpx;
416
+ font-size: 28rpx;
417
+ box-sizing: border-box;
418
+ display: flex;
419
+ align-items: center;
420
+ justify-content: center;
421
+ }
335
422
  }
336
423
  }
337
424
  }
@@ -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
+ ];