我的-发布

This commit is contained in:
A1300399510 2023-07-19 18:47:31 +08:00
parent a17df0ca8a
commit 5dc1049f01
9 changed files with 331 additions and 44 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter x="-50.00%" y="-50.00%" width="200.00%" height="200.00%" filterUnits="objectBoundingBox" id="filter564">
<feColorMatrix type="matrix" values="4 0 0 0 -1.5 0 4 0 0 -1.5 0 0 4 0 -1.5 0 0 0 1 0 " in="SourceGraphic" />
</filter>
</defs>
<g transform="matrix(1 0 0 1 -268 -2 )">
<image preserveAspectRatio="none" style="overflow:visible" width="16" height="16" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAHVklEQVRoBe2YeWyVRRDAe9hSrlobL0BtUaGK8a7IbTkaooA3NSohqIFiYpo0pbQVlRaNbWlJk/qPhSgQ9Q/qhQnEkBYaBIqteGAMoWK0imCACBQq0NvffN358rV93/ve40GMyZtk3s7Ozs7OzM7O7vsiIsIQjkA4AuEI/JcRiLwUixcWFsYOGTLkQXRNB+8CU8CR4DBQoBU8CjaBP4J1586da2BeO3RIEJIDJSUlU6Kiol7AgifBhCAtOY38Z93d3evz8/N3BznXFg/agZ6ensjVq1c/ERkZWYCWVFtTaMQ+9BYvX778c/T2BKMqKAdKS0tTWaCSBSb6WORXeDUYsic6OvpAe3t7M3hW5GJjY4eDyV1dXeOYPwXWLPBmGesHe5mflZeXt68f37UbkAOVlZWDLly48BZassFoh7YO6A9YtIpFGx18T5JgjEdoCQ4tpI1xTOi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S1tc03tN8Gozc5BJaY94uDNZAUGQK2REf66VD2gJZXglS8K83AQX3O2zmF0vd0FvQbVVVVMdp3a83DTCuD7NoWf06YMbnIYo1OedvscNOvfPnqgaOva5/WttW+iWG+C8pbXG66MWfOnCmifRX0gsUISArKbSxVqYEH4VoplVpthg4deif850zk1fiT/DGyd4JxVyD6RczV/D/BJxmx1YI+FYeFMxHUQTnlj8pbxMi6NkRW7gN5D+mr0VXWDJykfRzdnvmPTfOw6QvkLVvZiaXsWpUu0McBBOU5Le/1GUbgFAduEn8kDuoEtxYnxjC2FkxzkzH8Oom85rA/WZ4Zt2PwHmT0rbUd4+X/hl32+zggyjDkehr5D6oXzAkeXbNzcnK+l3EvkLcNC8iBm0p7o8gTmMM0u+hvCiTnZQ7Pm3txdBukpLTAn/zRSl2xYsWx3m7v7wAHhM37/n5yWA6X/qVsgZ4XyJbL/FDBfPGT1NWqI+vPYP3v+uv26YAIiRIi/yXRG2YmtRPBVUlJSSWX+U+9fGJZCephl49jD2O8pNIAcHVAJM1ObIV0flb5mv5CFDrfJSIeEpgztBElEx2KjnEG53AGv3Xw+pB+HRBJduImlMiHrfGOme3QG8jRYq8PT445PkmKxmh2OZ/BRaBGXWQbWPcZjP9dOm7g6YBMlIuEWr6KhXLoOu+ODtLqQ87LWnakAdquDm4LCh89kezuBMjF0PIEiRG+gU7acmr9StaVQPmFgBxQDWzzfdDycXey8hxtM3QtBu2Wj7vQv/FB1/q429raGi8fd3H0Dsan4OgsxpPA/iB5nuXrsPYX1H5QDugktv0xDJFb2plWOnwxbSNOvU2JlQsrKLgoB3QFzsckFl4EPgUv0FtYp8s3p0/BDfwVrVdmsG1IDuhi8vDjq8F4HEnDoLvhp4AjQf38Ial0FGxCZj+Hv47P9Y3kuOR7GMIRCEcgHIH/cQT+BQ4SxhkqIPesAAAAAElFTkSuQmCC" x="268px" y="2px" filter="url(#filter564)" />
</g>
</svg>

View File

@ -3,7 +3,7 @@
<img class="img" :src="item['image']">
<div class="title">{{ item['title'] }}</div>
<div class="hint">{{ item['propaganda'] }}</div>
<div class="tab-box flexflex">
<div class="tab-box flexflex" v-if="item['tags']">
<div class="tab-item flexcenter" v-for="it in item['tags'].split(',')">{{ it }}</div>
</div>
<div class="location flexacenter">

View File

@ -7,13 +7,15 @@
</div>
<div class="top-box">
<div class="title-text">
{{ data && data.subject || '暂无标题' }}
<div class="title-hint" v-if="data.verifiedstatus == 1 && !stateData.text">认证审核中</div>
<div class="title-hint" v-if="stateData.text">{{ stateData.text }}</div>
{{ data.subject || '暂无标题' }}
</div>
<div class=" dis-f al-item-start jus-bet s-w-100" style="margin-top: 20px;">
<div>
<div class="dis-f al-item">
<div class="tab-item first-tab flexacenter">{{ data && data.gptype }}</div>
<div class="tab-item mg-l-8 flexacenter" v-if="data.type">{{ listData.type[data && data.type] }}
<div class="tab-item first-tab flexacenter">{{ data.gptype }}</div>
<div class="tab-item mg-l-8 flexacenter" v-if="data.type">{{ listData.type[data.type] }}
</div>
<div class="tab-item mg-l-8 flexacenter" v-if="data.elevator && data.elevator !== -1">{{
listData.elevator[data.elevator] }}</div>
@ -32,7 +34,6 @@
</div>
</template>
</template>
<div class="address-item flexacenter" v-else>
<img src="../../assets/homeImage/addMarker.png" class="img" alt="">
{{ location[item['location'] >>> 0] + ' > ' + location[item['location']] }}
@ -46,6 +47,30 @@
<span class="time" v-show="data.rentalduration">[ 租期{{ data.rentalduration == 0 ? '不限' :
listData['rentalduration'][data.rentalduration] }} ]</span>
</div>
<div class="data-info flexacenter" v-if="ispublish">
<div class="info-item" v-if="data['id']">
房源ID{{ data['id'] }}
</div>
<template v-if="data['timestamp']">
<div class="longstring" v-if="data['id']" style="margin: 0 8px;"></div>
<div class="info-item">
{{ formatDate(data['timestamp']) }}发布
</div>
</template>
<template v-if="data['status'] != 0">
<div class="longstring"></div>
<div class="info-item flexacenter">
<div class="itemm flexacenter">
<img class="item-icon" src="@/assets/img/publicImage/eye-icon.svg" alt="">
{{ data['count_view'] }}
</div>
<div class="itemm flexacenter" style="margin-left: 10px;">
<img class="item-icon" src="@/assets/img/publicImage/collect-icon.png" alt="">
{{ data['count_fav'] }}
</div>
</div>
</template>
</div>
</div>
<div class="img">
<div>
@ -61,7 +86,20 @@
<img src="../../assets/homeImage/intermediaryCorner.svg" v-if="routePath === '/intermediaryHousing'"
class="tab-img" alt="">
</div>
<div class="btm-box dis-f al-item">
<div class="publish-footer flexacenter" v-if="ispublish">
<div class="publish-item flexcenter" v-if="stateData.btn >= 0 || stateData.btn == -2" @click="handleDelete">删除
</div>
<div class="publish-item flexcenter" v-if="stateData.btn >= 0" @click="goEdit">{{ stateData.btn
== 1 ? "编辑上架" : "编辑" }}</div>
<div class="publish-item flexcenter" v-if="stateData.btn == 2" @click="undercarriage">下架</div>
<div class="publish-item flexcenter go-up"
:class="{ 'go-up': data.isding == 0, 'already-go-up': data.isding == 1 }" v-if="stateData.btn == 2"
@click="goUp">{{
data.isding == 0 ? '顶上去' : '今天已顶' }}
</div>
<!-- <div class="publish-item flexcenter already-go-up" v-if="stateData.btn == 2 && item.isding == 1"></div> -->
</div>
<div class="btm-box dis-f al-item" v-else>
<div class="flex1 flexacenter">
<img :src="data.avatar" class="user-img" alt="">
<span class="user-name">{{ data.author }}</span>
@ -78,22 +116,32 @@
</template>
<script setup>
import { ref, defineProps, reactive, defineEmits, onMounted, getCurrentInstance } from "vue";
import { ref, watch, defineProps, reactive, defineEmits, onMounted, getCurrentInstance } from "vue";
import { useRoute, useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus'
import store from '../../store/index';
const { proxy } = getCurrentInstance()
const router = useRouter()
let props = defineProps({
item: {
type: Object
type: Object,
},
index: Number
index: Number,
ispublish: Boolean,
})
const emit = defineEmits(['cancelCollection'])
let data = {}
data = props.item
const emit = defineEmits(['cancelCollection', 'goUp', 'undercarriage'])
// console.log("item", props.item);
let data = {}
data = props.item
//
const route = useRoute()
@ -138,10 +186,87 @@ const stateObj = { // btn: 0 删除 编辑 1 删除 编辑 上架 2 删除 编
}
}
let stateData = ref(stateObj[data.status])
//
watch(() => props.item.status, (newValue, oldValue) => {
stateData.value = stateObj[data.status]
})
const cancelCollection = token => {
emit('cancelCollection', { token, index: props['index'] })
}
//
const goEdit = () => router.push(`/edit?token=${data.token}`)
//
const handleDelete = () => {
ElMessageBox.confirm(
'确定删除吗?',
'提示',
{
cancelButtonText: '取消',
confirmButtonText: '确定',
center: true,
autofocus: false,
customClass: "ElMessageBox",
width: 260,
customStyle: 'width: 260px'
},
).then(() => {
proxy.$post('/tenement/pc/api/user/delete', {
token: data['token']
}).then(res => {
if (res.code != 200) return
ElMessage.success(res.message)
emit('handleDelete', props['index'], data['status'])
})
}).catch(() => { })
}
//
const undercarriage = () => {
proxy.$post('/tenement/pc/api/user/status', {
status: 2,
token: data['token'],
uniqid: data['uniqid'],
}).then(res => {
let data = res.data
emit('undercarriage', props['index'], data['status'])
})
}
//
const goUp = () => {
if (data.isding == 1) ElMessage('今天已顶过啦,明天再来吧!')
if (data.isding != 0) return
proxy.$post("/tenement/pc/api/user/ding", { token: data['token'] }).then(res => {
ElMessage.success(res.message)
emit('goUp', props['index'])
})
}
// 20230704
const formatDate = timestamp => {
// Date
var date = new Date(timestamp * 1000);
// 使Dateget
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
// 0
if (month < 10) month = '0' + month;
if (day < 10) day = '0' + day;
//
return year + '年' + month + '月' + day + '日';
}
</script>
<style scoped lang="less">
img {
@ -264,6 +389,17 @@ img {
text-align: left;
word-wrap: break-word;
line-height: 28px;
.title-hint {
border: 1px solid rgba(249, 93, 93, 1);
display: inline;
height: 24px;
font-size: 14px;
color: #F95D5D;
border-radius: 5px;
padding: 0 8px;
}
}
.mg-l-8 {
@ -397,5 +533,59 @@ img {
}
}
}
.data-info {
color: #555555;
font-size: 14px;
margin-top: 24px;
font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
.longstring {
width: 2px;
height: 13px;
background-color: #d7d7d7;
margin: 0 16px;
}
.info-item {
.itemm {
.item-icon {
width: 16px;
height: 16px;
margin-right: 5px;
}
}
}
}
.publish-footer {
height: 85px;
border-top: 1px dotted #d7d7d7;
justify-content: flex-end;
padding: 0 20px;
.publish-item {
width: 100px;
height: 40px;
border: 1px solid rgba(170, 170, 170, 1);
font-size: 15px;
color: #555555;
border-radius: 45px;
cursor: pointer;
margin-left: 10px;
&.go-up {
border: none;
color: #fff;
background-color: rgba(98, 177, 255, 1);
}
&.already-go-up {
border: none;
color: #AAAAAA;
background-color: rgba(242, 242, 242, 1);
}
}
}
}
</style>

