Browse Source

强制清退列表待对接口,权限修改

master
wangyx 3 weeks ago
parent
commit
1c59fd0398
  1. 5
      pages.json
  2. 2
      pages/tabBar/mine/index.vue
  3. 17
      pages/tabBar/work/index.vue
  4. 187
      pagesA/force/list/list.vue
  5. 12
      pagesA/release/detail/detail.vue

5
pages.json

@ -60,6 +60,11 @@
"style": { "style": {
"navigationBarTitleText": "释放房源检查" "navigationBarTitleText": "释放房源检查"
} }
},{
"path": "force/list/list",
"style": {
"navigationBarTitleText": "强制清退"
}
}, },
{ {
"path": "force/index/index", "path": "force/index/index",

2
pages/tabBar/mine/index.vue

@ -17,6 +17,7 @@
v-for="(item, idx) in menuList" v-for="(item, idx) in menuList"
:key="idx" :key="idx"
@click="goPage(item.url)" @click="goPage(item.url)"
v-if="item.show"
> >
<image :src="item.icon" class="menu-icon"></image> <image :src="item.icon" class="menu-icon"></image>
<text class="menu-text">{{ item.text }}</text> <text class="menu-text">{{ item.text }}</text>
@ -48,6 +49,7 @@ export default {
icon: "/static/img/巡检记录.png", icon: "/static/img/巡检记录.png",
text: "我的巡检记录", text: "我的巡检记录",
url: "/pagesA/xjPage/xjRecord", url: "/pagesA/xjPage/xjRecord",
show: uni.getStorageSync("showInspection"),
}, },
// { // {
// icon: "/static/img/password.png", // icon: "/static/img/password.png",

17
pages/tabBar/work/index.vue

@ -53,7 +53,7 @@
</view> </view>
</view> </view>
<view class="conItem"> <view class="conItem" v-if="showBx">
<view class="conItem-title">报修</view> <view class="conItem-title">报修</view>
<view class="conItem-cont"> <view class="conItem-cont">
<view <view
@ -68,7 +68,7 @@
</view> </view>
</view> </view>
<view class="conItem"> <view class="conItem" v-if="showBs">
<view class="conItem-title">报事</view> <view class="conItem-title">报事</view>
<view class="conItem-cont"> <view class="conItem-cont">
<view <view
@ -94,6 +94,8 @@ export default {
showInspection: false, // showInspection: false, //
showElectric: false, // showElectric: false, //
showWater: false, // showWater: false, //
showBx: false, //
showBs: false, //
fyList: [ fyList: [
// { image: '/static/img/.png', text: '' }, // { image: '/static/img/.png', text: '' },
{ image: "/static/img/退房检查.png", text: "退房检查" }, { image: "/static/img/退房检查.png", text: "退房检查" },
@ -141,10 +143,19 @@ export default {
if (menu.children) return hasMenu(menu.children, name); if (menu.children) return hasMenu(menu.children, name);
return false; return false;
} }
console.log('resdata',res.data)
this.showCheckOut = hasMenu(res.data || res, "Check_out"); this.showCheckOut = hasMenu(res.data || res, "Check_out");
this.showInspection = hasMenu(res.data || res, "Inspection"); this.showInspection = hasMenu(res.data || res, "Inspection");
this.showElectric = hasMenu(res.data || res, "ElectricMeterRecord"); this.showElectric = hasMenu(res.data || res, "ElectricMeterRecord");
this.showWater = hasMenu(res.data || res, "WaterMeterRecord"); this.showWater = hasMenu(res.data || res, "WaterMeterRecord");
this.showBx = hasMenu(res.data || res, "Repair");
this.showBs = hasMenu(res.data || res, "Report");
uni.setStorageSync("showCheckOut", this.showCheckOut);
uni.setStorageSync("showInspection", this.showInspection);
uni.setStorageSync("showElectric", this.showElectric);
uni.setStorageSync("showWater", this.showWater);
uni.setStorageSync("showBx", this.Repair);
uni.setStorageSync("showBs", this.Report);
}, },
handelFyClick(item) { handelFyClick(item) {
if (item.text == "退房检查") { if (item.text == "退房检查") {
@ -157,7 +168,7 @@ export default {
}); });
} else if (item.text == "强制清退") { } else if (item.text == "强制清退") {
uni.navigateTo({ uni.navigateTo({
url: "/pagesA/force/index/index", url: "/pagesA/force/list/list",
}); });
} }
}, },

187
pagesA/force/list/list.vue

