address-5/23

master
游梦婷 2 years ago
parent 70c04adc5a
commit 7123f2dc61
  1. 2
      Utils/physicalObject.js
  2. 53
      components/uni-combox/components/uni-combox/uni-combox.vue
  3. 121
      physical-merchants/address/addNewAddress/addNewAddress.vue
  4. 2
      physical-merchants/classify/order/wuliuPupup/wuliuPupup.vue

@ -73,7 +73,7 @@ export const insertDeliveryAddress = params => {
export const baiduApiMapSearch = params => {
return POST('GET', `${base}/common/baiduApiMapSearch`, params).then(res => res.data);
return POST('GET', `${base}/common/gaoDeApiMapSearch`, params).then(res => res.data);
}
// 更新收货地址
export const updateDeliveryAddress = params => {

@ -4,11 +4,13 @@
<text>{{label}}</text>
</view>
<view class="uni-combox__input-box">
<input class="uni-combox__input" type="text" :placeholder="placeholder" :placeholder-class="placeholderClass" v-model="inputVal" @input="onInput"
<input v-if="isShowIcon" class="uni-combox__input" type="text" :placeholder="placeholder" :placeholder-class="placeholderClass" v-model="inputVal" @input="onInput"
@focus="onFocus" @blur="onBlur" />
<textarea v-if="!isShowIcon" :cursor-spacing="110" v-model.trim="inputVal" class="uni-combox__input2" :placeholder="placeholder" :placeholder-class="placeholderClass" @input="onInput"
@focus="onFocus" @blur="onBlur"></textarea>
<uni-icons class="uni-combox__input-arrow" v-if="isShowIcon" type="arrowdown" size="14" @click="toggleSelector"></uni-icons>
<view v-else class="icon location foc3da7e7" @click="location"></view>
<view :class="' uni-combox__selector '+(isAddress?' topmore ': ' ')" v-if="showSelector">
<!-- <view v-if="!isShowIcon" class="icon location foc3da7e7" @click="location"></view> -->
<view :class="' uni-combox__selector '+(isAddress?' topmore ': ' ')" v-if="showSelector">
<scroll-view v-if="isShowIcon" scroll-y="true" class="uni-combox__selector-scroll">
<view class="uni-combox__selector-empty" v-if="filterCandidatesLength === 0">
<text>{{emptyTips}}</text>
@ -20,11 +22,11 @@
</scroll-view>
<!-- -->
<scroll-view v-else scroll-y="true" class="uni-combox__selector-scroll">
<scroll-view v-else scroll-y="true" :style="'max-height:'+height+'px'" class="uni-combox__selector-scroll">
<view class="uni-combox__selector-empty" v-if="candidates.length === 0">
<text>{{emptyTips}}</text>
</view>
<view v-else class="uni-combox__selector-item" @click="toggleSelector" >
<view v-else class="uni-combox__selector-item se-t" @click="toggleSelector" >
<slot></slot>
</view>
</scroll-view>
@ -86,6 +88,10 @@
type: String,
default: ''
},
height:{
type:Number,
default:0,
}
},
data() {
return {
@ -138,11 +144,17 @@
}
},
onBlur() {
async onBlur() {
this.$emit("blur")
if(this.isAddress){
this.showSelector = false;
if(this.inputVal==""){
this.showSelector = false;
}else{
this.showSelector = true;
}
return
}
@ -169,7 +181,7 @@
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
height: 40px;
// height: 40px;
flex-direction: row;
align-items: center;
// border-bottom: solid 1px #DDDDDD;
@ -198,7 +210,17 @@
height: 22px;
line-height: 22px;
}
.uni-combox__input2 {
flex: 1;
font-size: 16px;
line-height: 22px;
width: 100%;
background-color: #f6f6f6;
border-radius: 8px;
box-sizing: border-box;
padding: 10px;
height: 100px;
}
.uni-combox__input-arrow {
padding: 10px;
}
@ -213,19 +235,18 @@
border-radius: 6px;
box-shadow: #DDDDDD 4px 4px 8px, #DDDDDD -4px -4px 8px;
z-index: 100;
.topmore{
top:52px;
}
}
.uni-combox__selector.topmore{
top:110px;
// bottom: 75px;
}
.uni-combox__selector-scroll {
max-height: 200px;
box-sizing: border-box;
}
.uni-combox__selector-scroll2 {
max-height:300px;
box-sizing: border-box;
}
.uni-combox__selector::before {
content: '';

@ -1,13 +1,13 @@
<template>
<view class="page-bottom-fixed backcor9">
<view class="page-bottom-fixed backcor9" >
<form @submit="form_submit" class="form-container">
<view class="pd-main border-box height100" style="overflow-y: auto;">
<view class="pd-main border-box height100" :style="'overflow-y: auto;transform: translateY(-0px);'" >
<view class="form-gorup backcolorfff">
<view class="dis-flex">
<view class="form-gorup-title marRight10">收货人:
</view>
<input type="text" name="name" v-model="userAddress.name" placeholder-class="corf6"
class="fcor666 flex-1 bs-bb" placeholder="名字">
class=" flex-1 bs-bb" placeholder="名字">
</view>
@ -19,7 +19,7 @@
<view class="form-gorup-title marRight10">手机号码:
</view>
<input type="number" name="tel" v-model="userAddress.tel" maxlength="11"
placeholder-class="corf6" class="fcor666 flex-1" placeholder="手机号">
placeholder-class="corf6" class=" flex-1" placeholder="手机号">
</view>
@ -32,7 +32,7 @@
<view class="dis-flex ">
<view class=" form-gorup-title">所在地区:</view>
<view class="dis-flex flex-1 flex-end">
<view class=" pickRes fcor666">{{userAddress.region || '请选择'}}</view>
<view class=" pickRes ">{{userAddress.region || '请选择'}}</view>
<view class="icon-ymt to-right font14 fcor666"></view>
</view>
</view>
@ -47,10 +47,10 @@
<!-- <view style="clear: both;"> -->
<view class="dis-flex">
<view class="dis-flex scrol-t mart10">
<view class="form-gorup-title marRight10">详细地址:</view>
<uni-combox @location="location" placeholderClass="corf6" :candidates="candidates" class="flex-1" :isAddress="true" :isShowIcon="false" placeholder="请输入详细地址" v-model="userAddress.address">
<uni-combox :height="height" @focus="focusMethod" @blur="blurMethod" :cursorSpacing="50" placeholderClass="corf6" :candidates="candidates" class="flex-1" :isAddress="true" :isShowIcon="false" placeholder="请输入详细地址" v-model="userAddress.address">
<view class="selector-item" v-for="(item,index) in candidates" :key="index" @click="getSelect(item)">
<view class="text1 name">
@ -77,12 +77,12 @@
<text class="font18">设为默认地址</text>
</view>
<view class="bottom-fixed ">
<button class="btn " type="default" form-type="submit">保存</button>
</view>
</view>
</view>
<view class="bottom-fixed ">
<button class="btn " type="default" form-type="submit">保存</button>
</view>
</form>
@ -108,6 +108,7 @@
region: '',
address: "",
is_default: false,
},
dataParams: null,
//
@ -122,6 +123,9 @@
// {"name": "-","address": "189",},
// {"name": "-","address": "189",}
],
top:0,
top1:0,
height:0,
};
@ -134,7 +138,7 @@
},
onLoad(params) {
console.log(params)
// console.log(params)
this.dataParams = params
},
watch: {
@ -174,8 +178,49 @@
},
async mounted() {
await this.getRect('.scrol-t').then(res => {
this.top = res.top;
})
await this.getRect('.bottom-fixed').then(res => {
this.top1 = res.top;
})
this.height = this.top1 - this.top - 120;
// console.log(this.top1,this.top,this.height)
},
methods: {
focusMethod(){
},
blurMethod(){
this.baiduApiMap(this.userAddress.address)
},
getRect(selector, all) {
return new Promise(resolve => {
uni.createSelectorQuery()
.in(this)
[all ? 'selectAll' : 'select'](selector)
.boundingClientRect(rect => {
if (all && Array.isArray(rect) && rect.length) {
resolve(rect);
}
if (!all && rect) {
resolve(rect);
}
})
.exec();
});
},
findAddressById(id) {
let params = {
id: id
@ -217,46 +262,25 @@
this.userAddress.region = this.region.map(item => item.name).join(',');
}
console.log(this.userAddress.region, "获取选择的地区", this.regionId, this.region)
// console.log(this.userAddress.region, "", this.regionId, this.region)
},
//
init() {
},
//
location(){
this.userAddress.address = this.userAddress.address.replace(/\s+/g, "")
if(app.globalData.latitude&&app.globalData.longitude){
this.baiduApiMap(app.globalData.longitude,app.globalData.latitude,this.userAddress.address)
}else{
uni.getLocation({
type: 'wgs84',
success: function(res) {
app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude;
this.baiduApiMap(app.globalData.longitude,app.globalData.latitude,this.userAddress.address)
}
})
}
//onInput
location(n){
// this.userAddress.address = this.userAddress.address.replace(/\s+/g, "")
},
baiduApiMap(lng,lat,query){
let params;
if(query==""){
params={
lng,lat
}
}else{
params={
lng,lat,query
}
}
baiduApiMap(query){
query = query.replace(/\s+/g, "")
let params={
query:query
}
// console.log(params,"params")
baiduApiMapSearch(params).then(res=>{
console.log(res)
@ -280,12 +304,16 @@
})
},
//
getSelect(desc){
console.log(desc)
// console.log(desc)
this.defaultRegionCode = desc.adcode ;
this.userAddress.address = desc.address;
uni.showToast({
icon:'none',
title:"所在地区同步修改"
})
},
//
@ -468,7 +496,8 @@
/*表单*/
.form-container {
height: 100%;
/* display: flex;
flex-direction: column; */
.form-gorup {
padding: 20rpx;
margin-bottom: 20rpx;

@ -1,6 +1,6 @@
<template>
<wybPopup @touchmove.stop ref="popup" zIndex="999" type="bottom" width="500" height="500" :scrollY="true" radius="0" :showCloseIcon="true">
<view class="pd-main wuliupop backcor9">
<view class="pd-main wuliupop height100 border-box backcor9">
<view class="pop-title fontwig6 backcor9"><text>物流信息</text></view>
<view class="pd-main backcolorfff border-8r font14" >
<view class="dis-flex flex-sp mart10 marb10 paddbotm10 border-b">

Loading…
Cancel
Save