561 lines
17 KiB
Vue
561 lines
17 KiB
Vue
<template>
|
||
<view>
|
||
<!-- 页面其他内容 -->
|
||
<view class="page-content">
|
||
<!-- 这里可以添加页面的主要内容 -->
|
||
<view class="company-profile">
|
||
<view class="header">
|
||
<view class="avatar">
|
||
<image :src="imgage" mode="aspectFill" class="avatar-img" />
|
||
</view>
|
||
<view class="title">玉田房产</view>
|
||
<!-- <view class="badge">达人标识</view> -->
|
||
<!-- <view
|
||
:class="istae == true ? 'follow-btn' : 'stafollow-btn'"
|
||
@click="istae = !istae"
|
||
>关注</view
|
||
> -->
|
||
</view>
|
||
<view class="info-section">
|
||
<view class="info-item">
|
||
<text class="info-content"
|
||
>无终街是玉田房产业界专业的信息展示平台,提供全面及时的玉田房产资讯,给网友提供快捷专业房产信息,欢迎广大房产平台咨询0315-6198200</text
|
||
>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="card" v-for="(item, index) in list" :key="index">
|
||
<view class="card-header" @click="torout(item)">
|
||
<text class="title">{{ item.title }}</text>
|
||
<text class="subtitle">{{ item.conent }}</text>
|
||
</view>
|
||
<view class="card-body">
|
||
<view class="img-list">
|
||
<image
|
||
v-for="(imgUrl, imgIndex) in item.imglist"
|
||
:key="imgIndex"
|
||
:src="imgUrl"
|
||
mode="aspectFill"
|
||
class="list-img"
|
||
/>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="stats-row">
|
||
<view class="stat-item">
|
||
<text class="stat-number">
|
||
<image
|
||
v-if="item.xing"
|
||
@click="addxingfun(item, index)"
|
||
src="@/static/img/index/xing-2.png"
|
||
:style="stylie"
|
||
></image>
|
||
<image
|
||
v-else
|
||
src="@/static/img/index/xing.png"
|
||
@click="delxingfun(item, index)"
|
||
:style="stylie"
|
||
></image>
|
||
<text>
|
||
{{ item.xingnum }}
|
||
</text>
|
||
</text>
|
||
</view>
|
||
<view class="stat-item">
|
||
<text class="stat-number">
|
||
<image
|
||
v-if="item.fen"
|
||
@click="shareContent(item, index)"
|
||
src="@/static/img/index/fen.png"
|
||
:style="stylie"
|
||
></image>
|
||
<image
|
||
v-else
|
||
src="@/static/img/index/fen-2.png"
|
||
@click="shareContent(item, index)"
|
||
:style="stylie"
|
||
></image>
|
||
<text>
|
||
{{ item.fennum }}
|
||
</text>
|
||
</text>
|
||
</view>
|
||
<!-- 评论 -->
|
||
<view class="stat-item">
|
||
<text class="stat-number">
|
||
<text class="stat-number">
|
||
<image
|
||
v-if="item.ping"
|
||
@click="showCommentInput(item, index)"
|
||
src="@/static/img/index/ping.png"
|
||
:style="stylie"
|
||
></image>
|
||
<image
|
||
v-else
|
||
src="@/static/img/index/ping.png"
|
||
@click="showCommentInput(item, index)"
|
||
:style="stylie"
|
||
></image>
|
||
<text>
|
||
{{ item.pingnum }}
|
||
</text>
|
||
</text>
|
||
</text>
|
||
</view>
|
||
<view class="stat-item">
|
||
<text class="stat-number">
|
||
<image
|
||
v-if="item.xin"
|
||
@click="addisredfun(item, index)"
|
||
src="@/static/img/index/xin.png"
|
||
:style="stylie"
|
||
></image>
|
||
<image
|
||
v-else
|
||
src="@/static/img/index/xin-3.png"
|
||
@click="delisredfun(item, index)"
|
||
:style="stylie"
|
||
></image>
|
||
<text>
|
||
{{ item.xinnum }}
|
||
</text>
|
||
</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<!-- 自定义模态框 -->
|
||
<view v-if="showCommentModal" class="comment-modal">
|
||
<view class="modal-content">
|
||
<textarea
|
||
v-model="commentContent"
|
||
placeholder="请输入评论内容"
|
||
class="comment-input"
|
||
></textarea>
|
||
<view class="modal-buttons">
|
||
<button @click="cancelComment">取消</button>
|
||
<button @click="submitComment()">提交</button>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import imgage from "@/static/logn.png"; // 导入图片资源
|
||
import l1 from "@/static/img/index/l1.png"; // 导入图片资源
|
||
import l2 from "@/static/img/index/l2.png"; // 导入图片资源
|
||
import l3 from "@/static/img/index/l3.png"; // 导入图片资源
|
||
import l4 from "@/static/img/index/l4.png"; // 导入图片资源
|
||
import l5 from "@/static/img/index/l5.png"; // 导入图片资源
|
||
import l6 from "@/static/img/index/l6.png"; // 导入图片资源
|
||
export default {
|
||
data() {
|
||
return {
|
||
stylie: {
|
||
width: "20px", // 设置宽度为 20px
|
||
height: "20px", // 设置高度为 20px
|
||
marginRight: "10px", // 设置右边距为 10px
|
||
},
|
||
showCommentModal: false, // 控制模态框的显示
|
||
commentContent: "", // 评论内容
|
||
currentCommentIndex: -1,
|
||
currentCommentItem: null,
|
||
isred: false,
|
||
isrednum: 0,
|
||
imgage: imgage,
|
||
navTitle: [
|
||
{ id: "tabs" + 1, name: "房地产", pageid: 9 },
|
||
{ id: "tabs" + 2, name: "医疗", pageid: 10 },
|
||
{ id: "tabs" + 3, name: "教育", pageid: 11 },
|
||
{ id: "tabs" + 4, name: "商贸", pageid: 12 },
|
||
{ id: "tabs" + 5, name: "商超", pageid: 13 },
|
||
{ id: "tabs" + 6, name: "特色", pageid: 14 },
|
||
],
|
||
showDropdown: false,
|
||
currentTitle: "",
|
||
istae: true,
|
||
list: [
|
||
{
|
||
tp: "玉田房产",
|
||
img: "",
|
||
title: "年轻人买房你选对了吗?",
|
||
conent:
|
||
"年轻人买房🏠要🤔结合自己的未来规划。如果有换工作💼的可能,要考虑🧐房子是否便于适应新的工作🤔地点。对于有结婚生育计划🧐的人,房子的户型和面积是否能满足家庭结构变化的需求就🤔很重要。例如,考虑是否有足够🧐的房间给未来的孩子。同时,🤔还要考虑房子的🤔转手或出租的可能性,🤔因为未来可能会因为工作调动等🤔情况而需要转手房产或者出租,所以房子在市场上的受欢迎程度也需要🧐提前思考。看看下面内容你选对了吗?",
|
||
xin: false,
|
||
timer: "2025-06-01 12:00 玉田",
|
||
xinnum: 0,
|
||
xing: false,
|
||
xingnum: 0,
|
||
ping: false,
|
||
pingnum: 0,
|
||
pingcontent: [],
|
||
fen: false,
|
||
fennum: 0,
|
||
imglist: [l3, l2, l1],
|
||
},
|
||
{
|
||
tp: "玉田房产",
|
||
img: "",
|
||
title: "买二手房你需要知道知识点",
|
||
conent:
|
||
"购买二手房时,讲价是一个常见的环节,通过合理的讲价技巧,买家可以争取到更优惠的价格。以下是一些有效的讲价方法:了解市场行情:在开始讲价之前,买家需要对当地的房产市场有一个全面的了解。这包括了解相似房源的售价、市场供需状况以及经济环境等因素。通过这些信息,买家可以更准确地评估房屋的合理价格。准备充分的数据支持:在讲价时,提供具体的数据和事实支持是非常有帮助的。例如,可以指出房屋的某些不足之处,如装修老旧、设施不齐全等,并据此提出降价的理由。同时,也可以提供周边类似房源的成交价格作为参考。保持冷静和耐心:讲价过程中,保持冷静和耐心至关重要。不要急于做出决定,也不要在情绪的驱使下做出让步。通过冷静分析和耐心等待,往往能够获得更好的交易条件。利用中介的力量:如果通过房产中介进行交易,可以充分利用中介的专业知识和经验来进行讲价。中介通常对市场有深入的了解,并且能够提供专业的谈判策略。灵活运用多种讲价策略:讲价不仅仅是直接要求降价,还包括提出其他形式的优惠条件,如要求卖家承担部分税费、提供家具电器等。这些策略可以增加讲价的灵活性,提高成功率。了解房主卖房🏠的原因:了解房主是因为什么原因而卖房,是否急卖。比如,有的房主可能急卖房子,供孩子出国留学或者给家里的老人看病。这个时候,只要价格合适,哪怕低一点,房主也愿意出售。不要表露自己的喜好:遇到喜欢的房屋时,千万不能把你的欢喜表露出来。在这时应该不断的提出你不满意的地方,比如房子临街,就抱怨房子太吵;在一楼,就说太潮;住在高楼层,就说太高;如此种种。不论你怎么说,其目的就是打击房主的优势心理,让他知道自己的房子有太多的缺点,这样的房子我都愿意买,你还不降点价吗?",
|
||
xin: false,
|
||
timer: "2025-06-02 10:01 玉田",
|
||
xinnum: 0,
|
||
xing: false,
|
||
xingnum: 0,
|
||
ping: false,
|
||
pingnum: 0,
|
||
pingcontent: [],
|
||
fen: false,
|
||
fennum: 0,
|
||
imglist: [l4, l5, l6],
|
||
},
|
||
],
|
||
};
|
||
},
|
||
onLoad(options) {
|
||
if (options.name) {
|
||
this.passedName = options.name;
|
||
this.currentTitle = options.name; // 可以根据需求设置当前标题
|
||
}
|
||
},
|
||
methods: {
|
||
shareContent(item, index) {
|
||
uni.share({
|
||
provider: "weixin",
|
||
scene: "WXSceneTimeline", // 指定分享到朋友圈
|
||
type: 0,
|
||
href: "https://example.com", // 分享的链接,需替换为实际链接
|
||
title: "房产服务分享", // 分享标题
|
||
imageUrl: item.img || "https://example.com/default-image.jpg", // 分享图片,需替换为实际图片链接
|
||
success: () => {
|
||
this.list[index].fennum++;
|
||
this.list[index].fen = true;
|
||
uni.showToast({
|
||
title: "分享成功",
|
||
icon: "success",
|
||
duration: 2000,
|
||
});
|
||
},
|
||
fail: (err) => {
|
||
uni.showToast({
|
||
title: "分享失败,请重试",
|
||
icon: "none",
|
||
duration: 2000,
|
||
});
|
||
},
|
||
});
|
||
},
|
||
addisredfun(item, index) {
|
||
this.list[index].xinnum--;
|
||
this.list[index].xin = !this.list[index].xin;
|
||
},
|
||
delisredfun(item, index) {
|
||
if (this.list[index].xinnum == 0) {
|
||
this.list[index].xinnum++;
|
||
}
|
||
this.list[index].xin = !this.list[index].xin;
|
||
},
|
||
addxingfun(item, index) {
|
||
this.list[index].xingnum--;
|
||
this.list[index].xing = !this.list[index].xing;
|
||
},
|
||
delxingfun(item, index) {
|
||
if (this.list[index].xingnum == 0) {
|
||
this.list[index].xingnum++;
|
||
}
|
||
this.list[index].xing = !this.list[index].xing;
|
||
},
|
||
showCommentInput(item, index) {
|
||
this.showCommentModal = true;
|
||
this.currentCommentIndex = index;
|
||
this.currentCommentItem = item;
|
||
},
|
||
cancelComment() {
|
||
this.showCommentModal = false;
|
||
this.commentContent = "";
|
||
},
|
||
submitComment() {
|
||
if (this.commentContent.trim()) {
|
||
const userInfo = this.$options.filters.isLogin();
|
||
const currentDate = new Date();
|
||
const time = `${currentDate.getFullYear()}-${String(
|
||
currentDate.getMonth() + 1
|
||
).padStart(2, "0")}-${String(currentDate.getDate()).padStart(
|
||
2,
|
||
"0"
|
||
)} ${String(currentDate.getHours()).padStart(2, "0")}:${String(
|
||
currentDate.getMinutes()
|
||
).padStart(2, "0")}`;
|
||
this.list[this.currentCommentIndex].pingcontent.push({
|
||
img: userInfo.face, //图片
|
||
name: userInfo.nickName, //名字
|
||
content: this.commentContent, //内容
|
||
time: time, //时间
|
||
zannum: 0, //点赞数
|
||
iszan: false, // 点赞状态,默认为未赞
|
||
});
|
||
this.list[this.currentCommentIndex].pingnum++;
|
||
this.list[this.currentCommentIndex].ping = true;
|
||
}
|
||
this.showCommentModal = false;
|
||
this.commentContent = "";
|
||
uni.showToast({
|
||
title: "提交成功",
|
||
icon: "success",
|
||
duration: 2000,
|
||
});
|
||
},
|
||
// addpingfun(item, index) {
|
||
// this.list[index].pingnum--;
|
||
// this.list[index].ping = !this.list[index].ping;
|
||
// },
|
||
// delpingfun(item, index) {
|
||
// if (this.list[index].pingnum == 0) {
|
||
// this.list[index].pingnum++;
|
||
// }
|
||
// this.list[index].ping = !this.list[index].ping;
|
||
// },
|
||
|
||
torout(item) {
|
||
const itemJson = encodeURIComponent(JSON.stringify(item));
|
||
uni.navigateTo({
|
||
url: `/pages/tabbar/vlog/vlindexstr?item=${itemJson}`,
|
||
});
|
||
},
|
||
},
|
||
};
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
.nav-left,
|
||
.nav-right {
|
||
width: 100rpx;
|
||
text-align: center;
|
||
font-size: 32rpx;
|
||
color: #333333;
|
||
}
|
||
|
||
.nav-title {
|
||
flex: 1;
|
||
text-align: center;
|
||
font-size: 36rpx;
|
||
// font-weight: bold;
|
||
color: #333333;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
|
||
.dropdown-icon {
|
||
margin-left: 10rpx;
|
||
font-size: 28rpx;
|
||
}
|
||
}
|
||
|
||
.dropdown-menu {
|
||
position: absolute;
|
||
top: 160rpx;
|
||
left: 0;
|
||
right: 0;
|
||
background-color: #fff;
|
||
border: 1rpx solid #eee;
|
||
border-radius: 10rpx;
|
||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
|
||
z-index: 10;
|
||
margin: 0 20rpx;
|
||
|
||
.dropdown-item {
|
||
padding: 20rpx;
|
||
font-size: 32rpx;
|
||
color: #333;
|
||
border-bottom: 1rpx solid #eee;
|
||
|
||
&:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
&:active {
|
||
background-color: #f5f5f5;
|
||
}
|
||
}
|
||
}
|
||
|
||
.page-content {
|
||
padding: 20rpx;
|
||
}
|
||
.company-profile {
|
||
padding: 20px;
|
||
background: #fff;
|
||
// margin-bottom: 15px;
|
||
}
|
||
|
||
.header {
|
||
display: flex;
|
||
align-items: center;
|
||
// margin-bottom: 20px;
|
||
}
|
||
|
||
.title {
|
||
font-size: 18px;
|
||
font-weight: bold;
|
||
margin-right: 10px;
|
||
}
|
||
|
||
.badge {
|
||
background: #ffcc00;
|
||
color: #333;
|
||
padding: 2px 8px;
|
||
border-radius: 4px;
|
||
font-size: 12px;
|
||
margin-right: 10px;
|
||
}
|
||
|
||
.follow-btn {
|
||
color: #1890ff;
|
||
border: 1px solid #1890ff;
|
||
padding: 2px 10px;
|
||
border-radius: 4px;
|
||
font-size: 12px;
|
||
}
|
||
.stafollow-btn {
|
||
color: #ffffff;
|
||
border: 1px solid red;
|
||
background: red;
|
||
padding: 2px 10px;
|
||
border-radius: 4px;
|
||
font-size: 12px;
|
||
}
|
||
|
||
.info-section {
|
||
// border-top: 1px solid #eee;
|
||
padding-top: 10px;
|
||
}
|
||
|
||
.info-item {
|
||
margin-bottom: 12px;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.info-label {
|
||
font-weight: bold;
|
||
color: #333;
|
||
}
|
||
|
||
.info-content {
|
||
color: #666;
|
||
}
|
||
|
||
.avatar {
|
||
width: 40px;
|
||
height: 40px;
|
||
border-radius: 50%;
|
||
overflow: hidden;
|
||
margin-right: 10px;
|
||
}
|
||
|
||
.avatar-img {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
.card {
|
||
background-color: #ffffff;
|
||
border-radius: 8px;
|
||
padding: 16px;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||
margin-top: 10px;
|
||
}
|
||
|
||
.card-header {
|
||
margin-bottom: 16px;
|
||
}
|
||
|
||
.title {
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
color: #333;
|
||
display: block;
|
||
}
|
||
|
||
.subtitle {
|
||
font-size: 14px;
|
||
color: #666;
|
||
display: block;
|
||
// 新增样式控制两行显示
|
||
// overflow: hidden;
|
||
// display: -webkit-box;
|
||
// -webkit-box-orient: vertical;
|
||
// -webkit-line-clamp: 2; /* 限制显示两行 */
|
||
}
|
||
|
||
.stats-row {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
margin-top: 20px;
|
||
}
|
||
|
||
.stat-item {
|
||
flex: 1;
|
||
text-align: center;
|
||
}
|
||
|
||
.stat-number {
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
color: #1890ff;
|
||
display: flex; /* 弹性布局 */
|
||
justify-content: center; /* 水平居中 */
|
||
align-items: center; /* 垂直居中(关键) */
|
||
gap: 8rpx; /* 图片与文字间距 */
|
||
}
|
||
|
||
// 补充:确保图片和文字的垂直基准一致(可选)
|
||
.stat-number image {
|
||
vertical-align: middle; /* 图片垂直居中(兼容非 flex 场景) */
|
||
}
|
||
.comment-modal {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background-color: rgba(0, 0, 0, 0.5);
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
z-index: 999;
|
||
}
|
||
|
||
.modal-content {
|
||
background-color: #fff;
|
||
padding: 20px;
|
||
border-radius: 8px;
|
||
width: 80%;
|
||
}
|
||
|
||
.comment-input {
|
||
width: 100%;
|
||
height: 150px;
|
||
margin-bottom: 20px;
|
||
}
|
||
|
||
.modal-buttons {
|
||
display: flex;
|
||
justify-content: space-around;
|
||
}
|
||
.img-list {
|
||
display: flex;
|
||
// flex-wrap: wrap;
|
||
gap: 10px; /* 图片之间的间距 */
|
||
}
|
||
|
||
.list-img {
|
||
width: 250rpx; /* 图片宽度,根据需求调整 */
|
||
height: 250rpx; /* 图片高度,根据需求调整 */
|
||
border-radius: 8rpx; /* 图片圆角 */
|
||
object-fit: cover; /* 图片填充方式 */
|
||
}
|
||
</style>
|