@ -0,0 +1,187 @@
<template>
<view class="checkout-list-bg">
<scroll-view
class="content"
scroll-y
refresher-enabled
:refresher-triggered="isRefreshing"
@refresherrefresh="refreshData"
@scrolltolower="loadMore"
style="height: 100vh"
>
<view v-for="(item, index) in listData" :key="index">
<view class="checkout-card" @click="goDetail(item)">
<image
v-if="item.coverImg"
:src="item.coverImg || ''"
class="room-img"
mode="aspectFill"
></image>
<view class="room-info">
<view class="room-title">{{ item.roomNamePath }}</view>
<view class="room-user">
<text>{{ item.graduateName }}</text>
<text class="gender">{{ item.gender == 1 ? "男" : "女" }}</text>
<text class="phone">{{ maskPhoneNumber(item.telephone) }}</text>
</view>
<view class="room-date">{{ item.checkInDate }}{{ item.checkOutDate }}</view>
</view>
</view>
</view>
<view style="text-align: center" v-if="isLoading">加载中...</view>
<!-- <view v-else style="text-align: center">没有更多了~</view> -->
<view v-else-if="listData.length <= 0" class="no-data"> 暂无数据~ </view>
</scroll-view>
</view>
</template>
<script>
import { listCheckout } from "../../../pages/api";
export default {
data() {
return {
isLoading: false,
isRefreshing: false,
noMore: false,
form: {
pageNum: 1,
pageSize: 10,
},
listData: [],
};
},
onLoad() {
this.refreshData();
},
methods: {
maskPhoneNumber(phoneNumber) {
if (!phoneNumber || phoneNumber.length !== 11) {
return phoneNumber;
}
return phoneNumber.substr(0, 3) + "****" + phoneNumber.substr(7);
},
//
refreshData() {
this.isRefreshing = true;
this.noMore = false;
this.listData = [];
this.form.pageNum = 1;
this.fetchData();
},
//
loadMore() {
if (this.isLoading || this.noMore) return;
this.isLoading = true;
this.form.pageNum++;
this.fetchData();
},
//
async fetchData() {
try {
const res = await listCheckout(this.form);
console.log(res, "res");
const tempList = res.rows || [];
let page = this.form.pageNum;
if (page === 1) {
// this.listData = tempList;
this.listData = [];
} else {
if (tempList.length > 0) {
this.listData = [...this.listData, ...tempList];
}
}
//
if (res.total <= this.form.pageSize * this.form.pageNum) {
this.noMore = true;
if (page !== 1) {
// uni.showToast({
// title: "",
// icon: "none"
// });
}
}
} catch (error) {
uni.showToast({ title: "网络异常", icon: "none" });
} finally {
this.isLoading = false;
this.isRefreshing = false;
}
},
goDetail(item) {
uni.setStorageSync("checkoutDetail", {
idCard: item.graduateIdCard,
roomNamePath: item.roomNamePath, //
graduateName: item.graduateName, //
gender: item.gender, //
telephone: item.telephone, //
checkInDate: item.checkInDate,
checkOutDate: item.checkOutDate, //
houseTypeCoverImg: item.coverImg,
});
uni.navigateTo({
url: `/pagesA/force/index/index?houseId=${item.houseId}&idCard=${item.graduateIdCard}`,
});
},
},
};
</script>
<style scoped>
.checkout-list-bg {
background: #f7f7f7;
min-height: 80vh;
padding: 24rpx 0;
}
.checkout-card {
display: flex;
background: #fff;
border-radius: 20rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
margin: 24rpx 24rpx 0 24rpx;
padding: 20rpx;
align-items: center;
}
.room-img {
width: 160rpx;
height: 120rpx;
border-radius: 12rpx;
object-fit: cover;
margin-right: 20rpx;
}
.room-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
.room-title {
font-weight: bold;
font-size: 32rpx;
margin-bottom: 10rpx;
}
.room-user {
font-size: 28rpx;
color: #222;
margin-bottom: 8rpx;
}
.room-user .gender {
margin-left: 16rpx;
}
.room-user .phone {
margin-left: 16rpx;
}
.room-date {
color: #bbb;
font-size: 26rpx;
}
.content {
width: 100%;
height: 100vh;
}
.no-data {
text-align: center;
color: #bbb;
margin-top: 40rpx;
}
</style>

12
pagesA/release/detail/detail.vue

@ -192,7 +192,11 @@ export default {
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
const file = files[i]; const file = files[i];
const filePath = file.tempFilePath; const filePath = file.tempFilePath;
const type = file.fileType || (filePath.match(/\.(mp4|mov|avi|wmv|flv|mkv)$/i) ? "video" : "image"); const type =
file.fileType ||
(filePath.match(/\.(mp4|mov|avi|wmv|flv|mkv)$/i)
? "video"
: "image");
// //
const uploadRes = await uploadImage(filePath); const uploadRes = await uploadImage(filePath);
this.fileList.push({ this.fileList.push({
@ -245,7 +249,7 @@ export default {
if (res && res.code === 200) { if (res && res.code === 200) {
this.roomDetail = res.data || {}; this.roomDetail = res.data || {};
this.value = res.data.facilitiesCheckDesc
// //
this.updatePageData(); this.updatePageData();
} else { } else {
@ -281,6 +285,8 @@ export default {
if (this.roomDetail.remark) { if (this.roomDetail.remark) {
this.value = this.roomDetail.remark; this.value = this.roomDetail.remark;
} }
this.value = this.roomDetail.facilitiesCheckDesc;
this.fileList = this.roomDetail.facilitiesCheckImages;
}, },
onDeviceChange(idx, val) { onDeviceChange(idx, val) {
@ -340,7 +346,7 @@ export default {
uni.showToast({ title: "提交成功", icon: "success" }); uni.showToast({ title: "提交成功", icon: "success" });
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/tabBar/work/index' url: "/pages/tabBar/work/index",
}); });
}, 1000); }, 1000);
} else { } else {

Loading…
Cancel
Save