|
@@ -120,6 +120,8 @@
|
|
type: 0,
|
|
type: 0,
|
|
count: 0,
|
|
count: 0,
|
|
ftitle: '',
|
|
ftitle: '',
|
|
|
|
+ ftitleList:[],
|
|
|
|
+ stitleList:[],
|
|
stitle: '',
|
|
stitle: '',
|
|
selectList: [],
|
|
selectList: [],
|
|
}
|
|
}
|
|
@@ -224,14 +226,16 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
confirmBtn() {
|
|
confirmBtn() {
|
|
|
|
+
|
|
//设置地区 0发货地 1收货地
|
|
//设置地区 0发货地 1收货地
|
|
- // if (this.type == 0||this.type == 1) {
|
|
|
|
|
|
+ if (this.type == 0) {
|
|
if (this.fchooseprovince == '选择' ||(this.fchoosearea == '请选择区'&&this.fchoosecity!='全部')|| (this.fchoosecity == '请选择市' && this.fchooseprovince != '全国')) {
|
|
if (this.fchooseprovince == '选择' ||(this.fchoosearea == '请选择区'&&this.fchoosecity!='全部')|| (this.fchoosecity == '请选择市' && this.fchooseprovince != '全国')) {
|
|
- this.$refs.uToast.show({
|
|
|
|
- type: 'error',
|
|
|
|
- message: "请选择区域!",
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: "请选择区域!",
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
// }
|
|
// }
|
|
console.log("省", this.fchooseprovince)
|
|
console.log("省", this.fchooseprovince)
|
|
console.log("市", this.fchoosecity)
|
|
console.log("市", this.fchoosecity)
|
|
@@ -272,17 +276,18 @@
|
|
uni.setStorageSync('fPlaceObj', _obj);
|
|
uni.setStorageSync('fPlaceObj', _obj);
|
|
//选择区
|
|
//选择区
|
|
if (this.fchoosearea != '请选择区' && this.fchoosearea != '全部') {
|
|
if (this.fchoosearea != '请选择区' && this.fchoosearea != '全部') {
|
|
- let _list = this.fchoosearea.split(',')
|
|
|
|
- let _newList
|
|
|
|
- //设置历史收发地并去重,区重名判断是否是同一个市在去重
|
|
|
|
- for (let i = 0; i < _list.length; i++) {
|
|
|
|
- let _deepObj = uni.$u.deepClone(_obj)
|
|
|
|
- _deepObj.selected = _list[i]
|
|
|
|
- this.historyFcityList.unshift(_deepObj)
|
|
|
|
- _newList = this.makeHistoryList(_deepObj)
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- console.log(_newList)
|
|
|
|
|
|
+ console.log(this.fchooseprovince,this.fchoosecity,this.fchoosearea)
|
|
|
|
+ // let _list = this.fchoosearea.split(',')
|
|
|
|
+ // let _newList
|
|
|
|
+ // //设置历史收发地并去重,区重名判断是否是同一个市在去重
|
|
|
|
+ // for (let i = 0; i < _list.length; i++) {
|
|
|
|
+ // let _deepObj = uni.$u.deepClone(_obj)
|
|
|
|
+ // _deepObj.selected = _list[i]
|
|
|
|
+ // this.historyFcityList.unshift(_deepObj)
|
|
|
|
+ // _newList = this.makeHistoryList(_deepObj)
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ // console.log(_newList)
|
|
uni.setStorageSync('fPlaceList', this.historyFcityList);
|
|
uni.setStorageSync('fPlaceList', this.historyFcityList);
|
|
uni.setStorageSync('fPlaceObj', {
|
|
uni.setStorageSync('fPlaceObj', {
|
|
fchooseprovince: this.fchooseprovince,
|
|
fchooseprovince: this.fchooseprovince,
|
|
@@ -380,11 +385,13 @@
|
|
this.fchoosearea = ''
|
|
this.fchoosearea = ''
|
|
this.ftitle = ''
|
|
this.ftitle = ''
|
|
this.isfcity = null
|
|
this.isfcity = null
|
|
|
|
+ this.ftitleList=[]
|
|
} else {
|
|
} else {
|
|
this.schoosecity = '请选择市'
|
|
this.schoosecity = '请选择市'
|
|
this.schoosearea = ''
|
|
this.schoosearea = ''
|
|
this.stitle = ''
|
|
this.stitle = ''
|
|
this.isscity = null
|
|
this.isscity = null
|
|
|
|
+ this.stitleList=[]
|
|
}
|
|
}
|
|
} else if ((this.type == 0 ? this.fstatus : this.sstatus) == 0) {
|
|
} else if ((this.type == 0 ? this.fstatus : this.sstatus) == 0) {
|
|
if (this.type == 0) {
|
|
if (this.type == 0) {
|
|
@@ -420,19 +427,23 @@
|
|
this.fchooseprovince = '选择'
|
|
this.fchooseprovince = '选择'
|
|
this.fchoosecity = '请选择市'
|
|
this.fchoosecity = '请选择市'
|
|
this.fchoosearea = '请选择区'
|
|
this.fchoosearea = '请选择区'
|
|
|
|
+ this.ftitleList=[]
|
|
} else {
|
|
} else {
|
|
this.schooseprovince = '选择'
|
|
this.schooseprovince = '选择'
|
|
this.schoosecity = '请选择市'
|
|
this.schoosecity = '请选择市'
|
|
this.schoosearea = '请选择区'
|
|
this.schoosearea = '请选择区'
|
|
|
|
+ this.stitleList=[]
|
|
}
|
|
}
|
|
|
|
|
|
} else if (status == 1) {
|
|
} else if (status == 1) {
|
|
if (this.type == 0) {
|
|
if (this.type == 0) {
|
|
this.fchoosecity = '请选择市'
|
|
this.fchoosecity = '请选择市'
|
|
this.fchoosearea = '请选择区'
|
|
this.fchoosearea = '请选择区'
|
|
|
|
+ this.ftitleList=[]
|
|
} else {
|
|
} else {
|
|
this.schoosecity = '请选择市'
|
|
this.schoosecity = '请选择市'
|
|
this.schoosearea = '请选择区'
|
|
this.schoosearea = '请选择区'
|
|
|
|
+ this.stitleList=[]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -529,6 +540,7 @@
|
|
this.farealist[i].checked = false
|
|
this.farealist[i].checked = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.ftitleList=[]
|
|
this.fchoosearea = '全部'
|
|
this.fchoosearea = '全部'
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
return
|
|
return
|
|
@@ -540,82 +552,137 @@
|
|
this.sarealist[i].checked = false
|
|
this.sarealist[i].checked = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.stitleList=[]
|
|
this.schoosearea = '全部'
|
|
this.schoosearea = '全部'
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (this.count < 3) {
|
|
|
|
- item.checked = !item.checked
|
|
|
|
- if (item.checked && this.count < 3) {
|
|
|
|
- this.count++;
|
|
|
|
- } else if (!item.checked && this.count < 3) {
|
|
|
|
- this.count--;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (item.checked) {
|
|
|
|
- item.checked = !item.checked
|
|
|
|
- this.count--;
|
|
|
|
- } else {
|
|
|
|
- this.$refs.uToast.show({
|
|
|
|
- type: 'error',
|
|
|
|
- message: "最多选择3个地区",
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.$forceUpdate()
|
|
|
|
- //设置面包屑 0发货地 1收货地
|
|
|
|
if (this.type == 0) {
|
|
if (this.type == 0) {
|
|
- if (item.checked && !this.fchoosearea.includes(item.label)) {
|
|
|
|
- if (this.ftitle) {
|
|
|
|
- this.ftitle += ',' + item.label
|
|
|
|
- } else {
|
|
|
|
- this.ftitle += item.label
|
|
|
|
|
|
+ this.farealist[0].checked = false
|
|
|
|
+ if (this.ftitleList.length < 3) {
|
|
|
|
+ item.checked = !item.checked
|
|
|
|
+ if (item.checked ) {
|
|
|
|
+ if(this.ftitleList.indexOf(item.label)==-1){
|
|
|
|
+ this.ftitleList.push(item.label)
|
|
|
|
+ }
|
|
|
|
+ } else if (!item.checked) {
|
|
|
|
+ for (var i = 0; i < this.ftitleList.length; i++) {
|
|
|
|
+ console.log(this.ftitleList[i])
|
|
|
|
+ if(this.ftitleList[i]==item.label){
|
|
|
|
+ this.ftitleList.splice(i,1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- this.fchoosearea = this.ftitle
|
|
|
|
- console.log(this.fchoosearea)
|
|
|
|
} else {
|
|
} else {
|
|
- if (this.ftitle.includes(',' + item.label)) {
|
|
|
|
- this.ftitle = this.ftitle.replace(',' + item.label, '')
|
|
|
|
- this.fchoosearea = this.fchoosearea.replace(',' + item.label, '')
|
|
|
|
- } else {
|
|
|
|
- let _val = this.ftitle.split(',')
|
|
|
|
- let _len = _val.length;
|
|
|
|
- if (_len == 1) {
|
|
|
|
- this.ftitle = this.ftitle.replace(item.label, '')
|
|
|
|
- this.fchoosearea = '请选择区'
|
|
|
|
- } else if (_len > 1) {
|
|
|
|
- this.ftitle = this.ftitle.replace(item.label + ',', '')
|
|
|
|
- this.fchoosearea = this.fchoosearea.replace(item.label + ',', '')
|
|
|
|
|
|
+ if (item.checked) {
|
|
|
|
+ item.checked = !item.checked
|
|
|
|
+ for (var i = 0; i < this.ftitleList.length; i++) {
|
|
|
|
+ if(this.ftitleList[i]==item.label){
|
|
|
|
+ this.ftitleList.splice(i,1)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: "最多选择3个地区",
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- if (item.checked && !this.schoosearea.includes(item.label)) {
|
|
|
|
- if (this.stitle) {
|
|
|
|
- this.stitle += ',' + item.label
|
|
|
|
- } else {
|
|
|
|
- this.stitle += item.label
|
|
|
|
|
|
+ this.ftitle=this.ftitleList.toString()
|
|
|
|
+ this.fchoosearea=this.ftitleList.toString()
|
|
|
|
+ }else{
|
|
|
|
+ this.sarealist[0].checked = false
|
|
|
|
+ if (this.stitleList.length < 3) {
|
|
|
|
+ item.checked = !item.checked
|
|
|
|
+ if (item.checked ) {
|
|
|
|
+ if(this.stitleList.indexOf(item.label)==-1){
|
|
|
|
+ this.stitleList.push(item.label)
|
|
|
|
+ }
|
|
|
|
+ } else if (!item.checked) {
|
|
|
|
+ for (var i = 0; i < this.stitleList.length; i++) {
|
|
|
|
+ console.log(this.stitleList[i])
|
|
|
|
+ if(this.stitleList[i]==item.label){
|
|
|
|
+ this.stitleList.splice(i,1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- this.schoosearea = this.stitle
|
|
|
|
} else {
|
|
} else {
|
|
- if (this.stitle.includes(',' + item.label)) {
|
|
|
|
- this.stitle = this.stitle.replace(',' + item.label, '')
|
|
|
|
- this.schoosearea = this.schoosearea.replace(',' + item.label, '')
|
|
|
|
- } else {
|
|
|
|
- let _val = this.stitle.split(',')
|
|
|
|
- let _len = _val.length;
|
|
|
|
- if (_len == 1) {
|
|
|
|
- this.stitle = this.stitle.replace(item.label, '')
|
|
|
|
- this.schoosearea = '请选择区'
|
|
|
|
- } else if (_len > 1) {
|
|
|
|
- this.stitle = this.stitle.replace(item.label + ',', '')
|
|
|
|
- this.schoosearea = this.schoosearea.replace(item.label + ',', '')
|
|
|
|
|
|
+ if (item.checked) {
|
|
|
|
+ item.checked = !item.checked
|
|
|
|
+ for (var i = 0; i < this.stitleList.length; i++) {
|
|
|
|
+ if(this.stitleList[i]==item.label){
|
|
|
|
+ this.stitleList.splice(i,1)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: "最多选择3个地区",
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.stitle=this.stitleList.toString()
|
|
|
|
+ this.schoosearea=this.stitleList.toString()
|
|
}
|
|
}
|
|
|
|
+ console.log(this.ftitleList)
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ //设置面包屑 0发货地 1收货地
|
|
|
|
+ // if (this.type == 0) {
|
|
|
|
+ // this.farealist[0].checked = false
|
|
|
|
+ // // if(this.ftitleList.indexOf(item.label)==-1){
|
|
|
|
+ // // this.ftitleList.push(item.label)
|
|
|
|
+ // // }
|
|
|
|
+ // if (item.checked && !this.fchoosearea.includes(item.label)) {
|
|
|
|
+ // if (this.ftitle) {
|
|
|
|
+ // this.ftitle += ',' + item.label
|
|
|
|
+
|
|
|
|
+ // } else {
|
|
|
|
+ // this.ftitle += item.label
|
|
|
|
+ // }
|
|
|
|
+ // this.fchoosearea = this.ftitle
|
|
|
|
+ // console.log(this.fchoosearea)
|
|
|
|
+ // } else {
|
|
|
|
+ // if (this.ftitle.includes(',' + item.label)) {
|
|
|
|
+ // this.ftitle = this.ftitle.replace(',' + item.label, '')
|
|
|
|
+ // this.fchoosearea = this.fchoosearea.replace(',' + item.label, '')
|
|
|
|
+ // } else {
|
|
|
|
+ // let _val = this.ftitle.split(',')
|
|
|
|
+ // let _len = _val.length;
|
|
|
|
+ // if (_len == 1) {
|
|
|
|
+ // this.ftitle = this.ftitle.replace(item.label, '')
|
|
|
|
+ // this.fchoosearea = '请选择区'
|
|
|
|
+ // } else if (_len > 1) {
|
|
|
|
+ // this.ftitle = this.ftitle.replace(item.label + ',', '')
|
|
|
|
+ // this.fchoosearea = this.fchoosearea.replace(item.label + ',', '')
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // } else {
|
|
|
|
+ // if (item.checked && !this.schoosearea.includes(item.label)) {
|
|
|
|
+ // if (this.stitle) {
|
|
|
|
+ // this.stitle += ',' + item.label
|
|
|
|
+ // } else {
|
|
|
|
+ // this.stitle += item.label
|
|
|
|
+ // }
|
|
|
|
+ // this.schoosearea = this.stitle
|
|
|
|
+ // } else {
|
|
|
|
+ // if (this.stitle.includes(',' + item.label)) {
|
|
|
|
+ // this.stitle = this.stitle.replace(',' + item.label, '')
|
|
|
|
+ // this.schoosearea = this.schoosearea.replace(',' + item.label, '')
|
|
|
|
+ // } else {
|
|
|
|
+ // let _val = this.stitle.split(',')
|
|
|
|
+ // let _len = _val.length;
|
|
|
|
+ // if (_len == 1) {
|
|
|
|
+ // this.stitle = this.stitle.replace(item.label, '')
|
|
|
|
+ // this.schoosearea = '请选择区'
|
|
|
|
+ // } else if (_len > 1) {
|
|
|
|
+ // this.stitle = this.stitle.replace(item.label + ',', '')
|
|
|
|
+ // this.schoosearea = this.schoosearea.replace(item.label + ',', '')
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
changeCity(type) {
|
|
changeCity(type) {
|
|
if (type == 0) {
|
|
if (type == 0) {
|