jufubao-base 1.0.197-beta3 → 1.0.197-beta5

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.
@@ -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,21 @@
46
45
  @click="toSearch"
47
46
  :style="{
48
47
  background:inputBackgroundColor,
49
- color:inputTextColor
48
+ color:inputTextColor,
49
+ borderRadius: searchBoxRadius + 'rpx'
50
50
  }"
51
51
  >
52
+ <view v-if="loaded && showLocation==='Y' && searchBoxPosition==='in'" class="header-city-in">
53
+ <xd-city-show-api
54
+ @done="handleCityDone"
55
+ @onChange="handleCityChange"
56
+ :color="textColor"
57
+ :icon="locationIcon"
58
+ :bgColor="locationBackgroundColor"
59
+ :key="showLocationKey"
60
+ ></xd-city-show-api>
61
+ </view>
62
+ <xd-font-icon v-if="searchIconPosition==='left'" :icon="icon" :color="iconColor" size="32"/>
52
63
  <input
53
64
  v-if="useSearch==='Y'"
54
65
  :placeholder="placeholder"
@@ -59,8 +70,18 @@
59
70
  :placeholder-style="'color:' + inputTextColor"
60
71
  />
61
72
  <view v-else class="search_placeholder">{{placeholder}}</view>
62
- <xd-font-icon :icon="icon" :color="iconColor" size="32"/>
73
+ <xd-font-icon v-if="searchIconPosition==='right'" :icon="icon" :color="iconColor" size="32"/>
74
+ <view v-if="showSearchBtn==='Y' && searchBtnPosition==='in'"
75
+ :style="[searchBtnStyle]"
76
+ style="padding: 4rpx 32rpx;"
77
+ @click="doSearch"
78
+ >{{searchBtnText || '搜索'}}</view>
63
79
  </view>
80
+ <view v-if="showSearchBtn==='Y' && searchBtnPosition==='out'"
81
+ style="margin-left: 4px;padding: 8rpx 32rpx;"
82
+ :style="[searchBtnStyle]"
83
+ @click="doSearch"
84
+ >{{searchBtnText || '搜索'}}</view>
64
85
  </view>
65
86
  </view>
66
87
  </view>
@@ -86,14 +107,12 @@
86
107
  mixins: [componentsMixins,extsMixins,JfbBaseHeaderMixin],
87
108
  computed:{
88
109
  ...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';
110
+ searchBtnStyle(){
111
+ return {
112
+ background: this.searchBtnBgColor,
113
+ color: this.searchBtnTextColor,
114
+ borderRadius: this.searchBtnRadius + 'rpx'
115
+ }
97
116
  }
98
117
  },
99
118
  data() {
@@ -102,6 +121,7 @@
102
121
  saveKey: 'xd_user_current_access_city', //用户选中城市存储key
103
122
  loaded: false,
104
123
  keyword: "",
124
+ isPreview: false,
105
125
 
106
126
  //面板
107
127
  showLocation: "",
@@ -128,12 +148,6 @@
128
148
  icon: '',
129
149
  iconColor: '',
130
150
 
131
- //投影
132
- is_shadow: 'Y',
133
- is_shadow_bg: 0,
134
- is_shadow_w: 0,
135
-
136
-
137
151
  //边框
138
152
  is_border: 'Y',
139
153
  is_border_w: 0,
@@ -141,9 +155,19 @@
141
155
 
142
156
  //定位ICON
143
157
  locationIcon: "",
144
- locationBackgroundColor: ""
158
+ locationBackgroundColor: "",
145
159
 
146
160
  //
161
+ searchBoxPosition: "out",
162
+ searchIconPosition: "right",
163
+ showSearchBtn: "",
164
+ searchBtnPosition: "out",
165
+ searchBtnText: "",
166
+ searchBtnBgColor: "",
167
+ searchBtnTextColor: "",
168
+ searchBtnRadius: 0,
169
+ searchBoxRadius: 30,
170
+ bottomBorder: "",
147
171
  }
148
172
  },
149
173
  watch: {
@@ -154,6 +178,7 @@
154
178
  },
155
179
  created() {
156
180
  this.init(this.container);
181
+ this.isPreview = this.$configProject['isPreview'];
157
182
  },
158
183
  methods: {
159
184
  ...mapMutations(['setShowSwitchCity', 'setCityInfo']),
@@ -185,15 +210,25 @@
185
210
  this.locationIcon = getContainerPropsValue(container, "content.locationIcon", "icondizhitubiao")
186
211
  this.locationBackgroundColor = getContainerPropsValue(container, "content.locationBackgroundColor", "")
187
212
 
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
213
  this.is_border = getContainerPropsValue(container, 'content.is_border', 'N');
193
214
  this.is_border_c = getContainerPropsValue(container, 'content.is_border_c', '#fff');
194
215
  this.is_border_w = getContainerPropsValue(container, 'content.is_border_w', '2');
195
216
 
196
-
217
+ this.searchBoxPosition = getContainerPropsValue(container, 'content.searchBoxPosition', "out");
218
+ this.searchIconPosition = getContainerPropsValue(container, 'content.searchIconPosition', "right");
219
+ this.showSearchBtn = getContainerPropsValue(container, 'content.showSearchBtn', "");
220
+ this.searchBtnPosition = getContainerPropsValue(container, 'content.searchBtnPosition', "out");
221
+ this.searchBtnText = getContainerPropsValue(container, 'content.searchBtnText', "");
222
+ this.searchBtnBgColor = getContainerPropsValue(container, 'content.searchBtnBgColor', "");
223
+ this.searchBtnTextColor = getContainerPropsValue(container, 'content.searchBtnTextColor', "");
224
+ this.searchBtnRadius = getContainerPropsValue(container, 'content.searchBtnRadius', 0);
225
+ this.searchBoxRadius = getContainerPropsValue(container, 'content.searchBoxRadius', 30);
226
+ let bottomBorder = getContainerPropsValue(container, 'content.bottomBorder', "Y");
227
+ this.bottomBorder = this.getBorderCompatibleOldStyle(bottomBorder, {
228
+ type: this.is_border,
229
+ width: this.is_border_w,
230
+ color: this.is_border_c
231
+ })
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({
@@ -317,19 +364,40 @@
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;
333
401
  }
334
402
  }
335
403
  }
@@ -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
+ ];