Commit c997b6dc authored by 吴春's avatar 吴春

1

parent 349d07d1
......@@ -35,12 +35,12 @@
<q-card flat class="rounded-borders q-py-md">
<div class="text-subtitle1 text-weight-bold q-mx-md">篩選目的地</div>
<q-input
v-model="searchAdd.name"
v-model="msg.searchKey"
type="text"
standout
placeholder="蒐索關鍵字"
class="q-ma-md"
@input="changeAddrSearchHandler"
@blur="changeAddrSearchHandler"
/>
<!-- <q-tree
ref="area"
......@@ -134,26 +134,13 @@
<q-card flat class="rounded-borders q-py-md">
<div class="text-subtitle1 text-weight-bold q-mx-md">篩選目的地</div>
<q-input
v-model="searchAdd.name"
v-model="msg.searchKey"
type="text"
standout
placeholder="蒐索關鍵字"
class="q-ma-md"
@input="changeAddrSearchHandler"
@blur="handleSearchKey"
/>
<!-- <q-tree
ref="area"
:nodes="areaList"
no-connectors
node-key="Id"
label-key="Name"
tick-strategy="leaf"
@update:ticked="handleAreaTicked"
:ticked="areaTicked"
text-color="#666"
no-nodes-label=" "
no-results-label=" "
/> -->
</q-card>
<q-card flat class="rounded-borders q-py-md q-mt-lg">
<div class="text-subtitle1 text-weight-bold q-mx-md">所有類別</div>
......@@ -519,7 +506,7 @@ export default {
created() {
this.msg = this.qMsg;
// this.msg.teamType = [];
this.initAreaList();
//this.initAreaList();
this.initGoods();
this.msg.priceRange = {
min: 1,
......@@ -577,48 +564,16 @@ export default {
this.ticked = target;
this.goSearchHandler();
},
handleSearchKey(target) {
this.msg.pageIndex = 1;
this.goSearchHandler();
},
handleAreaTicked(target) {
this.msg.pageIndex = 1;
this.msg.placeIds = this.getChoseAddressCity().join(",");
this.goSearchHandler();
},
initAreaList() {
let jObj = JSON.parse(window.localStorage.getItem("baseifo"));
let arr = [];
jObj.AreaList.forEach((x) => {
x.children = x.SubList;
x.children.forEach((y) => {
y.checked = false;
y.explsed = false;
y.isShow = true;
if (y.Id === this.msg.areaId) {
arr.push(y.Id);
}
if (y.SubList) {
y.children = y.SubList;
y.children.forEach((z) => {
z.checked = false;
z.explsed = false;
z.isShow = true;
if (z.Id === this.msg.areaId) {
arr.push(z.Id);
}
if (y.Id === this.msg.areaId) {
arr.push(z.Id);
}
});
}
});
this.areaList = jObj.AreaList;
this.areaListJSON = JSON.parse(JSON.stringify(this.areaList));
});
if (this.msg.areaId) {
this.$nextTick(() => {
this.$refs.area?.setTicked([...new Set(arr)], true);
});
}
},
changeExplesdHandler(x) {
x.explsed = !x.explsed;
if (x.SubList) {
......@@ -764,31 +719,6 @@ export default {
};
return walkAndCopy(tree);
},
changeAddrSearchHandler(v) {
this.areaListJSONTMP = JSON.parse(JSON.stringify(this.areaListJSON));
let tree = this.dfs(
{ Name: "", children: this.areaListJSONTMP },
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
}
);
tree = this.dfs(
tree,
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
}
);
tree = this.dfs(
tree,
(name, depth) => {},
({ Name }) => {
return Name.indexOf(v) !== -1;
}
);
this.areaList = tree.children;
},
goSearchHandler() {
this.$q.loading.show();
this.DataList = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment