123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614 |
- <template>
- <view>
- <u-navbar v-show="false" ref="refNavbar" >
-
- </u-navbar>
-
- <view class="header">
- <!-- 导航 -->
- <view :class="flag?'sticky':'navbar'">
- <view class="back" style="font-size: 32rpx;" @click="back()">
- <u-icon name="arrow-left" size="40"></u-icon>返回
- </view>
- <view class="title">
- 个人主页
- </view>
- <view class="camera" @click="issueMethod()" >
- <u-icon name="camera-fill" size="48"></u-icon>
- </view>
- </view>
- <!-- 个人信息 -->
- <view class="person-infos">
- <view class="photo">
-
- <img v-if="userInfo.headImg" :src="userInfo.headImg" alt="">
-
- <u-avatar v-else size="120" ></u-avatar>
- </view>
- <view class="infos">
- <view class="name">
- {{userInfo.name}}
- </view>
- <view class="department-position">
- <view class="department" v-if="userInfo.orgName">
- <view class="icon">
- <img src="../../assets/img/department2.png" alt="">
- </view>
- <view class="text">
- {{userInfo.orgName}}
- </view>
- </view>
- <view class="position">
- <text class="icon">
- <img src="../../assets/img/position2.png" alt="">
- </text>
- <text class="text">
- 员工
- </text>
- </view>
- </view>
- </view>
- </view>
-
- <view class="grid">
- <view class="item">
- <view class="amout">
- {{plusInfo.userShare}}
- </view>
- <view class="text">
- 发布
- </view>
- </view>
- <view class="item">
- <view class="amout">
- {{plusInfo.userNewsLike}}
- </view>
- <view class="text">
- 点赞
- </view>
- </view>
- <view class="item">
- <view class="amout">
- {{plusInfo.userNewsComment}}
- </view>
- <view class="text">
- 评论
- </view>
- </view>
-
- </view>
- </view>
- <!-- 分享 -->
- <view class="share">
- <view class="item" v-for="(item,i) in list" :key="i" >
- <view class="date">
- <view class="day">
- {{day(item.createTime)}}
- </view>
- <view class="year-month">
- {{yearmonth(item.createTime)}}
- </view>
- <view class="status" style="color: red;" v-if="item.status!=1">
- [{{item.status==0?'审核中':''}}{{item.status==2?'审核不通过':''}}]
- </view>
-
- <view class="status" style="color: #19be6b;" @click="delShare(item.id)" v-if="item.status!=1">
- <u>点击删除</u>
- </view>
- </view>
- <view class="tagMain">
- <view class="content">
- <view class="title">
- <textarea placeholder="记录点滴生活..." :auto-height="true"
- v-model="item.synopsis" maxlength="200" readonly
- name="" id="" ></textarea>
- </view>
- <view class="photos">
- <template v-for="(pic,i2) in item.listShareFiles" v-if="pic.url">
- <img v-if="pic.isPic" :key="i2"
- @click="previewImage(item.listShareFiles,i2)"
- :src="pic.url" alt="">
-
- <video v-else :key="i2" :src="pic.url" :class="{videoplay:playurl==pic.url}" @play="playurl=pic.url"
- enable-danmu danmu-btn controls></video>
- </template>
- </view>
- </view>
- <view class="likeMain" v-if="item.status==1" >
- <view class="like" >
- <view class="icon">
- <u-icon name="thumb-up" size="38"></u-icon>
- </view>
- <view class="number">
- {{item.likesNum}}
- </view>
- </view>
-
-
- <view class="like" style="margin-left: 18rpx;">
- <view class="icon">
- <img style="width: 40rpx; height: 48rpx;"
- src="../../assets/img/riLine-chat-4-line.svg"></img>
- </view>
- <view class="number"> {{item.commentNum}}</view>
- </view>
- <view class="like" style="margin-left: 18rpx;"
- @click="gotoUrl('pages/staffHome/filesonicInfo?id='+item.id)" >
- <view class="icon">
- <u-icon name="photo" size="38"></u-icon>
-
- </view>
- <view class="number"> 查看</view>
- </view>
- </view>
-
-
- <view class="messageListMain" v-show="item.listShareLikes.length||item.listShareComment.length" >
- <view class="mLikeList" v-show="item.listShareLikes.length">
- <u-icon name="thumb-up" size="38"></u-icon>
- <span v-for="(itemlike,ilike) in item.listShareLikes" :key="ilike">
- {{ilike==0?' ':', '}}{{itemlike.userName}}
- </span>
- <span v-show="item.likesNum>item.listShareLikes.length">...</span>
- </view>
- <view class="messageList" v-show="item.listShareComment.length">
- <view class="messageItem" v-for="(itemcom,ico) in item.listShareComment" :key="ico" >
- <span class="mItemTitle">{{itemcom.userName}}:</span>
- <span class="mItemBody">{{itemcom.content}}</span>
- </view>
- <view class="messageItemEnd" v-show="item.commentNum>item.listShareComment.length" >最多显示20条评论</view>
- </view>
-
- </view>
- </view>
- </view>
- </view>
- <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
-
- </view>
- </template>
- <script>
- import * as API from '@/apis/pagejs/user.js'
- import * as API_share from '@/apis/pagejs/share.js'
-
- export default {
- data() {
- return {
- flag: false,
- scrollTop: "",
- playurl:"",
- plusInfo:{},
- userInfo:{},
- listForm:{
- pageIndex:1,
- pageSize:20,
- queryStatus:1
- },
- list:[],
- recordsTotal:0,
- }
- },
- onLoad() {
- this.carhelp.set("addShare",0);
- this.init()
- this.getList()
- },
- onShow(){
- this.findByOpenId()
- if( this.carhelp.get("addShare")){
- this.listForm.pageIndex=1;
- this.getList()
- }
- },
- onReachBottom() {
- if (this.list.length < this.recordsTotal) {
- this.myLoadmore();
- }
- },
- methods: {
- delShare(id){
- uni.showModal({
- title: '提示',
- content: '是否删除分享?',
-
- success: res=>{
- if (res.confirm) {
- this.delShareApi(id)
- } else if (res.cancel) {
- //('用户点击取消');
- }
- }
- });
- },
- delShareApi(id){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API_share.delShare({
- shareId:id
- }).then((res) => {
-
- uni.showToast({
- title: "删除成功",
- icon: "none"
- })
-
- this.listForm.pageIndex=1;
- this.getList()
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- this.listForm.pageIndex=1;
- this.getList()
- })
- },
- day(time){
- if(time){
-
- return time.substring(8,10)
- }else
- return''
- },
- yearmonth(time){
- if(time){
-
- return time.substring(0,7).replace('-','.')
- }else
- return''
- },
- issueMethod(id){
-
- this.gotoUrl('pages/mine/issue?nic=1')
- },
- init(){
- this.plusInfo=this.carhelp.getPersonInfoPlus();
- this.userInfo=this.carhelp.getPersonInfo();
-
- },
- findByOpenId(){
- API.findByOpenId({
- noerror:true,
- openId: this.carhelp.getOpenId(),
-
- }).then((response) => {
- this.carhelp.setToken(response.data.token);
- this.carhelp.setPersonInfo(response.data.regUser);
- this.carhelp.setPersonInfoPlus(response.data)
- this.init();
- }).catch(error => {
- uni.hideLoading();
-
- })
- },
- back(){
- this.$refs.refNavbar.goBack()
- },
- onPageScroll(e) {
- this.scrollTop = e.scrollTop;
- console.log(this.scrollTop);
-
- if (this.scrollTop >=44) {
- this.flag = true;
- } else {
- this.flag = false;
- }
-
-
- },previewImage(img,j) {
- let imgs = [];
- img.forEach(it=>{
- if(it.isPic){
- imgs.push(it.url)
- }
- })
-
-
- uni.previewImage({
- indicator:"number",
- indicatorDots:true,
- loop:true,
- urls: imgs,
- current: j,
- success:(e)=>{
-
- }
-
- })
- },getList(){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- API_share.pageList(this.listForm).then((res) => {
- this.carhelp.set("addShare",0);
- uni.hideLoading();
- //this.list=response.data.data
- if(this.listForm.pageIndex==1){
- this.list = res.data.data;
- }else{
- this.list = [
- ...this.list,
- ...res.data.data
- ];
- }
- this.recordsTotal = res.data.recordsTotal;
-
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- myLoadmore(){
- this.listForm.pageIndex += 1;
- this.getList();
- },
- }
- }
- </script>
- <style scoped lang="scss">
-
-
- .tagMain {
- // display: flex;
- // justify-content: space-between;
- .messageListMain{
- border-radius: 4px;
- background-color: rgba(240, 240, 240, 1);
-
- color: #224466 ;
- .mLikeList{
- padding:16rpx;
- border-bottom: 1px solid rgba(222, 222, 222, 1);
- }
- .messageList{
- padding:16rpx;
- .messageItem{
- // display: flex;
- // flex-wrap: wrap;
- .mItemBody{
- color: #101010;
-
- }
- }
- .messageItemEnd{
- text-align: center;
- color: #9E9E9E;
- }
-
- }
- }
- .likeMain{
- display: flex;
- justify-content: flex-end;
- .like {
- margin-top: 16rpx;
- line-height: 24px;
- display: flex;
- color:#224466 ;
- .number {
- margin-left: 16rpx;
- }
- }
- }
- .tag {
- margin-top: 16rpx;
- line-height: 24px;
-
- .symbol {
- color: rgba(31, 74, 153, 100);
- font-size: 16px
- }
-
- .text {
- color: rgba(31, 74, 153, 1);
- margin-left: 14rpx;
- }
- }
- }
-
-
- uni-textarea{
- width: 500rpx;
- text-indent: 28rpx;
- padding-top:28rpx;
- font-family: Microsoft Yahei;
- }
- page{
- background-color: #fff;
- padding-bottom: 50px;
- font-family: 'Regular';
- }
- .header{
- padding: 0 0 48rpx 0;
- background: linear-gradient(180deg, rgba(183,208,255,1) 0%,rgba(244,244,246,1) 100%);
- .navbar{
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 44px;
- padding: 0 32rpx;
- .title{
- font-size: 16px;
- color: rgba(16, 16, 16, 1);
- }
- }
- .sticky{
- background-color: #fff;
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 44px;
- padding: 0 32rpx;
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- .title{
- font-size: 16px;
- color: rgba(16, 16, 16, 1);
- }
-
- }
-
- // 个人信息
- .person-infos{
- margin-top: 32rpx;
- padding: 0 48rpx;
- display: flex;
- align-items: center;
- margin-bottom: 48rpx;
- .photo {
- box-shadow: 0px 2px 8px 0px rgba(35, 72, 75, 15);
- border: 2px solid rgba(255, 255, 255, 1);
- border-radius: 50px;
- width: 120rpx;
- height: 120rpx;
- overflow: hidden;
- img {
- vertical-align: middle;
- border-radius: 50px;
- width: 120rpx;
- height: 120rpx;
- }
-
- }
-
- .infos {
- margin-left:32rpx;
-
- .name {
- line-height: 28px;
- font-size: 20px;
- font-family: 'Medium';
- }
-
- .department-position {
- display: flex;
- margin-top: 16rpx;
- color: rgba(119, 119, 119, 1);
-
- .icon {
- margin-right: 8rpx;
-
- img {
- width: 28rpx;
- height: 28rpx;
-
- }
- }
-
-
- .department {
- display: flex;
-
- .text{
- line-height: 16px;
- }
-
- }
-
- .position {
- display: flex;
-
- margin-left: 24rpx;
- .text{
- line-height: 16px;
- }
- }
- }
- }
- }
-
- .grid {
- width: 100%;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- align-items: center;
- margin-top: 24rpx;
- justify-content: space-between;
- .item {
- width: 33.3%;
- text-align: center;
-
- .amout {
- font-size: 48rpx;
- line-height: 64rpx;
-
- }
-
- .text {
- font-size: 32rpx;
- line-height: 44rpx;
- }
- }
- }
- }
-
- .share{
- padding: 32rpx;
- .item{
- margin-bottom: 48rpx;
- display: flex;
- .date{
- width: 120rpx;
- .day{
- color: rgba(51, 51, 51, 1);
- font-size: 18px;
- font-weight:bold;
- line-height: 25px;
- font-family: 'Medium';
- }
- .year-month{
- color: rgba(51, 51, 51, 1);
- }
- }
- .content{
- margin-left: 52rpx;
- border-bottom: 1px solid rgba(232, 232, 232, 1);
- padding-bottom: 32rpx;
- .title{
- color: rgba(51, 51, 51, 1);
- font-size: 16px;
- margin-bottom: 16rpx;
- line-height: 22px;
- }
- .photos{
-
- img{
- width: 168rpx;
- height: 168rpx;
- border-radius: 16rpx;
- margin-right: 4rpx;
- }
- .videoplay{
- height: 400rpx;
- }
- video {
- width: 100%;
- height: 200rpx;
- border-radius: 16rpx;
- margin-bottom: 16rpx;
- //margin-left: 16rpx;
- }
- }
- }
-
- }
- .item:last-of-type{
- .content{
- border: none;
- }
- }
- }
- </style>
|