|
|
|
@ -12,7 +12,7 @@ |
|
|
|
<div :class="show?'triangle_border_top':'triangle_border_down'"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-input style="border-left: 1px solid #c1c1c1;" placeholder="请输入小区名称" v-model="communityName" @keyup.enter.native="searchByName" @clear="clear" clearable> |
|
|
|
<el-input style="border-left: 1px solid #c1c1c1;" placeholder="请输入小区名称" v-model="communityName" @keyup.enter.native="searchByName" @clear="clear" clearable> |
|
|
|
<i slot="prefix" class="el-input__icon el-icon-search"></i> |
|
|
|
</el-input> |
|
|
|
</div> |
|
|
|
@ -59,6 +59,8 @@ import { Alert, Toast, Loading } from "vux"; |
|
|
|
import popupPicker from "../components/popup-picker.vue"; |
|
|
|
import chooseCommunity from "../api/chooseCommunity"; |
|
|
|
import { countPartner } from "@/common/util"; |
|
|
|
import { isEmpty } from "@/common/util"; |
|
|
|
import { exists } from "fs"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
Toast, |
|
|
|
@ -69,6 +71,7 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
show: false, |
|
|
|
templateNo: this.$route.query.templateNo || "", |
|
|
|
defaultCity: "天河区", |
|
|
|
districtId: "440106000", //区id 默认值 不需要去掉 |
|
|
|
provinceId: "", |
|
|
|
@ -159,10 +162,10 @@ export default { |
|
|
|
this.$vux.toast.text("请选择一个小区", "middle"); |
|
|
|
return; |
|
|
|
} |
|
|
|
history.go(-1) |
|
|
|
// this.$router.push({ |
|
|
|
// name: "首页" |
|
|
|
// }); |
|
|
|
history.go(-1); |
|
|
|
// this.$router.push({ |
|
|
|
// name: "首页" |
|
|
|
// }); |
|
|
|
}, |
|
|
|
//确定时保存记录 |
|
|
|
confirm(list) { |
|
|
|
@ -204,7 +207,7 @@ export default { |
|
|
|
this.show = false; |
|
|
|
}, |
|
|
|
clear() { |
|
|
|
console.log("communityName11:"+this.communityName) |
|
|
|
console.log("communityName11:" + this.communityName); |
|
|
|
// 清除搜索条件 |
|
|
|
this.showFlag = false; |
|
|
|
this.communityName = ""; |
|
|
|
@ -213,7 +216,7 @@ export default { |
|
|
|
this.loadMoreHide = false; |
|
|
|
this.loadMoreTips = false; |
|
|
|
this.communityList = []; |
|
|
|
|
|
|
|
|
|
|
|
this.fetchCommunityList(); |
|
|
|
}, |
|
|
|
searchByName(event) { |
|
|
|
@ -277,17 +280,68 @@ export default { |
|
|
|
item.cityId + "&" + item.cityName, |
|
|
|
item.districtId + "&" + item.districtName + "&" + item.merchantNo |
|
|
|
]; |
|
|
|
localStorage.setItem("cityName", addressValue.slice()); |
|
|
|
localStorage.setItem( |
|
|
|
"estate", |
|
|
|
item.housingEstateId + "&" + item.housingEstateName |
|
|
|
); |
|
|
|
this.estateId = item.housingEstateId; |
|
|
|
countPartner(); |
|
|
|
history.go(-1) |
|
|
|
// this.$router.push({ |
|
|
|
// name: "首页" |
|
|
|
// }); |
|
|
|
if (isEmpty(this.templateNo)) { |
|
|
|
localStorage.setItem("cityName", addressValue.slice()); |
|
|
|
localStorage.setItem( |
|
|
|
"estate", |
|
|
|
item.housingEstateId + "&" + item.housingEstateName |
|
|
|
); |
|
|
|
this.estateId = item.housingEstateId; |
|
|
|
countPartner(); |
|
|
|
history.go(-1); |
|
|
|
} else { |
|
|
|
this.$vux.confirm.show({ |
|
|
|
title: "选择小区", |
|
|
|
content: "确定选择" + item.housingEstateName, |
|
|
|
confirmText: "确定", |
|
|
|
cancelText: "取消", |
|
|
|
onCancel: () => {}, |
|
|
|
onConfirm: () => { |
|
|
|
this.estateId = item.housingEstateId; |
|
|
|
chooseCommunityApi |
|
|
|
.getGoodsTemlate({ |
|
|
|
templateNo: this.templateNo, |
|
|
|
housingEstateId: this.estateId ? this.estateId : "" |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
this.showLoading = false; |
|
|
|
if (res.code === 0) { |
|
|
|
localStorage.setItem("cityName", addressValue.slice()); |
|
|
|
localStorage.setItem( |
|
|
|
"estate", |
|
|
|
item.housingEstateId + "&" + item.housingEstateName |
|
|
|
); |
|
|
|
countPartner(); |
|
|
|
//存在商品 |
|
|
|
window.location.href = |
|
|
|
"/mall/web/vgoods/detail/" + res.response.goodsNo; |
|
|
|
} else { |
|
|
|
this.$vux.confirm.show({ |
|
|
|
title: "无服务", |
|
|
|
content: item.housingEstateName + "暂无提供此商品服务", |
|
|
|
confirmText: "确定", |
|
|
|
onConfirm: () => { |
|
|
|
localStorage.setItem("cityName", addressValue.slice()); |
|
|
|
localStorage.setItem( |
|
|
|
"estate", |
|
|
|
item.housingEstateId + "&" + item.housingEstateName |
|
|
|
); |
|
|
|
this.$router.push({ |
|
|
|
name: "首页" |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
this.showLoading = false; |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
// this.$router.push({ |
|
|
|
// name: "首页" |
|
|
|
// }); |
|
|
|
}, |
|
|
|
ShareWenXin() { |
|
|
|
var merchantNo = this.merchantNo; |
|
|
|
@ -310,7 +364,7 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getTime(time) { |
|
|
|
let date = new Date(time); |
|
|
|
let year = date.getFullYear(); |
|
|
|
|