|
@@ -4,7 +4,8 @@ var isonShow;
|
|
|
var isTwoOnshow;
|
|
|
Page({
|
|
|
data: {
|
|
|
- focus:true,
|
|
|
+ value:[0,0,0,0,0],
|
|
|
+ focus: true,
|
|
|
showAdressBox: false,
|
|
|
showAdressBox1: false,
|
|
|
provinceArr: [],
|
|
@@ -887,11 +888,12 @@ Page({
|
|
|
this.chooseAdress();
|
|
|
this.setData({
|
|
|
multiIndex: [0, 0, 0, 0, 0],
|
|
|
+ value: [0, 0, 0, 0, 0],
|
|
|
showAdressBox: true
|
|
|
})
|
|
|
},
|
|
|
showAdressShow1() {
|
|
|
- if(!this.data.oldInfo[this.data.activeIndex].isSameWithAddress[0].checked){
|
|
|
+ if (!this.data.oldInfo[this.data.activeIndex].isSameWithAddress[0].checked) {
|
|
|
this.chooseAdress();
|
|
|
this.setData({
|
|
|
multiIndex: [0, 0, 0, 0, 0],
|
|
@@ -922,9 +924,11 @@ Page({
|
|
|
this.setData({
|
|
|
provinceArr: newdata,
|
|
|
})
|
|
|
- this.chooseAdress2();
|
|
|
+ if(this.data.provinceArr[this.data.multiIndex[1]]){
|
|
|
+ this.chooseAdress2();
|
|
|
+ }
|
|
|
},
|
|
|
- fail:()=>{
|
|
|
+ fail: () => {
|
|
|
wx.hideLoading()
|
|
|
}
|
|
|
})
|
|
@@ -938,7 +942,7 @@ Page({
|
|
|
if (fid) {
|
|
|
mid = fid
|
|
|
} else {
|
|
|
- mid = this.data.provinceArr[this.data.multiIndex[1]].CIVILREGIONALISMID
|
|
|
+ mid = this.data.provinceArr[this.data.multiIndex[1]].CIVILREGIONALISMID
|
|
|
}
|
|
|
let newdata = [];
|
|
|
wx.request({
|
|
@@ -957,9 +961,12 @@ Page({
|
|
|
this.setData({
|
|
|
cityArr: newdata
|
|
|
})
|
|
|
- this.chooseAdress3();
|
|
|
+ if (this.data.cityArr[this.data.multiIndex[2]]) {
|
|
|
+ this.chooseAdress3();
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
- fail:()=>{
|
|
|
+ fail: () => {
|
|
|
wx.hideLoading()
|
|
|
}
|
|
|
})
|
|
@@ -974,13 +981,7 @@ Page({
|
|
|
if (fid) {
|
|
|
mid = fid
|
|
|
} else {
|
|
|
- console.log(this.data.cityArr)
|
|
|
- console.log(this.data.multiIndex)
|
|
|
- if(!this.data.cityArr[this.data.multiIndex[2]].CIVILREGIONALISMID){
|
|
|
- wx.hideLoading()
|
|
|
- return false
|
|
|
- }
|
|
|
- mid = this.data.cityArr[this.data.multiIndex[2]].CIVILREGIONALISMID
|
|
|
+ mid = this.data.cityArr[this.data.multiIndex[2]].CIVILREGIONALISMID
|
|
|
}
|
|
|
let newdata = [];
|
|
|
wx.request({
|
|
@@ -1009,18 +1010,18 @@ Page({
|
|
|
village: '',
|
|
|
provinceCode: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMCODE,
|
|
|
cityCode: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMCODE,
|
|
|
- areaCode:'',
|
|
|
+ areaCode: '',
|
|
|
townCode: '',
|
|
|
- villageCode:'',
|
|
|
- areaArr:[],
|
|
|
+ villageCode: '',
|
|
|
+ areaArr: [],
|
|
|
townArr: [],
|
|
|
villageArr: [],
|
|
|
})
|
|
|
- } else {
|
|
|
+ } else if (this.data.areaArr[this.data.multiIndex[3]]) {
|
|
|
this.chooseAdress4();
|
|
|
}
|
|
|
},
|
|
|
- fail:()=>{
|
|
|
+ fail: () => {
|
|
|
wx.hideLoading()
|
|
|
}
|
|
|
})
|
|
@@ -1035,13 +1036,7 @@ Page({
|
|
|
if (fid) {
|
|
|
mid = fid
|
|
|
} else {
|
|
|
- console.log(this.data.areaArr)
|
|
|
- console.log(this.data.multiIndex)
|
|
|
- if(!this.data.areaArr[this.data.multiIndex[3]].CIVILREGIONALISMID){
|
|
|
- wx.hideLoading()
|
|
|
- return false
|
|
|
- }
|
|
|
- mid = this.data.areaArr[this.data.multiIndex[3]].CIVILREGIONALISMID
|
|
|
+ mid = this.data.areaArr[this.data.multiIndex[3]].CIVILREGIONALISMID
|
|
|
}
|
|
|
let newdata = [];
|
|
|
wx.request({
|
|
@@ -1076,11 +1071,11 @@ Page({
|
|
|
townCode: '',
|
|
|
villageCode: ''
|
|
|
})
|
|
|
- } else {
|
|
|
+ } else if (this.data.townArr[this.data.multiIndex[4]]) {
|
|
|
this.chooseAdress5();
|
|
|
}
|
|
|
},
|
|
|
- fail:()=>{
|
|
|
+ fail: () => {
|
|
|
wx.hideLoading()
|
|
|
}
|
|
|
})
|
|
@@ -1090,13 +1085,7 @@ Page({
|
|
|
if (fid) {
|
|
|
mid = fid
|
|
|
} else {
|
|
|
- console.log(this.data.townArr)
|
|
|
- console.log(this.data.multiIndex)
|
|
|
- if(!this.data.townArr[this.data.multiIndex[4]].CIVILREGIONALISMID){
|
|
|
- wx.hideLoading()
|
|
|
- return false
|
|
|
- }
|
|
|
- mid = this.data.townArr[this.data.multiIndex[4]].CIVILREGIONALISMID
|
|
|
+ mid = this.data.townArr[this.data.multiIndex[4]].CIVILREGIONALISMID
|
|
|
}
|
|
|
let newdata = [];
|
|
|
wx.request({
|
|
@@ -1116,6 +1105,7 @@ Page({
|
|
|
villageArr: newdata
|
|
|
})
|
|
|
if (newdata.length == 0) {
|
|
|
+ wx.hideLoading()
|
|
|
this.setData({
|
|
|
villageArr: [],
|
|
|
province: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMNAME,
|
|
@@ -1129,7 +1119,8 @@ Page({
|
|
|
townCode: this.data.townArr[this.data.multiIndex[3]].CIVILREGIONALISMCODE,
|
|
|
villageCode: ''
|
|
|
})
|
|
|
- } else {
|
|
|
+ } else if (this.data.villageArr[this.data.multiIndex[4]]) {
|
|
|
+ wx.hideLoading()
|
|
|
this.setData({
|
|
|
province: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMNAME,
|
|
|
city: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMNAME,
|
|
@@ -1143,38 +1134,75 @@ Page({
|
|
|
villageCode: this.data.villageArr[this.data.multiIndex[4]].CIVILREGIONALISMCODE,
|
|
|
})
|
|
|
}
|
|
|
- wx.hideLoading()
|
|
|
+
|
|
|
},
|
|
|
- fail:()=>{
|
|
|
+ fail: () => {
|
|
|
wx.hideLoading()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
bindChange(e) {
|
|
|
+ // this.setData({
|
|
|
+ // adressChangeStatus:true
|
|
|
+ // })
|
|
|
wx.showLoading({
|
|
|
title: '加载中',
|
|
|
mask: true
|
|
|
})
|
|
|
- console.log(e.detail.value,'我是改变的数组')
|
|
|
- console.log(this.data.multiIndex,'我是上次存的数组')
|
|
|
- if (e.detail.value[0] != this.data.multiIndex[0]) {
|
|
|
+ console.log(e, 'eeee')
|
|
|
+ console.log(this.data.multiIndex, '上次的值')
|
|
|
+ if ((e.detail.value[0] != this.data.multiIndex[0]) && this.data.provinceArr[e.detail.value[0]] && this.data.provinceArr[e.detail.value[0]].CIVILREGIONALISMID) {
|
|
|
this.chooseAdress2(this.data.provinceArr[e.detail.value[0]].CIVILREGIONALISMID);
|
|
|
- } else if (e.detail.value[1] != this.data.multiIndex[1]) {
|
|
|
+ console.log(e.detail.value[0])
|
|
|
+ let multiIndex=[];
|
|
|
+ multiIndex.push(e.detail.value[0],0,0,0,0)
|
|
|
+ this.setData({
|
|
|
+ value: multiIndex
|
|
|
+ })
|
|
|
+ console.log(multiIndex,'我是加了0之后的数组')
|
|
|
+ } else if ((e.detail.value[1] != this.data.multiIndex[1]) && this.data.cityArr[e.detail.value[1]] && this.data.cityArr[e.detail.value[1]].CIVILREGIONALISMID) {
|
|
|
this.chooseAdress3(this.data.cityArr[e.detail.value[1]].CIVILREGIONALISMID);
|
|
|
- } else if (e.detail.value[2] != this.data.multiIndex[2]) {
|
|
|
+ console.log(e.detail.value[0])
|
|
|
+ let multiIndex=[];
|
|
|
+ multiIndex.push(e.detail.value[0],e.detail.value[1],0,0,0)
|
|
|
+ this.setData({
|
|
|
+ value: multiIndex
|
|
|
+ })
|
|
|
+ console.log(multiIndex,'我是加了0之后的数组')
|
|
|
+ } else if ((e.detail.value[2] != this.data.multiIndex[2]) && this.data.areaArr[e.detail.value[2]] && this.data.areaArr[e.detail.value[2]].CIVILREGIONALISMID) {
|
|
|
this.chooseAdress4(this.data.areaArr[e.detail.value[2]].CIVILREGIONALISMID);
|
|
|
- } else if (e.detail.value[3] != this.data.multiIndex[3]) {
|
|
|
+ console.log(e.detail.value[0])
|
|
|
+ let multiIndex=[];
|
|
|
+ multiIndex.push(e.detail.value[0],e.detail.value[1],e.detail.value[2],0,0)
|
|
|
+ this.setData({
|
|
|
+ value: multiIndex
|
|
|
+ })
|
|
|
+ console.log(multiIndex,'我是加了0之后的数组')
|
|
|
+ } else if ((e.detail.value[3] != this.data.multiIndex[3]) && this.data.townArr[e.detail.value[3]] && this.data.townArr[e.detail.value[3]].CIVILREGIONALISMID) {
|
|
|
this.chooseAdress5(this.data.townArr[e.detail.value[3]].CIVILREGIONALISMID);
|
|
|
- } else if (e.detail.value[4] != this.data.multiIndex[4]) {
|
|
|
+ console.log(e.detail.value[0])
|
|
|
+ let multiIndex=[];
|
|
|
+ multiIndex.push(e.detail.value[0],e.detail.value[1],e.detail.value[2],e.detail.value[3],0)
|
|
|
+ this.setData({
|
|
|
+ value: multiIndex
|
|
|
+ })
|
|
|
+ console.log(multiIndex,'我是加了0之后的数组')
|
|
|
+ } else if ((e.detail.value[4] != this.data.multiIndex[4]) && this.data.villageArr[e.detail.value[4]] && this.data.villageArr[e.detail.value[4]].CIVILREGIONALISMID) {
|
|
|
+ this.setData({
|
|
|
+ value: e.detail.value
|
|
|
+ })
|
|
|
this.setData({
|
|
|
- village:this.data.villageArr[e.detail.value[4]].CIVILREGIONALISMNAME,
|
|
|
- villageCode:this.data.villageArr[e.detail.value[4]].CIVILREGIONALISMCODE
|
|
|
+ village: this.data.villageArr[e.detail.value[4]].CIVILREGIONALISMNAME,
|
|
|
+ villageCode: this.data.villageArr[e.detail.value[4]].CIVILREGIONALISMCODE
|
|
|
})
|
|
|
}
|
|
|
this.setData({
|
|
|
multiIndex: e.detail.value
|
|
|
})
|
|
|
wx.hideLoading()
|
|
|
+ // this.setData({
|
|
|
+ // adressChangeStatus:false
|
|
|
+ // })
|
|
|
},
|
|
|
pickSure() {
|
|
|
let arr = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr';
|
|
@@ -1193,7 +1221,7 @@ Page({
|
|
|
})
|
|
|
this.setData({
|
|
|
showAdressBox: false,
|
|
|
- oldInfo: this.data.oldInfo
|
|
|
+ oldInfo: this.data.oldInfo,
|
|
|
})
|
|
|
},
|
|
|
pickEsc() {
|
|
@@ -1230,10 +1258,10 @@ Page({
|
|
|
},
|
|
|
bindpickstart(e) {
|
|
|
console.log(e, '滚动开始了')
|
|
|
- wx.showLoading({
|
|
|
- title: '加载中',
|
|
|
- mask: true
|
|
|
- })
|
|
|
+ // wx.showLoading({
|
|
|
+ // title: '加载中',
|
|
|
+ // mask: true
|
|
|
+ // })
|
|
|
},
|
|
|
bindpickend(e) {
|
|
|
console.log(e, '滚动结束了')
|
|
@@ -3772,9 +3800,9 @@ Page({
|
|
|
app.globalData.id = ''
|
|
|
}
|
|
|
app.globalData.name = ''
|
|
|
- this.setData({
|
|
|
- showBj: false,
|
|
|
- })
|
|
|
+ // this.setData({
|
|
|
+ // showBj: false,
|
|
|
+ // })
|
|
|
},
|
|
|
//获取位置
|
|
|
getSelfLocation: function (varSendOrgId) {
|
|
@@ -3816,6 +3844,7 @@ Page({
|
|
|
});
|
|
|
},
|
|
|
onLoad() {
|
|
|
+ console.log(wx.getStorageSync('user'), '000000')
|
|
|
if (wx.getStorageSync('user') == '') {
|
|
|
wx.redirectTo({
|
|
|
url: '/pages/login/login',
|