|
@@ -203,7 +203,7 @@
|
|
|
this.form.store = data.company.words
|
|
|
}
|
|
|
this.form.company = data.company.words
|
|
|
- if(data.company.words!="无"){
|
|
|
+ if(data.person.words!="无"){
|
|
|
this.form.name = data.person.words
|
|
|
}
|
|
|
|
|
@@ -239,69 +239,67 @@
|
|
|
this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
|
|
|
this.modelshow = true
|
|
|
}
|
|
|
-
|
|
|
+ this.judgeIosPermission()
|
|
|
+ this.requestAndroidPermission()
|
|
|
},
|
|
|
methods: {
|
|
|
judgeIosPermission(permisionID) {
|
|
|
let result = permision.judgeIosPermission(permisionID)
|
|
|
if (!result) {
|
|
|
- this.getLocation()
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'wgs84',
|
|
|
+ success: res=>{
|
|
|
+ console.log("获取到定位");
|
|
|
+ },
|
|
|
+ fail:err=>{
|
|
|
+ console.log("没获取到定位")
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.getLocation()
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'wgs84',
|
|
|
+ success: res=>{
|
|
|
+ console.log("获取到定位");
|
|
|
+ },
|
|
|
+ fail:err=>{
|
|
|
+ console.log("没获取到定位")
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
async requestAndroidPermission(permisionID) {
|
|
|
let result = await permision.requestAndroidPermission(permisionID)
|
|
|
if (result == 1) {
|
|
|
- this.getLocation()
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'wgs84',
|
|
|
+ success: res=>{
|
|
|
+ console.log("获取到定位");
|
|
|
+ },
|
|
|
+ fail:err=>{
|
|
|
+ console.log("没获取到定位")
|
|
|
+ }
|
|
|
+ });
|
|
|
} else if (result == 0) {
|
|
|
- this.getLocation()
|
|
|
- } else {
|
|
|
- this.getLocation()
|
|
|
- }
|
|
|
- },
|
|
|
- getLocation() {
|
|
|
- let that = this
|
|
|
- uni.getLocation({
|
|
|
- type: 'wgs84',
|
|
|
- geocode: true,
|
|
|
- success: function(res) {
|
|
|
- switch (res.address.province) {
|
|
|
- case "北京市":
|
|
|
- {
|
|
|
- that.city = "直辖市"
|
|
|
- break;
|
|
|
- }
|
|
|
- case "天津市":
|
|
|
- {
|
|
|
- that.city = "直辖市"
|
|
|
- break;
|
|
|
- }
|
|
|
- case "上海市":
|
|
|
- {
|
|
|
- that.city = "直辖市"
|
|
|
- break;
|
|
|
- }
|
|
|
- case "重庆市":
|
|
|
- {
|
|
|
- that.city = "直辖市"
|
|
|
- break;
|
|
|
- }
|
|
|
- default:
|
|
|
- {
|
|
|
- that.city = "不是直辖市"
|
|
|
- break;
|
|
|
- }
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'wgs84',
|
|
|
+ success: res=>{
|
|
|
+ console.log("获取到定位");
|
|
|
+ },
|
|
|
+ fail:err=>{
|
|
|
+ console.log("没获取到定位")
|
|
|
}
|
|
|
- if (that.city == "直辖市") {
|
|
|
- let RegionData = res.address.province + "," + that.city + "," + res.address.district
|
|
|
- that.defaultRegion = RegionData.split(",");
|
|
|
- } else {
|
|
|
- let RegionData = res.address.province + "," + res.address.city + "," + res.address.district
|
|
|
- that.defaultRegion = RegionData.split(",");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'wgs84',
|
|
|
+ success: res=>{
|
|
|
+ console.log("获取到定位");
|
|
|
+ },
|
|
|
+ fail:err=>{
|
|
|
+ console.log("没获取到定位")
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
nextStep() {
|
|
|
this.$refs.uForm.validate(valid => {
|