| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <template>
- <view>
- <view class="tab ddflex">
- <view class="tab-item fflex" :class="tabIndex==1?'tab-item-active':''" @click="tabChange(1)">今日动态</view>
- <view class="tab-item fflex" :class="tabIndex==2?'tab-item-active':''" @click="tabChange(2)">历史动态</view>
- </view>
- <view style="height: 120rpx;"></view>
-
- <view class="log">
- <view v-if="logsList && logsList.length > 0" v-for="(it, index) in logsList" :key="index" @click="jumpUrl('/mine/clientDetail/clientDetail?id='+it.uid)">
- <view class="time-year" v-if="todayYear!=it.year && index==0 || (index!=0 && (it.year!=logsList[index-1].year))">{{ it.year }}年</view>
- <view class="dflex">
- <view class="time-sort">
- <block v-if="index==0 || (index!=0 && (it.day!=logsList[index-1].day||it.month!=logsList[index-1].month||it.year!=logsList[index-1].year))">
- <text v-if="todayYear==it.year&&todayMonth==it.month&&todayDay==it.day">今日</text>
- <block v-else>
- <text>{{it.day}}</text>{{ it.month }}月
- </block>
- </block>
- </view>
- <view class="li fflex">
- <image src="/mine/static/images/jcico.png" class="jcico"></image>
- <view class="ddflex" style="width: 100%;margin-bottom: 20rpx;">
- <image style="width: 80rpx;height: 80rpx;border-radius: 100%;margin-right: 20rpx;" :src="it.avatar?it.avatar:'/static/images/userimg.png'"></image>
- <view class="fflex">
- <view style="font-size: 28rpx;font-weight: bold;" class="ddflex">
- <view class="tover " style="max-width: 250rpx;">{{it.nickName}}</view>
- <view v-if="it.realName">({{it.realName}})</view>
- </view>
- <view class="time">{{ it.time }}</view>
- </view>
- </view>
- <!-- <view class="des" v-if="it.brief">{{ it.brief }}</view> -->
- <rich-text class="des" :nodes="it.content"></rich-text>
- </view>
- </view>
- </view>
- <view v-if="!logsList || logsList.length == 0" class="nodata">
- <image src="/mine/static/images/empty.png" mode="aspectFill"></image>
- <view>暂无记录~</view>
- </view>
- </view>
-
- </view>
- </template>
- <script>
- import util from "../../utils/util.js";
- const app = getApp();
- const req = require("../../utils/request.js");
- export default {
- components: {},
- props: {},
- data() {
- return {
- tabIndex:1,
- isLoad: true,
- form: {
- page: 1,
- limit: 10
- },
-
- logsList:[{
- createDate:'2023-03-04',
- brief:'阅读了《3·15|手把手教你读懂“食品标签”,拒绝被“坑”》',
- logsContent:'sss',
- year:"2022",
- month:"10",
- day:'30',
- time:'12:00'
-
- },{
- createDate:'2023-03-04',
- brief:'阅读了《3·15|手把手教你读懂“食品标签”,拒绝被“坑”》',
- logsContent:'sss',
- year:"2023",
- month:"4",
- day:'30',
- time:'12:00'
-
- },{
- createDate:'2023-03-04',
- brief:'浏览了中医馆私域解决方案',
- logsContent:'sss',
- year:"2023",
- month:"3",
- day:'04',
- time:'12:00'
- },{
- createDate:'2023-03-04',
- brief:'填写了表单《英才少儿教育精品VIP课程试听报名》',
- logsContent:'sss',
- year:"2023",
- month:"3",
- day:'03',
- time:'12:00'
- },{
- createDate:'2023-03-04',
- brief:'浏览了中医馆私域解决方案',
- logsContent:'sss',
- year:"2023",
- month:"3",
- day:'03',
- time:'12:00'
- },{
- createDate:'2023-03-04',
- brief:'填写了表单《英才少儿教育精品VIP课程试听报名》',
- logsContent:'sss',
- year:"2023",
- month:"2",
- day:'04',
- time:'12:00'
- },{
- createDate:'2023-03-04',
- brief:'浏览了中医馆私域解决方案',
- logsContent:'sss',
- year:"2022",
- month:"2",
- day:'04',
- time:'12:00'
- },{
- createDate:'2023-03-04',
- brief:'填写了表单《英才少儿教育精品VIP课程试听报名》',
- logsContent:'sss',
- year:"2022",
- month:"2",
- day:'03',
- time:'12:00'
- }],
- todayYear:'',
- todayMonth:'',
- todayDay:''
- }
- },
- onLoad(options) {
- this.todayYear = new Date().getFullYear()
- this.todayMonth = new Date().getMonth() + 1
- this.todayDay = new Date().getDate()
- this.getPageList()
- },
- onShow() {
-
- },
- onReachBottom: function() {
- this.form.page++;
- this.getPageList(false);
- },
- methods: {
- jumpUrl(url) {
- uni.navigateTo({
- url: url
- })
- },
- tabChange(index){
- if(this.tabIndex==index) return false
- this.tabIndex = index
- this.form.page = 1
- this.isLoad = true;
- this.getPageList(true)
- },
- getPageList(isShow) {
- if (!this.isLoad) return false;
- this.isLoad = false;
- let form = this.form;
- if(this.tabIndex==1) {
- form.startDate = util.formatTime(new Date()).t2 + ' 00:00:00'
- form.endDate = util.formatTime(new Date()).t2 + ' 23:59:59'
- }else{
- delete form.startDate
- delete form.endDate
- }
- uni.showLoading();
- req.getRequest(
- '/api/user/getUsersTrends',
- form,
- res => {
- res = res?res.list:[]
- if(res&&res.length>0){
- res.map(item=>{
- let t = this.getDate(item.createDate)
- item.year = t.year
- item.month = t.month
- item.day = t.day
- item.time = (t.hour<10?('0'+t.hour):t.hour)+':'+(t.minute<10?('0'+t.minute):t.minute)
- })
- }
- this.isShow = true;
- if (res && res.length == 10) {
- this.isLoad = true;
- }
- if (this.form.page > 1) {
- res = this.logsList.concat(res);
- }else{
- this.goTop()
- }
- this.logsList = res;
- uni.hideLoading();
- },
- isShow
- );
- },
- getDate(dateStr){
- if(!dateStr) return false
- let date = new Date(dateStr)
- const year = date.getFullYear();
- const month = date.getMonth() + 1;
- const day = date.getDate();
- const hour = date.getHours();
- const minute = date.getMinutes();
- const second = date.getSeconds();
- return {
- year:year,
- month:month,
- day:day,
- hour:hour,
- minute:minute,
- second:second,
- }
- },
- goTop(e) {
- // 一键回到顶部
- if (uni.pageScrollTo) {
- uni.pageScrollTo({
- scrollTop: 0,
- duration:100
- });
- }
- }
- },
- mounted() {
- },
- }
- </script>
- <style>
- @import "./allDynamic.css";
- </style>
|