Browse Source

选择小区bug修改

feature/3.1.0-小区合伙人
lfs3 6 years ago
parent
commit
742b161d1d
1 changed files with 8 additions and 26 deletions
  1. 34
      src/view/choose-community.vue

34
src/view/choose-community.vue

@ -173,11 +173,13 @@ export default {
}, },
// //
confirm(list) { confirm(list) {
console.log("list:" + list);
console.log("list:" + list);
// let addressArr = list.split(",");
let arr = list[2].split("&") || ""; let arr = list[2].split("&") || "";
this.districtId = arr[0]; this.districtId = arr[0];
this.defaultCity = arr[1]; this.defaultCity = arr[1];
this.addressValue = list.slice(); this.addressValue = list.slice();
console.log("arr:" + this.defaultCity);
// localStorage.setItem("cityName", list); // localStorage.setItem("cityName", list);
this.show = false; this.show = false;
this.pageNum = 1; this.pageNum = 1;
@ -188,26 +190,6 @@ export default {
this.fetchCommunityList(); this.fetchCommunityList();
}, },
cancel() { cancel() {
let str = localStorage.getItem("cityName") || "";
//
if (!str) {
this.defaultCity = "天河区";
//
this.merchantNo = 2;
//id
this.districtId = "440106000";
this.addressValue = [
"440000000&广东省",
"440100000&广州市",
"440106000&天河区&2"
];
this.pageNum = 0;
this.busy = false;
this.loadMoreHide = false;
this.loadMoreTips = false;
this.communityList = [];
this.fetchCommunityList();
}
this.show = false; this.show = false;
}, },
clear() { clear() {
@ -242,7 +224,7 @@ export default {
this.isRequesting = true; this.isRequesting = true;
//this.busy = true; //this.busy = true;
var _this = this; var _this = this;
console.log("communityName:" + this.communityName);
console.log("communityName:" + this.defaultCity);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
var params = { var params = {
pageNo: this.pageNum, pageNo: this.pageNum,
@ -279,13 +261,13 @@ export default {
}); });
}, },
chooseCommunity(item) { chooseCommunity(item) {
var addressValue = [
this.addressValue = [
item.provinceId + "&" + item.provinceName, item.provinceId + "&" + item.provinceName,
item.cityId + "&" + item.cityName, item.cityId + "&" + item.cityName,
item.districtId + "&" + item.districtName + "&" + item.merchantNo item.districtId + "&" + item.districtName + "&" + item.merchantNo
]; ];
if (isEmpty(this.templateNo)) { if (isEmpty(this.templateNo)) {
localStorage.setItem("cityName", addressValue.slice());
localStorage.setItem("cityName", this.addressValue.slice());
localStorage.setItem( localStorage.setItem(
"estate", "estate",
item.housingEstateId + "&" + item.housingEstateName item.housingEstateId + "&" + item.housingEstateName
@ -312,7 +294,7 @@ export default {
.then(res => { .then(res => {
this.showLoading = false; this.showLoading = false;
if (res.code === 0) { if (res.code === 0) {
localStorage.setItem("cityName", addressValue.slice());
localStorage.setItem("cityName", this.addressValue.slice());
localStorage.setItem( localStorage.setItem(
"estate", "estate",
item.housingEstateId + "&" + item.housingEstateName item.housingEstateId + "&" + item.housingEstateName
@ -327,7 +309,7 @@ export default {
content: item.housingEstateName + "暂无提供此商品服务", content: item.housingEstateName + "暂无提供此商品服务",
confirmText: "确定", confirmText: "确定",
onConfirm: () => { onConfirm: () => {
localStorage.setItem("cityName", addressValue.slice());
localStorage.setItem("cityName", this.addressValue.slice());
localStorage.setItem( localStorage.setItem(
"estate", "estate",
item.housingEstateId + "&" + item.housingEstateName item.housingEstateId + "&" + item.housingEstateName

Loading…
Cancel
Save