flx:修改样式问题

This commit is contained in:
X_Rian 2024-06-19 11:25:04 +08:00
parent e5033f0b6c
commit 2ec7bdac0a
5 changed files with 59 additions and 21 deletions

View File

@ -17,7 +17,7 @@
<!-- title == '司机姓名' --> <!-- title == '司机姓名' -->
<uni-data-checkbox v-if="formProps.expanding" :map="optionsKeyMap" v-model="__value" <uni-data-checkbox v-if="formProps.expanding" :map="optionsKeyMap" v-model="__value"
:localdata="dataOptions" /> :localdata="dataOptions" />
<picker class="picker" v-else-if="title == '司机姓名'" @cancel="onCancel" @change="ok2" mode="selector" <picker class="picker" v-else-if="title == '司机姓名'" @cancel="onCancel" @change="ok2" mode="selector" ref="pickerBottom"
:value="index" range-key="name" :range="dataOptions2"> :value="index" range-key="name" :range="dataOptions2">
<uni-search-bar v-if="isSearch" bgColor="#fff" v-model="searchValue" class="search" radius="5" <uni-search-bar v-if="isSearch" bgColor="#fff" v-model="searchValue" class="search" radius="5"
placeholder="请输入" clearButton="auto" cancelButton="none" @input="searchChange" /> placeholder="请输入" clearButton="auto" cancelButton="none" @input="searchChange" />
@ -25,8 +25,7 @@
<click-input @click="isSearchFn()" :value="(modelValue || []).length > 0 ? dataOptions[index]:null" <click-input @click="isSearchFn()" :value="(modelValue || []).length > 0 ? dataOptions[index]:null"
index="name" :placeholder="formProps.placeholder || '请选择'" /> index="name" :placeholder="formProps.placeholder || '请选择'" />
</picker> </picker>
<picker v-else @change="ok" mode="selector" :value="index" range-key="name" <picker v-else @change="ok" mode="selector" :value="index" range-key="name" :range="dataOptions">
:range="dataOptions">
<click-input :value="(modelValue || []).length > 0 ? dataOptions[index]:null" index="name" <click-input :value="(modelValue || []).length > 0 ? dataOptions[index]:null" index="name"
:placeholder="formProps.placeholder || '请选择'" /> :placeholder="formProps.placeholder || '请选择'" />
</picker> </picker>
@ -160,6 +159,7 @@
// //
const isSearch = ref(false); const isSearch = ref(false);
const searchValue = ref(""); const searchValue = ref("");
const searchBottom = ref(0);
function searchChange(e) { function searchChange(e) {
console.log(e); console.log(e);
@ -174,6 +174,23 @@
isSearch.value = false; isSearch.value = false;
} }
const isSearchFn = () => { const isSearchFn = () => {
//.boxclassbox使id= 'box' 使'#box'
// uni.createSelectorQuery().in(this).select('.picker').boundingClientRect(data => {
// console.log(JSON.stringify(data))
// console.log(data.height / 100 * window.innerHeight,window.innerHeight)
// console.log(uni.getSystemInfoSync().windowHeight, uni.getSystemInfoSync().windowWidth)
// uni.getSystemInfo({
// success: function (res) {
// console.log(res.screenHeight);
// console.log(res.windowHeight);
// console.log(data.height / 100 * res.screenHeight)
// // data.height / 100 * res.screenHeight - 22
// // searchBottom.value = (45 / 8) + 238;
// }
// });
// // (data.height / 100 * window.innerHeight) * 1.48
// }).exec()
setTimeout(() => { setTimeout(() => {
isSearch.value = true; isSearch.value = true;
@ -311,14 +328,15 @@
} }
</script> </script>
<style> <style>
.uni-picker-custom { :deep(.uni-picker-custom){
height: 480rpx; height: 480rpx;
} }
</style> </style>
<style scoped> <style scoped>
.search { .search {
position: fixed; position: fixed;
bottom: 465rpx; /* bottom: 465rpx; */
bottom: 400rpx;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
z-index: 9999; z-index: 9999;

View File

@ -18554,7 +18554,7 @@ ${i3}
doRequest(dataOptions.value); doRequest(dataOptions.value);
} }
} catch (e2) { } catch (e2) {
formatAppLog("log", "at components/form/SelectPlus.vue:124", e2); formatAppLog("log", "at components/form/SelectPlus.vue:123", e2);
} }
} }
vue.watch(() => dataOptions, () => { vue.watch(() => dataOptions, () => {
@ -18585,8 +18585,10 @@ ${i3}
} }
const isSearch = vue.ref(false); const isSearch = vue.ref(false);
const searchValue = vue.ref(""); const searchValue = vue.ref("");
vue.ref(0);
const pickerBottom = vue.ref(null);
function searchChange(e2) { function searchChange(e2) {
formatAppLog("log", "at components/form/SelectPlus.vue:165", e2); formatAppLog("log", "at components/form/SelectPlus.vue:166", e2);
let findList = dataOptions.value.filter((item) => item.name.includes(e2)); let findList = dataOptions.value.filter((item) => item.name.includes(e2));
dataOptions2.value = findList; dataOptions2.value = findList;
if (e2 == "") { if (e2 == "") {
@ -18597,6 +18599,19 @@ ${i3}
isSearch.value = false; isSearch.value = false;
}; };
const isSearchFn = () => { const isSearchFn = () => {
uni.createSelectorQuery().in(this).select(".picker").boundingClientRect((data) => {
formatAppLog("log", "at components/form/SelectPlus.vue:180", JSON.stringify(data));
formatAppLog("log", "at components/form/SelectPlus.vue:181", data.height / 100 * window.innerHeight, window.innerHeight);
formatAppLog("log", "at components/form/SelectPlus.vue:182", uni.getSystemInfoSync().windowHeight, uni.getSystemInfoSync().windowWidth);
uni.getSystemInfo({
success: function(res) {
formatAppLog("log", "at components/form/SelectPlus.vue:185", res.screenHeight);
formatAppLog("log", "at components/form/SelectPlus.vue:186", res.windowHeight);
formatAppLog("log", "at components/form/SelectPlus.vue:187", data.height / 100 * res.screenHeight);
}
});
}).exec();
formatAppLog("log", "at components/form/SelectPlus.vue:195", pickerBottom.value.offsetHeight);
setTimeout(() => { setTimeout(() => {
isSearch.value = true; isSearch.value = true;
}, 500); }, 500);
@ -18663,7 +18678,7 @@ ${i3}
try { try {
preHandlerFuc(params); preHandlerFuc(params);
} catch (e2) { } catch (e2) {
formatAppLog("log", "at components/form/SelectPlus.vue:250", e2); formatAppLog("log", "at components/form/SelectPlus.vue:269", e2);
} }
} }
} }
@ -18710,7 +18725,7 @@ ${i3}
try { try {
return aftHandlerFuc(rsp) || []; return aftHandlerFuc(rsp) || [];
} catch (e2) { } catch (e2) {
formatAppLog("log", "at components/form/SelectPlus.vue:307", e2); formatAppLog("log", "at components/form/SelectPlus.vue:326", e2);
} }
} }
return []; return [];
@ -18776,6 +18791,8 @@ ${i3}
onCancel, onCancel,
onChange: ok2, onChange: ok2,
mode: "selector", mode: "selector",
ref_key: "pickerBottom",
ref: pickerBottom,
value: index2.value, value: index2.value,
"range-key": "name", "range-key": "name",
range: dataOptions2.value range: dataOptions2.value

