|
@@ -148,10 +148,65 @@
|
|
} else {
|
|
} else {
|
|
this.historyScityList = []
|
|
this.historyScityList = []
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
//赋值地区
|
|
//赋值地区
|
|
},
|
|
},
|
|
|
|
+ mounted() {
|
|
|
|
+ if (uni.getStorageSync('fPlaceObj')) {
|
|
|
|
+ this.fchooseprovince=uni.getStorageSync('fPlaceObj').fchooseprovince
|
|
|
|
+ this.fchoosecity=uni.getStorageSync('fPlaceObj').fchoosecity
|
|
|
|
+ this.fchoosearea=uni.getStorageSync('fPlaceObj').fchoosearea
|
|
|
|
+ for (var i = 0; i < this.fprovincelist.length; i++) {
|
|
|
|
+ if(this.fprovincelist[i].label==this.fchooseprovince){
|
|
|
|
+ this.fprovincelist[i].checked=true
|
|
|
|
+ this.fcitylist = this.fprovincelist[i].child
|
|
|
|
+ for (var q = 0; q < this.fcitylist.length; q++) {
|
|
|
|
+ if(this.fcitylist[q].label==this.fchoosecity){
|
|
|
|
+ this.fcitylist[q].checked=true
|
|
|
|
+ this.farealist = this.fcitylist[i].child
|
|
|
|
+ for (var area = 0; area < this.farealist.length; area++) {
|
|
|
|
+ if(this.farealist[area].label==this.fchoosearea){
|
|
|
|
+ this.farealist[area].checked=true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.fstatus=2
|
|
|
|
+ }
|
|
|
|
+ if (uni.getStorageSync('sPlaceObj')) {
|
|
|
|
+ // sprovincelist
|
|
|
|
+ // console.log(this.sprovincelist)
|
|
|
|
+ this.schooseprovince=uni.getStorageSync('sPlaceObj').schooseprovince
|
|
|
|
+ this.schoosecity=uni.getStorageSync('sPlaceObj').schoosecity
|
|
|
|
+ this.schoosearea=uni.getStorageSync('sPlaceObj').schoosearea
|
|
|
|
+
|
|
|
|
+ if(this.schooseprovince=='全国'){
|
|
|
|
+ this.sstatus=0
|
|
|
|
+ this.$set(this.sprovincelist[0],'checked',true)
|
|
|
|
+ this.issprovince=0
|
|
|
|
+ }else{
|
|
|
|
+ for (var i = 0; i < this.sprovincelist.length; i++) {
|
|
|
|
+ if(this.sprovincelist[i].label==this.schooseprovince){
|
|
|
|
+ this.sprovincelist[i].checked=true
|
|
|
|
+ this.scitylist = this.sprovincelist[i].child
|
|
|
|
+ for (var q = 0; q < this.scitylist.length; q++) {
|
|
|
|
+ if(this.scitylist[q].label==this.schoosecity){
|
|
|
|
+ this.scitylist[q].checked=true
|
|
|
|
+ this.sarealist = this.scitylist[i].child
|
|
|
|
+ for (var area = 0; area < this.sarealist.length; area++) {
|
|
|
|
+ if(this.sarealist[area].label==this.schoosearea){
|
|
|
|
+ this.sarealist[area].checked=true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.sstatus=2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
historyClick(type,val){
|
|
historyClick(type,val){
|
|
console.log(type)
|
|
console.log(type)
|
|
@@ -228,18 +283,26 @@
|
|
confirmBtn() {
|
|
confirmBtn() {
|
|
|
|
|
|
//设置地区 0发货地 1收货地
|
|
//设置地区 0发货地 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({
|
|
this.$refs.uToast.show({
|
|
type: 'error',
|
|
type: 'error',
|
|
- message: "请选择区域!",
|
|
|
|
|
|
+ message: "请选择发货地区域!",
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //收货地
|
|
|
|
+ if (this.schooseprovince == '选择' ||(this.schoosearea == '请选择区'&&this.schoosecity!='全部'&& this.schooseprovince != '全国')|| (this.schoosecity == '请选择市' && this.schooseprovince != '全国')) {
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: "请选择收货地区域!",
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
// }
|
|
// }
|
|
- console.log("省", this.fchooseprovince)
|
|
|
|
- console.log("市", this.fchoosecity)
|
|
|
|
- console.log("区", this.fchoosearea)
|
|
|
|
|
|
+ // console.log("省", this.fchooseprovince)
|
|
|
|
+ // console.log("市", this.fchoosecity)
|
|
|
|
+ // console.log("区", this.fchoosearea)
|
|
let _obj = {
|
|
let _obj = {
|
|
fchooseprovince: this.fchooseprovince,
|
|
fchooseprovince: this.fchooseprovince,
|
|
fchoosecity: this.fchoosecity,
|
|
fchoosecity: this.fchoosecity,
|
|
@@ -297,21 +360,12 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
console.log(this.historyFcityList)
|
|
console.log(this.historyFcityList)
|
|
- uni.switchTab({
|
|
|
|
- url: '/pages/goodSource/index'
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- //收货地
|
|
|
|
- if (this.schooseprovince == '选择' ||(this.schoosearea == '请选择区'&&this.schoosecity!='全部')|| (this.schoosecity == '请选择市' && this.schooseprovince != '全国')) {
|
|
|
|
- this.$refs.uToast.show({
|
|
|
|
- type: 'error',
|
|
|
|
- message: "请选择区域!",
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- console.log(this.schooseprovince)
|
|
|
|
- console.log(this.schoosecity)
|
|
|
|
- console.log(this.schoosearea)
|
|
|
|
- let _obj = {
|
|
|
|
|
|
+ // uni.switchTab({
|
|
|
|
+ // url: '/pages/goodSource/index'
|
|
|
|
+ // });
|
|
|
|
+ // } else {
|
|
|
|
+
|
|
|
|
+ let _obj1 = {
|
|
schooseprovince: this.schooseprovince,
|
|
schooseprovince: this.schooseprovince,
|
|
schoosecity: this.schoosecity,
|
|
schoosecity: this.schoosecity,
|
|
schoosearea: this.schoosearea,
|
|
schoosearea: this.schoosearea,
|
|
@@ -319,44 +373,44 @@
|
|
}
|
|
}
|
|
//选中全国
|
|
//选中全国
|
|
if (this.schoosecity == '请选择市' && this.schooseprovince == '全国') {
|
|
if (this.schoosecity == '请选择市' && this.schooseprovince == '全国') {
|
|
- _obj.selected = this.schooseprovince
|
|
|
|
- this.historyScityList.unshift(_obj)
|
|
|
|
- let _newList = this.makeHistoryList(_obj)
|
|
|
|
|
|
+ _obj1.selected = this.schooseprovince
|
|
|
|
+ this.historyScityList.unshift(_obj1)
|
|
|
|
+ let _newList = this.makeHistoryList(_obj1)
|
|
uni.setStorageSync('sPlaceList', _newList);
|
|
uni.setStorageSync('sPlaceList', _newList);
|
|
}
|
|
}
|
|
//选择省
|
|
//选择省
|
|
if (this.schoosearea == '请选择区' && this.schoosecity == '全部') {
|
|
if (this.schoosearea == '请选择区' && this.schoosecity == '全部') {
|
|
- _obj.selected = this.schooseprovince
|
|
|
|
- this.historyScityList.unshift(_obj)
|
|
|
|
- let _newList = this.makeHistoryList(_obj)
|
|
|
|
|
|
+ _obj1.selected = this.schooseprovince
|
|
|
|
+ this.historyScityList.unshift(_obj1)
|
|
|
|
+ let _newList = this.makeHistoryList(_obj1)
|
|
|
|
|
|
uni.setStorageSync('sPlaceList', _newList);
|
|
uni.setStorageSync('sPlaceList', _newList);
|
|
}
|
|
}
|
|
//选择市
|
|
//选择市
|
|
if (this.schoosearea == '全部') {
|
|
if (this.schoosearea == '全部') {
|
|
if(this.schoosecity=='市辖区'){
|
|
if(this.schoosecity=='市辖区'){
|
|
- _obj.selected = this.schooseprovince
|
|
|
|
|
|
+ _obj1.selected = this.schooseprovince
|
|
}else{
|
|
}else{
|
|
- _obj.selected = this.schoosecity
|
|
|
|
|
|
+ _obj1.selected = this.schoosecity
|
|
}
|
|
}
|
|
|
|
|
|
- this.historyScityList.unshift(_obj)
|
|
|
|
- let _newList = this.makeHistoryList(_obj)
|
|
|
|
|
|
+ this.historyScityList.unshift(_obj1)
|
|
|
|
+ let _newList = this.makeHistoryList(_obj1)
|
|
uni.setStorageSync('sPlaceList', _newList);
|
|
uni.setStorageSync('sPlaceList', _newList);
|
|
}
|
|
}
|
|
- uni.setStorageSync('sPlaceObj', _obj);
|
|
|
|
|
|
+ uni.setStorageSync('sPlaceObj', _obj1);
|
|
//选择区
|
|
//选择区
|
|
if (this.schoosearea != '请选择区' && this.schoosearea != '全部') {
|
|
if (this.schoosearea != '请选择区' && this.schoosearea != '全部') {
|
|
let _list = this.schoosearea.split(',')
|
|
let _list = this.schoosearea.split(',')
|
|
let _newList
|
|
let _newList
|
|
for (let i = 0; i < _list.length; i++) {
|
|
for (let i = 0; i < _list.length; i++) {
|
|
|
|
|
|
- let _deepObj = uni.$u.deepClone(_obj)
|
|
|
|
|
|
+ let _deepObj = uni.$u.deepClone(_obj1)
|
|
_deepObj.selected = _list[i]
|
|
_deepObj.selected = _list[i]
|
|
this.historyScityList.unshift(_deepObj)
|
|
this.historyScityList.unshift(_deepObj)
|
|
_newList = this.makeHistoryList(_deepObj)
|
|
_newList = this.makeHistoryList(_deepObj)
|
|
}
|
|
}
|
|
- console.log(_newList)
|
|
|
|
|
|
+ // console.log(_newList)
|
|
uni.setStorageSync('sPlaceList', this.historyScityList);
|
|
uni.setStorageSync('sPlaceList', this.historyScityList);
|
|
uni.setStorageSync('sPlaceObj', {
|
|
uni.setStorageSync('sPlaceObj', {
|
|
schooseprovince: this.schooseprovince,
|
|
schooseprovince: this.schooseprovince,
|
|
@@ -366,10 +420,15 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
console.log(this.historyScityList)
|
|
console.log(this.historyScityList)
|
|
|
|
+ this.schooseprovince='选择'
|
|
|
|
+ this.schoosecity='请选择市'
|
|
|
|
+ this.schoosearea='请选择区'
|
|
|
|
+ this.fchooseprovince='选择'
|
|
|
|
+ this.fchoosecity='请选择市'
|
|
|
|
+ this.fchoosearea='请选择区'
|
|
uni.switchTab({
|
|
uni.switchTab({
|
|
url: '/pages/goodSource/index'
|
|
url: '/pages/goodSource/index'
|
|
});
|
|
});
|
|
- }
|
|
|
|
},
|
|
},
|
|
//返回上一级
|
|
//返回上一级
|
|
backLevel() {
|
|
backLevel() {
|
|
@@ -449,6 +508,7 @@
|
|
},
|
|
},
|
|
// 选择省
|
|
// 选择省
|
|
selectProvince(item, i, statusIndex) {
|
|
selectProvince(item, i, statusIndex) {
|
|
|
|
+ console.log(this.type)
|
|
this.count = 0;
|
|
this.count = 0;
|
|
if (this.type == 0) {
|
|
if (this.type == 0) {
|
|
if (i == 0) {
|
|
if (i == 0) {
|