修改个人和中介筛选的学校显示问题
This commit is contained in:
1
dist/css/app.39c9c5e7.css
vendored
1
dist/css/app.39c9c5e7.css
vendored
File diff suppressed because one or more lines are too long
1
dist/css/app.e5e70fd5.css
vendored
Normal file
1
dist/css/app.e5e70fd5.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -1,4 +1,4 @@
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/favicon.ico"><title>港校租房</title><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/js/chunk-vendors.e0e9f2f6.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/js/app.d4e8bb48.js"></script><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/css/chunk-vendors.7885d77e.css" rel="stylesheet"><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/css/app.39c9c5e7.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but zufang doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><script src="https://app.gter.net/bottom?tpl=header&menukey=fang"></script><div id="app"></div><div style="display:none;"><script src="//v1.cnzz.com/z_stat.php?id=1281224882&web_id=1281224882"></script><script>var _hmt = _hmt || [];
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/favicon.ico"><title>港校租房</title><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/js/chunk-vendors.e0e9f2f6.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/js/app.d474b68f.js"></script><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/css/chunk-vendors.7885d77e.css" rel="stylesheet"><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/css/app.e5e70fd5.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but zufang doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><script src="https://app.gter.net/bottom?tpl=header&menukey=fang"></script><div id="app"></div><div style="display:none;"><script src="//v1.cnzz.com/z_stat.php?id=1281224882&web_id=1281224882"></script><script>var _hmt = _hmt || [];
|
||||
(function () {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "//hm.baidu.com/hm.js?4bd66cbe45a640b607fe46c48f658746";
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
dist/js/seachPage.a0d40575.js
vendored
Normal file
1
dist/js/seachPage.a0d40575.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/js/seachPage.d0e77f06.js
vendored
1
dist/js/seachPage.d0e77f06.js
vendored
File diff suppressed because one or more lines are too long
@@ -349,23 +349,48 @@ let shcoolData = shallowReactive([])
|
||||
let setSchoolData = () => {
|
||||
let arr = routePath.value === '/' ? store.state.seachTypeData[0] && store.state.seachTypeData[0].where : store.state.schoolList
|
||||
if (arr[0] && arr[0].id) arr.unshift({ name: '不限', id: '' })
|
||||
|
||||
let num = 0
|
||||
let accumulationWidth = 0
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (!shcoolData[num]) {
|
||||
shcoolData[num] = []
|
||||
}
|
||||
if (shcoolData[num].length < 8) shcoolData[num].push(arr[i])
|
||||
if (arr[i].id === schoolSelectObj.id) {
|
||||
schoolSelectObj['page'] = num
|
||||
schoolPages.value = num
|
||||
}
|
||||
if (shcoolData[num].length === 8) {
|
||||
// if (!shcoolData[num]) {
|
||||
// shcoolData[num] = []
|
||||
// }
|
||||
// if (shcoolData[num].length < 8) shcoolData[num].push(arr[i])
|
||||
// if (arr[i].id === schoolSelectObj.id) {
|
||||
// schoolSelectObj['page'] = num
|
||||
// schoolPages.value = num
|
||||
// }
|
||||
// if (shcoolData[num].length === 8) {
|
||||
// num++
|
||||
// }
|
||||
|
||||
let width = accumulationWidth + getStrWidth(arr[i].name) + 20
|
||||
if (width > 380) { // 下一个二维数组
|
||||
num++
|
||||
accumulationWidth = getStrWidth(arr[i].name) + 20
|
||||
} else accumulationWidth = width
|
||||
|
||||
if (!shcoolData[num]) shcoolData[num] = []
|
||||
shcoolData[num].push(arr[i])
|
||||
}
|
||||
}
|
||||
// console.log(shcoolData);
|
||||
// console.log(schoolSelectObj)
|
||||
}
|
||||
|
||||
// 计算字符串在屏幕的显示宽度
|
||||
let getStrWidth = (str) => {
|
||||
let width = 0;
|
||||
let fontSize = 14;
|
||||
let font = fontSize + 'px Arial';
|
||||
let canvas = document.createElement('canvas');
|
||||
let context = canvas.getContext('2d');
|
||||
context.font = font;
|
||||
width = context.measureText(str).width;
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
//选择学校区域属性
|
||||
let setSchoolObj = (obj) => {
|
||||
if(obj.id===schoolSelectObj.id)return
|
||||
@@ -944,6 +969,10 @@ img {
|
||||
}
|
||||
}
|
||||
|
||||
.middle-btn {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
.line {
|
||||
height: 100%;
|
||||
width: 1px;
|
||||
|
||||
Reference in New Issue
Block a user