View File

@ -20,7 +20,6 @@ import {
ElPopover,
ElDatePicker,
ElMessage,
ElSpace,
ElSkeleton,
ElSkeletonItem
// 其他需要的组件
@ -71,6 +70,7 @@ app.use(ElDatePicker, {
})
app.use(ElSkeleton)
app.use(ElSkeletonItem)
app.use(ElMessage)
app.use(store).use(router).use(Axios).mount('#app')

View File

@ -662,8 +662,6 @@
<how :howBoxState="howBoxState" @close="howBoxState = false"></how>
</template>
<script>
import zhCn from "element-plus/lib/locale/lang/zh-cn";
import aboutPop from '@/components/edit/about-pop.vue'
import mapComponent from '@/components/edit/map.vue'
import pageFooter from '@/components/footer/footer.vue'
@ -758,6 +756,12 @@ export default {
}
},
watch: {
'$store.state.user'(newValue) {
this.userIntermediary = newValue['intermediary']
}
},
mounted() {
// 访URL
const queryString = window.location.search;
@ -767,6 +771,10 @@ export default {
this.intermediary = urlParams.get('intermediary') || 3; //
// this.verified = urlParams.get('verified') || 0;
setTimeout(() => {
console.log(this.$store.state.user, "state");
}, 1000)
this.init();
},
components: {
@ -784,6 +792,8 @@ export default {
return require(url)
},
init() {
this.loading = this.$loading({
lock: true,
text: 'Loading',

View File

@ -78,7 +78,7 @@ const getData = () => {
}).then(res => {
if (res.code != 200) return
let data = res.data
list.value = list.value.concat(data.data)
list.value = list.value.concat(data.data || [])
page = data.page * data.limit >= data.count ? 0 : page + 1
listCount = data.count
@ -108,10 +108,8 @@ let pitchValue = {}
//
const handleTransfer = (data) => {
for (const key in data.value) {
console.log(data.value[key] != pitchValue[key]);
if (data.value[key] != pitchValue[key]) {
pitchValue = { ...data.value }
page = 1
list.value = []
getData()

View File

@ -1,7 +1,5 @@
<template>
<!-- <header-nav></header-nav> -->
<pageTopBar></pageTopBar>
<div class="user-box">
<div class="info-box flexacenter">
<div class="info-left flexacenter flex1">
@ -70,22 +68,23 @@
<div class="quantity wid1200" v-else> <b>{{ count['publish'] }}</b> 条房源上架 {{ stat['listing'] }} | 草稿 {{ stat['draft']
}} | 下架 {{ stat['offshelf'] }}</div>
<div class="list wid1200 flexflex" v-if="tabState == 'fav'">
<div class="item" v-for="(item, index) in favData['list']" :key="index">
<div class="list wid1200 flexflex" v-show="tabState == 'fav'" ref="gridContainer">
<div class="item" v-for="(item, index) in favData['list']" :key="item.id">
<public-list-item :item="item" :index="index" @cancelCollection="cancelCollection"></public-list-item>
</div>
</div>
<div class="list wid1200 flexflex" v-if="tabState == 'publish'">
<div class="item" v-for="(item, index) in publishData['list']" :key="index">
<public-list-item :item="item" :index="index" @cancelCollection="cancelCollection"></public-list-item>
<div class="list wid1200 flexflex" v-show="tabState == 'publish'" ref="gridContainerpublish">
<div class="item" v-for="(item, index) in publishData['list']" :key="item.id">
<public-list-item :item="item" :index="index" @cancelCollection="cancelCollection" :ispublish="true"
@goUp="goUp" @undercarriage="undercarriage" @handleDelete="handleDelete"></public-list-item>
</div>
</div>
<div class="empty-box flexcenter wid1200">
<div class="empty-box flexcenter wid1200"
v-if="(tabState == 'fav' && favData['list'].length == 0) || (tabState == 'publish' && publishData['list'].length == 0)">
<empty-duck></empty-duck>
</div>
<!-- 有疑问 -->
<have-questions></have-questions>
@ -105,13 +104,32 @@ import pageFooter from '@/components/footer/footer.vue'
import biserialListItem from '@/components/biserialListItem/biserialListItem.vue'
import publicListItem from '@/components/public/public-list-item.vue'
import emptyDuck from '@/components/public/empty-duck.vue'
import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick } from 'vue'
const { proxy } = getCurrentInstance()
import { ElLoading } from 'element-plus'
import { ElLoading, ElMessage } from 'element-plus'
import Masonry from 'masonry-layout';
const gridContainer = ref(null);
const gridContainerpublish = ref(null);
let masonryInstance = null
let masonryInstancepublish = null
onMounted(() => {
masonryInstance = new Masonry(gridContainer.value, {
itemSelector: '.item',
gutter: 20
});
masonryInstancepublish = new Masonry(gridContainerpublish.value, {
itemSelector: '.item',
gutter: 20
});
init()
window.addEventListener('scroll', handleScroll);
})
let systematicState = ref(false) //
@ -119,27 +137,30 @@ let user = ref({})
let count = ref({}) //
let newmessagenum = ref(0)
let validityidentity = ref('')
let tabState = ref('fav') // fav publish
let tabState = ref('publish') // fav publish
const identityObj = {
1: "中介认证",
"-1": "房源认证"
}
async function init() {
proxy.$post("/tenement/v2/api/user").then(res => {
if (res.code != 200) return
let data = res.data
// if (data.count['publish'] > 0) {
// tabState.value = 'publish'
// getPublishData()
// } else {
// tabState.value = 'fav'
// getFavData()
// }
if (data.count['publish'] > 0) {
tabState.value = 'publish'
getPublishData()
} else {
tabState.value = 'fav'
getFavData()
}
getFavData()
// getFavData()
user.value = data.user
count.value = data.count
@ -148,8 +169,6 @@ async function init() {
});
}
// let loading = null
let loading = ElLoading.service({
lock: true,
text: 'Loading',
@ -172,13 +191,18 @@ const getPublishData = () => {
background: 'rgba(0, 0, 0, 0.7)',
})
proxy.$post("/tenement/pc/api/user/publishList", {
page: publishData['page']
page: publishData.value['page']
}).then(res => {
if (res.code != 200) return
let data = res.data
stat.value = data['stat']
publishData.value['page'] = data['page'] * data['limit'] >= data['count'] ? 0 : data['page'] + 1
publishData.value['list'] = publishData.value['list'].concat(data['data'] || [])
nextTick(() => {
masonryInstancepublish.reloadItems();
masonryInstancepublish.layout();
loading.close()
})
}).finally(() => {
loading.close()
})
@ -198,12 +222,18 @@ const getFavData = () => {
background: 'rgba(0, 0, 0, 0.7)',
})
proxy.$post("/tenement/pc/api/user/favList", {
page: favData['page']
page: favData.value['page']
}).then(res => {
if (res.code != 200) return
let data = res.data
favData.value['page'] = data['page'] * data['limit'] >= data['count'] ? 0 : data['page'] + 1
favData.value['list'] = favData.value['list'].concat(data['data'] || [])
nextTick(() => {
masonryInstance.reloadItems();
masonryInstance.layout();
loading.close()
})
}).finally(() => {
loading.close()
})
@ -216,16 +246,62 @@ const cutTab = (value) => {
else if (tabState.value == 'fav' && favData.value['list'].length == 0) getFavData()
}
//
let cancelCollection = data => {
proxy.$post("/tenement/relation/operation", {
token: data['token']
}).then(res => {
console.log(res, "res");
if (res.code != 200) return
favData.value.list.splice(data['index'], 1)
count.value['fav']--
nextTick(() => {
masonryInstance.reloadItems();
masonryInstance.layout();
loading.close()
})
})
}
//
const undercarriage = (index, status) => {
stat.value['listing']--
stat.value['offshelf']++
publishData.value['list'][index].status = status
}
//
const goUp = index => publishData.value['list'][index].isding = 1
//
const handleDelete = (index, status) => {
if (status == 0) stat.value['draft']--
else if (status == 1) stat.value['listing']--
else stat.value['offshelf']--
publishData.value['list'].splice(index, 1)
nextTick(() => {
masonryInstancepublish.reloadItems();
masonryInstancepublish.layout();
loading.close()
})
}
//
const handleScroll = () => {
const scrollHeight = document.documentElement.scrollHeight;
const clientHeight = document.documentElement.clientHeight;
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
if (scrollTop + clientHeight >= scrollHeight) {
if (tabState.value == 'publish') getPublishData()
else getFavData()
}
};
onUnmounted(() => {
window.removeEventListener('scroll', handleScroll);
});
</script>
<style lang="less" scoped>
@ -438,7 +514,7 @@ let cancelCollection = data => {
justify-content: space-between;
.item {
margin-bottom: 20px;
cursor: pointer;
}
}
@ -448,5 +524,6 @@ let cancelCollection = data => {
margin: 0 auto;
justify-content: center;
align-items: center;
border-radius: 16px;
}
</style>

View File

@ -40,6 +40,7 @@ module.exports = defineConfig({
.end()
},
devServer: {
hot: true,
proxy: {
'/Api': {
target: 'https://app.gter.net',//请求的接口的前缀