| | |
| | | <!-- 收货地址列表 --> |
| | | <view class="p15 container-address"> |
| | | <view class="search-container m-t-12 flex"> |
| | | <view class="flex1 input" @click="selectWxAddress('input')"> |
| | | <!-- <view class="flex1 input" @click="selectWxAddress('input')"> --> |
| | | <view class="flex1 input" @click="selectGaodeAddress('input')"> |
| | | <u-input placeholder="小区名/店铺名/写字楼/街道名等" disabled v-model="search_flow"> |
| | | <template slot="suffix"> |
| | | <uni-icons color="#20613D" type="search" size="24"></uni-icons> |
| | |
| | | <view class="m-l-a m-r-0 flex " :class="[!dto['province']?'desc-gray':'']"> |
| | | <uni-data-picker :area="true" @change="(e)=>{PickArea(submitForm,e)}" placeholder="" |
| | | :localdata="regionDataPlus"> |
| | | {{ submitForm['province'] || '请选择' }}{{ submitForm['city'] && ('/' + submitForm['city']) || '' }}{{ |
| | | {{ submitForm['province'] || '请选择' }}{{ submitForm['city'] && ('/' + submitForm['city']) |
| | | || '' |
| | | }}{{ |
| | | submitForm['region'] && ('/' + submitForm['region']) || '' |
| | | }} |
| | | </uni-data-picker> |
| | |
| | | // const chooseLocation = requirePlugin('chooseLocation'); |
| | | // #endif |
| | | |
| | | import amapFile from '@/map/amap-wx.130.js'; |
| | | |
| | | import { |
| | | mapState |
| | | } from 'vuex' |
| | |
| | | uni.stopPullDownRefresh() |
| | | }, |
| | | async onLoad(options) { |
| | | // debugger; |
| | | // 引入高德地图的组件 |
| | | const myAmapFun = new amapFile.AMapWX({ key: '75d7da3feb329cd5ae997975b953abb6' }); |
| | | myAmapFun.getRegeo({ |
| | | success: (data) => { |
| | | console.log('当前位置:', data[0]); |
| | | console.log(data) |
| | | // this.setData({ |
| | | // longitude: data[0].longitude, |
| | | // latitude: data[0].latitude, |
| | | // locationName: data[0].name, |
| | | // }); |
| | | }, |
| | | fail(err) { |
| | | console.error(err); |
| | | }, |
| | | }); |
| | | |
| | | // this.list = [{}, {}] |
| | | this.source = options.source || '' |
| | | this.listApi = '/api/address/list' |
| | |
| | | |
| | | }, |
| | | onShow() { |
| | | // const location = chooseLocation.getLocation(); // 如果点击确认选点按钮,则返回选点结果对象,否则返回null |
| | | // // console.log('onshow location', location, this.tmp_picker_lock_index, this.formcodes["LOC_ONE"]) |
| | | // // address: "江苏省苏州市吴中区太湖东路280号" |
| | | // // city: "苏州市" |
| | | // // district: "吴中区" |
| | | // // latitude: 31.262438 |
| | | // // longitude: 120.633985 |
| | | // // name: "太湖东路280号小区" |
| | | // // province: "江苏省" |
| | | // if (location && location.address) { |
| | | // this.submitForm.address = location.address |
| | | // this.submitForm.latitude = location.latitude |
| | | // this.submitForm.longitude = location.longitude |
| | | // if (!this.submitForm.province && location.province) { |
| | | // this.submitForm.province = location.province |
| | | // if (!this.submitForm.city && location.city) { |
| | | // this.submitForm.city = location.city |
| | | // } |
| | | // if (!this.submitForm.region && location.district) { |
| | | // this.submitForm.region = location.district |
| | | // } |
| | | // if (!this.submitForm.region && location.city) { |
| | | // this.submitForm.region = location.city |
| | | // } |
| | | // } |
| | | // this.$forceUpdate() |
| | | // } |
| | | |
| | | }, |
| | | computed: { |
| | | ...mapState({ |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | selectGaodeAddress(){ |
| | | uni.navigateTo({ |
| | | url: '/pages/user/address/gaode-address' |
| | | }) |
| | | }, |
| | | selectWxAddress(source) { |
| | | let that = this |
| | | |
| | |
| | | wx.chooseLocation({ |
| | | success: location => { |
| | | console.log('success loc', location,source) |
| | | console.log(location) |
| | | // address: "江苏省苏州市吴中区太湖东路288号" |
| | | // errMsg: "chooseLocation:ok" |
| | | // latitude: 31.26249 |