This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-04-09 18:04:21 +08:00
parent 2ff122ebae
commit d72f234cc7
5 changed files with 507 additions and 442 deletions

View File

@ -15,8 +15,8 @@ let openPlantGrass = '-openPlantGrass-'
let httpSix, httpApi;
const env = 'dev'; // 开发
// const env = 'prod'; // 生产
// const env = 'dev'; // 开发
const env = 'prod'; // 生产
// const env = 'prew'; // 预上线
switch (env) {

View File

@ -2,8 +2,8 @@
"name": "惠农生活",
"appid": "__UNI__3A527D1",
"description": "",
"versionName": "2.0.23",
"versionCode": 2023,
"versionName": "2.0.20",
"versionCode": 2020,
"transformPx": false,
/* 5+App */
"app-plus": {

View File

@ -2,10 +2,10 @@
<view class="" style="background-color: #fff;">
<u-sticky customNavHeight="0">
<view class="head_top">
<!-- <u-search placeholder="搜索小区、办公楼等" @custom="searchMap"></u-search>
<view style="height: 20rpx;"></view> -->
<u-tabs :list="tabsList" itemStyle="font-size: 32rpx;height: 74rpx;" :current="current" @change="changeCurrent"
lineColor="#FF6D20" lineWidth="105rpx" height="7rpx"></u-tabs>
<u-search placeholder="搜索小区、办公楼等" @custom="searchMap"></u-search>
<view style="height: 20rpx;"></view>
<u-tabs :list="tabsList" itemStyle="font-size: 32rpx;height: 74rpx;" :current="current"
@change="changeCurrent" lineColor="#FF6D20" lineWidth="105rpx" height="7rpx"></u-tabs>
</u-tabs>
</view>
</u-sticky>
@ -22,7 +22,8 @@
</view>
</view>
<view class="re-btn" @click="reGetLocation">
<image class="re-address-img" src="@/static/images/re_address.png"></image><text class="text">重新定位</text>
<image class="re-address-img" src="@/static/images/re_address.png"></image><text
class="text">重新定位</text>
</view>
</view>
<u-button text="确认" @click="submitAddress"></u-button>
@ -32,8 +33,8 @@
<view><text class="text">泸州区县</text></view>
</view>
<view class="area">
<view class="area-item" :class="{'area-item-on': item.code==area_change}" v-for="(item, index) in areaList"
:key="index" @click="changeArea(item)">
<view class="area-item" :class="{'area-item-on': item.code==area_change}"
v-for="(item, index) in areaList" :key="index" @click="changeArea(item)">
<text class="text">{{item.name}}</text>
</view>
</view>
@ -44,7 +45,8 @@
<view class="letter-item" v-for="key in mapKey" :key="key">
<view class="letter"><text class="text">{{key}}</text></view>
<view class="item-box">
<view class="street-item" v-for="item in mapList[key]" :key="item.code" @click="changeStreet(item)">
<view class="street-item" v-for="item in mapList[key]" :key="item.code"
@click="changeStreet(item)">
<text class="text">{{item.name}}</text>
</view>
</view>
@ -64,8 +66,12 @@
getArea,
getStreet
} from "@/api/article.js";
import { Toast } from '@/libs/uniApi';
import { wgsToGcj } from "@/utils/wgs.js";
import {
Toast
} from '@/libs/uniApi';
import {
wgsToGcj
} from "@/utils/wgs.js";
export default {
data() {
return {
@ -94,6 +100,10 @@
mapList: {},
area_change: '',
street_change: '',
selectedInfo: {
address: '',
location: ''
}
}
},
onLoad(options) {
@ -148,6 +158,9 @@
this.town = res.data.address_reference.town.title
this.street_id = res.data.address_reference.town.id
this.street = res.data.address_reference.town.title;
this.selectedInfo.address = res.data.address;
this.selectedInfo.location = `${latitude},${longitude}`;
}).catch(err => {
uni.showToast({
title: err,
@ -229,7 +242,6 @@
let latitude = e.detail.latitude;
this.markers.longitude = longitude;
this.markers.latitude = latitude;
// console.log('修改成功', this.markers);
getGeocoder({
lat: latitude,
long: longitude
@ -259,9 +271,12 @@
code: this.street_id
},
latitude: this.latitude,
longitude: this.longitude
longitude: this.longitude,
addr: {
...this.selectedInfo
}
console.log({ ...obj });
}
uni.navigateBack({
success: () => {
uni.$emit('changeAddress', obj)

View File

@ -18,8 +18,8 @@
</view>
<view class="con">
<image class="record"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_active_mer/new_active_mer_qrcode_record.webp">
<image mode="aspectFit" class="record"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/eec81202404091550527405.webp">
</image>
<view class="table" v-if="list.length > 0">
@ -199,7 +199,7 @@
<style lang="scss" scoped>
page {
background-color: #FFF3EF;
background-color: #fff;
}
.invite {
@ -217,7 +217,7 @@
align-items: center;
width: 690rpx;
height: 666rpx;
background-image: url(https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_active_mer/new_active_mer_qrcode_bg.webp);
background-image: url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/5a3b2202404091555409835.webp);
background-size: 100%;
background-repeat: no-repeat;
padding-top: 54rpx;
@ -261,18 +261,21 @@
}
.con {
background-color: #FFF3EF;
width: 100%;
background-color: #ECECEC;
padding: 192rpx 30rpx 0;
border-radius: 40rpx 40rpx 0 0;
image {
width: 100%;
height: 45rpx;
height: 42rpx;
margin-bottom: 40rpx;
}
.table {
#scrollView {
height: calc(100vh - 544rpx - 350rpx);
width: 100%;
height: calc(100vh - 544rpx - 340rpx);
overflow: auto;
padding-bottom: 20rpx;
}

View File

@ -1,8 +1,44 @@
<style lang="scss">
.sel_addr_wrap {
height: 120rpx;
padding: 30rpx 0;
.sel_addr {
display: flex;
align-items: center;
justify-content: center;
margin: 0 30rpx;
border: 2rpx solid #40ae36;
height: 60rpx;
line-height: 60rpx;
text-align: center;
color: #40ae36;
border-radius: 10rpx;
font-weight: bold;
&:active {
background: rgba(64, 174, 54, .1);
}
text {
margin-right: 10rpx;
}
}
}
</style>
<template>
<view :style="viewColor">
<form @submit="formSubmit" report-submit='true'>
<view class='addAddress'>
<view class='list'>
<view class="sel_addr_wrap">
<view class="sel_addr" @click="handleToChoose">
<text>选择收货地址</text>
<u-icon name="arrow-right" size="16" color="#40ae36"></u-icon>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>姓名</view>
<input type='text' placeholder='请输入姓名' name='real_name' :value="userAddress.real_name"
@ -16,35 +52,19 @@
<view class='item acea-row row-between-wrapper'>
<view class='name'>所在地区</view>
<view class="region">
<view class="region_count" @click="changeRegion">
<text v-if="!addressInfo.length" style="color:#cdcdcd;">请选择地区</text>
<text v-else>{{addressText}}</text>
<view class="region_count" @click="handleToChoose">
<text v-if="!detail.length" style="color:#cdcdcd;">请选择地区</text>
<text v-else>{{detail}}</text>
<text class="iconfont icon-xiangyou"></text>
</view>
</view>
</view>
<!-- <view class='item acea-row row-between-wrapper'>
<view class='name'>所在村队</view>
<view class="region">
<view class="region_count" @click="changevillage">
<text v-if="!villageInfo.length" style="color:#cdcdcd;">请选择村队</text>
<text v-else>{{villageText}}</text>
<text class="iconfont icon-xiangyou"></text>
</view>
</view>
</view> -->
<view class='item acea-row row-between-wrapper'>
<view class='name'>详细地址</view>
<input type='text' class="location-input" placeholder='请填写具体地址' name='detail'
placeholder-class='placeholder' v-model="userAddress.detail"></input>
<!--<view class="location" @click="selfLocation">
<text class="iconfont icon-chakanditu"></text>
<br>
定位
</view> -->
</view>
</view>
<view class='default acea-row row-middle'>
@ -86,7 +106,9 @@
editAddress,
getAddressDetail
} from '@/api/user.js';
import { wgsToGcj } from "@/utils/wgs.js";
import {
wgsToGcj
} from "@/utils/wgs.js";
import {
getCityV2,
getCityList
@ -126,10 +148,15 @@
display: false,
display_one: false,
addressInfo: [],
newAddrInfo: '',
newPCAS: '',
villageInfo: [],
list: [],
latitude: '',
longitude: ''
longitude: '',
detail: '', //15
location: '', //
};
},
computed: {
@ -158,14 +185,28 @@
}
},
methods: {
//
handleToChoose() {
let that = this;
uni.navigateTo({
url: "/pages/select_address_n/select_address_n",
success: (res) => {
uni.$once('changeAddress', res => {
console.log(res)
// this.newAddrInfo = res.addr; "name": ",,,",
that.detail = res.addr.address;
that.location = res.addr.location;
})
}
})
},
OnChangeAddress(address) {
this.addressInfo = address;
this.list = address
},
OnChangevAddress(address) {
this.villageInfo = address;
console.log(this.villageInfo)
},
//
getCityList: function() {
let that = this;
@ -208,11 +249,13 @@
let region = [res.data.province, res.data.city, res.data.district, res.data.street, res
.data.village
];
console.log({...res.data});
console.log({
...res.data
});
that.$set(that, 'userAddress', res.data);
that.$set(that, 'region', region);
that.city_id = res.data.city_id
if(res.data.areas) that.addressInfo = res.data.areas;
if (res.data.areas) that.addressInfo = res.data.areas;
else {
}
@ -344,6 +387,7 @@
formSubmit: function(e) {
let that = this,
value = e.detail.value;
if (!value.real_name) return that.$util.Tips({
title: '请填写收货人姓名'
});
@ -353,7 +397,7 @@
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.addressInfo.length) return that.$util.Tips({
if (!that.detail.length) return that.$util.Tips({
title: '请选择所在地区'
});
// if (!that.villageInfo.length) return that.$util.Tips({
@ -364,8 +408,8 @@
});
value.address_id = that.address_id;
value.is_default = that.userAddress.is_default ? 1 : 0;
value.area = that.addressInfo;
value.brigade = that.villageInfo[0]
value.area = that.detail;
// value.brigade = that.villageInfo[0]
uni.showLoading({
title: '保存中',
@ -470,8 +514,11 @@
}
.region .region_count {
height: 42rpx;
line-height: 42rpx;
// height: 42rpx;
// line-height: 42rpx;
display: flex;
align-items: center;
justify-content: space-between;
.icon-xiangyou {
float: right;