Commit d3a276b6 authored by 罗超's avatar 罗超

1

parent ee3fc59f
<style> <style>
.circleNews .ftBox{ .circleNews .ftBox {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0 15px; padding: 0 15px;
} }
.circleNews .interDList{
.circleNews .interDList {
width: 100%; width: 100%;
margin-top: 20px; margin-top: 20px;
} }
.circleNews .box-top{
.circleNews .box-top {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.circleNews .box-top-l{
.circleNews .box-top-l {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
position: relative; position: relative;
border-radius: 50%; border-radius: 50%;
} }
.circleNews .gstyle{
position: absolute;right: 0;bottom: 0; .circleNews .gstyle {
position: absolute;
right: 0;
bottom: 0;
width: 15px; width: 15px;
height: 15px; height: 15px;
} }
.circleNews .box-top-r{
.circleNews .box-top-r {
width: calc(100vw - 30px - 80rpx - 15px); width: calc(100vw - 30px - 80rpx - 15px);
margin-left: 15px; margin-left: 15px;
} }
.circleNews .box-top-r-n{
.circleNews .box-top-r-n {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
white-space:nowrap; white-space: nowrap;
text-overflow:ellipsis; text-overflow: ellipsis;
font-size: 15px; font-size: 15px;
color: #000000; color: #000000;
font-weight: bold; font-weight: bold;
} }
.circleNews .box-c{
.circleNews .box-c {
width: 100%; width: 100%;
padding: 10px 0; padding: 10px 0;
font-size: 13px; font-size: 13px;
...@@ -45,22 +54,28 @@ ...@@ -45,22 +54,28 @@
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
} }
.circleNews .box-b{
.circleNews .box-b {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
background: #F5F5F5; background: #F5F5F5;
min-height: 45px; min-height: 45px;
border-radius: 2px; border-radius: 2px;
} }
.box-b-text{
display: flex;align-items: center; .box-b-text {
font-size: 13px;color: #111111;margin-left: 15px; display: flex;
overflow: hidden; align-items: center;
white-space:nowrap; font-size: 13px;
text-overflow:ellipsis; color: #111111;
margin-left: 15px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.ftBox-right-text { .ftBox-right-text {
width: 55px; width: 55px;
height: 55px; height: 55px;
...@@ -68,209 +83,258 @@ ...@@ -68,209 +83,258 @@
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
background: #F5F5F5; background: #F5F5F5;
} }
</style> </style>
<template> <template>
<view class="circleNews"> <view class="circleNews">
<u-empty v-if="g.length == 0" text="暂无消息记录" mode="list"></u-empty> <u-empty v-if="g.length == 0" text="暂无消息记录" mode="list"></u-empty>
<view <view v-if="g.length > 0" style="
v-if="g.length > 0"
style="
height: calc(100vh); height: calc(100vh);
width: calc(100vw); width: calc(100vw);
overflow: hidden; overflow: hidden;
" ">
> <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
<scroll-view :style="{ height: '100%' }">
:scroll-y="true" <view class="ftBox" v-if="type==1">
:enable-back-to-top="true" <view class="interDList" v-for="(x, i) in g" :key="i">
:enable-flex="true" <view class="box-top">
@scrolltolower="lower" <view class="box-top-l" @click.native.stop="goUserinfo(x)">
:style="{ height: '100%' }" <u-avatar :src="x.Photo" size="80"></u-avatar>
> <image class="gstyle" v-if="x.Sex==1"
<view class="ftBox" v-if="type==0"> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nan-b.png">
<view class="interDList" v-for="(x, i) in g" :key="i"> </image>
<view class="box-top"> <image class="gstyle" v-if="x.Sex==2"
<view class="box-top-l" @click.native.stop="goUserinfo(x)"> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nv-b.png">
<u-avatar :src="x.Photo" size="80"></u-avatar> </image>
<image class="gstyle" v-if="x.Sex==1" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nan-b.png" ></image> </view>
<image class="gstyle" v-if="x.Sex==2" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nv-b.png" ></image> <view class="box-top-r">
</view> <view class="box-top-r-n">{{x.Name}}</view>
<view class="box-top-r"> <view style="font-size: 10px;color: #888888;">{{x.CreateDate}}</view>
<view class="box-top-r-n">{{x.Name}}</view> </view>
<view style="font-size: 10px;color: #888888;">{{x.CreateDate}}</view> </view>
</view> <view class="box-c">
</view> <u-icon name="good-job-o" :color="mainColor" size="28" v-if='x.Type==1'></u-icon>
<view class="box-c"> <u-icon name="comment-o" :color="mainColor" size="28" v-if='x.Type==2'
<u-icon name="good-job-o" :color="mainColor" size="28" v-if='x.Type==1'></u-icon> style='margin-top: 6rpx;'></u-icon>
<u-icon name="comment-o" :color="mainColor" size="28" v-if='x.Type==2' style='margin-top: 6rpx;'></u-icon> <view style="margin-left: 5px;">{{x.Content}}</view>
<view style="margin-left: 5px;">{{x.Content}}</view> </view>
</view> <view class="box-b" @click="jumpCircleDetail(x.ReplyContent[0])">
<view class="box-b"> <image :src='x.ReplyContent[0].CoverPhoto'
<image :src='x.ReplyContent[0].CoverPhoto' style="width: 55px;height: 55px;position: relative;" v-if="x.ReplyContent[0].FileType==1 "></image> style="width: 55px;height: 55px;position: relative;"
<view class="ftBox-right-text" v-if="x.ReplyContent[0].FileType==2" style="position: relative;"> v-if="x.ReplyContent[0].FileType==1 "></image>
<video id="myVideo" :src="x.ReplyContent[0].CoverPhoto" style="width: 100%;height: 100%;border-radius: 5px;" :controls='false' <view class="ftBox-right-text" v-if="x.ReplyContent[0].FileType==2"
:show-center-play-btn='false'></video> style="position: relative;">
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;"> <video id="myVideo" :src="x.ReplyContent[0].CoverPhoto"
<u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon> style="width: 100%;height: 100%;border-radius: 5px;" :controls='false'
</view> :show-center-play-btn='false'></video>
</view> <view
<image v-if="x.ReplyContent[0].FileType==3" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/circle-mic.png" mode="widthFix" style="width: 13px;height: auto;margin-left: 15px;"></image> style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;">
<u-icon name="column" color="#666666" size="40" v-if="x.ReplyContent[0].FileType==0" style='margin-left: 15px;'></u-icon> <u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon>
<view class="box-b-text" style="width: calc(100vw - 30px - 55px - 30px);" v-if="x.ReplyContent[0].FileType==1 || x.ReplyContent[0].FileType==2"> </view>
<text :style="{color:mainColor}">{{x.ReplyContent[0].CreateByName}}:</text> </view>
{{x.ReplyContent[0].Content}} <image v-if="x.ReplyContent[0].FileType==3"
</view> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/circle-mic.png"
mode="widthFix" style="width: 13px;height: auto;margin-left: 15px;"></image>
<view class="box-b-text" style="width: calc(100vw - 30px - 25px - 30px);margin-left: 10px;" v-if="x.ReplyContent[0].FileType==0 || x.ReplyContent[0].FileType==3"> <u-icon name="column" color="#666666" size="40" v-if="x.ReplyContent[0].FileType==0"
<text :style="{color:mainColor}">{{x.ReplyContent[0].CreateByName}}:</text> style='margin-left: 15px;'></u-icon>
{{x.ReplyContent[0].Content}} <view class="box-b-text" style="width: calc(100vw - 30px - 55px - 30px);"
</view> v-if="x.ReplyContent[0].FileType==1 || x.ReplyContent[0].FileType==2">
</view> <text :style="{color:mainColor}">{{x.ReplyContent[0].CreateByName}}:</text>
</view> {{x.ReplyContent[0].Content}}
</view> </view>
<view class="box-b-text" style="width: calc(100vw - 30px - 25px - 30px);margin-left: 10px;"
<u-loadmore v-if="x.ReplyContent[0].FileType==0 || x.ReplyContent[0].FileType==3">
:status="status" <text :style="{color:mainColor}">{{x.ReplyContent[0].CreateByName}}:</text>
:load-text="loadText" {{x.ReplyContent[0].Content}}
:font-size="24" </view>
:margin-top="20" </view>
:margin-bottom="20" </view>
bg-color="#FFF" </view>
/> <view class="ftBox" v-if="type==2">
</scroll-view> <view class="interDList" v-for="(x, i) in g" :key="i">
<view class="box-top">
</view> <view class="box-top-l" @click.native.stop="goUserinfo(x)">
<u-avatar :src="x.Photo" size="80"></u-avatar>
<image class="gstyle" v-if="x.Sex==1"
</view> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nan-b.png">
</image>
<image class="gstyle" v-if="x.Sex==2"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nv-b.png">
</image>
</view>
<view class="box-top-r">
<view class="box-top-r-n">{{x.Name}}</view>
<view style="font-size: 10px;color: #888888;">{{x.CreateDate}}</view>
</view>
</view>
<view class="box-c">
<u-icon name="good-job-o" :color="mainColor" size="28" v-if='x.Type==1'></u-icon>
<u-icon name="comment-o" :color="mainColor" size="28" v-if='x.Type==2'
style='margin-top: 6rpx;'></u-icon>
<view style="margin-left: 5px;">{{x.Content}}</view>
</view>
<view class="box-b" @click="jumpPPDetail(x.ReplyContent[0])">
<image
:src="x.ReplyContent[0].ImageList[0]"
mode="widthFix" style="width: 55px;height: 55px;position: relative;"></image>
<view class="box-b-text" style="width: calc(100vw - 30px - 55px - 30px);">
<text :style="{color:mainColor}">{{x.ReplyContent[0].UserName}}:</text>
{{x.ReplyContent[0].ActivityTitle}}
</view>
</view>
</view>
</view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20"
bg-color="#FFF" />
</scroll-view>
</view>
</view>
</template> </template>
<script> <script>
export default {
export default { data() {
return {
data() { pageTitle: "",
return { showAuth: false,
pageTitle: "报名列表", msg: {
showAuth:false, pageIndex: 1,
msg:{ pageSize: 10,
pageIndex: 1, SelectType: 1,
pageSize:10, Type: 0,
SelectType:1, Status: -1,
Type:0, },
Status:-1, type: 0,
}, mainColor: "",
type:0, secondary: '',
mainColor: "", pricecolor: '',
secondary:'',
pricecolor:'',
page: 1,
page_count: 1,
g: [],
loading: false,
status: "loadmore",
count:0,
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
windowWidth:0,
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.pricecolor = this.$uiConfig.pricecolor;
this.windowWidth = this.$utils.SystemInfo().windowWidth;
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
onLoad(options){
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
this.init();
}
},
methods: {
init() {
this.loading = true;
this.request2(
{
url: '/api/AppletMiai/GetMiaiMessagePageList',
data: this.msg
},
res => {
if(res.resultCode==1){
this.loading = false;
this.count = res.data.count;
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
lower(e) { page: 1,
if (this.msg.pageIndex < this.page_count) { page_count: 1,
this.msg.pageIndex++; g: [],
this.status = "loading"; loading: false,
this.init(); status: "loadmore",
} else { count: 0,
loadText: {
this.status = "nomore"; loadmore: "轻轻上拉,加载更多",
} loading: "努力加载中",
}, nomore: "没有更多了",
reloadUserinfo() { },
this.u = uni.getStorageSync("mall_UserInfo"); windowWidth: 0,
// this.showAuth=false;
this.init(); };
}, },
//关闭登录窗口 created() {
gbAuth(){
uni.navigateBack() this.mainColor = this.$uiConfig.mainColor;
}, this.secondary = this.$uiConfig.secondary;
}, this.pricecolor = this.$uiConfig.pricecolor;
}; this.windowWidth = this.$utils.SystemInfo().windowWidth;
</script>
<style> },
.circleNews { mounted() {
width: 100%; let currentPages = getCurrentPages();
height: 100vh; // let u = "/" + currentPages[currentPages.length - 1].route;
background: #FFF; // let pages = wx.getStorageSync("basedata") ?
} // wx.getStorageSync("basedata").bar_title :
// [];
// pages.forEach((x) => {
// if (x.value == u) {
// this.pageTitle = x.new_name ? x.new_name : x.name;
// }
// });
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
onLoad(options) {
this.msg.SelectType = options.pageType;
this.type = options.pageType;
if (options.pageType == 1) {
this.pageTitle = "圈子消息"
} else if (options.pageType == 2) {
this.pageTitle = "拼拼Plus"
}
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else {
this.init();
}
},
methods: {
init() {
this.loading = true;
this.request2({
url: '/api/AppletMiai/GetMiaiMessagePageList',
data: this.msg
},
res => {
if (res.resultCode == 1) {
this.loading = false;
this.count = res.data.count;
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth=false;
this.init();
},
//关闭登录窗口
gbAuth() {
uni.navigateBack()
},
//跳转拼拼plus详情
jumpPPDetail(x){
uni.navigateTo({
url: '/pages/blindDate/postDetails?Id='+x.Id
})
},
//跳转q圈子详情
jumpCircleDetail(x){
uni.navigateTo({
url: '/pages/friendcircle/mydetails?ID=' + x.id+'&index='+-1
})
}
},
};
</script>
<style>
.circleNews {
width: 100%;
height: 100vh;
background: #FFF;
}
</style> </style>
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
jumpPage(index){ jumpPage(index){
let url=""; let url="";
if(index==0){ if(index==0){
url="/pages/blindDate/circleNews" url="/pages/blindDate/circleNews?pageType=1"
}else if(index==1){ }else if(index==1){
url="/pages/blindDate/systemMsg" url="/pages/blindDate/systemMsg"
}else if(index==2){ }else if(index==2){
url="" url="/pages/blindDate/circleNews?pageType=2"
}else if(index==3){ }else if(index==3){
url="/pages/blindDate/visitor" url="/pages/blindDate/visitor"
} }
......
...@@ -654,6 +654,7 @@ ...@@ -654,6 +654,7 @@
}); });
}, },
onLoad(options) { onLoad(options) {
console.log(options)
if(options && options.Id){ if(options && options.Id){
this.msg.ActivityId = options.Id; this.msg.ActivityId = options.Id;
this.sendMsg.ActivityId = options.Id; this.sendMsg.ActivityId = options.Id;
......
...@@ -4,21 +4,29 @@ ...@@ -4,21 +4,29 @@
<view v-if="sysMsgData.length > 0" style=" <view v-if="sysMsgData.length > 0" style="
height: calc(100vh); height: calc(100vh);
overflow: hidden; overflow: hidden;
padding-bottom: 50px;
"> ">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
:style="{ height: '100%' }"> :style="{ height: '100%' }">
<view v-for="(item,index) in sysMsgData" :key="index"> <view v-for="(item,index) in sysMsgData" :key="index">
<view class="itemBox"> <view class="itemBox">
<view class="date"> <view class="date">
{{item.date}} {{item.date.slice(0,10)}}
</view> </view>
<view v-if="item.list" v-for="(subItem,subIndex) in item.list" :key="subIndex"> <view v-if="item.list" v-for="(subItem,subIndex) in item.list" :key="subIndex">
<view class="subItemBox"> <view class="subItemBox">
<view class="top"> <view class="top">
<image class="icon" :src="subItem.icon" mode="heightFix"></image> <image class="icon" :src="icon" mode="heightFix"></image>
<view class="type"> <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> </view>
</view> </view>
...@@ -26,7 +34,7 @@ ...@@ -26,7 +34,7 @@
</view> </view>
</view> </view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" <u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20"
bg-color="#FFF" /> bg-color="#EAEBEC" />
</scroll-view> </scroll-view>
</view> </view>
<!-- 加载中 --> <!-- 加载中 -->
...@@ -38,68 +46,97 @@ ...@@ -38,68 +46,97 @@
</template> </template>
<script> <script>
export default{ export default {
data(){ data() {
return{ return {
pageTitle: "系统消息", pageTitle: "系统消息",
msg: { icon: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Blind-ppplus.png",
pageIndex: 1, msg: {
pageSize: 10, pageIndex: 1,
SelectType: 4, pageSize: 10,
Status: -1 SelectType: 4,
}, Status: -1
sysMsgData:[ },
{date:"2021/03/01", sysMsgData: [],
list:[{ pageCount: null,
type:"系统消息", loading: false,
icon:"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Blind-ppplus.png", status: "loadmore",
tipMsg:"报名取消成功!", loadText: {
con:'支付宝717生活狂欢节--开场动画 美术制造流程' loadmore: "轻轻上拉,加载更多",
}]} loading: "努力加载中",
], nomore: "没有更多了",
loading: false, },
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
} }
}, },
methods:{ methods: {
getMiaiMessagePageList(){ getMiaiMessagePageList() {
this.request2( this.request2({
{ url: '/api/AppletMiai/GetMiaiMessagePageList',
url: '/api/AppletMiai/GetMiaiMessagePageList', data: this.msg
data:this.msg },
}, res => {
res => { if (res.resultCode == 1) {
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() { mounted() {
this.getMiaiMessagePageList(); this.getMiaiMessagePageList();
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.pageTitle, title: this.pageTitle,
}); });
uni.setNavigationBarColor({
backgroundColor: '#FFFFFF',
})
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page{ .page {
padding: 0 30rpx; padding: 0 30rpx;
// width: 100%;
min-height: 100vh; min-height: 100vh;
background-color: #EAEBEC; background-color: #EAEBEC;
} }
.itemBox{
width: 100%; .itemBox {
.date { .date {
height: 84rpx; height: 84rpx;
display: flex; display: flex;
...@@ -108,29 +145,64 @@ ...@@ -108,29 +145,64 @@
font-size: 26rpx; font-size: 26rpx;
font-weight: 500; font-weight: 500;
color: #888888; color: #888888;
padding-top: 40rpx;
} }
.subItemBox{
// width: 100%; .subItemBox {
height: 290rpx; // height: 292rpx;
padding: 30rpx; padding: 0 30rpx 30rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
.top{ border-radius: 4rpx;
margin-bottom: 30rpx;
.top {
width: 100%; width: 100%;
height: 95rpx; height: 84rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.icon{ padding-top: 37rpx;
.icon {
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.type{
.type {
font-size: 30rpx; font-size: 30rpx;
font-weight: 800; font-weight: 800;
color: #000000; 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> </style>
<template> <template>
<view class="page"> <view class="page">
<!-- <view class="navBox"> <view class="fixBox">
<view v-for="(item,index) in navList" :key="index"> <view class="navBox">
<view class="nav"> <view v-for="(item,index) in navList" :key="index">
{{item.name}} <view class="nav" :style="{'background-color':(activeNav==index?mainColor:'#fff'),'color':(activeNav==index?'#fff':'#888888')}" @click="changNav(index)">
</view> {{item.name}}
</view> </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> </view>
<view class="visit"> <view class="visitBox">
<view class="num"> <view class="visit">
{{todayVisit}} <view class="num">
</view> {{allVisit}}
<view class="name"> </view>
今日访客 <view class="name">
总浏览量
</view>
</view> </view>
</view> <view class="visit">
<view class="visit"> <view class="num">
<view class="num"> {{todayVisit}}
{{todayVisit}} </view>
<view class="name">
今日访客
</view>
</view> </view>
<view class="name"> <view class="visit">
今日浏览量 <view class="num">
{{todayVisit}}
</view>
<view class="name">
今日浏览量
</view>
</view> </view>
</view> </view>
</view> </view>
<u-empty v-if="visitorData.length == 0" text="暂无访问记录" mode="list"></u-empty> <u-empty v-if="visitorData.length == 0" text="暂无访问记录" mode="list" class="noBox"></u-empty>
<view v-if="visitorData.length > 0" style=" <view v-if="visitorData.length > 0" class="viewBox">
height: calc(100vh-160rpx-80rpx);
width: calc(100vw);
overflow: hidden;
padding-bottom: 50px;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
:style="{ height: '100%' }"> :style="{ height: '100%' }">
<view v-for="(item,index) in visitorData" :key="index"> <view v-for="(item,index) in visitorData" :key="index">
...@@ -56,17 +51,16 @@ ...@@ -56,17 +51,16 @@
<image class="sex" :src="sex[subItem.Sex]"></image> <image class="sex" :src="sex[subItem.Sex]"></image>
</view> </view>
<view class="rightBox"> <view class="rightBox">
<view class="infoBox"> <view class="infoBox">
<view class="name"> <view class="name">
{{subItem.RealName||subItem.UserName}} {{subItem.RealName||subItem.UserName}}
</view> </view>
<view class="time"> <view class="time">
{{subItem.CreateDate.slice(-5)}}访问了你的自画像 {{subItem.CreateDate.slice(-5)}}&nbsp;&nbsp;访问了你的自画像
</view> </view>
</view> </view>
<view class="icon"> </view> <!-- <view class="icon"> </view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -108,7 +102,7 @@ ...@@ -108,7 +102,7 @@
}, { }, {
name: "我看过谁" name: "我看过谁"
}], }],
current: 0, activeNav: 0,
allVisit: 100, //总浏览量 allVisit: 100, //总浏览量
todayVisit: 1, //今日访客,今日浏览量 todayVisit: 1, //今日访客,今日浏览量
visitorData: [], visitorData: [],
...@@ -122,13 +116,17 @@ ...@@ -122,13 +116,17 @@
} }
}, },
methods: { methods: {
change(index) { changNav(index){
this.current = index; this.activeNav=index
this.msg.VsisitorType=index+1
this.visitorData=[]
this.getMiaiMessageVisitorPageList();
}, },
//获取访问量
getMiaiMessageVisitorStatistics() { getMiaiMessageVisitorStatistics() {
this.request2({ this.request2({
url: '/api/AppletMiai/GetMiaiMessageVisitorStatistics', url: '/api/AppletMiai/GetMiaiMessageVisitorStatistics',
data: {} data: this.msg
}, },
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
...@@ -138,6 +136,7 @@ ...@@ -138,6 +136,7 @@
} }
); );
}, },
// 获取访问列表
getMiaiMessageVisitorPageList() { getMiaiMessageVisitorPageList() {
this.request2({ this.request2({
url: '/api/AppletMiai/GetMiaiMessageVisitorPageList', url: '/api/AppletMiai/GetMiaiMessageVisitorPageList',
...@@ -146,20 +145,22 @@ ...@@ -146,20 +145,22 @@
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.loading = false; this.loading = false;
let data=this.handleDate(res.data.pageData, "CreateDate","CreateDate") let data = this.handleDate(res.data.pageData, "CreateDate")
console.log(data)
this.visitorData = this.visitorData.concat(data); this.visitorData = this.visitorData.concat(data);
this.pageCount = res.data.pageCount this.pageCount = res.data.pageCount
if (this.pageCount == 1) {
this.status = "nomore";
}
} }
} }
); );
}, },
handleDate(arr, date,id) { //合并相同日期
handleDate(arr, date) {
let newArr = [] let newArr = []
arr.map((item, i) => { arr.map((item, i) => {
let find = newArr.filter((e) => { 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) { if (find.length > 0) {
find[0].list.push(item) find[0].list.push(item)
...@@ -173,8 +174,8 @@ ...@@ -173,8 +174,8 @@
}, []) }, [])
return newArr return newArr
}, },
//触底事件
lower(e) { lower(e) {
console.log(e)
if (this.msg.pageIndex < this.pageCount) { if (this.msg.pageIndex < this.pageCount) {
this.msg.pageIndex++; this.msg.pageIndex++;
this.status = "loading"; this.status = "loading";
...@@ -202,18 +203,43 @@ ...@@ -202,18 +203,43 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.page { .page {
padding: 0 30rpx; 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 { .navBox {
width: 100%; width: 100%;
height: 115rpx; height: 110rpx;
// display: flex; display: flex;
// justify-content: space-around; justify-content: space-around;
// align-items: center; align-items: center;
.nav { .nav {
width: 170rpx; width: 170rpx;
height: 56rpx; // height: 56rpx;
border-radius: 28rpx; border-radius: 28rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; 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