This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-04-26 11:12:29 +08:00
commit 317c575391
5 changed files with 28 additions and 10 deletions

View File

@ -84,8 +84,8 @@
default: '' default: ''
}, },
sale_type: { sale_type: {
type: String, type: [Number,String],
default: '' default: 1
} }
}, },
data() { data() {

View File

@ -628,7 +628,7 @@
long: longitude long: longitude
}).then(res => { }).then(res => {
let town = res.data.address_reference.town.title let town = res.data.address_reference.town.title
let street_id = street_id = res.data.address_reference.town.id let street_id = res.data.address_reference.town.id
this.street = res.data.address_reference.town.title; this.street = res.data.address_reference.town.title;
this.$store.commit('setAddress', { this.$store.commit('setAddress', {
street_id: street_id, street_id: street_id,
@ -637,6 +637,19 @@
uni.$emit('getLocation_succees', { uni.$emit('getLocation_succees', {
street_id, street_id,
}); });
uni.$emit('changeAddress', {
addr:{
address: res.data.address,
location: `${res.data.location.lat},${res.data.location.lng}`
},
area: res.data.ad_info.adcode,
latitude: res.data.location.lat,
longitude: res.data.location.lng,
street:{
code: street_id,
name: town
}
})
this.where.location = `${latitude},${longitude}`; this.where.location = `${latitude},${longitude}`;
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {

View File

@ -130,7 +130,7 @@
} }
</style> </style>
<template> <template>
<view class="gather"> <view class="gather" @click.stop="clickWhite">
<!--顶部定位--> <!--顶部定位-->
<view class="gather-header"> <view class="gather-header">
<view style="height: var(--status-bar-height);"></view> <view style="height: var(--status-bar-height);"></view>
@ -182,18 +182,18 @@
<view class="content"> <view class="content">
<block v-if="nowMenuList.length > 0"> <block v-if="nowMenuList.length > 0">
<u-transition v-for="(item, index) in nowMenuList" :key="item.name" show> <u-transition v-for="(item, index) in nowMenuList" :key="item.name" show>
<view class="examine" @click="editFlag ? removeMenu(item) : clickMenu(item)"> <view class="examine" @click.stop="editFlag ? removeMenu(item) : clickMenu(item)" @longpress="editFlag = true">
<image class="icon_img" :src="item.pic" mode="aspectFit"> <image class="icon_img" :src="item.pic" mode="aspectFit">
</image> </image>
<!-- <u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon> --> <!-- <u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon> -->
<view v-if="editFlag" class="icon" style="background-color: red;">隐藏</view> <view v-if="editFlag" class="icon" style="background-color: red;">删除</view>
<text class="text">{{ item.name }}</text> <text class="text">{{ item.name }}</text>
</view> </view>
</u-transition> </u-transition>
</block> </block>
<view class="add-box examine" <view class="add-box examine"
style="display: flex;justify-content: center;flex-direction: column;align-items: center;" style="display: flex;justify-content: center;flex-direction: column;align-items: center;"
@click="editFlag = true"> @click.stop="editFlag = true" @longpress="editFlag = true" v-if="!editFlag">
<view class="add-box-icon" <view class="add-box-icon"
style="margin-bottom: 14rpx; width:84rpx;height:84rpx;border: 2rpx solid #40AE36;border-radius: 10rpx;display: flex;justify-content: center;align-items: center;"> style="margin-bottom: 14rpx; width:84rpx;height:84rpx;border: 2rpx solid #40AE36;border-radius: 10rpx;display: flex;justify-content: center;align-items: center;">
<u-icon name="plus" size="25" :bold="true" color="#40AE36"></u-icon> <u-icon name="plus" size="25" :bold="true" color="#40AE36"></u-icon>
@ -209,7 +209,7 @@
</view> </view>
<view class="content"> <view class="content">
<u-transition v-for="(item, index) in AllMenuList" :key="item.name" show> <u-transition v-for="(item, index) in AllMenuList" :key="item.name" show>
<view class="examine" @click="pushMenu(item)"> <view class="examine" @click.stop="pushMenu(item)">
<image class="icon_img" :src="item.pic" mode="aspectFit"> </image> <image class="icon_img" :src="item.pic" mode="aspectFit"> </image>
<!-- <u-icon class="icon" name="plus-circle-fill"></u-icon> --> <!-- <u-icon class="icon" name="plus-circle-fill"></u-icon> -->
<view class="icon">添加</view> <view class="icon">添加</view>
@ -524,6 +524,10 @@
} }
}); });
}, },
//
clickWhite(){
if(this.editFlag) this.editFlag = false;
}
} }
}; };
</script> </script>

View File

@ -339,7 +339,8 @@ const open = (id = null) => {
uniMP: true, uniMP: true,
token: token, token: token,
avatar: avatar, avatar: avatar,
} },
// path: '/pages/index/index?unimp=true'
}, (ret) => { }, (ret) => {
uni.hideLoading(); uni.hideLoading();
if (0 != ret.code) { if (0 != ret.code) {

View File

@ -3,7 +3,7 @@ import {
uniMPgetLocation, uniMPgetLocation,
test test
} from "@/utils/uniMPfunction.js" } from "@/utils/uniMPfunction.js"
console.log(123)
export const initEvent = () => { export const initEvent = () => {
mp.onUniMPEventReceive(async (ret) => { mp.onUniMPEventReceive(async (ret) => {
console.log('小程序事件: ', ret); console.log('小程序事件: ', ret);