jufubao-base 1.0.289-beta3 → 1.0.289-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.289-beta3",
3
+ "version": "1.0.289-beta4",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -36,7 +36,7 @@
36
36
 
37
37
  <script>
38
38
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
39
- import XdFooterBar from "@/components/XdFooterBar/XdFooterBar";
39
+ import XdFooterBar from "./XdFooterBar";
40
40
  import { jfbRootExec, jfbRootFnExec } from "@/utils/xd.event";
41
41
  import JfbBaseFooterMixin from "./JfbBaseFooterMixin";
42
42
  import componentsMixins from "@/mixins/componentsMixins";
@@ -0,0 +1,324 @@
1
+ <template>
2
+ <view class="xd-footer-bar" :style="[boxStyleComp]">
3
+ <view class="xd-footer-bar__border">
4
+ <view
5
+ v-for="(item,index) in dataList"
6
+ :key="item.key"
7
+ class="xd-footer-bar__item"
8
+ >
9
+ <view
10
+ class="xd-footer-bar__item-badge"
11
+ v-if="item.num"
12
+ :style="[numStyleComp,{padding: item.num === '99+' ? '0 8rpx': '0'}]"
13
+ >{{item.num}}</view>
14
+ <navigator
15
+ class="xd-footer-bar__item-link"
16
+ open-type="redirect"
17
+ :url="view ? '': (item.path + '?' + params)"
18
+ >
19
+ <view class="xd-footer-bar__icon" :class="{noName:!item.name,isCenter:index === isCenterIndex}">
20
+ <view v-if="item.image" class="image">
21
+ <image :src="(activeUrl === getPath(item.path))?item['actImage']:item.image" />
22
+ </view>
23
+ <xd-font-icon
24
+ v-else-if="item.icon"
25
+ :size="(item.size ? item.size * 2 : 36) * nameSizeComp"
26
+ :icon="item.icon"
27
+ :style="{color: (activeUrl === getPath(item.path)) ? iconActColor : iconColor}"
28
+ ></xd-font-icon>
29
+ </view>
30
+ <view v-if="index !== isCenterIndex && item.name" class="xd-footer-bar__text" :style="{color: (activeUrl === getPath(item.path))? nameActColor : nameColor}">{{item.name}}</view>
31
+ </navigator>
32
+ </view>
33
+ </view>
34
+ </view>
35
+ </template>
36
+
37
+ <script>
38
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
39
+ import {
40
+ getPlatformParamsValue,
41
+ getPlatformParamsForGroup
42
+ } from "@/project";
43
+ import storage from "@/common/storage";
44
+ import {
45
+ getParentsStyle,
46
+ } from '@/utils/xd.base';
47
+
48
+ /**
49
+ * XdFooterBar 全局Ui
50
+ * @description 底部功能
51
+ * @tutorial
52
+ * @property {Number} zIndex 层级数字 (可选)
53
+ * @property {Number} height tabBar高度(可选)
54
+ * @property {Boolean} view view显示模式(可选)
55
+ * @property {Object} styles 模版风格(可选)
56
+ * @property {Object} tabbar
57
+ * tabBar.selectedColor {String} tabBar当前选中文字颜色
58
+ * tabBar.bgColor {String} tabBar背景颜色值
59
+ * tabBar.list {Array} tabBar列表
60
+ * tabBar.list.name {String} tabBar文案(4个汉字)
61
+ * tabBar.list.path {String} 链接路径
62
+ * tabBar.list.icon {String} iconfont图标
63
+ */
64
+
65
+ export default {
66
+ name: "XdFooterBar",
67
+ components: {
68
+ XdFontIcon
69
+ },
70
+ props: {
71
+ styles:{
72
+ type: Object,
73
+ default(){
74
+ return {}
75
+ },
76
+ },
77
+ view: {
78
+ type:Boolean,
79
+ default: false,
80
+ },
81
+ zIndex: {
82
+ type: Number,
83
+ default: 1500 //rpx
84
+ },
85
+ tabBar: {
86
+ type: Object,
87
+ required: true
88
+ },
89
+ height: {
90
+ type: Number,
91
+ default: 100 //rpx
92
+ },
93
+ baseUrl: {
94
+ type: String,
95
+ required: true
96
+ }
97
+ },
98
+
99
+ watch:{
100
+ tabBar(){
101
+ this.init();
102
+ }
103
+ },
104
+
105
+ computed:{
106
+ boxStyleComp(){
107
+ return {
108
+ zIndex: this.zIndex,
109
+ height: this.height + 'rpx',
110
+ "--center-border": `${this.centerBorderWidth * this.$rpxNum}px solid ${this.centerBorderColor}`,
111
+ "--center-background-color": this.centerBorderColor
112
+ }
113
+ },
114
+ numStyleComp(){
115
+ return {
116
+ backgroundColor: 'red',
117
+ }
118
+ },
119
+ nameSizeComp(){
120
+ if(this.hasName === false) return 80/52;
121
+ return 1
122
+ },
123
+ },
124
+
125
+ data(){
126
+ return {
127
+ dataList: [],
128
+ activeUrl: null, //当前路径
129
+ params: null, //系统透传参数
130
+ hasName:true,//展示文字
131
+
132
+ //文字样式
133
+ nameColor: '#333',
134
+ nameActColor: 'red',
135
+
136
+ //图标样式
137
+ iconColor: '#333',
138
+ iconActColor: 'red',
139
+
140
+ styleMainColor: null, //插件主题风格样式
141
+
142
+ //中间效果
143
+ isCenterIndex:-1,
144
+ centerBorderColor:'#333',
145
+ centerBorderWidth: 12
146
+
147
+ }
148
+ },
149
+
150
+ async created() {
151
+ this.styleMainColor = await getParentsStyle(this.$parent, '$mainColor');
152
+
153
+ //设置活动参数
154
+ let params = [];
155
+ let xParamsKey = getPlatformParamsForGroup([]);
156
+ xParamsKey.map(key=>{
157
+ let {paramKey, storageKey} = getPlatformParamsValue(key);
158
+ let value = storage.get(storageKey);
159
+ if(value) params.push(`${paramKey}=${value}`);
160
+ })
161
+ this.params = params.join("&");
162
+
163
+ this.init();
164
+ },
165
+
166
+ mounted() {
167
+ this.$nextTick(() => {
168
+ this.getActive()
169
+ })
170
+ },
171
+
172
+ methods:{
173
+
174
+ getPath(path){
175
+ if(this.baseUrl) path = require('path').normalize(`/${this.baseUrl}/${path}`);
176
+ return path;
177
+ },
178
+
179
+ getActive(){
180
+ let routes = this.$xdUniHelper.getCurrentPages(this.tabBar.home);
181
+ this.activeUrl = routes['path'];
182
+ },
183
+
184
+
185
+ /**
186
+ * @description 初始化数据
187
+ */
188
+ init(){
189
+ this.nameActColor = this.tabBar['selectedColor'] || this.styleMainColor || 'red';
190
+ this.nameColor = this.tabBar['color'] || '#333';
191
+ this.iconActColor = this.tabBar['selectedIconColor'] || this.styleMainColor || 'red';
192
+ this.iconColor = this.tabBar['iconColor'] || '#333';
193
+ this.hasName = this.tabBar['hasName'];
194
+ this.dataList = this.tabBar.list.map(item=>{
195
+ return {
196
+ key : this.$xdUniHelper.randomChar(20),
197
+ ...item
198
+ }
199
+ });
200
+ this.centerBorderWidth = this.tabBar['borderWidth'] || 12;
201
+ this.centerBorderColor = this.tabBar['borderColor'] || this.tabBar['bgColor'] || '#fff';
202
+
203
+ if(this.tabBar['tpl'] === 'itemCenterBig') {
204
+ if( this.dataList .length === 1) this.isCenterIndex = 0;
205
+ if( this.dataList .length === 3) this.isCenterIndex = 1;
206
+ if( this.dataList .length === 5) this.isCenterIndex = 2;
207
+ }
208
+ else {
209
+ this.isCenterIndex = -1
210
+ }
211
+ },
212
+ }
213
+ }
214
+ </script>
215
+
216
+ <style scoped lang="less">
217
+ .xd-footer-bar {
218
+ height: 100%;
219
+ width: 100%;
220
+
221
+ &__icon {
222
+ width: 52rpx;
223
+ height: 52rpx;
224
+ display: flex;
225
+ justify-content: center;
226
+ align-items: center;
227
+
228
+ &.noName {
229
+ width: 80rpx;
230
+ height: 80rpx;
231
+ }
232
+ }
233
+
234
+ &__text {
235
+ line-height:1.2rem;
236
+ }
237
+
238
+ &__border {
239
+ border-top: 1px solid #eee;
240
+ display: flex;
241
+ flex-wrap: nowrap;
242
+ justify-content: center;
243
+ align-items: center;
244
+ height: 100%;
245
+ box-sizing: border-box;
246
+ }
247
+
248
+ &__item {
249
+ height: 100%;
250
+ flex: 1;
251
+ font-size: @xd-font-size-sm;
252
+ text-align: center;
253
+ display: flex;
254
+ flex-wrap: nowrap;
255
+ justify-content: center;
256
+ align-items: center;
257
+ position: relative;
258
+
259
+ &-link {
260
+ height: 100%;
261
+ width: 100%;
262
+ display: flex;
263
+ justify-content: center;
264
+ flex-direction: column;
265
+ align-items: center;
266
+ position: relative;
267
+
268
+ & .isCenter {
269
+ width: 120rpx;
270
+ height: 120rpx;
271
+ position: absolute;
272
+ background-color: var(--center-background-color);
273
+ border-radius: 50%;
274
+ box-sizing: border-box;
275
+ left:50%;
276
+ margin-left: -60rpx;
277
+ bottom: 0;
278
+ border: var(--center-border);
279
+ }
280
+ }
281
+
282
+ & > view:nth-child(2) {
283
+ flex: 1;
284
+ display: flex;
285
+ justify-content: center;
286
+ align-items: center;
287
+ flex-direction: column;
288
+ }
289
+
290
+ &-badge {
291
+ position: absolute;
292
+ top: unit(0, rpx);
293
+ left: 50%;
294
+ color: #fff;
295
+ transform: translateX(unit(10,rpx));
296
+ min-width: unit(32, rpx);
297
+ height: unit(32, rpx);
298
+ line-height: unit(32, rpx);
299
+ border-radius: unit(16, rpx);
300
+ font-size: unit(18, rpx);
301
+ z-index: 20;
302
+ }
303
+ }
304
+
305
+
306
+ &__image {
307
+ display: flex;
308
+ flex-wrap: nowrap;
309
+ justify-content: center;
310
+ align-items: center;
311
+ }
312
+
313
+ .image {
314
+ width: 100%;
315
+ height: 100%;
316
+
317
+ & > image {
318
+ max-width: 100%;
319
+ max-height: 100%;
320
+ }
321
+ }
322
+
323
+ }
324
+ </style>
@@ -517,22 +517,12 @@
517
517
  let keys = Object.keys(maps);
518
518
  if (keys.indexOf(key) > -1) {
519
519
  this.searchFilterParams[maps[key]] = ids[key]
520
+ if (this.$xdUniHelper.checkVarType(ids[key]) === 'array') {
521
+ if (ids[key].length === 0) {
522
+ this.searchFilterParams[maps[key]] = ''
523
+ }
524
+ }
520
525
  }
521
- // if (key === 'brand') {
522
- // this.searchFilterParams.brands = ids[key]
523
- // }
524
- // if (key === 'area') {
525
- // this.searchFilterParams.area_codes = ids[key]
526
- // }
527
- // if (key === 'delivery_method') {
528
- // this.searchFilterParams.delivery_methods = ids[key]
529
- // }
530
- // if (key === 'shop_category') {
531
- // this.searchFilterParams.category_ids = ids[key]
532
- // }
533
- // if (key === 'business_line') {
534
- // this.searchFilterParams.business_lines = ids[key]
535
- // }
536
526
  this.selectFilterParams[key] = ids[key]
537
527
  })
538
528
  this.curQueryTab = '';