Notes
Notes - notes.io |
Vue.component('multi-search', {
template: '#multi-search',
props: ['ms-mode', 'ms-type', 'ms-detail'],
data: function () {
return {
show: false,
selected: [""],
}
},
methods: {
ClickChoice: function (index) {
if (this.msMode == "one") {
if ($.inArray(index, this.selected) == -1) {
this.selected = [index];
} else {
this.selected = [""];
}
} else if (this.msMode == "multi") {
var min = Math.min.apply(Math, this.selected);
var max = Math.max.apply(Math, this.selected);
if ($.inArray(index, this.selected) == -1) {
if (index === "") {
this.selected = [index];
} else {
if (this.selected.length == 1 && this.selected[0] === "") {
this.selected = this.selected.concat(index);
this.selected = $.grep(this.selected, function (v) { return v !== ""; });
} else {
if (min < index) {
this.selected = [min];
for (var i = min + 1; i <= index; i++) {
this.selected.push(i);
}
} else {
this.selected = [index];
for (var i = index + 1; i <= max; i++) {
this.selected.push(i);
}
}
}
}
} else {
if (min == index) {
this.selected = $.grep(this.selected, function (v) { return v != index; });
} else {
this.selected = [min];
for (var i = min + 1; i < index; i++) {
this.selected.push(i);
}
}
}
if (this.selected.length == 0) {
this.selected.push("");
}
}
this.$emit('input', this.selected);
},
GetChoiceClass: function (index) {
if ($.inArray(index, this.selected) == -1) {
return 'is-hide';
} else {
return 'is-curr';
}
}
},
computed: {
GetName: function () {
switch (this.msType) {
case "TypeMode":
return "用途";
case "Price":
return "總價";
case "Ping":
return "坪數";
case "Rm":
return "房數";
}
},
GetText: function () {
var str = "";
if (this.msType == "TypeMode") {
str = "全部用途";
} else {
str = "不限";
}
if (this.msMode == "one") {
if (this.selected[0] != "") {
str = this.msDetail[this.selected[0]].text;
}
} else if (this.msMode == "multi") {
}
return str;
},
GetDefText: function () {
if (this.msType == "TypeMode") {
return "全部用途";
} else {
return "不限";
}
},
GetShowClass: function () {
return this.show ? "is-curr" : "";
},
}
});
var app = new Vue({
el: '#app',
data: {
CaseMode: "銷售中",
PageMode: "List",
objects: {
item: [],
total: 0,
totalnum: 0,
page: 1
},
SearchCondition: {
CaseMode: "1",//1:銷售中,2:新進,3:下架,4:價變
Sort: "",
Keyword: "",
},
TypeMode: {
detail: TypeModeDetail,
selected: [""]
},
Price: {
detail: PriceDetail,
selected: [""]
},
Ping: {
detail: PingDetail,
selected: [""]
},
Rm: {
detail: RmDetail,
selected: [""]
}
},
mounted: function () {
this.GetWebCaseList();
},
components: {
Pagination,
},
methods: {
GetWebCaseList: function () {
var obj = {};
obj = $.extend(obj, this.SearchCondition || {});
obj["Page"] = this.objects.page;
obj["City"] = StoreCity;
obj["Area"] = StoreArea;
dataToSend = { PostData: JSON.stringify(obj) };
waitingDialog.show('資料讀取中');
axios.post(urlPath + "WebCase/GetWebCaseList", dataToSend)
.then(function (RsData) {
var data = {};
data = RsData.data;
if (data.length > 0) {
//app.objects.item = app.objects.item.concat(data);
app.objects.item = data;
app.objects.total = data[0].TotalPages;
app.objects.totalnum = data[0].TotalRows;
}
waitingDialog.hide();
})
.catch(function (error) {
waitingDialog.hide();
alert('送出失敗');
})
},
ChangeCaseMode: function (mode) {
var name = ["銷售中", "新進", "下架", "價變"];
this.SearchCondition.CaseMode = mode;
if (mode != "5") this.CaseMode = name[mode - 1];
this.PageMode = "List";
this.objects = {
item: [],
total: 0,
totalnum: 0,
page: 1
};
this.GetWebCaseList();
},
orderbySearch: function (od) {
this.PageMode = "List";
this.SearchCondition.Sort = od;
this.objects = {
item: [],
total: 0,
totalnum: 0,
page: 1
};
this.GetWebCaseList();
},
WebCaseFa: function (CaseIdx, FaIdx, index) {
var obj = {};
obj["CaseIdx"] = CaseIdx;
obj["idx"] = FaIdx;
dataToSend = { PostData: JSON.stringify(obj) };
axios.post(urlPath + "WebCase/WebCaseFa", dataToSend)
.then(function (RsData) {
var data = {};
data = RsData.data;
if (data.Result == "Success") {
if (FaIdx == 0) {
app.objects.item[index].FaIdx = data.Idx;
} else {
app.objects.item[index].FaIdx = 0;
}
}
})
.catch(function (error) {
alert('送出失敗')
});
},
GetMoreData: function () {
this.objects.page += 1;
this.GetWebCaseList();
},
setPage: function (page) {
this.objects.page = page;
this.GetWebCaseList();
}
}
});
</script>
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team
