更新版本
This commit is contained in:
parent
9ac27fc4aa
commit
494427d94c
@ -2,8 +2,8 @@
|
|||||||
"name" : "惠农生活",
|
"name" : "惠农生活",
|
||||||
"appid" : "__UNI__3A527D1",
|
"appid" : "__UNI__3A527D1",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.6.0",
|
"versionName" : "1.6.1",
|
||||||
"versionCode" : 160,
|
"versionCode" : 161,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
9
package-lock.json
generated
9
package-lock.json
generated
@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"requires": true,
|
"name": "e-select下拉选择器",
|
||||||
|
"version": "1.0.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
@ -424,6 +426,11 @@
|
|||||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
|
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"tiny-pinyin": {
|
||||||
|
"version": "1.3.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/tiny-pinyin/-/tiny-pinyin-1.3.2.tgz",
|
||||||
|
"integrity": "sha512-uHNGu4evFt/8eNLldazeAM1M8JrMc1jshhJJfVRARTN3yT8HEEibofeQ7QETWQ5ISBjd6fKtTVBCC/+mGS6FpA=="
|
||||||
|
},
|
||||||
"to-fast-properties": {
|
"to-fast-properties": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
|
||||||
|
@ -12,5 +12,8 @@
|
|||||||
"前端组件",
|
"前端组件",
|
||||||
"通用组件"
|
"通用组件"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tiny-pinyin": "^1.3.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,8 @@
|
|||||||
<view class="head_top">
|
<view class="head_top">
|
||||||
<u-search placeholder="搜索小区、办公楼等" :showAction="false"></u-search>
|
<u-search placeholder="搜索小区、办公楼等" :showAction="false"></u-search>
|
||||||
<view style="height: 20rpx;"></view>
|
<view style="height: 20rpx;"></view>
|
||||||
<u-tabs
|
<u-tabs :list="tabsList" itemStyle="font-size: 32rpx;height: 74rpx;" :current="current" @change="changeCurrent"
|
||||||
:list="tabsList" itemStyle="font-size: 32rpx;height: 74rpx;"
|
lineColor="#FF6D20" lineWidth="105rpx" height="7rpx"></u-tabs>
|
||||||
:current="current"
|
|
||||||
@change="changeCurrent"
|
|
||||||
lineColor="#FF6D20"
|
|
||||||
lineWidth="105rpx"
|
|
||||||
height="7rpx"
|
|
||||||
></u-tabs>
|
|
||||||
</u-tabs>
|
</u-tabs>
|
||||||
</view>
|
</view>
|
||||||
</u-sticky>
|
</u-sticky>
|
||||||
@ -22,7 +16,9 @@
|
|||||||
<view class="re-title">当前位置: </view>
|
<view class="re-title">当前位置: </view>
|
||||||
<view>{{street}}</view>
|
<view>{{street}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="re-btn" @click="reGetLocation"><image class="re-address-img" src="@/static/images/re_address.png"></image>重新定位</view>
|
<view class="re-btn" @click="reGetLocation">
|
||||||
|
<image class="re-address-img" src="@/static/images/re_address.png"></image>重新定位
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="head_item_tips">
|
<view class="head_item_tips">
|
||||||
<view>附近地址</view>
|
<view>附近地址</view>
|
||||||
@ -36,12 +32,8 @@
|
|||||||
<view>泸州区县</view>
|
<view>泸州区县</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="area">
|
<view class="area">
|
||||||
<view class="area-item"
|
<view class="area-item" :class="{'area-item-on': item.code==area_change}" v-for="(item, index) in areaList"
|
||||||
:class="{'area-item-on': item.code==area_change}"
|
:key="index" @click="changeArea(item)">
|
||||||
v-for="(item, index) in areaList"
|
|
||||||
:key="index"
|
|
||||||
@click="changeArea(item)"
|
|
||||||
>
|
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -49,26 +41,10 @@
|
|||||||
<view>选择街道/镇</view>
|
<view>选择街道/镇</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="street">
|
<view class="street">
|
||||||
<view class="letter-item">
|
<view class="letter-item" v-for="key in mapKey" :key="key">
|
||||||
<view class="letter">A</view>
|
<view class="letter">{{key}}</view>
|
||||||
<view class="item-box">
|
<view class="item-box">
|
||||||
<view class="street-item" v-for="item in streetList.slice(0, 3)">
|
<view class="street-item" v-for="item in mapList[key]" :key="item.code" @click="changeStreet(item)">
|
||||||
{{item.name}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="letter-item">
|
|
||||||
<view class="letter">B</view>
|
|
||||||
<view class="item-box">
|
|
||||||
<view class="street-item" v-for="item in streetList.slice(3,5)">
|
|
||||||
{{item.name}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="letter-item">
|
|
||||||
<view class="letter">D</view>
|
|
||||||
<view class="item-box">
|
|
||||||
<view class="street-item" v-for="item in streetList.slice(5,10)">
|
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -80,14 +56,15 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getGeocoder,
|
getGeocoder,
|
||||||
merClassifly,
|
merClassifly,
|
||||||
getProductslist
|
getProductslist
|
||||||
} from '@/api/store.js';
|
} from '@/api/store.js';
|
||||||
import {
|
import {
|
||||||
getArea,
|
getArea,
|
||||||
getStreet
|
getStreet
|
||||||
} from "@/api/article.js";
|
} from "@/api/article.js";
|
||||||
|
import pinyin from "tiny-pinyin";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -104,6 +81,7 @@
|
|||||||
street: '',
|
street: '',
|
||||||
areaList: [],
|
areaList: [],
|
||||||
streetList: [],
|
streetList: [],
|
||||||
|
mapList: {},
|
||||||
area_change: '',
|
area_change: '',
|
||||||
street_change: '',
|
street_change: '',
|
||||||
}
|
}
|
||||||
@ -113,78 +91,111 @@
|
|||||||
this.loadArea();
|
this.loadArea();
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
|
computed: {
|
||||||
|
mapKey() {
|
||||||
|
return Object.keys(this.mapList).sort()
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeCurrent(e){
|
changeCurrent(e) {
|
||||||
this.current = e.index;
|
this.current = e.index;
|
||||||
},
|
},
|
||||||
getLoaction(){
|
getLoaction() {
|
||||||
this.street = '定位中'
|
this.street = '定位中'
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
timeout: '10',
|
timeout: '10',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
let latitude, longitude;
|
let latitude, longitude;
|
||||||
latitude = res.latitude.toString();
|
latitude = res.latitude.toString();
|
||||||
longitude = res.longitude.toString();
|
longitude = res.longitude.toString();
|
||||||
this.latitude = res.latitude.toFixed(6);
|
this.latitude = res.latitude.toFixed(6);
|
||||||
this.longitude = res.longitude.toFixed(6);
|
this.longitude = res.longitude.toFixed(6);
|
||||||
this.$store.commit('setLocation', {
|
this.$store.commit('setLocation', {
|
||||||
lat: res.latitude.toFixed(6),
|
lat: res.latitude.toFixed(6),
|
||||||
long: res.longitude.toFixed(6),
|
long: res.longitude.toFixed(6),
|
||||||
});
|
});
|
||||||
getGeocoder({
|
getGeocoder({
|
||||||
lat: latitude,
|
lat: latitude,
|
||||||
long: longitude
|
long: longitude
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.town = res.data.address_reference.town.title
|
this.town = res.data.address_reference.town.title
|
||||||
this.street_id = res.data.address_reference.town.id
|
this.street_id = res.data.address_reference.town.id
|
||||||
this.street = res.data.address_reference.town.title;
|
this.street = res.data.address_reference.town.title;
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err,
|
title: err,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
this.street = '定位失败'
|
this.street = '定位失败'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log('定位失败');
|
console.log('定位失败');
|
||||||
this.isshow = false
|
this.isshow = false
|
||||||
uni.setStorageSync("RejectTarget", true)
|
uni.setStorageSync("RejectTarget", true)
|
||||||
Toast('定位失败,请检查定位权限是否开启')
|
Toast('定位失败,请检查定位权限是否开启')
|
||||||
this.street = '定位失败'
|
this.street = '定位失败'
|
||||||
|
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: "获取定位超时",
|
// title: "获取定位超时",
|
||||||
// icon: 'none',
|
// icon: 'none',
|
||||||
// duration: 2000
|
// duration: 2000
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reGetLocation(){
|
reGetLocation() {
|
||||||
this.getLoaction()
|
this.getLoaction()
|
||||||
},
|
},
|
||||||
loadArea(){
|
loadArea() {
|
||||||
getArea({
|
getArea({
|
||||||
city_code: 510500
|
city_code: 510500
|
||||||
}).then((res)=>{
|
}).then((res) => {
|
||||||
this.areaList = res.data;
|
this.areaList = res.data;
|
||||||
this.changeArea(this.areaList[0]);
|
this.changeArea(this.areaList[0]);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loadStreet(area_code){
|
loadStreet(area_code) {
|
||||||
this.street_change = '';
|
this.street_change = '';
|
||||||
getStreet({
|
getStreet({
|
||||||
area_code
|
area_code
|
||||||
}).then((res)=>{
|
}).then((res) => {
|
||||||
this.streetList = res.data;
|
this.streetList = res.data;
|
||||||
|
this.initPinyin();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
changeArea(item){
|
initPinyin() {
|
||||||
|
this.mapList = {};
|
||||||
|
if (pinyin.isSupported()) {
|
||||||
|
this.streetList.forEach((item) => {
|
||||||
|
let str = pinyin.convertToPinyin(item.name[0]);
|
||||||
|
str = str[0] ? str[0] : '#';
|
||||||
|
if (this.mapList[str]) {
|
||||||
|
this.mapList[str].push(item);
|
||||||
|
} else {
|
||||||
|
this.mapList[str] = [];
|
||||||
|
this.mapList[str].push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.mapList['#'] = this.streetList;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeArea(item) {
|
||||||
this.area_change = item.code;
|
this.area_change = item.code;
|
||||||
this.loadStreet(this.area_change);
|
this.loadStreet(this.area_change);
|
||||||
|
},
|
||||||
|
changeStreet(item){
|
||||||
|
uni.navigateBack({
|
||||||
|
success: () => {
|
||||||
|
uni.$emit('changeAddress', {
|
||||||
|
area: this.area_change,
|
||||||
|
street: item
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
@ -194,18 +205,21 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page{
|
page {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.head_top {
|
.head_top {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 28rpx;
|
padding: 28rpx;
|
||||||
}
|
}
|
||||||
.address-box{
|
|
||||||
|
.address-box {
|
||||||
// background-color: red;
|
// background-color: red;
|
||||||
border-radius: 21rpx 21rpx 0rpx 0rpx;
|
border-radius: 21rpx 21rpx 0rpx 0rpx;
|
||||||
padding: 30rpx 28rpx;
|
padding: 30rpx 28rpx;
|
||||||
.head_item{
|
|
||||||
|
.head_item {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -214,47 +228,54 @@
|
|||||||
font-family: PingFang SC-Regular, PingFang SC;
|
font-family: PingFang SC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
.re-location{
|
|
||||||
|
.re-location {
|
||||||
display: flex;
|
display: flex;
|
||||||
.re-title{
|
|
||||||
|
.re-title {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
padding-right: 14rpx;
|
padding-right: 14rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.re-address-img{
|
|
||||||
|
.re-address-img {
|
||||||
width: 38.55rpx;
|
width: 38.55rpx;
|
||||||
height: 38.55rpx;
|
height: 38.55rpx;
|
||||||
margin-right: 14rpx;
|
margin-right: 14rpx;
|
||||||
}
|
}
|
||||||
.re-btn{
|
|
||||||
|
.re-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
padding-left: 14rpx;
|
padding-left: 14rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.head_item_tips{
|
|
||||||
|
.head_item_tips {
|
||||||
height: 44rpx;
|
height: 44rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
font-family: PingFang SC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #737373;
|
color: #737373;
|
||||||
}
|
}
|
||||||
.address-list{
|
|
||||||
|
.address-list {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
font-family: PingFang SC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
line-height: 75rpx;
|
line-height: 75rpx;
|
||||||
border-bottom: 1rpx solid rgba(0,0,0,0.1);
|
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.area{
|
.area {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
padding-top: 30rpx;
|
padding-top: 30rpx;
|
||||||
.area-item{
|
|
||||||
|
.area-item {
|
||||||
// width: 158rpx;
|
// width: 158rpx;
|
||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
// background: #F4F4F4;
|
// background: #F4F4F4;
|
||||||
@ -272,32 +293,43 @@
|
|||||||
margin-bottom: 22rpx;
|
margin-bottom: 22rpx;
|
||||||
margin-right: 22rpx;
|
margin-right: 22rpx;
|
||||||
}
|
}
|
||||||
.area-item-on{
|
|
||||||
|
.area-item-on {
|
||||||
// background-color: #F4F4F4;
|
// background-color: #F4F4F4;
|
||||||
color: #ff6d20;
|
color: #ff6d20;
|
||||||
// font-weight: bold;
|
// font-weight: bold;
|
||||||
border: 2rpx solid #ff6d20;
|
border: 2rpx solid #ff6d20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.street{
|
.street {
|
||||||
padding-top: 28rpx;
|
padding-top: 28rpx;
|
||||||
.letter-item{
|
|
||||||
|
.letter-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
.letter{
|
|
||||||
|
.letter {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-right: 28rpx;
|
margin-right: 28rpx;
|
||||||
font-size: 25rpx;
|
font-size: 25rpx;
|
||||||
font-family: PingFang SC, PingFang SC;
|
font-family: PingFang SC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
width: 40rpx;
|
||||||
|
text-align: center;
|
||||||
color: #737373;
|
color: #737373;
|
||||||
}
|
}
|
||||||
.street-item{
|
|
||||||
padding-bottom: 28rpx;
|
.item-box {
|
||||||
font-size: 28rpx;
|
flex: 1;
|
||||||
font-family: PingFang SC, PingFang SC;
|
|
||||||
font-weight: 400;
|
.street-item {
|
||||||
color: #333333;
|
width: 100%;
|
||||||
|
padding-bottom: 28rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-family: PingFang SC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -639,7 +639,6 @@
|
|||||||
that.filterMenus(item)
|
that.filterMenus(item)
|
||||||
that.personalMenu.push(item)
|
that.personalMenu.push(item)
|
||||||
})
|
})
|
||||||
|
|
||||||
that.imgUrls = res.data.banner
|
that.imgUrls = res.data.banner
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 624 KiB After Width: | Height: | Size: 638 KiB |
Loading…
x
Reference in New Issue
Block a user