提交 4a5a4638 作者: ZhangLingKun

修复:网点页面优化

上级 247a1dc6
......@@ -24,9 +24,9 @@
/>
</view>
</view>
<view class="content-info"> 浏览115 | 交易198 </view>
<view class="content-info"> 浏览{{ i.id }} | 交易{{ i.backUserAccountId }} </view>
</view>
<view class="content-type"> 航拍/航测 | CAAC证书 | 测绘乙级 </view>
<view class="content-type">{{ i.brandName }}</view>
<view class="content-location">
<image src="../../../../static/img/location.png" mode="widthFix" />
<text>{{ i.address }}</text>
......@@ -36,7 +36,7 @@
</view>
</scroll-view>
<scroll-view v-else class="list-view-click animate__animated animate__slideInRight" scroll-y>
<view v-for="(i, j) in list" :key="j" class="list-item" @click="handleSelect(j)">
<view v-for="(i, j) in getCurrentList" :key="j" class="list-item" @click="handleSelect(j)">
<image class="item-image" :src="i.brandLogo" mode="widthFix" />
<view class="item-content">
<view class="content-title">{{ i.companyName }}</view>
......@@ -47,9 +47,9 @@
</view>
<view class="serve-star">⭐⭐⭐⭐ </view>
</view>
<view class="content-info"> 浏览115 | 交易198 </view>
<view class="content-info"> 浏览{{ i.id }} | 交易{{ i.backUserAccountId }} </view>
</view>
<view class="content-type"> 航拍/航测 | CAAC证书 | 测绘乙级 </view>
<view class="content-type">{{ i.brandName }}</view>
<view class="content-location">
<image src="../../../../static/img/location.png" mode="widthFix" />
<text>{{ i.address }}</text>
......@@ -60,7 +60,7 @@
</view>
</template>
<script setup lang="ts">
import { onMounted, PropType } from 'vue'
import { computed, PropType, ref, watch } from 'vue'
import { InterListType } from '@/api/interface'
import { listCompanyInfoByCoopIdType } from '@/api/interface/common'
......@@ -74,6 +74,10 @@ const props = defineProps({
isclick: {
type: Boolean,
default: false
},
currentItem: {
type: Object as unknown as PropType<ListType[0]>,
default: () => ({})
}
})
// 事件
......@@ -82,10 +86,20 @@ const emits = defineEmits(['onSelect'])
const handleSelect = (j: number) => {
emits('onSelect', props.list[j])
}
// 组件挂载
onMounted(() => {
// console.log('列表组件 --->', props.list)
// 当前选择的项目
const currentItem = ref<ListType[0]>()
// 获取当前列表
const getCurrentList = computed(() => {
return props.list?.filter((i) => i.id === currentItem.value?.id)
})
// 监听变化
watch(
() => props.currentItem,
() => {
currentItem.value = props.currentItem
console.log(props.currentItem)
}
)
</script>
<style scoped lang="scss">
.network-list {
......@@ -123,7 +137,7 @@ onMounted(() => {
position: relative;
width: 100%;
margin-top: 14rpx;
font-family: PingFangSC-Medium, PingFang SC;
//font-family: PingFangSC-Medium, PingFang SC;
font-size: 20rpx;
font-weight: 400;
color: #888d9c;
......@@ -222,6 +236,8 @@ onMounted(() => {
height: 216rpx;
z-index: 30;
overflow-x: auto;
box-sizing: border-box;
padding-left: 16rpx;
.list-item {
position: relative;
display: flex;
......
......@@ -47,6 +47,7 @@
v-if="networkList.length !== 0"
:list="networkList"
:isclick="isclick"
:current-item="currentItem"
@on-select="handleSelect"
/>
<view v-else class="network-none">空空如也</view>
......@@ -176,7 +177,8 @@ import weChatSDK from 'z-weixin-ts'
layer: null,
parkList: [],
markers: [],
isclick:false,
isclick: false,
currentItem: {},
icon: {
type: 'image',
image: 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/b0364bd1-f193-4b93-ac9f-cfb6e2624d6b.png',
......@@ -249,10 +251,11 @@ import weChatSDK from 'z-weixin-ts'
position: element.position,
icon: this.icon,
});
console.log('labelMarker',labelMarker)
// console.log('labelMarker',labelMarker)
this.markers.push(labelMarker);
labelMarker.on('click', (e) => {
console.log('执行了--->',e)
this.currentItem = {...element,...this.networkList[index]};
// console.log('执行到此处 --->', {...element,...this.networkList[index]})
this.openInfo({...element,...this.networkList[index]});
this.isclick = true
});
......@@ -268,6 +271,12 @@ import weChatSDK from 'z-weixin-ts'
if (zoom > 5) this.map.setZoom(5); // 设置地图层级
}
// 展示当前定位
const marker = new AMap.Marker({
position: [this.location.lng, this.location.lat]
})
this.map.add(marker);
},
// 在指定位置打开信息窗体
openInfo(obj) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论