Commit d3a276b6 authored by 罗超's avatar 罗超

1

parent ee3fc59f
This diff is collapsed.
......@@ -37,11 +37,11 @@
jumpPage(index){
let url="";
if(index==0){
url="/pages/blindDate/circleNews"
url="/pages/blindDate/circleNews?pageType=1"
}else if(index==1){
url="/pages/blindDate/systemMsg"
}else if(index==2){
url=""
url="/pages/blindDate/circleNews?pageType=2"
}else if(index==3){
url="/pages/blindDate/visitor"
}
......
......@@ -654,6 +654,7 @@
});
},
onLoad(options) {
console.log(options)
if(options && options.Id){
this.msg.ActivityId = options.Id;
this.sendMsg.ActivityId = options.Id;
......
......@@ -4,21 +4,29 @@
<view v-if="sysMsgData.length > 0" style="
height: calc(100vh);
overflow: hidden;
padding-bottom: 50px;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
:style="{ height: '100%' }">
<view v-for="(item,index) in sysMsgData" :key="index">
<view class="itemBox">
<view class="date">
{{item.date}}
{{item.date.slice(0,10)}}
</view>
<view v-if="item.list" v-for="(subItem,subIndex) in item.list" :key="subIndex">
<view class="subItemBox">
<view class="top">
<image class="icon" :src="subItem.icon" mode="heightFix"></image>
<image class="icon" :src="icon" mode="heightFix"></image>
<view class="type">
{{subItem.type}}
系统消息
</view>
</view>
<view class="tipMsg" :style="{'color':(subItem.Type==9?'#F05353':'#000000;')}">
{{subItem.Content}}
</view>
<view class="conBox">
<image class="img" :src="subItem.ReplyContent[0].CoverImg"></image>
<view class="con">
{{subItem.ReplyContent[0].ActivityName}}
</view>
</view>
</view>
......@@ -26,7 +34,7 @@
</view>
</view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20"
bg-color="#FFF" />
bg-color="#EAEBEC" />
</scroll-view>
</view>
<!-- 加载中 -->
......@@ -38,68 +46,97 @@
</template>
<script>
export default{
data(){
return{
pageTitle: "系统消息",
msg: {
pageIndex: 1,
pageSize: 10,
SelectType: 4,
Status: -1
},
sysMsgData:[
{date:"2021/03/01",
list:[{
type:"系统消息",
icon:"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Blind-ppplus.png",
tipMsg:"报名取消成功!",
con:'支付宝717生活狂欢节--开场动画 美术制造流程'
}]}
],
loading: false,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
export default {
data() {
return {
pageTitle: "系统消息",
icon: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Blind-ppplus.png",
msg: {
pageIndex: 1,
pageSize: 10,
SelectType: 4,
Status: -1
},
sysMsgData: [],
pageCount: null,
loading: false,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
}
},
methods:{
getMiaiMessagePageList(){
this.request2(
{
url: '/api/AppletMiai/GetMiaiMessagePageList',
data:this.msg
},
res => {
if(res.resultCode==1){
methods: {
getMiaiMessagePageList() {
this.request2({
url: '/api/AppletMiai/GetMiaiMessagePageList',
data: this.msg
},
res => {
if (res.resultCode == 1) {
this.loading = false;
let data = this.handleDate(res.data.pageData, "CreateDate")
console.log(data)
this.sysMsgData = this.sysMsgData.concat(data);
this.pageCount = res.data.pageCount
if (this.pageCount == 1) {
this.status = "nomore";
}
}
}
);
}
}
);
},
//合并相同日期的元素
handleDate(arr, date) {
let newArr = []
arr.map((item, i) => {
let find = newArr.filter((e) => {
return e.date.slice(0, 10) == item[date].slice(0, 10)
})
if (find.length > 0) {
find[0].list.push(item)
} else {
let obj = {
date: item[date],
list: [item]
}
newArr.push(obj)
}
}, [])
return newArr
},
lower(e) {
if (this.msg.pageIndex < this.pageCount) {
this.msg.pageIndex++;
this.status = "loading";
this.getMiaiMessagePageList();
} else {
this.status = "nomore";
}
},
},
mounted() {
this.getMiaiMessagePageList();
uni.setNavigationBarTitle({
title: this.pageTitle,
});
uni.setNavigationBarColor({
backgroundColor: '#FFFFFF',
})
}
}
</script>
<style lang="scss" scoped>
.page{
.page {
padding: 0 30rpx;
// width: 100%;
min-height: 100vh;
background-color: #EAEBEC;
}
.itemBox{
width: 100%;
.itemBox {
.date {
height: 84rpx;
display: flex;
......@@ -108,29 +145,64 @@
font-size: 26rpx;
font-weight: 500;
color: #888888;
padding-top: 40rpx;
}
.subItemBox{
// width: 100%;
height: 290rpx;
padding: 30rpx;
.subItemBox {
// height: 292rpx;
padding: 0 30rpx 30rpx;
background-color: #FFFFFF;
.top{
border-radius: 4rpx;
margin-bottom: 30rpx;
.top {
width: 100%;
height: 95rpx;
height: 84rpx;
display: flex;
align-items: center;
.icon{
padding-top: 37rpx;
.icon {
width: 30rpx;
height: 30rpx;
margin-right: 10rpx;
}
.type{
.type {
font-size: 30rpx;
font-weight: 800;
color: #000000;
}
}
.tipMsg {
font-size: 26rpx;
font-weight: bold;
color: #000000;
margin-bottom: 30rpx;
margin-top: 20rpx;
}
.conBox {
height: 110rpx;
background-color: #F5F5F5;
border-radius: 4rpx;
display: flex;
.img {
width: 110rpx;
height: 110rpx;
}
.con {
flex-grow: 5;
padding: 0 20rpx;
display: flex;
align-items: center;
font-size: 26rpx;
font-weight: 500;
color: #111111;
}
}
}
}
</style>
<template>
<view class="page">
<!-- <view class="navBox">
<view v-for="(item,index) in navList" :key="index">
<view class="nav">
{{item.name}}
</view>
</view>
</view> -->
<u-tabs :list="navList" :is-scroll="false" :current="current" @change="change" :active-color="mainColor">
</u-tabs>
<view class="visitBox">
<view class="visit">
<view class="num">
{{allVisit}}
</view>
<view class="name">
总浏览量
</view>
<view class="fixBox">
<view class="navBox">
<view v-for="(item,index) in navList" :key="index">
<view class="nav" :style="{'background-color':(activeNav==index?mainColor:'#fff'),'color':(activeNav==index?'#fff':'#888888')}" @click="changNav(index)">
{{item.name}}
</view>
</view>
</view>
<view class="visit">
<view class="num">
{{todayVisit}}
</view>
<view class="name">
今日访客
<view class="visitBox">
<view class="visit">
<view class="num">
{{allVisit}}
</view>
<view class="name">
总浏览量
</view>
</view>
</view>
<view class="visit">
<view class="num">
{{todayVisit}}
<view class="visit">
<view class="num">
{{todayVisit}}
</view>
<view class="name">
今日访客
</view>
</view>
<view class="name">
今日浏览量
<view class="visit">
<view class="num">
{{todayVisit}}
</view>
<view class="name">
今日浏览量
</view>
</view>
</view>
</view>
<u-empty v-if="visitorData.length == 0" text="暂无访问记录" mode="list"></u-empty>
<view v-if="visitorData.length > 0" style="
height: calc(100vh-160rpx-80rpx);
width: calc(100vw);
overflow: hidden;
padding-bottom: 50px;
">
<u-empty v-if="visitorData.length == 0" text="暂无访问记录" mode="list" class="noBox"></u-empty>
<view v-if="visitorData.length > 0" class="viewBox">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
:style="{ height: '100%' }">
<view v-for="(item,index) in visitorData" :key="index">
......@@ -56,17 +51,16 @@
<image class="sex" :src="sex[subItem.Sex]"></image>
</view>
<view class="rightBox">
<view class="infoBox">
<view class="name">
{{subItem.RealName||subItem.UserName}}
</view>
<view class="time">
{{subItem.CreateDate.slice(-5)}}访问了你的自画像
{{subItem.CreateDate.slice(-5)}}&nbsp;&nbsp;访问了你的自画像
</view>
</view>
<view class="icon"> </view>
<!-- <view class="icon"> </view> -->
</view>
</view>
</view>
......@@ -108,7 +102,7 @@
}, {
name: "我看过谁"
}],
current: 0,
activeNav: 0,
allVisit: 100, //总浏览量
todayVisit: 1, //今日访客,今日浏览量
visitorData: [],
......@@ -122,13 +116,17 @@
}
},
methods: {
change(index) {
this.current = index;
changNav(index){
this.activeNav=index
this.msg.VsisitorType=index+1
this.visitorData=[]
this.getMiaiMessageVisitorPageList();
},
//获取访问量
getMiaiMessageVisitorStatistics() {
this.request2({
url: '/api/AppletMiai/GetMiaiMessageVisitorStatistics',
data: {}
data: this.msg
},
res => {
if (res.resultCode == 1) {
......@@ -138,6 +136,7 @@
}
);
},
// 获取访问列表
getMiaiMessageVisitorPageList() {
this.request2({
url: '/api/AppletMiai/GetMiaiMessageVisitorPageList',
......@@ -146,20 +145,22 @@
res => {
if (res.resultCode == 1) {
this.loading = false;
let data=this.handleDate(res.data.pageData, "CreateDate","CreateDate")
console.log(data)
let data = this.handleDate(res.data.pageData, "CreateDate")
this.visitorData = this.visitorData.concat(data);
this.pageCount = res.data.pageCount
if (this.pageCount == 1) {
this.status = "nomore";
}
}
}
);
},
handleDate(arr, date,id) {
//合并相同日期
handleDate(arr, date) {
let newArr = []
arr.map((item, i) => {
let find = newArr.filter((e) => {
return e.date == item[date]
return e.date.slice(0, 10) == item[date].slice(0, 10)
})
if (find.length > 0) {
find[0].list.push(item)
......@@ -173,8 +174,8 @@
}, [])
return newArr
},
//触底事件
lower(e) {
console.log(e)
if (this.msg.pageIndex < this.pageCount) {
this.msg.pageIndex++;
this.status = "loading";
......@@ -202,18 +203,43 @@
<style lang="scss" scoped>
.page {
padding: 0 30rpx;
position: relative;
}
.fixBox {
width: 100%;
position: fixed;
top: 0;
left: 0;
}
.noBox{
position: fixed;
top: 270rpx;
left: 0;
width: 100%;
overflow: hidden;
}
.viewBox {
position: fixed;
top: 270rpx;
left: 0;
width: 100%;
height: calc(100vh - 270rpx);
overflow: hidden;
padding: 0 30rpx;
}
.navBox {
width: 100%;
height: 115rpx;
// display: flex;
// justify-content: space-around;
// align-items: center;
height: 110rpx;
display: flex;
justify-content: space-around;
align-items: center;
.nav {
width: 170rpx;
height: 56rpx;
// height: 56rpx;
border-radius: 28rpx;
font-size: 28rpx;
font-weight: 500;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment