|
@@ -230,6 +230,8 @@
|
|
|
|
|
|
<script>
|
|
|
import wPicker from "@/components/w-picker/w-picker.vue"
|
|
|
+ import http from "@/https/request.js"
|
|
|
+ import { isString } from "util"
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -279,7 +281,7 @@
|
|
|
sms_code:'', // 验证码
|
|
|
address: '', //详细地址
|
|
|
chanId: '',
|
|
|
- county: 1480, //城市ID,区县id
|
|
|
+ county: 0, //城市ID,区县id
|
|
|
id_no: '', //身份号码,
|
|
|
mobile_id: '',
|
|
|
name: '', //姓名
|
|
@@ -291,7 +293,8 @@
|
|
|
open_idcard_back_img:'',
|
|
|
open_face_img:'',
|
|
|
orderId:'',
|
|
|
- no:''
|
|
|
+ no:'',
|
|
|
+ platform_type: 'h5',
|
|
|
},
|
|
|
chanId:''
|
|
|
|
|
@@ -634,31 +637,67 @@
|
|
|
},
|
|
|
// 根据经纬度查询城市
|
|
|
loAcquire(longitude, latitude) {
|
|
|
- let this_ = this;
|
|
|
- this.myAmapFun.reverseGeocoder({
|
|
|
- location: {
|
|
|
- latitude: latitude,
|
|
|
- longitude: longitude
|
|
|
- },
|
|
|
- success: function(res) {
|
|
|
- console.log("解析地址成功");
|
|
|
- console.log(res);
|
|
|
- // 根据名称筛选id
|
|
|
- this_.cityId(res.result.address_component.province, res.result.address_component.city,
|
|
|
- res.result.address_component.district)
|
|
|
- },
|
|
|
- fail: function(res) {
|
|
|
- uni.showToast({
|
|
|
- title: '定位失败',
|
|
|
- duration: 2000,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- console.log(res);
|
|
|
- },
|
|
|
- complete: function(res) {
|
|
|
- console.log(res);
|
|
|
+ let this_=this;
|
|
|
+
|
|
|
+ http('https://restapi.amap.com/v3/geocode/regeo',"GET",{
|
|
|
+ key: "08dceab59cbce678d07e89924e376f53",
|
|
|
+ location: longitude + ',' + latitude,
|
|
|
+ output: "JSON"
|
|
|
+ })
|
|
|
+ .then(res=>{
|
|
|
+ console.log(res)
|
|
|
+ if(res.statusCode == 200){
|
|
|
+ if(res.data.status == 1){
|
|
|
+ console.log({
|
|
|
+ province:res.data.regeocode.addressComponent.province,
|
|
|
+ city:res.data.regeocode.addressComponent.city,
|
|
|
+ district:res.data.regeocode.addressComponent.district,
|
|
|
+ });
|
|
|
+ let province = res.data.regeocode.addressComponent.province;
|
|
|
+ let city = res.data.regeocode.addressComponent.city;
|
|
|
+ let district = res.data.regeocode.addressComponent.district;
|
|
|
+ if(!isString(city)){
|
|
|
+ city = province;
|
|
|
+ }
|
|
|
+ // uni.setStorage({
|
|
|
+ // key: 'address',
|
|
|
+ // data: JSON.stringify({
|
|
|
+ // district:district,
|
|
|
+ // city:city,
|
|
|
+ // province:province,
|
|
|
+ // })
|
|
|
+ // });
|
|
|
+ this_.cityId(province, city, district);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
})
|
|
|
+
|
|
|
+ // let this_ = this;
|
|
|
+ // this.myAmapFun.reverseGeocoder({
|
|
|
+ // location: {
|
|
|
+ // latitude: latitude,
|
|
|
+ // longitude: longitude
|
|
|
+ // },
|
|
|
+ // success: function(res) {
|
|
|
+ // console.log("解析地址成功");
|
|
|
+ // console.log(res);
|
|
|
+ // // 根据名称筛选id
|
|
|
+ // this_.cityId(res.result.address_component.province, res.result.address_component.city,
|
|
|
+ // res.result.address_component.district)
|
|
|
+ // },
|
|
|
+ // fail: function(res) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '定位失败',
|
|
|
+ // duration: 2000,
|
|
|
+ // icon: "none"
|
|
|
+ // })
|
|
|
+ // console.log(res);
|
|
|
+ // },
|
|
|
+ // complete: function(res) {
|
|
|
+ // console.log(res);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
// 根据名称筛选id
|
|
|
cityId(province, city, district) {
|
|
@@ -850,6 +889,13 @@
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.form.county == 0) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: '请选择城市',
|
|
|
+ type: 'error ',
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (this.form.address == '') {
|
|
|
this.$refs.uToast.show({
|
|
|
title: '请输入地址',
|
|
@@ -860,6 +906,7 @@
|
|
|
this.applyType = false
|
|
|
//#ifdef MP-TOUTIAO
|
|
|
this.form.pay_type = 4
|
|
|
+ this.form.platform_type = 'dy_mini'
|
|
|
//#endif
|
|
|
// 是否是H5支付
|
|
|
if (this.mixin_type == 'H5') {
|