This commit is contained in:
2025-11-14 11:39:33 +08:00
parent 6e5d892992
commit 1ba633ba45
7143 changed files with 922330 additions and 0 deletions

330
pages/center/center.vue Normal file
View File

@@ -0,0 +1,330 @@
<template>
<view class="user-center">
<!-- 顶部用户信息 -->
<view class="user-header u-flex u-p-30">
<u-avatar :src="avatar" size="100"></u-avatar>
<view class="user-info u-m-l-20">
<!-- <view class="u-font-18 u-m-b-10">{{ userName }}</view> -->
<view class="u-font-18 u-m-b-10">吴康桥</view>
<view class="user-tag">用户类型: 个人</view>
<view class="user-tag">系统认证已认证</view>
</view>
<view class="msg-setting">
<view class="u-relative u-m-r-20" @click="toMessage()">
<u-icon name="chat" size="50" color="#333"></u-icon>
<u-badge count="2" type="error" absolute :offset="[2,-2]"></u-badge>
</view>
<u-icon name="setting" size="50" color="#333" @click="toSetting()"></u-icon>
</view>
</view>
<!-- 会员中心卡片 -->
<!-- <view class="vip-card">
<view class="vip-header u-flex u-row-between">
<view class="vip-title">会员中心</view>
</view>
<u-tabs :list="vipTabs" :current="currentTab" @change="tabChange"></u-tabs>
<u-row gutter="20" class="vip-benefits u-m-t-20">
<u-col span="3" v-for="(item,index) in benefits" :key="index">
<view class="benefit-item u-text-center">
<u-icon :name="item.icon" color="#111" size="50"></u-icon>
<view class="u-font-14 u-m-t-10">{{ item.name }}</view>
<view class="u-font-12 u-tips-color">{{ item.desc }}</view>
</view>
</u-col>
</u-row>
<view class="vip-upgrade-btn" @click="upgrade">超值优惠 升级立享</view>
</view> -->
<!-- 功能网格 -->
<!-- <view class="function-grid u-m-t-30">
<u-grid :col="4" :border="false">
<u-grid-item v-for="(item,index) in gridList" :key="index" @click="clickNav(item.url)">
<u-icon :name="item.icon" size="65" color="#333"></u-icon>
<text class="u-font-14 u-m-t-10" >{{ item.name }}</text>
</u-grid-item>
</u-grid>
</view> -->
<!-- <view class="function-grid">
<swiper
:indicator-dots="true"
class="swiper"
>
<swiper-item>
<u-grid :border="false">
<u-grid-item
:customStyle="{width:220+'rpx',height:220+'rpx'}"
v-for="(item, index) in gridList"
:index="index"
:key="index"
>
<u-icon
:customStyle="{paddingTop:20+'rpx'}"
:name="item.icon"
size="46" color="#333"
></u-icon>
<text class="u-font-14 u-m-t-10">{{item.name}}</text>
</u-grid-item>
</u-grid>
</swiper-item>
<swiper-item>
<u-grid :border="false">
<u-grid-item
:customStyle="{width:220+'rpx',height:220+'rpx'}"
v-for="(item, index) in gridList"
:index="index + 9"
:key="index"
>
<u-icon
:customStyle="{paddingTop:20+'rpx'}"
:name="item.icon"
size="46" color="#333"
></u-icon>
<text class="u-font-14 u-m-t-10">{{item.name}}</text>
</u-grid-item>
</u-grid>
</swiper-item>
<swiper-item>
<u-grid :border="false">
<u-grid-item
:customStyle="{width:220+'rpx',height:220+'rpx'}"
v-for="(item, index) in gridList"
:index="index + 18"
:key="index"
>
<u-icon
:customStyle="{paddingTop:20+'rpx'}"
:name="item.icon"
size="46" color="#333"
></u-icon>
<text class="u-font-14 u-m-t-10">{{item.name}}</text>
</u-grid-item>
</u-grid>
</swiper-item>
</swiper>
</view> -->
<view class="center-nav">
<u-row>
<u-col span="3" text-align="center" v-for="(item,index) in gridList" :key="index">
<view v-if="item.name=='问题反馈'">
<!-- 调用微信反馈功能 -->
<button type="default" open-type="feedback" class="clearBtn" hover-class="none" style="background-color: #FFFFFF;">
<u-icon :name="item.icon" color="#909399" size="50"></u-icon>
<view class="tabName" style="padding-top: 15rpx;">{{item.name}}</view>
</button>
</view>
<view @click="clickNav(item.url)" v-else>
<image :src="item.icon" style="width: 80rpx;height: 80rpx;" mode="widthFix"></image>
<view class="tabName">{{item.name}}</view>
</view>
</u-col>
</u-row>
</view>
<!-- 分隔条广告 -->
<!-- <view class="ad-banner u-m-t-20">
<image src="/static/ad-banner.png" mode="widthFix" style="width: 100%; border-radius: 12rpx;"></image>
</view> -->
<!-- 其他功能列表 -->
<view class="other-list u-m-t-20 cell-group">
<UCellItemPlus
v-for="(item, index) in cellList"
:key="index"
:title="item.title"
:icon="item.icon"
arrow
@click="clickNav(item.url)"
/>
</view>
</view>
</template>
<script>
import UCellItemPlus from "../../components/ucellitem/UCellItemPlus.vue";
import config from "@/common/config.js" // 全局配置文件
export default {
components: { UCellItemPlus },
data() {
return {
avatar:uni.getStorageSync('lifeData').vuex_user.user.avatar.includes(config.staticUrl)?uni.getStorageSync('lifeData').vuex_user.user.avatar:config.staticUrl+uni.getStorageSync('lifeData').vuex_user.user.avatar,
show:true,
gridList:[
{name:"我的合同",icon:"../../static/icon/我的合同.png",url:"pages/center/history"},
{name:"我的账单",icon:"../../static/icon/我的账单.png",url:"pages/bill/bill"},
{name:"我的待付",icon:"../../static/icon/我的待付.png",url:"pages/unpaid/unpaid"},
{name:"水电缴费",icon:"../../static/icon/水电缴费.png",url:"pages/wae/wae"}
],
cellList:[
{title:"我的租赁资产",icon:"star",function:"goTo",url:"pages/center/myLease"},
{title:"我的预约",icon:"star",function:"goTo",url:"pages/reserve/reserveRecords"},
{title:"缴费记录",icon:"star",function:"goTo",url:"pages/bill/payHistory"},
{title:"水电费明细",icon:"star",function:"goTo",url:"pages/wae/waeRecords"}
],
}
},
onLoad() {
uni.$on('updateAvatar', (obj) => {
// 获取数据
this.updateAvatar();
})
},
onUnload() {
// 移除监听事件
uni.$off('updateAvatar');
},
onShow(){
// 检查token
this.checkToken();
},
methods: {
logout() {
// 登录成功修改token与用户信息
this.$u.vuex('vuex_token', '');
this.$u.vuex('vuex_user', {});
this.$u.route('/pages/login/login')
},
profile(){
this.$u.route('/pages/profile/profile')
},
toMessage(){
this.$u.route('/pages/message/message')
},
toSetting(){
this.$u.route('/pages/profile/setting')
},
//拨打固定电话
callPhoneNumber() {
uni.makePhoneCall({
phoneNumber: "18720989281",
});
},
problem(){
this.$u.route({
url: 'pages/login/problem'
})
},
// 关于作者
aboutMe() {
this.$u.route('/pages/profile/aboutMe')
},
toMyLease(){
this.$u.route('/pages/center/myLease')
},
checkToken(){
// 判断是否有token
let lifeData = uni.getStorageSync('lifeData');
let token = lifeData.vuex_token
if(!token){
// 没有token 则跳转到登录
return uni.reLaunch({
url:'../login/login'
})
}else{
// 判断Token是否有效
let url = "/api/profile/isExpiration";
this.$u.get(url,{
token:token
}).then(obj => {
if(obj.data){
// 没有token过期则跳转到登录
return uni.reLaunch({
url:'../login/login'
})
}
});
}
},
code(){
this.$mytip.toast('敬请期待')
},
clickNav(url){
if(url){
this.$u.route(url);
}else{
this.$mytip.toast('敬请期待')
}
},
updateAvatar(){
this.avatar = uni.getStorageSync('lifeData').vuex_user.user.avatar.includes(config.staticUrl)?uni.getStorageSync('lifeData').vuex_user.user.avatar:config.staticUrl+uni.getStorageSync('lifeData').vuex_user.user.avatar
},
}
}
</script>
<style lang="scss" scoped>
.swiper {
height: 400rpx;
}
.user-center {
background-color: #f7f8fa;
min-height: 100vh;
padding: 15rpx;
}
.center-nav{
background-color: #FFFFFF;
margin-top: 30rpx;
padding: 30rpx 0;
border-radius: 8px;
.tabName{
color: #606266;
font-size: 26rpx;
padding-top: 10rpx;
}
}
.cell-group {
background-color: #fff;
border-radius: 16rpx;
overflow: hidden;
}
.cell-group > view:not(:last-child) {
border-bottom: 1rpx solid #f0f0f0;
}
/* 用户信息卡 */
.user-header {
align-items: center;
margin-top: 200rpx;
.user-info {
.user-tag {
background: #f6f6f6;
color: #ff8c00;
padding: 8rpx 12rpx;
border-radius: 8rpx;
font-size: 24rpx;
width: fit-content;
}
}
.msg-setting {
display: flex;
position: absolute;
right: 85rpx;
}
}
.vip-card {
margin: 20rpx;
padding: 30rpx;
background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
border-radius: 20rpx;
color: #fff;
.vip-title {
font-size: 30rpx;
font-weight: bold;
color: #f8e28e;
}
.vip-upgrade-btn {
margin-top: 30rpx;
background: linear-gradient(to right, #ffb347, #ffcc33);
color: #fff;
text-align: center;
padding: 20rpx 0;
border-radius: 40rpx;
font-weight: bold;
}
}
.function-grid {
margin: 0 20rpx;
padding: 20rpx 0;
}
</style>

View File

@@ -0,0 +1,187 @@
<template>
<view>
<u-navbar :is-back="false" title="我的" :border-bottom="false"></u-navbar>
<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-t-30 u-p-b-30">
<view class="u-flex" @click="profile">
<view class="u-m-r-20">
<u-avatar :src="avatar" size="140"></u-avatar>
</view>
<view class="u-flex-1">
<view class="u-font-18 u-p-b-20">{{vuex_user.user.userName}}</view>
<view class="u-font-14 u-tips-color">昵称:{{vuex_user.user.nickName}}</view>
<view class="u-font-14 u-tips-color">用户类型:个人</view>
</view>
</view>
</view>
<view class="center-nav">
<u-row>
<u-col span="3" text-align="center" v-for="(item,index) in navList" :key="index">
<view v-if="item.name=='问题反馈'">
<!-- 调用微信反馈功能 -->
<button type="default" open-type="feedback" class="clearBtn" hover-class="none" style="background-color: #FFFFFF;">
<u-icon :name="item.icon" color="#909399" size="50"></u-icon>
<view class="tabName" style="padding-top: 15rpx;">{{item.name}}</view>
</button>
</view>
<view @click="clickNav(item.url)" v-else>
<u-icon :name="item.icon" color="#909399" size="50"></u-icon>
<view class="tabName">{{item.name}}</view>
</view>
</u-col>
</u-row>
</view>
<view class="u-m-t-20">
<u-cell-group>
<!-- <u-cell-item icon="integral" title="实名认证" @click="setting"></u-cell-item> -->
<u-cell-item icon="setting" title="个人中心" @click="setting"></u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item icon="level" :arrow="false" title="技术支持" value="18720989281" @click="callPhoneNumber"></u-cell-item>
<u-cell-item icon="question-circle" title="常见问题" @click="problem"></u-cell-item>
<u-cell-item icon="star" title="关于我们" @click="aboutMe"></u-cell-item>
</u-cell-group>
</view>
</view>
</template>
<script>
import config from "@/common/config.js" // 全局配置文件
export default {
data() {
return {
avatar:uni.getStorageSync('lifeData').vuex_user.user.avatar.includes(config.staticUrl)?uni.getStorageSync('lifeData').vuex_user.user.avatar:config.staticUrl+uni.getStorageSync('lifeData').vuex_user.user.avatar,
show:true,
navList:[
{name:"我的合同",icon:"checkmark-circle",url:"pages/center/history"},
{name:"我的账单",icon:"heart",url:"pages/center/heart"},
{name:"消息通知",icon:"order",url:"pages/center/order"},
{name:"水电充值",icon:"info-circle"}
],
}
},
onLoad() {
uni.$on('updateAvatar', (obj) => {
// 获取数据
this.updateAvatar();
})
},
onUnload() {
// 移除监听事件
uni.$off('updateAvatar');
},
onShow(){
// 检查token
this.checkToken();
},
methods: {
logout() {
// 登录成功修改token与用户信息
this.$u.vuex('vuex_token', '');
this.$u.vuex('vuex_user', {});
this.$u.route('/pages/login/login')
},
profile(){
this.$u.route('/pages/profile/profile')
},
setting(){
this.$u.route('/pages/profile/setting')
},
//拨打固定电话
callPhoneNumber() {
uni.makePhoneCall({
phoneNumber: "18720989281",
});
},
problem(){
this.$u.route({
url: 'pages/login/problem'
})
},
// 关于作者
aboutMe() {
this.$u.route('/pages/profile/aboutMe')
},
checkToken(){
// 判断是否有token
let lifeData = uni.getStorageSync('lifeData');
let token = lifeData.vuex_token
if(!token){
// 没有token 则跳转到登录
return uni.reLaunch({
url:'../login/login'
})
}else{
// 判断Token是否有效
let url = "/api/profile/isExpiration";
this.$u.get(url,{
token:token
}).then(obj => {
if(obj.data){
// 没有token过期则跳转到登录
return uni.reLaunch({
url:'../login/login'
})
}
});
}
},
code(){
this.$mytip.toast('敬请期待')
},
clickNav(url){
if(url){
this.$u.route(url);
}else{
this.$mytip.toast('敬请期待')
}
},
updateAvatar(){
this.avatar = uni.getStorageSync('lifeData').vuex_user.user.avatar.includes(config.staticUrl)?uni.getStorageSync('lifeData').vuex_user.user.avatar:config.staticUrl+uni.getStorageSync('lifeData').vuex_user.user.avatar
},
}
}
</script>
<style lang="scss">
.user-box{
background-color: #fff;
justify-content: space-between;
}
.center-nav{
background-color: #FFFFFF;
margin-top: 30rpx;
padding: 30rpx 0;
border-radius: 8px;
.tabName{
color: #606266;
font-size: 26rpx;
padding-top: 10rpx;
}
}
.qiandao{
color: #606266;
font-size: 24rpx;
margin-right: 24rpx;
margin-top: 54rpx;
justify-content:center;
align-items: center;
}
.clearBtn{
margin:0;
padding: 0;
line-height: 1;
background-color: #FFFFFF;
}
.clearBtn::after{
position: unset !important;
border: unset;
}
</style>

264
pages/center/contract.vue Normal file
View File

@@ -0,0 +1,264 @@
<template>
<view class="contract-page">
<!-- 顶部导航栏 -->
<customNavbar title="我的合同"/>
<!-- 顶部筛选栏 -->
<u-tabs
:list="tabList"
:current="currentTab"
@change="onTabChange"
lineColor="#2979ff"
activeColor="#2979ff"
></u-tabs>
<!-- 合同列表 -->
<scroll-view
scroll-y
class="scroll-content"
@scrolltolower="loadMore"
:refresher-enabled="true"
:refresher-triggered="isRefreshing"
@refresherrefresh="refresh"
>
<view v-if="contracts.length > 0" class="contract-list">
<view
class="contract-card"
v-for="item in contracts"
:key="item.id"
@click="goDetail(item)"
>
<!-- 左侧封面图 -->
<image
class="contract-cover"
:src="item.coverUrl || defaultCover"
mode="aspectFill"
/>
<!-- 右侧信息 -->
<view class="contract-info">
<view class="top-row">
<text class="asset-name">{{ item.assetName }}</text>
<u-icon name="arrow-right" size="28" color="#ccc" />
</view>
<view class="asset-room">{{ item.assetRoom || '—' }}</view>
<view class="date-range">{{ item.startDate }} ~ {{ item.endDate }}</view>
<view :class="['status-tag', item.status]">
{{ getStatusText(item.status) }}
</view>
</view>
</view>
<u-loadmore :status="loadStatus" />
</view>
<view v-else class="empty">
<u-empty mode="list" text="暂无合同记录" />
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
tabList: [
{ name: '全部', value: 'all' },
{ name: '待签署', value: 'pending' },
{ name: '已签署', value: 'signed' },
{ name: '已过期', value: 'expired' }
],
currentTab: 0,
statusFilter: 'all',
contracts: [],
pageNo: 1,
pageSize: 10,
loadStatus: 'loadmore',
isRefreshing: false,
defaultCover: '/static/img/index/swiper/swiper3.jpg' // 可换成你的默认封面
};
},
onLoad() {
this.loadContracts();
},
methods: {
onTabChange(index) {
this.currentTab = index;
this.statusFilter = this.tabList[index].value;
this.pageNo = 1;
this.contracts = [];
this.loadContracts();
},
loadContracts() {
this.loadStatus = 'loading';
setTimeout(() => {
const allData = [
{
id: 1,
assetName: '金辉大厦',
assetRoom: '502',
coverUrl: '/static/img/index/swiper/swiper3.jpg',
status: 'pending',
startDate: '2025-01-01',
endDate: '2025-12-31'
},
{
id: 2,
assetName: '东方广场',
assetRoom: '',
coverUrl: '/static/img/index/swiper/swiper3.jpg',
status: 'signed',
startDate: '2024-03-01',
endDate: '2025-03-01'
},
{
id: 3,
assetName: '海景公寓',
assetRoom: 'A-1201',
coverUrl: '/static/img/index/swiper/swiper3.jpg',
status: 'expired',
startDate: '2023-01-01',
endDate: '2024-01-01'
}
];
const filtered =
this.statusFilter === 'all'
? allData
: allData.filter(i => i.status === this.statusFilter);
this.contracts = filtered;
this.loadStatus = 'nomore';
this.isRefreshing = false;
}, 400);
},
refresh() {
this.isRefreshing = true;
this.pageNo = 1;
this.loadContracts();
},
loadMore() {
if (this.loadStatus === 'nomore') return;
this.pageNo++;
this.loadContracts();
},
goDetail(item) {
console.log('跳转合同详情页')
uni.navigateTo({
url: `/pages/detail/contractDetail?id=${item.id}`
});
},
getStatusText(status) {
switch (status) {
case 'pending':
return '待签署';
case 'signed':
return '已签署';
case 'expired':
return '已过期';
default:
return '';
}
}
}
};
</script>
<style lang="scss" scoped>
.contract-page {
background-color: #f8f8f8;
padding-top: 175rpx; /* 给导航栏留空间 */
min-height: 100vh;
}
.scroll-content {
height: calc(100vh - 100rpx);
}
.contract-list {
padding: 20rpx;
}
.contract-card {
display: flex;
background: #fff;
border-radius: 16rpx;
margin-bottom: 20rpx;
padding: 20rpx;
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
position: relative;
}
.contract-cover {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
background-color: #f0f0f0;
flex-shrink: 0;
}
.contract-info {
flex: 1;
margin-left: 20rpx;
display: flex;
flex-direction: column;
position: relative;
}
.top-row {
display: flex;
justify-content: space-between;
align-items: center;
.asset-name {
font-size: 30rpx;
font-weight: bold;
color: #333;
flex: 1;
}
}
.asset-room {
font-size: 26rpx;
color: #555;
margin-top: 10rpx;
}
.date-range {
font-size: 24rpx;
color: #888;
margin-top: 8rpx;
}
.status-tag {
position: absolute;
bottom: 10rpx;
right: 0rpx;
padding: 6rpx 16rpx;
border-radius: 24rpx;
font-size: 24rpx;
&.pending {
background: #fff8e1;
color: #ff9800;
}
&.signed {
background: #e8f5e9;
color: #4caf50;
}
&.expired {
background: #fbe9e7;
color: #e53935;
}
}
.empty {
margin-top: 200rpx;
}
</style>

