133 lines
2.6 KiB
Vue
133 lines
2.6 KiB
Vue
<template>
|
|
<view class="bottom-navbar safe-area-inset-bottom">
|
|
<view class="left-actions">
|
|
<view class="action" @tap="onShare">
|
|
<u-icon name="share" color="#909399" size="50"></u-icon>
|
|
<text class="label">分享</text>
|
|
</view>
|
|
<view class="action" @tap="onCall">
|
|
<u-icon name="phone" color="#909399" size="50"></u-icon>
|
|
<text class="label">拨打电话</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="main-btn" @tap="onReserve">
|
|
<text class="label">预约看房</text>
|
|
</view>
|
|
<share ref="share" :assetId="assetId" />
|
|
</view>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
import share from '../share/share.vue';
|
|
|
|
export default {
|
|
name: 'assetBottomBar',
|
|
components: { share },
|
|
props: { assetId: [String, Number], phone: String },
|
|
methods: {
|
|
onShare() {
|
|
console.log("调用分享")
|
|
this.$refs.share.open()
|
|
},
|
|
onCall() {
|
|
if (!this.phone) {
|
|
return uni.showToast({ title: '暂无联系电话', icon: 'none' })
|
|
}
|
|
uni.makePhoneCall({
|
|
phoneNumber: this.phone
|
|
})
|
|
},
|
|
onReserve() {
|
|
this.$emit('reserve') // 通知父页面弹出预约弹窗
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.bottom-navbar {
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 170rpx;
|
|
background-color: #ffffff;
|
|
border-top: 1rpx solid #e5e5e5;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
z-index: 999;
|
|
box-shadow: 0 -4rpx 12rpx rgba(0, 0, 0, 0.06);
|
|
padding: 0 20rpx env(safe-area-inset-bottom);
|
|
}
|
|
|
|
/* 左侧按钮组 */
|
|
.left-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 20rpx;
|
|
}
|
|
.action {
|
|
width: 120rpx;
|
|
height: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
color: #333;
|
|
font-size: 24rpx;
|
|
}
|
|
.action:active {
|
|
background-color: #f6f6f6;
|
|
border-radius: 12rpx;
|
|
}
|
|
.icon {
|
|
width: 42rpx;
|
|
height: 42rpx;
|
|
margin-bottom: 6rpx;
|
|
}
|
|
.label {
|
|
font-size: 22rpx;
|
|
}
|
|
|
|
/* 蓝色描边主按钮(完全居中) */
|
|
.main-btn {
|
|
flex-shrink: 0;
|
|
width: 340rpx;
|
|
height: 88rpx;
|
|
border: 2rpx solid #FF2F31;
|
|
border-radius: 44rpx;
|
|
background-color: #ffffff;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: #FF2F31;
|
|
font-size: 30rpx;
|
|
font-weight: 500;
|
|
transition: all 0.2s;
|
|
}
|
|
.main-btn:active {
|
|
background-color: #e6f0ff;
|
|
border-color: #FF2F31;
|
|
color: #FF2F31;
|
|
}
|
|
|
|
/* 内部内容居中控制 */
|
|
.btn-content {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.btn-content .icon {
|
|
width: 38rpx;
|
|
height: 38rpx;
|
|
margin-right: 10rpx;
|
|
}
|
|
.btn-content .label {
|
|
font-size: 28rpx;
|
|
color: #FF2F31;
|
|
}
|
|
</style>
|