123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- Component({
- properties: {
- dropDownMenuTitle: {
- type: Array,
- value: [],
- },
- dropDownMenuDistrictData: {
- type: Array,
- value: [],
- observer: function(newVal, oldVal) {
- let model = newVal[0] ? newVal[0] : null
- this.selectDefaltDistrictLeft(model)
- }
- },
- dropDownMenuSourceData: {
- type: Array,
- value: []
- },
- dropDownMenuStyleData: {
- type: Array,
- value: []
- },
- dropDownMenuFilterData: {
- type: Array,
- value: []
- },
- },
- data: {
- // private properity
- district_open: false, // 区域
- source_open: false, // 来源
- style_open: false, // 出租 出售
- filteropen: false, // 筛选
- shownavindex: '',
- dropDownMenuDistrictDataRight: {},
- district_left_select: '',
- district_right_select: '',
- district_right_select_name: '',
- selected_style_id: 0,
- selected_style_name: '',
- selected_source_id: 0,
- selected_source_name: '',
- selected_filter_id: 0,
- selected_filter_name: ''
- },
- methods: {
- tapSourceNav: function(e) {
- if (this.data.source_open) {
- this.setData({
- source_open: false,
- shownavindex: 0
- })
- } else {
- this.setData({
- source_open: true,
- shownavindex: e.currentTarget.dataset.nav
- })
- }
- },
- selectSourceItem: function(e) {
- var selectedId = e.target.dataset.model.id
- var selectedTitle = e.target.dataset.model.title;
- this.closeHyFilter();
- this.setData({
- selected_source_id: selectedId,
- selected_source_name: selectedTitle
- })
- this.triggerEvent("selectedItem", {
- index: this.data.shownavindex,
- selectedId: selectedId,
- selectedTitle: selectedTitle
- })
- },
- /**关闭筛选 */
- closeHyFilter: function() {
- if (this.data.district_open) {
- this.setData({
- district_open: false,
- source_open: false,
- style_open: false,
- filter_open: false,
- })
- } else if (this.data.source_open) {
- this.setData({
- source_open: false,
- style_open: false,
- district_open: false,
- filter_open: false,
- })
- } else if (this.data.style_open) {
- this.setData({
- source_open: false,
- style_open: false,
- district_open: false,
- filter_open: false,
- })
- } else if (this.data.filter_open) {
- this.setData({
- source_open: false,
- style_open: false,
- district_open: false,
- filter_open: false,
- })
- }
- },
- },
- //组件生命周期函数,在组件实例进入页面节点树时执行
- attached: function() {
- },
- })
|