提交本地代码到718分支
This commit is contained in:
@@ -2,59 +2,61 @@
|
||||
<view class="con-body">
|
||||
<view class="con-bg">
|
||||
<!-- 头部 -->
|
||||
<customHeader ref="customHeaderRef" :title="'市场信息查看'" :leftFlag="true" :rightFlag="true">
|
||||
<template #right>
|
||||
</template>
|
||||
<customHeader ref="customHeaderRef" :title="!searchShow?'市场信息查看':'搜索'"
|
||||
:leftFlag="true"
|
||||
:rightFlag="true"
|
||||
@back="handleBack" :searchType="searchShow?1:undefined"
|
||||
>
|
||||
<!-- <template #right v-if="!searchShow">
|
||||
<view class="head-right" @click="handleRead">
|
||||
<img :src="'static/images/icon-clean@2x.png'" />清除未读
|
||||
</view>
|
||||
</template> -->
|
||||
</customHeader>
|
||||
|
||||
|
||||
<!-- 高度来避免头部遮挡 -->
|
||||
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view>
|
||||
<view class="top-height"></view>
|
||||
|
||||
<!-- 搜索处理 -->
|
||||
<customSearch v-if="searchShow" :searchKeywords="searchText" :searchType="searchTypeObj"
|
||||
:checkTypeObj="notictTypeCheck" :searchTypeList="noticeTypeList" @confirm="handleSearchConfirm">
|
||||
</customSearch>
|
||||
<view class="search" v-else @click="handleSearchFocus">
|
||||
<view class="search-bg">
|
||||
<view class="search-left">{{ notictTypeCheck.name?notictTypeCheck.name:'全部' }}</view>
|
||||
<view class="search-right">
|
||||
<input class="uni-input" v-model="inputval" placeholder="请输入您想查询的内容或服务"
|
||||
placeholder-class="search-color" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 正文内容 -->
|
||||
<view class="all-body">
|
||||
<!-- 搜索 @blur="blur" @focus="focus" @input="input" @cancel="cancel" @clear="clear"-->
|
||||
<!-- <view class="search">
|
||||
<uni-search-bar class="custom-search" radius="28" placeholder="请输入客户名称" clearButton="auto"
|
||||
cancelButton="none" bgColor="#6FA2F8" textColor="#ffffff" v-model="searchValue" />
|
||||
<button type="default" @click="handleSearch" size="mini" class="btn-search">查询</button>
|
||||
</view> -->
|
||||
<view class="search_center">
|
||||
<view class="category">
|
||||
<view class="flex_row_center_center" @click="showCate">
|
||||
<text>{{selCategory.val||'全部'}}</text>
|
||||
<image src="@/static/images/icon-notice@2x.png" mode=""></image>
|
||||
</view>
|
||||
<view class="pop_arrow" v-if="maskShow"></view>
|
||||
<view class="pop" v-if="maskShow">
|
||||
<text v-for="(item,index) in categories" :key="index"
|
||||
@click="toList(item.categoryId,item.categoryName)">{{item.categoryName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<image class="search_icon" src="@/static/images/icon-notice@2x.png"></image>
|
||||
<input class='sea_input' :focus="inputFocus" type='text' :value="inputval" placeholder="请输入搜索条件"
|
||||
@input="inputChange" @confirm='search' maxlength="50" placeholder-class="placeClass"></input>
|
||||
<image class='clear_content' v-show="inputval" @click="clearInputVal"
|
||||
src="@/static/images/icon-notice@2x.png" />
|
||||
</view>
|
||||
<text class='sea_btn' @click="btnSearch(1)">{{'搜索'}}</text>
|
||||
|
||||
|
||||
<!-- 分页部分 -->
|
||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
||||
<mescroll-uni v-if="!searchShow" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
||||
:up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"
|
||||
class="scroll-h" :class="{ 'loading-scroll': cssFlag }">
|
||||
<view class="white-bg margin-bottom20" v-for="(item, index) in list" :key="index" @click="showDetail(item)">
|
||||
<view class="white-bg margin-bottom20" v-for="(item, index) in list" :key="index"
|
||||
@click="showDetail(item)">
|
||||
<view>
|
||||
<view class="report-list">
|
||||
<view class="title">信息类型:{{ item.informationType }}</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="r-list">
|
||||
<view class="r-name"v-if="item.cusName!=null">公司名称:{{ item.cusName }}</view>
|
||||
<view class="r-right btn-gray flex-auto" :class="item.myselfBrowsing==0?'btn-blue':'btn-green'"
|
||||
size="mini">{{item.myselfBrowsing==0?'未读':'已读'}}</view>
|
||||
<view class="r-name" v-if="item.cusName!=null">公司名称:{{ item.cusName }}</view>
|
||||
<view class="r-right btn-gray flex-auto"
|
||||
:class="item.myselfBrowsing==0?'btn-blue':'btn-green'" size="mini">
|
||||
{{item.myselfBrowsing==0?'未读':'已读'}}</view>
|
||||
|
||||
</view>
|
||||
<view class="border-bottom"></view>
|
||||
|
||||
|
||||
<view class="border-bottom"></view>
|
||||
<view class="r-list">
|
||||
<view class="r-left">报告人</view>
|
||||
@@ -70,7 +72,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -82,6 +84,7 @@
|
||||
watch
|
||||
} from 'vue'
|
||||
import customHeader from '@/components/customHeader.vue'
|
||||
import customSearch from '@/components/customSearch.vue'
|
||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||
import {
|
||||
getNavBarPaddingTop
|
||||
@@ -90,12 +93,13 @@
|
||||
visitorReportList
|
||||
} from '@/api/business.js'
|
||||
import {
|
||||
viewingMarketInfForAllMembers
|
||||
viewingMarketInfForAllMembers
|
||||
} from '@/api/crm/api_ys.js';
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onUnload
|
||||
onUnload,
|
||||
onHide
|
||||
} from '@dcloudio/uni-app'
|
||||
// 获取导航栏高度用于内容区域padding
|
||||
const navBarPaddingTop = ref(0);
|
||||
@@ -103,10 +107,45 @@
|
||||
navBarPaddingTop.value = getNavBarPaddingTop() * 2;
|
||||
uni.$on('updateStatus', markVisited)
|
||||
})
|
||||
// 搜索处理
|
||||
let searchShow = ref(false);
|
||||
let searchText = ref(undefined);
|
||||
let searchTypeObj = ref({
|
||||
typeId: 3,
|
||||
typeName: '消息类型'
|
||||
});
|
||||
let noticeTypeList = ref([{
|
||||
id: 1,
|
||||
name: '市场机会'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '重大事项信息'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '竞争对手信息'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '人员变化信息'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: '重点型号任务信息'
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: '通用信息'
|
||||
}
|
||||
]);
|
||||
let notictTypeCheck = ref({}); //选中类型
|
||||
|
||||
// 查询列表
|
||||
let list = ref([]);
|
||||
|
||||
// 新增状态变量存储搜索条件
|
||||
const selValue = ref(''); // 搜索类型名称
|
||||
const inputval = ref(''); // 搜索内容
|
||||
let searchValue = ref(null)
|
||||
//监视查询的内容的变化
|
||||
watch(searchValue, (newValue, oldValue) => {
|
||||
@@ -114,7 +153,6 @@
|
||||
var data = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
searchContent: searchValue.value
|
||||
};
|
||||
viewingMarketInfForAllMembers(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
@@ -123,6 +161,10 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
onHide(()=>{
|
||||
searchShow.value=false;
|
||||
})
|
||||
|
||||
const index = ref(0)
|
||||
const categories = ref([{
|
||||
categoryId: 1,
|
||||
@@ -143,16 +185,39 @@
|
||||
categoryId: 6,
|
||||
categoryName: '通用信息'
|
||||
}])
|
||||
const selCategory = ref ({
|
||||
id: 1,
|
||||
val: ''
|
||||
const selCategory = ref({
|
||||
id: 1,
|
||||
val: ''
|
||||
})
|
||||
// 搜索返回操作
|
||||
const handleBack=()=>{
|
||||
searchShow.value=false;
|
||||
}
|
||||
// 获取input 焦点跳转
|
||||
const handleSearchFocus=()=>{
|
||||
searchShow.value = true;
|
||||
}
|
||||
// 搜索完返回处理
|
||||
const handleSearchConfirm = (param1,param2)=>{
|
||||
// console.log(param1,param2)
|
||||
notictTypeCheck.value=param1.value;
|
||||
inputval.value=param2.value || '';
|
||||
selValue.value = param1.value.name || '';
|
||||
searchValue.value = param2.value;
|
||||
console.log("selValue"+selValue.value)
|
||||
console.log("inputval"+inputval.value)
|
||||
// 重置mescroll触发刷新
|
||||
if (mescrollRef.value) {
|
||||
mescrollRef.value.resetUpScroll();
|
||||
}
|
||||
searchShow.value = false;
|
||||
}
|
||||
// 查询搜索跳转
|
||||
let handleSearch = () => {
|
||||
var data = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
searchContent: searchValue.value
|
||||
|
||||
};
|
||||
viewingMarketInfForAllMembers(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
@@ -218,7 +283,8 @@
|
||||
const upCallback = async (mescroll) => {
|
||||
try {
|
||||
setTimeout(async () => {
|
||||
const res = await getViewingMarketInfForAllMembers(mescroll.num, mescroll.size);
|
||||
const res = await getViewingMarketInfForAllMembers(mescroll.num, mescroll.size,selValue.value,
|
||||
inputval.value);
|
||||
if (mescroll.num === 1) {
|
||||
list.value = res.list;
|
||||
} else {
|
||||
@@ -236,7 +302,10 @@
|
||||
return new Promise(async (resolve) => {
|
||||
let param = {
|
||||
pageNum,
|
||||
pageSize
|
||||
pageSize,
|
||||
// 添加搜索条件参数
|
||||
selValue: selValue.value,
|
||||
inputval: inputval.value
|
||||
}
|
||||
let res = await viewingMarketInfForAllMembers(param);
|
||||
resolve({
|
||||
@@ -245,7 +314,6 @@
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
let Loop = ref(0)
|
||||
let now
|
||||
const visistId = ref();
|
||||
@@ -255,25 +323,28 @@
|
||||
|
||||
function showDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/business/CRM/marketInformation/informationDetail?informationId=" + item.informationId + '&selValue=' + item.selValue+ '&inputval=' + item.inputval
|
||||
url: "/pages/business/CRM/marketInformation/informationDetail?informationId=" + item.informationId +
|
||||
'&selValue=' + item.selValue + '&inputval=' + item.inputval
|
||||
})
|
||||
}
|
||||
|
||||
onUnload(() => {
|
||||
uni.$off('updateStatus')
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
onUnload(() => {
|
||||
uni.$off('updateStatus')
|
||||
})
|
||||
|
||||
const markVisited = (informationId) => {
|
||||
const newList = [...list.value].map(item => {
|
||||
if (item.informationId == informationId) {
|
||||
return { ...item, myselfBrowsing: 1 };
|
||||
}
|
||||
return item;
|
||||
});
|
||||
list.value = newList;
|
||||
|
||||
const newList = [...list.value].map(item => {
|
||||
if (item.informationId == informationId) {
|
||||
return {
|
||||
...item,
|
||||
myselfBrowsing: 1
|
||||
};
|
||||
}
|
||||
return item;
|
||||
});
|
||||
list.value = newList;
|
||||
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user