|
@@ -69,7 +69,7 @@
|
|
dataList: [],
|
|
dataList: [],
|
|
searchKeyWord: '',
|
|
searchKeyWord: '',
|
|
radiolist1: [
|
|
radiolist1: [
|
|
-
|
|
|
|
|
|
+
|
|
{
|
|
{
|
|
name: '默认装货',
|
|
name: '默认装货',
|
|
disabled: false
|
|
disabled: false
|
|
@@ -89,7 +89,7 @@
|
|
console.log(options)
|
|
console.log(options)
|
|
this.type = options.type
|
|
this.type = options.type
|
|
that = this
|
|
that = this
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
this.getList()
|
|
this.getList()
|
|
@@ -103,7 +103,7 @@
|
|
}
|
|
}
|
|
// uni.$u.route('/pages/release/release');
|
|
// uni.$u.route('/pages/release/release');
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|
|
- delta:1
|
|
|
|
|
|
+ delta: 1
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getList() {
|
|
getList() {
|
|
@@ -128,7 +128,7 @@
|
|
this.dataList[i].radiovalue = '默认卸货'
|
|
this.dataList[i].radiovalue = '默认卸货'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -225,178 +225,159 @@
|
|
// 0临时地址 1 新增地址
|
|
// 0临时地址 1 新增地址
|
|
if (type == 0) {
|
|
if (type == 0) {
|
|
let that = this
|
|
let that = this
|
|
- uni.chooseLocation({
|
|
|
|
|
|
+ uni.getLocation({
|
|
|
|
+ type: 'wgs84',
|
|
success: function(res) {
|
|
success: function(res) {
|
|
- console.log(res);
|
|
|
|
- console.log('位置名称:' + res.name);
|
|
|
|
- console.log('详细地址:' + res.address);
|
|
|
|
- console.log('纬度:' + res.latitude);
|
|
|
|
- console.log('经度:' + res.longitude);
|
|
|
|
- var locationObj = that.$helper.formatLocation(res);
|
|
|
|
- console.log(locationObj)
|
|
|
|
- that.temporaryAddress.latitude = res.latitude
|
|
|
|
- that.temporaryAddress.longitude = res.longitude
|
|
|
|
- that.temporaryAddress.detailedAddress = locationObj.ADDRESS
|
|
|
|
- that.temporaryAddress.province = locationObj.REGION_PROVINCE
|
|
|
|
- that.temporaryAddress.city = locationObj.REGION_CITY
|
|
|
|
- that.temporaryAddress.area = locationObj.REGION_COUNTRY
|
|
|
|
- that.temporaryAddress.commonId = that.userInfo.id
|
|
|
|
- that.configAddress(that.temporaryAddress)
|
|
|
|
- },
|
|
|
|
- fail: function() {
|
|
|
|
- uni.getSetting({
|
|
|
|
|
|
+ console.log('当前位置的经度:' + res.longitude);
|
|
|
|
+ console.log('当前位置的纬度:' + res.latitude);
|
|
|
|
+ uni.chooseLocation({
|
|
success: function(res) {
|
|
success: function(res) {
|
|
- var statu = res.authSetting;
|
|
|
|
- if (!statu['scope.userLocation']) {
|
|
|
|
- uni.showModal({
|
|
|
|
- title: '是否授权当前位置',
|
|
|
|
- content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用',
|
|
|
|
- success: function(tip) {
|
|
|
|
- if (tip.confirm) {
|
|
|
|
- uni.openSetting({
|
|
|
|
- success: function(
|
|
|
|
- data) {
|
|
|
|
- if (data
|
|
|
|
- .authSetting[
|
|
|
|
- "scope.userLocation"
|
|
|
|
- ] === true
|
|
|
|
- ) {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '授权成功',
|
|
|
|
- icon: 'success',
|
|
|
|
- duration: 1000
|
|
|
|
- })
|
|
|
|
- //授权成功之后,再调用chooseLocation选择地方
|
|
|
|
- uni.chooseLocation({
|
|
|
|
- success: function(
|
|
|
|
- res
|
|
|
|
- ) {
|
|
|
|
- console
|
|
|
|
- .log(
|
|
|
|
- res
|
|
|
|
- );
|
|
|
|
- console
|
|
|
|
- .log(
|
|
|
|
- '位置名称:' +
|
|
|
|
- res
|
|
|
|
- .name
|
|
|
|
- );
|
|
|
|
- console
|
|
|
|
- .log(
|
|
|
|
- '详细地址:' +
|
|
|
|
- res
|
|
|
|
- .address
|
|
|
|
- );
|
|
|
|
- console
|
|
|
|
- .log(
|
|
|
|
- '纬度:' +
|
|
|
|
- res
|
|
|
|
- .latitude
|
|
|
|
- );
|
|
|
|
- console
|
|
|
|
- .log(
|
|
|
|
- '经度:' +
|
|
|
|
- res
|
|
|
|
- .longitude
|
|
|
|
- );
|
|
|
|
- var locationObj =
|
|
|
|
- that
|
|
|
|
- .$helper
|
|
|
|
- .formatLocation(
|
|
|
|
- res
|
|
|
|
- );
|
|
|
|
- console
|
|
|
|
- .log(
|
|
|
|
- locationObj
|
|
|
|
- )
|
|
|
|
- that.temporaryAddress
|
|
|
|
- .latitude =
|
|
|
|
- res
|
|
|
|
- .latitude
|
|
|
|
- that.temporaryAddress
|
|
|
|
- .longitude =
|
|
|
|
- res
|
|
|
|
- .longitude
|
|
|
|
- that.temporaryAddress
|
|
|
|
- .detailedAddress =
|
|
|
|
- locationObj
|
|
|
|
- .ADDRESS
|
|
|
|
- that.temporaryAddress
|
|
|
|
- .province =
|
|
|
|
- locationObj
|
|
|
|
- .REGION_PROVINCE
|
|
|
|
- that.temporaryAddress
|
|
|
|
- .city =
|
|
|
|
- locationObj
|
|
|
|
- .REGION_CITY
|
|
|
|
- that.temporaryAddress
|
|
|
|
- .area =
|
|
|
|
- locationObj
|
|
|
|
- .REGION_COUNTRY
|
|
|
|
- that.temporaryAddress
|
|
|
|
- .commonId =
|
|
|
|
- that
|
|
|
|
- .userInfo
|
|
|
|
- .id
|
|
|
|
- that.configAddress(
|
|
|
|
- that
|
|
|
|
- .temporaryAddress
|
|
|
|
- )
|
|
|
|
- },
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '授权失败',
|
|
|
|
- icon: 'none',
|
|
|
|
- duration: 1000
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ console.log(res);
|
|
|
|
+ console.log('位置名称:' + res.name);
|
|
|
|
+ console.log('详细地址:' + res.address);
|
|
|
|
+ console.log('纬度:' + res.latitude);
|
|
|
|
+ console.log('经度:' + res.longitude);
|
|
|
|
+ var locationObj = that.$helper.formatLocation(res);
|
|
|
|
+ console.log(locationObj)
|
|
|
|
+ that.temporaryAddress.latitude = res.latitude
|
|
|
|
+ that.temporaryAddress.longitude = res.longitude
|
|
|
|
+ that.temporaryAddress.detailedAddress = locationObj.ADDRESS
|
|
|
|
+ that.temporaryAddress.province = locationObj.REGION_PROVINCE
|
|
|
|
+ that.temporaryAddress.city = locationObj.REGION_CITY
|
|
|
|
+ that.temporaryAddress.area = locationObj.REGION_COUNTRY
|
|
|
|
+ that.temporaryAddress.commonId = that.userInfo.id
|
|
|
|
+ that.configAddress(that.temporaryAddress)
|
|
},
|
|
},
|
|
- fail: function(res) {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '调用授权窗口失败',
|
|
|
|
- icon: 'none',
|
|
|
|
- duration: 1000
|
|
|
|
- })
|
|
|
|
|
|
+ fail: function() {
|
|
|
|
+ // uni.getSetting({
|
|
|
|
+ // success: function(res) {
|
|
|
|
+ // var statu = res.authSetting;
|
|
|
|
+ // if (!statu['scope.userLocation']) {
|
|
|
|
+ // uni.showModal({
|
|
|
|
+ // title: '是否授权当前位置',
|
|
|
|
+ // content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用',
|
|
|
|
+ // success: function(tip) {
|
|
|
|
+ // if (tip.confirm) {
|
|
|
|
+ // uni.openSetting({
|
|
|
|
+ // success: function(
|
|
|
|
+ // data
|
|
|
|
+ // ) {
|
|
|
|
+ // if (data
|
|
|
|
+ // .authSetting[
|
|
|
|
+ // "scope.userLocation"
|
|
|
|
+ // ] ===
|
|
|
|
+ // true
|
|
|
|
+ // ) {
|
|
|
|
+ // uni.showToast({
|
|
|
|
+ // title: '授权成功',
|
|
|
|
+ // icon: 'success',
|
|
|
|
+ // duration: 1000
|
|
|
|
+ // })
|
|
|
|
+ // //授权成功之后,再调用chooseLocation选择地方
|
|
|
|
+ // uni.chooseLocation({
|
|
|
|
+ // success: function(
|
|
|
|
+ // res
|
|
|
|
+ // ) {
|
|
|
|
+ // console
|
|
|
|
+ // .log(
|
|
|
|
+ // res
|
|
|
|
+ // );
|
|
|
|
+ // console
|
|
|
|
+ // .log(
|
|
|
|
+ // '位置名称:' +
|
|
|
|
+ // res
|
|
|
|
+ // .name
|
|
|
|
+ // );
|
|
|
|
+ // console
|
|
|
|
+ // .log(
|
|
|
|
+ // '详细地址:' +
|
|
|
|
+ // res
|
|
|
|
+ // .address
|
|
|
|
+ // );
|
|
|
|
+ // console
|
|
|
|
+ // .log(
|
|
|
|
+ // '纬度:' +
|
|
|
|
+ // res
|
|
|
|
+ // .latitude
|
|
|
|
+ // );
|
|
|
|
+ // console
|
|
|
|
+ // .log(
|
|
|
|
+ // '经度:' +
|
|
|
|
+ // res
|
|
|
|
+ // .longitude
|
|
|
|
+ // );
|
|
|
|
+ // var locationObj =
|
|
|
|
+ // that
|
|
|
|
+ // .$helper
|
|
|
|
+ // .formatLocation(
|
|
|
|
+ // res
|
|
|
|
+ // );
|
|
|
|
+ // console
|
|
|
|
+ // .log(
|
|
|
|
+ // locationObj
|
|
|
|
+ // )
|
|
|
|
+ // that.temporaryAddress
|
|
|
|
+ // .latitude =
|
|
|
|
+ // res
|
|
|
|
+ // .latitude
|
|
|
|
+ // that.temporaryAddress
|
|
|
|
+ // .longitude =
|
|
|
|
+ // res
|
|
|
|
+ // .longitude
|
|
|
|
+ // that.temporaryAddress
|
|
|
|
+ // .detailedAddress =
|
|
|
|
+ // locationObj
|
|
|
|
+ // .ADDRESS
|
|
|
|
+ // that.temporaryAddress
|
|
|
|
+ // .province =
|
|
|
|
+ // locationObj
|
|
|
|
+ // .REGION_PROVINCE
|
|
|
|
+ // that.temporaryAddress
|
|
|
|
+ // .city =
|
|
|
|
+ // locationObj
|
|
|
|
+ // .REGION_CITY
|
|
|
|
+ // that.temporaryAddress
|
|
|
|
+ // .area =
|
|
|
|
+ // locationObj
|
|
|
|
+ // .REGION_COUNTRY
|
|
|
|
+ // that.temporaryAddress
|
|
|
|
+ // .commonId =
|
|
|
|
+ // that
|
|
|
|
+ // .userInfo
|
|
|
|
+ // .id
|
|
|
|
+ // that.configAddress(
|
|
|
|
+ // that
|
|
|
|
+ // .temporaryAddress
|
|
|
|
+ // )
|
|
|
|
+ // },
|
|
|
|
+ // })
|
|
|
|
+ // } else {
|
|
|
|
+ // uni.showToast({
|
|
|
|
+ // title: '授权失败',
|
|
|
|
+ // icon: 'none',
|
|
|
|
+ // duration: 1000
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // fail: function(res) {
|
|
|
|
+ // uni.showToast({
|
|
|
|
+ // title: '调用授权窗口失败',
|
|
|
|
+ // icon: 'none',
|
|
|
|
+ // duration: 1000
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- // that.$helper.getLocation(that.temporaryAddress)
|
|
|
|
- // console.log('1111111111111111111111111111111111')
|
|
|
|
- // console.log(that.temporaryAddress)
|
|
|
|
- // let that = this
|
|
|
|
- // // this.isShowMap = true
|
|
|
|
- // uni.chooseLocation({
|
|
|
|
- // success: function(res) {
|
|
|
|
- // console.log(res);
|
|
|
|
- // console.log('位置名称:' + res.name);
|
|
|
|
- // console.log('详细地址:' + res.address);
|
|
|
|
- // console.log('纬度:' + res.latitude);
|
|
|
|
- // console.log('经度:' + res.longitude);
|
|
|
|
- // // let _address = that.$helper.getAddress(res.address)
|
|
|
|
- // let _address = that.$helper.getLocation(res.address)
|
|
|
|
- // console.log(_address)
|
|
|
|
- // // that.temporaryAddress.latitude = res.latitude
|
|
|
|
- // // that.temporaryAddress.longitude = res.longitude
|
|
|
|
- // // that.temporaryAddress.detailedAddress = _address.village
|
|
|
|
- // // that.temporaryAddress.province = _address.province
|
|
|
|
- // // that.temporaryAddress.city = _address.city
|
|
|
|
- // // that.temporaryAddress.area = _address.county
|
|
|
|
- // // that.temporaryAddress.commonId = that.userInfo.id
|
|
|
|
- // // that.configAddress(that.temporaryAddress)
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // // console.log(123)
|
|
|
|
- // // uni.$u.route('/pages/release/map', {
|
|
|
|
- // // id: 1,
|
|
|
|
- // // });
|
|
|
|
} else {
|
|
} else {
|
|
uni.$u.route('/pages/release/addAddress', {
|
|
uni.$u.route('/pages/release/addAddress', {
|
|
type: type,
|
|
type: type,
|