20261008
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<!-- 顶部-吸顶 -->
|
||||
<u-sticky offset-top="0" customNavHeight="0">
|
||||
<uiheader :index='index'></uiheader>
|
||||
</u-sticky>
|
||||
<!-- 半圆区 -->
|
||||
<uisemicircle @search="search"></uisemicircle>
|
||||
<!-- 导航栏 -->
|
||||
<common-swiper height="14" class="mt-15"/>
|
||||
<div class="flex justify-around items-center">
|
||||
<div @click="$jump('/pages/self/self')" style="width: 30%; margin: 1%">
|
||||
<image src="/static/img/home1.jpg" alt="" style="width: 100%;" mode="widthFix"/>
|
||||
</div>
|
||||
<div @click="$jump('/pages/goods/goods')" style="width: 30%; margin: 1%">
|
||||
<image src="/static/img/home2.jpg" alt="" style="width: 100%;" mode="widthFix"/>
|
||||
</div>
|
||||
<div @click="$jump('/pages/price/price')" style="width: 30%; margin: 1%">
|
||||
<image src="/static/img/home3.jpg" alt="" style="width: 100%;" mode="widthFix"/>
|
||||
</div>
|
||||
</div>
|
||||
<view>
|
||||
<uinavr :index='index'></uinavr>
|
||||
</view>
|
||||
<!-- 轮播图 -->
|
||||
<uiswiper :ad="3"></uiswiper>
|
||||
<uiswiper :ad="4"></uiswiper>
|
||||
<!-- 最新询价 -->
|
||||
<uiprice></uiprice>
|
||||
<!-- 现货市场 -->
|
||||
<uigoods></uigoods>
|
||||
<!-- 合作商家 -->
|
||||
<uiwork></uiwork>
|
||||
<!-- 服务商 -->
|
||||
<uifacilitator></uifacilitator>
|
||||
<!-- 交易模式 -->
|
||||
<uimodel></uimodel>
|
||||
<!-- 金融服务 -->
|
||||
<uifinance></uifinance>
|
||||
<!-- 最新开通 -->
|
||||
<uiopen></uiopen>
|
||||
<!-- 入门 -->
|
||||
<uiabc></uiabc>
|
||||
<!-- 资讯中心 -->
|
||||
<uinews></uinews>
|
||||
<uiswiper :ad="5"></uiswiper>
|
||||
<uiswiper :ad="6"></uiswiper>
|
||||
<uiswiper :ad="7"></uiswiper>
|
||||
<uiswiper :ad="8"></uiswiper>
|
||||
<collapse></collapse>
|
||||
|
||||
<!-- 广告图 -->
|
||||
<!-- <uiadvert></uiadvert>-->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uiheader from '@/components/index/header'
|
||||
import uisemicircle from '@/components/index/semicircle'
|
||||
import uinavr from '@/components/index/nav'
|
||||
import uiswiper from '@/components/index/swiper'
|
||||
import uiprice from '@/components/index/price'
|
||||
import uigoods from '@/components/index/goods'
|
||||
import uiwork from '@/components/index/work'
|
||||
import uifacilitator from '@/components/index/facilitator'
|
||||
import uimodel from '@/components/index/model'
|
||||
import uifinance from '@/components/index/finance'
|
||||
import uiopen from '@/components/index/open'
|
||||
import uiabc from '@/components/index/abc'
|
||||
import uinews from '@/components/index/news'
|
||||
import uiadvert from '@/components/index/advert'
|
||||
import Collapse from "@/components/index/collapse.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Collapse,
|
||||
uiheader,
|
||||
uisemicircle,
|
||||
uinavr,
|
||||
uiswiper,
|
||||
uinews,
|
||||
uiabc,
|
||||
uiadvert,
|
||||
uiopen,
|
||||
uifinance,
|
||||
uifacilitator,
|
||||
uiwork,
|
||||
uigoods,
|
||||
uiprice,
|
||||
uimodel,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
index: 0,
|
||||
isLogin: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
search({keyword, type}) {
|
||||
let url = ''
|
||||
switch (type) {
|
||||
case 0 : {
|
||||
url = '/pages/shop/shop'
|
||||
}
|
||||
break;
|
||||
case 1 : {
|
||||
url = '/pages/goods/goods'
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
url = '/pages/price/price'
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
url = '/pages/work/work'
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
url = '/pages/junk/junk'
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.$jump(`${url}?keyword=${keyword}`)
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
// padding-top: 80rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="flex justify-between items-start">
|
||||
<div class="flex flex-col justify-start items-start">
|
||||
<span>您有<em style="color: #bf2b28;padding: 0 3px;font-weight: 500">{{
|
||||
unreadNum
|
||||
}}</em>条未读消息</span>
|
||||
<span class="text-main pointer" @click="allRead">全部已读</span>
|
||||
</div>
|
||||
<el-button style="float: right; padding: 3px 0; color: #666" type="text" @click="onSetting"
|
||||
v-if="userInfo && parseInt(userInfo.userLevel) > 0"><i
|
||||
class="el-icon-setting"></i> 消息推送设置
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- 消息列表 -->
|
||||
<div class="notice-list">
|
||||
<div class="item" v-for="(item,index) in noticeList" :key="index">
|
||||
<div class="notice-main">
|
||||
<div class="title-box" @click="toDetail(item, index)">
|
||||
<div class="flex justify-start items-start">
|
||||
<el-badge is-dot class="badge" v-if="!item.hasRead"></el-badge>
|
||||
<div class="title">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="meta-row">
|
||||
<div class="time">{{ item._add_time_str }}</div>
|
||||
<div class="right">
|
||||
<div class="btn" @click="setRead(index)" v-if="!item.hasRead">
|
||||
<i class="el-icon-sunset"></i>已读
|
||||
</div>
|
||||
<div class="btn" @click="del(index)">
|
||||
<i class="el-icon-delete"></i>删除
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="desc pointer" @click="toDetail(item, index)">
|
||||
{{ item.content }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-20">
|
||||
<el-pagination @current-change="getList" background layout="prev, pager, next"
|
||||
:total="total"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="提示" :visible.sync="dialogVisible" width="70%">
|
||||
<el-descriptions title="报价详情" v-if="sheet && dialogVisible" border :column="1">
|
||||
<el-descriptions-item label="公司">{{ sheet.user.company.companyName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人">{{ sheet.user.manager.personName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式">{{
|
||||
sheet.user.businessCard.companyMobile
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="价格">{{ sheet.amount }}元</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<p v-for="(item, index) in sheet.files" :key="index">
|
||||
<a :href="item" target="_blank">预览:文件{{ index + 1 }}</a>
|
||||
</p>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">{{ sheet.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="toContract" type="primary">去签合同</el-button>
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let that;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
unreadNum: 0,
|
||||
noticeList: [],
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
dialogVisible: false,
|
||||
sheet: null,
|
||||
userInfo: null,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getUserInfo()
|
||||
this.getList()
|
||||
this.getUnreadNum()
|
||||
},
|
||||
methods: {
|
||||
async getUserInfo() {
|
||||
const {userInfo} = await vk.callFunction({
|
||||
url: 'user/kh/getMyUserInfo'
|
||||
})
|
||||
this.userInfo = userInfo
|
||||
},
|
||||
async getList(pageIndex = 1) {
|
||||
const {rows, total} = await vk.callFunction({
|
||||
url: 'client/message/kh/getList',
|
||||
data: {
|
||||
pageIndex,
|
||||
pageSize: this.pageSize,
|
||||
}
|
||||
})
|
||||
this.total = total
|
||||
this.noticeList = rows
|
||||
},
|
||||
async getUnreadNum() {
|
||||
const {data} = await vk.callFunction({
|
||||
url: 'client/message/kh/getUnreadCount',
|
||||
});
|
||||
this.unreadNum = data
|
||||
},
|
||||
async setRead(index) {
|
||||
this.noticeList[index].hasRead = true
|
||||
await vk.callFunction({
|
||||
url: 'client/message/kh/setRead',
|
||||
data: {
|
||||
id: this.noticeList[index]._id
|
||||
}
|
||||
})
|
||||
},
|
||||
del(index) {
|
||||
this.$confirm('确认删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
await vk.callFunction({
|
||||
url: 'client/message/kh/delete',
|
||||
data: {
|
||||
id: this.noticeList[index]._id
|
||||
}
|
||||
})
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功'
|
||||
})
|
||||
await this.getList()
|
||||
await this.getUnreadNum()
|
||||
})
|
||||
|
||||
},
|
||||
onSetting() {
|
||||
uni.setStorageSync('user_tab', 3)
|
||||
vk.navigateTo('/pages/user/user')
|
||||
},
|
||||
toDetail(item, index) {
|
||||
if (!item.hasRead) this.setRead(index)
|
||||
let url = null
|
||||
if (item.type === 'old') url = `/pages/junk/detail?id=${item.pk}`
|
||||
else if (item.type === 'enquiry') url = `/pages/price/detail?id=${item.pk}`
|
||||
else if (item.type === 'process') url = `/pages/work/detail?id=${item.pk}`
|
||||
else if (item.type === 'contract') url = `/pages/public/contract?tab=1`
|
||||
else if (item.type === 'self-support') url = `/pages/self/makeQuote?id=${item.pk}`
|
||||
else if (item.type === 'self-product') url = `/pages/user/seller`
|
||||
else if (item.type === 'spot') url = `/pages/goods/detail?id=${item.pk}`
|
||||
else if (item.type === 'self-support-quote') {
|
||||
this.getQuoteDetail(item.pk)
|
||||
}
|
||||
if (url) vk.navigateTo({url})
|
||||
},
|
||||
async allRead() {
|
||||
await vk.callFunction({
|
||||
url: 'client/message/kh/setAllRead'
|
||||
})
|
||||
await this.getList(1)
|
||||
await this.getUnreadNum()
|
||||
},
|
||||
async getQuoteDetail(_id) {
|
||||
await vk.callFunction({
|
||||
url: 'client/selfSupport/kh/getQuoteDetail',
|
||||
data: {
|
||||
_id
|
||||
},
|
||||
success: ({rows}) => {
|
||||
this.sheet = rows
|
||||
this.dialogVisible = true
|
||||
}
|
||||
});
|
||||
},
|
||||
toContract() {
|
||||
this.dialogVisible = false
|
||||
vk.navigateTo({url: '/pages/public/contract?tab=1'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.el-icon-setting {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.notice-list {
|
||||
.item {
|
||||
font-size: 25rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 10rpx 0;
|
||||
border-bottom: 1px solid #ddd;
|
||||
|
||||
.notice-main {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.title-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 12rpx;
|
||||
//margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.meta-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 8rpx;
|
||||
|
||||
.time {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: #999999;
|
||||
line-height: 2em;
|
||||
}
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
.btn {
|
||||
color: #bf2b28;
|
||||
cursor: pointer;
|
||||
|
||||
i {
|
||||
padding: 0 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user