View File

@ -3454,13 +3454,14 @@ body[data-v-029c2886] {
} }
.uni-picker-custom[data-v-efe1296e] { [data-v-efe1296e] .uni-picker-custom{
height: 15rem; height: 15rem
} }
.search[data-v-efe1296e] { .search[data-v-efe1296e] {
position: fixed; position: fixed;
/* bottom: 465rpx; */
bottom: 12.34375rem; bottom: 12.34375rem;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);

View File

@ -3389,13 +3389,14 @@ body[data-v-029c2886] {
} }
.uni-picker-custom[data-v-efe1296e] { [data-v-efe1296e] .uni-picker-custom{
height: 15rem; height: 15rem
} }
.search[data-v-efe1296e] { .search[data-v-efe1296e] {
position: fixed; position: fixed;
/* bottom: 465rpx; */
bottom: 12.34375rem; bottom: 12.34375rem;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);

View File

@ -3455,13 +3455,14 @@ body[data-v-029c2886] {
} }
.uni-picker-custom[data-v-efe1296e] { [data-v-efe1296e] .uni-picker-custom{
height: 15rem; height: 15rem
} }
.search[data-v-efe1296e] { .search[data-v-efe1296e] {
position: fixed; position: fixed;
/* bottom: 465rpx; */
bottom: 12.34375rem; bottom: 12.34375rem;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);