jufubao-mall 2.0.53-beta2 → 2.0.53-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
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
class="xd-query-filter"
|
|
72
72
|
v-if="!['common','price', 'hot'].includes(menuAct) && showQueryModal"
|
|
73
73
|
>
|
|
74
|
-
<view class="filter_wrap" :style="[otherMenuComp]">
|
|
74
|
+
<scroll-view class="filter_wrap" :scroll-into-view="curView" :scroll-top="scrollTop" :style="[otherMenuComp]" scroll-y>
|
|
75
75
|
<view
|
|
76
76
|
class="filter_item"
|
|
77
77
|
v-for="tab in filterTabs"
|
|
@@ -103,17 +103,18 @@
|
|
|
103
103
|
</template>
|
|
104
104
|
</view>
|
|
105
105
|
</view>
|
|
106
|
-
<view v-if="menuAct === 'filter'" class="filter_item" :style="[otherMenuContComp]">
|
|
106
|
+
<view id="price_view" v-if="menuAct === 'filter'" class="filter_item" :style="[otherMenuContComp]">
|
|
107
107
|
<view class="filter_title">
|
|
108
108
|
<view>价格区间</view>
|
|
109
109
|
</view>
|
|
110
110
|
<view class="filter_tab">
|
|
111
|
-
<input type="digit" v-model.trim="startPrice" @blur="handlePriceBlur($event, 'start')" class="input_price" placeholder="最低价"></input>
|
|
111
|
+
<input :adjust-position="true" type="digit" v-model.trim="startPrice" @blur="handlePriceBlur($event, 'start')" class="input_price" placeholder="最低价"></input>
|
|
112
112
|
<view class="divide_price">--</view>
|
|
113
|
-
<input type="digit" v-model.trim="endPrice" @blur="handlePriceBlur($event, 'end')" class="input_price" placeholder="最高价"></input>
|
|
113
|
+
<input :adjust-position="true" type="digit" v-model.trim="endPrice" @blur="handlePriceBlur($event, 'end')" class="input_price" placeholder="最高价"></input>
|
|
114
114
|
</view>
|
|
115
115
|
</view>
|
|
116
|
-
|
|
116
|
+
<view v-if="diffHeight" :style="{height: diffHeight + 'px'}"></view>
|
|
117
|
+
</scroll-view>
|
|
117
118
|
<view class="bottom_btn" v-if="isShowBtn">
|
|
118
119
|
<xd-button class="xd-button" type="info" width="248rpx" size="normal" @click="onOtherReset">重置</xd-button>
|
|
119
120
|
<xd-button class="xd-button" type="primary" width="248rpx" size="normal" @click="onOtherConfirm">确定</xd-button>
|
|
@@ -414,6 +415,10 @@ export default {
|
|
|
414
415
|
|
|
415
416
|
startPrice: '',
|
|
416
417
|
endPrice: '',
|
|
418
|
+
scrollTop: 0,
|
|
419
|
+
windowHeight: 0,
|
|
420
|
+
diffHeight: 0, //窗口高度变化差值
|
|
421
|
+
curView: "",
|
|
417
422
|
}
|
|
418
423
|
},
|
|
419
424
|
created() {
|
|
@@ -421,6 +426,20 @@ export default {
|
|
|
421
426
|
this.bodyID = `body_${this.$xdUniHelper.randomChar(10)}`;
|
|
422
427
|
this.initMune();
|
|
423
428
|
this.initFilterData();
|
|
429
|
+
//监听窗口变化,用于解决软键盘遮挡 价格输入框问题
|
|
430
|
+
let winInfo = uni.getSystemInfoSync();
|
|
431
|
+
this.windowHeight = winInfo.windowHeight;
|
|
432
|
+
uni.onWindowResize((res)=>{
|
|
433
|
+
let curHeight = res.size.windowHeight;
|
|
434
|
+
this.diffHeight = this.windowHeight - curHeight;
|
|
435
|
+
if(!this.diffHeight) {
|
|
436
|
+
this.curView = "";
|
|
437
|
+
}else{
|
|
438
|
+
setTimeout(() => {
|
|
439
|
+
this.curView = 'price_view'
|
|
440
|
+
},200);
|
|
441
|
+
}
|
|
442
|
+
})
|
|
424
443
|
},
|
|
425
444
|
methods:{
|
|
426
445
|
...mapActions(['setHasPopStatus']),
|
|
@@ -669,7 +688,7 @@ export default {
|
|
|
669
688
|
this.update();
|
|
670
689
|
this.closeQueryModal();
|
|
671
690
|
},
|
|
672
|
-
//
|
|
691
|
+
// 价格输入格式化,最多保留两位小数(直接截断,不四舍五入)
|
|
673
692
|
handlePriceBlur(e, type) {
|
|
674
693
|
const value = e.target.value;
|
|
675
694
|
if (!value) {
|
|
@@ -677,10 +696,10 @@ export default {
|
|
|
677
696
|
else this.endPrice = '';
|
|
678
697
|
return;
|
|
679
698
|
}
|
|
680
|
-
//
|
|
699
|
+
// 最多保留两位小数,直接截断,去除末尾多余的零
|
|
681
700
|
const numValue = parseFloat(value);
|
|
682
701
|
if (!isNaN(numValue)) {
|
|
683
|
-
const formatted =
|
|
702
|
+
const formatted = parseFloat(Math.floor(numValue * 100) / 100);
|
|
684
703
|
if (type === 'start') this.startPrice = formatted;
|
|
685
704
|
else this.endPrice = formatted;
|
|
686
705
|
} else {
|