pages-index-message.W4IS5Vpv.js 5.3 KB

1
  1. import{P as e,Y as s,Z as t,_ as a,a0 as l,h as o,n as i,k as r,m as n,w as u,o as c,p as m,q as d,t as p,v as f,z as g,B as y,C as h,F as _,G as x}from"./index-C9TJPork.js";import{_ as b}from"./u-badge.BHkDpFBd.js";import{r as w}from"./uni-app.es.CUt9gedF.js";import{_ as k}from"./u-avatar.B8J43dhc.js";import{_ as M,a as I}from"./uni-swipe-action.CaA8KZcO.js";import{_ as j}from"./mescroll-body.DWp9Rb53.js";import{M as C}from"./mescroll-mixins.C2YUWJKd.js";import{I as N}from"./mixin.l9wQyb8S.js";import{_ as v}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-icon.BNGPST4x.js";import"./renderjs.Cg3LvhxW.js";const D=v({mixins:[C,N],data:()=>({key:+new Date,keyword:"",list:[],options:[{text:"移除",style:{backgroundColor:"#dd524d"}}],upOption:{use:!1},swipeAction:!1}),watch:{badgeNum(e){this.setTabBarBadge()}},computed:{msgInfo:()=>e().getMsgInfo,baseURL(){return this.define.baseURL}},onLoad(){s("updateList",(e=>{this.$nextTick((()=>{this.mescroll.triggerDownScroll()}))})),s("updateMsgNum",(e=>{this.updateMsgNum(e)}))},onUnload(){t("updateList"),t("updateMsgNum")},methods:{openAction(e){this.list[e].show=!0,this.list.map(((s,t)=>{e!=t&&(this.list[t].show=!1)}))},handleRelocation(e){a(e).then((e=>{this.init()}))},isJSON(e){try{var s=JSON.parse(e);return!("object"!=typeof s||!s)}catch(t){return!1}},downCallback(e){this.init()},init(){l().then((e=>{this.mescroll.endSuccess(e.data.list.length,!1),this.list=e.data.list||[],this.swipeAction=!0,o()})).catch((()=>{this.mescroll&&this.mescroll.endErr()}))},search(){},updateMsgNum(s){const t=e(),a=this.list.length;for(let e=0;e<a;e++)if(s===this.list[e].id){const s=this.list[e].unreadMessage;t.reduceBadgeNum(s),this.list[e].unreadMessage=0;break}},getMsgText(e,s){if(!e)return"";let t="";switch(s){case"voice":t="[语音]";break;case"image":t="[图片]";break;default:t=e}return t},openPage(e){e&&i({url:e})},toIm(s){const t=e(),a=s.realName+"/"+s.account;s.unreadMessage&&(t.reduceBadgeNum(s.unreadMessage),s.unreadMessage=0),i({url:"/pages/message/im/index?name="+a+"&formUserId="+s.id+"&headIcon="+s.headIcon})}}},[["render",function(e,s,t,a,l,o){const i=x,C=c,N=w(r("u-badge"),b),v=w(r("u-avatar"),k),D=w(r("uni-swipe-action-item"),M),T=w(r("uni-swipe-action"),I),L=w(r("mescroll-body"),j);return m(),n(C,{class:"message-v"},{default:u((()=>[d(C,{class:"search-box_sticky"},{default:u((()=>[d(C,{class:"reply-item u-border-bottom u-flex",onClick:s[0]||(s[0]=e=>o.openPage("/pages/message/message/index?type="))},{default:u((()=>[d(C,{class:"reply-item-img-sysMsg reply-item-icon u-flex u-row-center reply-item-icon-color2"},{default:u((()=>[d(i,{class:"icon-ym icon-ym-xitong"})])),_:1}),d(C,{class:"reply-item-txt u-flex-1"},{default:u((()=>[d(C,{class:"reply-item-cell reply-item-title u-flex u-row-between"},{default:u((()=>[d(i,{class:"title"},{default:u((()=>[p("站内消息")])),_:1}),d(i,{class:"u-font-24"},{default:u((()=>[p(f(o.msgInfo.messageDate?e.$u.timeFormat(o.msgInfo.messageDate,"mm-dd hh:MM"):""),1)])),_:1})])),_:1}),d(C,{class:"reply-item-cell u-flex u-row-between"},{default:u((()=>[d(i,{class:"reply-item-txt-msg u-line-1 againColor"},{default:u((()=>[p(f(o.msgInfo.messageText),1)])),_:1}),o.msgInfo.messageCount?(m(),n(N,{key:0,type:"error",count:o.msgInfo.messageCount,absolute:!1},null,8,["count"])):g("",!0)])),_:1})])),_:1})])),_:1}),d(C,{class:"reply-item u-border-bottom u-flex",onClick:s[1]||(s[1]=e=>o.openPage("/pages/message/contacts/index"))},{default:u((()=>[d(C,{class:"reply-item-img-sysMsg reply-item-icon u-flex u-row-center reply-item-icon-color"},{default:u((()=>[d(i,{class:"icon-ym icon-ym-contacts"})])),_:1}),d(C,{class:"reply-item-txt u-flex-1"},{default:u((()=>[d(C,{class:"reply-item-cell reply-item-title u-flex u-row-between",style:{margin:"0"}},{default:u((()=>[d(i,{class:"title"},{default:u((()=>[p("通讯录")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),d(L,{ref:"mescrollRef",onInit:e.mescrollInit,onDown:o.downCallback,sticky:!1,up:l.upOption,bottombar:!1},{default:u((()=>[d(C,{class:"message-list"},{default:u((()=>[d(C,{class:"message-list-box"},{default:u((()=>[d(T,{ref:"swipeAction"},{default:u((()=>[(m(!0),y(_,null,h(l.list,((s,t)=>(m(),n(D,{key:s.id,"right-options":l.options,onClick:e=>o.handleRelocation(s.id)},{default:u((()=>[d(C,{class:"reply-item u-border-bottom u-flex",onClick:e=>o.toIm(s),id:"item"+t,ref_for:!0,ref:"mydom"},{default:u((()=>[d(C,{class:"reply-item-img"},{default:u((()=>[d(v,{src:o.baseURL+s.headIcon,mode:"square",size:"96"},null,8,["src"])])),_:2},1024),d(C,{class:"reply-item-txt u-flex-1"},{default:u((()=>[d(C,{class:"reply-item-cell reply-item-title u-flex u-row-between"},{default:u((()=>[d(i,{class:"title"},{default:u((()=>[p(f(s.realName)+"/"+f(s.account),1)])),_:2},1024),d(i,{class:"u-font-24 againColor"},{default:u((()=>[p(f(e.jnpf.toDateText(s.latestDate)),1)])),_:2},1024)])),_:2},1024),d(C,{class:"reply-item-cell u-flex u-row-between"},{default:u((()=>[d(i,{class:"reply-item-txt-msg u-line-1 againColor"},{default:u((()=>[p(f(o.getMsgText(s.latestMessage,s.messageType)),1)])),_:2},1024),d(N,{type:"error",count:s.unreadMessage,absolute:!1},null,8,["count"])])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick","id"])])),_:2},1032,["right-options","onClick"])))),128))])),_:1},512)])),_:1})])),_:1})])),_:1},8,["onInit","onDown","up"])])),_:1})}],["__scopeId","data-v-dac57eaa"]]);export{D as default};