292
pages/center/heart.vue Normal file
View File

@@ -0,0 +1,292 @@
<template>
<view>
<u-navbar :is-back="true" title="收藏" :border-bottom="false"></u-navbar>
<view class="wrap">
<scroll-view scroll-y style="height: 100%;width: 100%;">
<view class="page-box">
<view v-if="heartList.length === 0">
<view class="centre">
<image :src="empty" mode=""></image>
<view class="explain">
您还没有收藏的房源
<view class="tips">可以去逛逛</view>
</view>
<view class="btn" @click="goHome">首页</view>
</view>
</view>
<view v-else
class="order" v-for="(item, index) in heartList" :key="index"
@click="viewImage(item.id)">
<view class="top">
<view class="left">
<view class="store">{{ item.code }}</view>
<u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
</view>
</view>
<view class="item">
<view class="left"><image :src="item.image" mode="aspectFill"></image></view>
<view class="content">
<view class="title u-line-2">
{{item.villageName}} {{item.type == '整租' ? item.houseNum + item.houseHall + item.toiletNum : item.roomType}}
</view>
<view class="price">¥{{item.price}}</view>
<view class="type">
{{item.type}} | {{item.type == '整租' ? item.houseArea : item.roomArea}} | {{item.decoration}}
</view>
</view>
</view>
<view class="bottom">
<view class="evaluate btn" @click="viewImage(item.id)">查看</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import config from "@/common/config.js" // 全局配置文件
export default {
data() {
return {
empty:'/static/empty/default.png',
heartList: [],
pageNum: 1,
pageSize: 100,
};
},
onLoad() {
this.findHeartList();
},
methods: {
findHeartList() {
let url = "/api/houseApi/findHouseHeartList";
let lifeData = uni.getStorageSync('lifeData');
let vuex_user = lifeData.vuex_user
this.$u.get(url,{
userId:vuex_user.user.userId,
pageNum: this.pageNum,
pageSize: this.pageSize,
orderByColumn: 'update_time,create_time',
isAsc: 'desc'
}
).then(result => {
const data = result.rows;
this.houseList = data;
for (let i = 0; i < this.houseList.length; i++) {
// 先转成字符串再转成对象,避免数组对象引用导致数据混乱
let item = this.houseList[i]
if(!item.faceUrl.includes(config.staticUrl)){
item.image = config.staticUrl+item.faceUrl
}else{
item.image = item.faceUrl
}
if(item.type == 0){
item.type = '整租'
}else if(item.type == 1){
item.type = '合租'
}
if(item.roomType == 1){
item.roomType = '主卧'
}else if(item.roomType == 2){
item.roomType = '次卧'
}else{
item.roomType = '未知'
}
if(this.$u.test.isEmpty(item.houseNum)){
item.houseNum = ''
}
if(this.$u.test.isEmpty(item.houseHall)){
item.houseHall = ''
}
if(this.$u.test.isEmpty(item.toiletNum)){
item.toiletNum = ''
}
this.heartList.push(item);
}
});
},
goHome(){
uni.switchTab({
url: '/pages/index/index'
})
},
viewImage(houseId){
this.$u.route({
url: '/pages/detail/detail',
params: {
houseId: houseId
}
})
}
}
};
</script>
<style>
/* #ifndef H5 */
page {
height: 100%;
background-color: #f2f2f2;
}
/* #endif */
</style>
<style lang="scss" scoped>
.container{
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
.empty{
overflow: hidden;
.tip{
color: #909399 ;
}
.btn {
color:#fff ;
background-color: #2979ff;
width:200rpx;
padding: 15rpx 28rpx;
border-radius: 130rpx;
margin: 30rpx 0 0 100rpx;
}
}
}
.order {
width: 710rpx;
background-color: #ffffff;
margin: 20rpx auto;
border-radius: 20rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 28rpx;
.top {
display: flex;
justify-content: space-between;
.left {
display: flex;
align-items: center;
.store {
// margin: 0 10rpx;
font-size: 32rpx;
}
}
.right {
color: #2979ff;
}
}
.item {
display: flex;
margin: 20rpx 0 0 0;
.left {
margin-right: 30rpx;
image {
width: 150rpx;
height: 150rpx;
border-radius: 10rpx;
}
}
.content {
.title {
font-weight: bold;
font-size: 28rpx;
line-height: 50rpx;
}
.price{
margin: 10rpx 0;
font-size: 30rpx;
}
.type {
margin: 10rpx 0;
font-size: 24rpx;
color: $u-tips-color;
}
.desc {
margin: 10rpx 0;
font-size: 24rpx;
color: $u-tips-color;
}
}
}
.bottom {
display: flex;
margin-top: 20rpx;
padding: 0 10rpx;
justify-content: flex-end;
align-items: center;
.btn {
margin-left: 20rpx;
line-height: 52rpx;
width: 160rpx;
border-radius: 26rpx;
border: 2rpx solid $u-border-color;
font-size: 26rpx;
text-align: center;
color: $u-type-info-dark;
}
.evaluate {
color: $u-tips-color;
}
}
}
.centre {
text-align: center;
margin: 200rpx auto;
font-size: 32rpx;
image {
width: 164rpx;
height: 164rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
.tips {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
.btn {
margin: 80rpx auto;
width: 200rpx;
border-radius: 32rpx;
line-height: 64rpx;
color: #ffffff;
font-size: 26rpx;
background-image:linear-gradient(to left,#2979ff,rgba(#2979ff,0.6));
}
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top));
width: 100%;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
.buttom {
.loginType {
font-size: 14px;
position: fixed;
right: 30rpx;
bottom: 120rpx;
width: 60px;
height: 60px;
padding: 4px;
cursor: pointer;
background: #FFF;
text-align: center;
line-height: 60px;
border-radius: 100%;
-webkit-box-shadow: 0px 1px 20px 0px rgba(0,0,0,0.1),inset 0px -1px 0px 0px rgba(0,0,0,0.1);
box-shadow: 0px 1px 20px 0px rgba(0,0,0,0.1),inset 0px -1px 0px 0px rgba(0,0,0,0.1);
}
}
</style>

233
pages/center/history.vue Normal file
View File

@@ -0,0 +1,233 @@
<template>
<view>
<u-navbar :is-back="true" title="浏览记录" :border-bottom="false">
<view class="u-nav-slot" slot="right" @click="clearHistory">
<u-icon name="trash"></u-icon>
清除
</view>
</u-navbar>
<scroll-view scroll-y style="height: 100%;width: 100%;">
<view class="page-box">
<view v-if="houseHistory.length === 0">
<view class="centre">
<image :src="empty" mode=""></image>
<view class="explain">
您还没有浏览过的房源
<view class="tips">可以去逛逛</view>
</view>
<view class="btn" @click="goHome">首页</view>
</view>
</view>
<view v-else class="order" v-for="(item, index) in houseHistory" :key="index"
@click="clickImage(item.id)">
<view class="top">
<view class="left">
<view class="store">{{ item.code }}</view>
<u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
</view>
</view>
<view class="item">
<view class="left"><image :src="item.faceUrl" mode="aspectFill"></image></view>
<view class="content">
<view class="title u-line-2">
{{item.villageName}} {{item.type == '整租' ? item.houseNum + item.houseHall + item.toiletNum : item.roomType}}
</view>
<view class="price">¥{{item.price}}</view>
<view class="type">
{{item.type}} | {{item.type == '整租' ? item.houseArea : item.roomArea}} | {{item.decoration}}
</view>
</view>
</view>
<view class="bottom">
<view class="evaluate btn" @click="clickImage(item.id)">查看</view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
import config from "@/common/config.js" // 全局配置文件
export default {
data() {
return {
empty:'/static/empty/default.png',
houseHistory:uni.getStorageSync('houseHistory').reverse()
};
},
onLoad() {
},
methods: {
clickImage(houseId) {
this.$u.route({
url: '/pages/detail/detail',
params: {
houseId: houseId
}
})
},
goHome(){
uni.switchTab({
url: '/pages/index/index'
})
},
clearHistory(){
// 清除搜索记录
uni.showModal({
title: '提示',
content: '是否清除浏览记录?',
cancelText: '取消',
confirmText: '确认',
success: res => {
if(res.confirm){
uni.removeStorageSync('houseHistory');
this.houseHistory = []
this.$mytip.toast('清除成功')
}
}
});
}
}
};
</script>
<style>
/* #ifndef H5 */
page {
height: 100%;
background-color: #f2f2f2;
}
/* #endif */
</style>
<style lang="scss" scoped>
.u-nav-slot{
color: $u-tips-color;
font-weight: normal;
font-size: 28rpx;
margin-right: 30rpx;
}
.container{
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
.empty{
overflow: hidden;
.tip{
color: #909399 ;
}
.btn {
color:#fff ;
background-color: #909399;
width:200rpx;
padding: 15rpx 28rpx;
border-radius: 130rpx;
margin: 30rpx 0 0 100rpx;
}
}
}
.order {
width: 710rpx;
background-color: #ffffff;
margin: 20rpx auto;
border-radius: 20rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 28rpx;
.top {
display: flex;
justify-content: space-between;
.left {
display: flex;
align-items: center;
.store {
// margin: 0 10rpx;
font-size: 32rpx;
}
}
.right {
color: #2979ff;
}
}
.item {
display: flex;
margin: 20rpx 0 0;
.left {
margin-right: 30rpx;
image {
width: 150rpx;
height: 150rpx;
border-radius: 10rpx;
}
}
.content {
.title {
font-weight: bold;
font-size: 28rpx;
line-height: 50rpx;
}
.price{
margin: 10rpx 0;
font-size: 30rpx;
}
.type {
margin: 10rpx 0;
font-size: 24rpx;
color: $u-tips-color;
}
}
}
.bottom {
display: flex;
// margin-top: 40rpx;
padding: 0 10rpx;
justify-content: flex-end;
align-items: center;
.btn {
margin-left: 20rpx;
line-height: 52rpx;
width: 160rpx;
border-radius: 26rpx;
border: 2rpx solid $u-border-color;
font-size: 26rpx;
text-align: center;
color: $u-type-info-dark;
}
.evaluate {
color: $u-tips-color;
border-color: $u-tips-color;
}
}
}
.centre {
text-align: center;
margin: 200rpx auto;
font-size: 32rpx;
image {
width: 164rpx;
height: 164rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
.tips {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
.btn {
margin: 80rpx auto;
width: 200rpx;
border-radius: 32rpx;
line-height: 64rpx;
color: #ffffff;
font-size: 26rpx;
background-image:linear-gradient(to left,#2979ff,rgba(#2979ff,0.6));
}
}
</style>

149
pages/center/myLease.vue Normal file
View File

@@ -0,0 +1,149 @@
<template>
<view class="page">
<!-- 顶部自定义导航栏 -->
<customNavbar title="我的租赁资产" />
<!-- 筛选栏 -->
<!-- <view class="filter-bar">
<u-button
v-for="(item, index) in filters"
:key="index"
:type="currentFilter === item.value ? 'primary' : 'default'"
size="mini"
class="filter-btn"
@click="changeFilter(item.value)"
>
{{ item.label }}
</u-button>
</view> -->
<!-- 租赁资产列表组件 -->
<scroll-view
scroll-y
class="scroll-content"
@scrolltolower="loadMore"
>
<asset-list
:list="assetList"
:load-status="loadStatus"
@click="goDetail"
/>
</scroll-view>
</view>
</template>
<script>
import AssetList from '@/components/asset/assetList.vue'
export default {
name: 'MyLease',
components: { AssetList},
data() {
return {
filters: [
{ label: '全部', value: 'all' },
{ label: '进行中', value: 'active' },
{ label: '即将到期', value: 'expiring' },
{ label: '已到期', value: 'expired' },
],
currentFilter: 'all',
assetList: [],
pageNo: 1,
pageSize: 10,
loadStatus: 'loadmore',
};
},
onLoad() {
this.loadAssets();
},
methods: {
changeFilter(value) {
if (this.currentFilter === value) return;
this.currentFilter = value;
this.pageNo = 1;
this.assetList = [];
this.loadAssets();
},
loadAssets() {
this.loadStatus = 'loading';
setTimeout(() => {
const mock = [
{
id: 1,
name: '科技园写字楼 501',
address: '深圳市南山区科兴科学园 A 栋',
// statusText: '进行中',
// status: 'active',
cover: '/static/img/index/swiper/swiper3.jpg',
},
{
id: 2,
name: '万科公寓 2101',
address: '龙华区民治街道梅龙路 8 号',
// statusText: '已到期',
// status: 'expired',
cover: '/static/img/index/swiper/swiper3.jpg',
},
];
let filtered = mock;
if (this.currentFilter !== 'all') {
filtered = mock.filter(item => item.status === this.currentFilter);
}
this.assetList = this.pageNo === 1 ? filtered : [...this.assetList, ...filtered];
this.loadStatus = 'nomore';
}, 500);
},
loadMore() {
if (this.loadStatus === 'nomore') return;
this.pageNo++;
this.loadAssets();
},
goDetail(item) {
uni.navigateTo({
url: `/pages/detail/assetsDetail?id=${item.id}`,
});
},
},
};
</script>
<style lang="scss" scoped>
.page {
display: flex;
flex-direction: column;
height: 100vh;
background: #f7f8fa;
padding-top: 175rpx;
}
.filter-bar {
display: flex;
justify-content: space-around;
align-items: center;
background-color: #fff;
padding: 20rpx 0;
margin-top: var(--custom-navbar-height);
border-bottom: 1rpx solid #f0f0f0;
.filter-btn {
min-width: 150rpx;
text-align: center;
font-size: 26rpx;
height: 60rpx;
line-height: 60rpx;
border-radius: 40rpx;
margin: 0 8rpx;
}
}
.scroll-content {
flex: 1;
height: calc(100vh - 200rpx);
}
</style>

364
pages/center/order.vue Normal file
View File

@@ -0,0 +1,364 @@
<template>
<view>
<u-navbar :is-back="true" title="我的委托" :border-bottom="false"></u-navbar>
<view class="wrap">
<view class="u-tabs-box">
<u-tabs-swiper activeColor="#2979ff" ref="tabs" :list="list" :current="current" @change="change" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view>
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item class="swiper-item" v-for="(swiper,i) in orderList" :key="i">
<scroll-view scroll-y style="height: 100%;width: 100%;">
<view class="page-box">
<view v-if="swiper.length === 0">
<view class="centre">
<image :src="empty" mode=""></image>
<view class="explain">
您还没有相关的房源
<view class="tips">可以去委托房源</view>
</view>
<view class="btn" @click="publishHouse">委托房源</view>
</view>
</view>
<view v-else
class="order" v-for="(item, index) in swiper" :key="index">
<view class="top">
<view class="left">
<view class="store">{{ item.code }}</view>
<u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
</view>
</view>
<view class="item">
<view class="left"><image :src="item.image" mode="aspectFill"></image></view>
<view class="content">
<view class="title u-line-2">
{{item.villageName}} {{item.type == '整租' ? item.houseNum + item.houseHall + item.toiletNum : item.roomType}}
</view>
<view class="price">¥{{item.price}}</view>
<view class="type">
{{item.type}} | {{item.type == '整租' ? item.houseArea : item.roomArea}} | {{item.decoration}}
</view>
</view>
</view>
<view class="bottom">
<view v-if="item.state == 0" class="evaluate btn" @click.stop="clickImage(item.id)">修改</view>
<view v-else class="evaluate btn" @click.stop="viewImage(item.id)">查看</view>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
<view class="buttom">
<view class="loginType">
<view class="wechat item">
<view class="icon"><u-icon size="60" name="server-man" color="#999" @click="server"></u-icon></view>
</view>
</view>
</view>
</view>
</template>
<script>
import config from "@/common/config.js" // 全局配置文件
export default {
data() {
return {
empty:'/static/empty/default.png',
orderList: [[], [], [], []],
list: [
{
name: '待审核'
},
{
name: '待出租',
// count: 1
},
{
name: '已出租'
},
{
name: '已下架',
}
],
current: 0,
swiperCurrent: 0,
tabsHeight: 0,
dx: 0,
pageNum: 1,
pageSize: 100,
};
},
onLoad() {
this.getOrderList(0);
this.getOrderList(1);
this.getOrderList(2);
this.getOrderList(3);
},
methods: {
login(){
this.$u.route('/pages/login/login')
},
// 页面数据
getOrderList(idx) {
this.findHouseList(idx)
},
// tab栏切换
change(index) {
this.swiperCurrent = index;
this.orderList[index] = []
this.getOrderList(index);
},
transition({ detail: { dx } }) {
this.$refs.tabs.setDx(dx);
},
animationfinish({ detail: { current } }) {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
findHouseList(idx) {
let url = "/api/houseApi/findHouseRoomList";
let defaultData = {
state:idx,
publishId:uni.getStorageSync('lifeData').vuex_user.user.userId,
villageCity:uni.getStorageSync('lifeData').vuex_city,
pageNum: this.pageNum,
pageSize: this.pageSize,
orderByColumn: 'update_time,create_time',
isAsc: 'desc'
}
this.$u.get(url, {...defaultData,...this.searchData}).then(result => {
const data = result.rows;
this.houseList = data;
for (let i = 0; i < this.houseList.length; i++) {
// 先转成字符串再转成对象,避免数组对象引用导致数据混乱
let item = this.houseList[i]
if(!item.faceUrl.includes(config.staticUrl)){
item.image = config.staticUrl+item.faceUrl
}else{
item.image = item.faceUrl
}
if(item.type == 0){
item.type = '整租'
}else if(item.type == 1){
item.type = '合租'
}
if(item.roomType == 1){
item.roomType = '主卧'
}else if(item.roomType == 2){
item.roomType = '次卧'
}else{
item.roomType = '未知'
}
if(this.$u.test.isEmpty(item.houseNum)){
item.houseNum = ''
}
if(this.$u.test.isEmpty(item.houseHall)){
item.houseHall = ''
}
if(this.$u.test.isEmpty(item.toiletNum)){
item.toiletNum = ''
}
this.orderList[idx].push(item);
}
});
},
publishHouse(){
this.$u.route('/pages/detail/preHouse');
},
server(){
// window.open ('https://sourcebyte.cn')
uni.makePhoneCall({
phoneNumber: "18720989281",
});
},
clickImage(houseId) {
this.$u.route({
url: '/pages/detail/preHouse',
params: {
houseId: houseId
}
})
},
viewImage(houseId){
this.$u.route({
url: '/pages/detail/detail',
params: {
houseId: houseId
}
})
}
}
};
</script>
<style>
/* #ifndef H5 */
page {
height: 100%;
background-color: #f2f2f2;
}
/* #endif */
</style>
<style lang="scss" scoped>
.container{
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
.empty{
overflow: hidden;
.tip{
color: #909399 ;
}
.btn {
color:#fff ;
background-color: #2979ff;
width:200rpx;
padding: 15rpx 28rpx;
border-radius: 130rpx;
margin: 30rpx 0 0 100rpx;
}
}
}
.order {
width: 710rpx;
background-color: #ffffff;
margin: 20rpx auto;
border-radius: 20rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 28rpx;
.top {
display: flex;
justify-content: space-between;
.left {
display: flex;
align-items: center;
.store {
// margin: 0 10rpx;
font-size: 32rpx;
}
}
.right {
color: #2979ff;
}
}
.item {
display: flex;
margin: 20rpx 0 0 0;
.left {
margin-right: 30rpx;
image {
width: 150rpx;
height: 150rpx;
border-radius: 10rpx;
}
}
.content {
.title {
font-weight: bold;
font-size: 28rpx;
line-height: 50rpx;
}
.price{
margin: 10rpx 0;
font-size: 30rpx;
}
.type {
margin: 10rpx 0;
font-size: 24rpx;
color: $u-tips-color;
}
.desc {
margin: 10rpx 0;
font-size: 24rpx;
color: $u-tips-color;
}
}
}
.bottom {
display: flex;
margin-top: 20rpx;
padding: 0 10rpx;
justify-content: flex-end;
align-items: center;
.btn {
margin-left: 20rpx;
line-height: 52rpx;
width: 160rpx;
border-radius: 26rpx;
border: 2rpx solid $u-border-color;
font-size: 26rpx;
text-align: center;
color: $u-type-info-dark;
}
.evaluate {
// color: #2979ff;
// border-color: #2979ff;
color: $u-tips-color;
border-color: $u-tips-color;
}
}
}
.centre {
text-align: center;
margin: 200rpx auto;
font-size: 32rpx;
image {
width: 164rpx;
height: 164rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
.tips {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
.btn {
margin: 80rpx auto;
width: 200rpx;
border-radius: 32rpx;
line-height: 64rpx;
color: #ffffff;
font-size: 26rpx;
background-image:linear-gradient(to left,#2979ff,rgba(#2979ff,0.6));
}
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top));
width: 100%;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
.buttom {
.loginType {
font-size: 14px;
position: fixed;
right: 30rpx;
bottom: 120rpx;
width: 60px;
height: 60px;
padding: 4px;
cursor: pointer;
background: #FFF;
text-align: center;
line-height: 60px;
border-radius: 100%;
-webkit-box-shadow: 0px 1px 20px 0px rgba(0,0,0,0.1),inset 0px -1px 0px 0px rgba(0,0,0,0.1);
box-shadow: 0px 1px 20px 0px rgba(0,0,0,0.1),inset 0px -1px 0px 0px rgba(0,0,0,0.1);
}
}
</style>

47
pages/center/tips.vue Normal file
View File

@@ -0,0 +1,47 @@
<template>
<view>
<u-navbar :is-back="true" :title="title" :border-bottom="false"></u-navbar>
<view class="u-content">
<u-parse :html="content"
:autosetTitle="true"
:show-with-animation="true"
:selectable="true"
></u-parse>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title:'避坑指南',
content: ``
}
},
onLoad() {
let url = "/api/cmsApi/getServiceItemByAjax?type=租房避坑指南"
this.$u.get(url).then(res => {
// console.log(res.data.content);
this.content = res.data.content
});
},
}
</script>
<style>
page{
background-color: #FFFFFF;
}
</style>
<style lang="scss" scoped>
.u-content{
// margin:0 10rpx;
// padding: 24rpx;
font-size: 34rpx;
color: $u-main-color;
line-height: 1.8;
white-space: pre-wrap !important;
}
</style>