jufubao-mall 2.0.52 → 2.0.53-beta1
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
|
@@ -103,6 +103,16 @@
|
|
|
103
103
|
</template>
|
|
104
104
|
</view>
|
|
105
105
|
</view>
|
|
106
|
+
<view class="filter_item" :style="[otherMenuContComp]">
|
|
107
|
+
<view class="filter_title">
|
|
108
|
+
<view>价格区间</view>
|
|
109
|
+
</view>
|
|
110
|
+
<view class="filter_tab">
|
|
111
|
+
<input type="digit" v-model.trim="startPrice" @blur="handlePriceBlur($event, 'start')" class="input_price" placeholder="最低价"></input>
|
|
112
|
+
<view class="divide_price">--</view>
|
|
113
|
+
<input type="digit" v-model.trim="endPrice" @blur="handlePriceBlur($event, 'end')" class="input_price" placeholder="最高价"></input>
|
|
114
|
+
</view>
|
|
115
|
+
</view>
|
|
106
116
|
</view>
|
|
107
117
|
<view class="bottom_btn" v-if="isShowBtn">
|
|
108
118
|
<xd-button class="xd-button" type="info" width="248rpx" size="normal" @click="onOtherReset">重置</xd-button>
|
|
@@ -188,6 +198,12 @@ export default {
|
|
|
188
198
|
return {}
|
|
189
199
|
}
|
|
190
200
|
},
|
|
201
|
+
priceRange: {
|
|
202
|
+
type: Array,
|
|
203
|
+
default(){
|
|
204
|
+
return ['','']
|
|
205
|
+
}
|
|
206
|
+
},
|
|
191
207
|
//是否在筛选项过滤配置项
|
|
192
208
|
filterFields:{
|
|
193
209
|
type: Array,
|
|
@@ -368,7 +384,10 @@ export default {
|
|
|
368
384
|
remoteList(){
|
|
369
385
|
this.initFilterData()
|
|
370
386
|
},
|
|
371
|
-
|
|
387
|
+
priceRange(arr){
|
|
388
|
+
this.startPrice = this.$xdUniHelper.divisionFloatNumber(arr[0], 100);
|
|
389
|
+
this.endPrice = this.$xdUniHelper.divisionFloatNumber(arr[1], 100);
|
|
390
|
+
}
|
|
372
391
|
},
|
|
373
392
|
data(){
|
|
374
393
|
return {
|
|
@@ -390,6 +409,9 @@ export default {
|
|
|
390
409
|
isShowBtn: false, //是单选还是多选
|
|
391
410
|
filterTabs: [],//当前下拉菜单数据
|
|
392
411
|
filterTabsOrg:[], //下拉菜单原始数据
|
|
412
|
+
|
|
413
|
+
startPrice: '',
|
|
414
|
+
endPrice: '',
|
|
393
415
|
}
|
|
394
416
|
},
|
|
395
417
|
created() {
|
|
@@ -643,6 +665,25 @@ export default {
|
|
|
643
665
|
this.update();
|
|
644
666
|
this.closeQueryModal();
|
|
645
667
|
},
|
|
668
|
+
// 价格输入格式化,保留两位小数
|
|
669
|
+
handlePriceBlur(e, type) {
|
|
670
|
+
const value = e.target.value;
|
|
671
|
+
if (!value) {
|
|
672
|
+
if (type === 'start') this.startPrice = '';
|
|
673
|
+
else this.endPrice = '';
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
// 保留两位小数
|
|
677
|
+
const numValue = parseFloat(value);
|
|
678
|
+
if (!isNaN(numValue)) {
|
|
679
|
+
const formatted = numValue.toFixed(2);
|
|
680
|
+
if (type === 'start') this.startPrice = formatted;
|
|
681
|
+
else this.endPrice = formatted;
|
|
682
|
+
} else {
|
|
683
|
+
if (type === 'start') this.startPrice = '';
|
|
684
|
+
else this.endPrice = '';
|
|
685
|
+
}
|
|
686
|
+
},
|
|
646
687
|
switchOtherOpen(tab){
|
|
647
688
|
this.filterTabs = this.filterTabs.map(item => {
|
|
648
689
|
if(JSON.stringify(tab.value) === JSON.stringify(item.value)) item['open'] = !item['open'];
|
|
@@ -739,6 +780,9 @@ export default {
|
|
|
739
780
|
update(){
|
|
740
781
|
let params = {};
|
|
741
782
|
if(this.sort) params['sort'] = this.sort;
|
|
783
|
+
//价格单位为元,需要转换成分
|
|
784
|
+
if(this.startPrice) params['startPrice'] = this.$xdUniHelper.multiplyFloatNumber(this.startPrice, 100);
|
|
785
|
+
if(this.endPrice) params['endPrice'] = this.$xdUniHelper.multiplyFloatNumber(this.endPrice, 100);
|
|
742
786
|
Object.keys(this.selectedNenuIds).map(key=>{
|
|
743
787
|
if(key === 'filter') {
|
|
744
788
|
if( this.selectedNenuIds[key].length > 0) params['filter_keys'] = this.selectedNenuIds[key].join(',');
|
|
@@ -921,7 +965,21 @@ export default {
|
|
|
921
965
|
}
|
|
922
966
|
}
|
|
923
967
|
|
|
924
|
-
|
|
968
|
+
.input_price{
|
|
969
|
+
background-color: #f8f8f8;
|
|
970
|
+
width: 300rpx;
|
|
971
|
+
height: 62rpx;
|
|
972
|
+
border-radius: 4rpx;
|
|
973
|
+
flex: 1;
|
|
974
|
+
text-align: center;
|
|
975
|
+
font-size: 24rpx;
|
|
976
|
+
}
|
|
977
|
+
.divide_price{
|
|
978
|
+
width: 100rpx;
|
|
979
|
+
display: flex;
|
|
980
|
+
align-items: center;
|
|
981
|
+
justify-content: center;
|
|
982
|
+
}
|
|
925
983
|
}
|
|
926
984
|
|
|
927
985
|
}
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
:filter-fields="isFilterMenuForFilterFields"
|
|
83
83
|
:def-sort="sort"
|
|
84
84
|
:def-remote="defMenuValue"
|
|
85
|
+
:price-range="[startPrice, endPrice]"
|
|
85
86
|
@on-change="handleFitlerChange"
|
|
86
87
|
></com-filter-query>
|
|
87
88
|
</template>
|
|
@@ -283,6 +284,8 @@
|
|
|
283
284
|
trueCateId:'',//分类二级(用于是查询商品列表操作)
|
|
284
285
|
defMenuValue:{}, //菜单选中
|
|
285
286
|
menuSelectParams:null, //null|object null未初始化 object已初始化
|
|
287
|
+
startPrice: "",
|
|
288
|
+
endPrice: "",
|
|
286
289
|
//==搜索条件=============
|
|
287
290
|
|
|
288
291
|
//面板
|
|
@@ -486,6 +489,13 @@
|
|
|
486
489
|
this.setNameSpace(options);
|
|
487
490
|
this.options = options;
|
|
488
491
|
let defMenuValue = {};
|
|
492
|
+
if(options.price){
|
|
493
|
+
let priceRange = options.price.split(',');
|
|
494
|
+
if(priceRange[0]) this.startPrice = this.$xdUniHelper.multiplyFloatNumber(priceRange[0], 100);
|
|
495
|
+
if(priceRange[1]) this.endPrice = this.$xdUniHelper.multiplyFloatNumber(priceRange[1], 100);
|
|
496
|
+
}
|
|
497
|
+
if(options.startPrice) this.startPrice = options.startPrice;
|
|
498
|
+
if( options.endPrice) this.endPrice = options.endPrice;
|
|
489
499
|
if( options.keyword) this.keyword = options.keyword;
|
|
490
500
|
if( options.pid) this.pid = Number(options.pid);
|
|
491
501
|
if( options.cateId || options.cateid) this.cateId = Number(options.cateId||options.cateid);
|
|
@@ -516,6 +526,8 @@
|
|
|
516
526
|
page_token: this.page_token,
|
|
517
527
|
page_size: this.page_size,
|
|
518
528
|
need_show_tags: this.need_show_tags.join(),
|
|
529
|
+
start_price: this.startPrice,
|
|
530
|
+
end_price: this.endPrice
|
|
519
531
|
}
|
|
520
532
|
|
|
521
533
|
if(this.keyword) data['keyword'] = this.keyword;
|
|
@@ -1219,6 +1231,8 @@
|
|
|
1219
1231
|
if(params['sort']) menuSelectParams['sort'] = params['sort'];
|
|
1220
1232
|
if(params['delivery_method']) menuSelectParams['delivery_method'] = params['delivery_method'];
|
|
1221
1233
|
if(params['filter_keys']) menuSelectParams['filter_keys'] = params['filter_keys'];
|
|
1234
|
+
if(params['startPrice']) this.startPrice = params['startPrice'];
|
|
1235
|
+
if(params['endPrice']) this.endPrice = params['endPrice'];
|
|
1222
1236
|
this.menuSelectParams = menuSelectParams;
|
|
1223
1237
|
console.log('getProductListParams',JSON.stringify(this.menuSelectParams));
|
|
1224
1238
|
this.clearProductData(); //清除商品列表数据
|