12345678910 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/tui-chat/message-list/index"],{"11df":function(e,t,n){},5556:function(e,t,n){"use strict";var s;n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return s}));var o=function(){var e=this,t=e.$createElement,n=(e._self._c,e.scrollHeight>0?e.__map(e.messageList,(function(t,n){var s=e.__get_orig(t),o="@TIM#SYSTEM"!==e.conversation.type&&"TIMGroupTipElem"!==t.type?"in"===t.flow&&t.payload.data&&99===JSON.parse(t.payload.data).type:null,i="@TIM#SYSTEM"!==e.conversation.type&&"TIMGroupTipElem"!==t.type?t.payload.data&&99!==JSON.parse(t.payload.data).type:null;return{$orig:s,g0:o,g1:i}})):null);e.$mp.data=Object.assign({},{$root:{l0:n}})},i=[]},"831e":function(e,t,n){"use strict";n.r(t);var s=n("c1a4"),o=n.n(s);for(var i in s)"default"!==i&&function(e){n.d(t,e,(function(){return s[e]}))}(i);t["default"]=o.a},b3a0:function(e,t,n){"use strict";var s=n("11df"),o=n.n(s);o.a},c1a4:function(e,t,n){"use strict";(function(e){function s(e){return r(e)||a(e)||i(e)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){if(e){if("string"===typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function a(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function r(e){if(Array.isArray(e))return c(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=function(){Promise.all([n.e("common/vendor"),n.e("components/tui-chat/message-elements/text-message/index")]).then(function(){return resolve(n("a556"))}.bind(null,n)).catch(n.oe)},u=function(){Promise.all([n.e("common/vendor"),n.e("components/tui-chat/message-elements/image-message/index")]).then(function(){return resolve(n("5bc3"))}.bind(null,n)).catch(n.oe)},d=function(){n.e("components/tui-chat/message-elements/video-message/index").then(function(){return resolve(n("9b7a"))}.bind(null,n)).catch(n.oe)},f=function(){n.e("components/tui-chat/message-elements/audio-message/index").then(function(){return resolve(n("af14"))}.bind(null,n)).catch(n.oe)},m=function(){Promise.all([n.e("common/vendor"),n.e("components/tui-chat/message-elements/custom-message/index")]).then(function(){return resolve(n("fc39"))}.bind(null,n)).catch(n.oe)},g=function(){Promise.all([n.e("common/vendor"),n.e("components/tui-chat/message-elements/tip-message/index")]).then(function(){return resolve(n("14f9"))}.bind(null,n)).catch(n.oe)},h=function(){Promise.all([n.e("common/vendor"),n.e("components/tui-chat/message-elements/system-message/index")]).then(function(){return resolve(n("c7d7"))}.bind(null,n)).catch(n.oe)},p=function(){n.e("components/tui-chat/message-elements/face-message/index").then(function(){return resolve(n("3c99"))}.bind(null,n)).catch(n.oe)},v=function(){n.e("components/tui-chat/message-elements/file-message/index").then(function(){return resolve(n("aad2"))}.bind(null,n)).catch(n.oe)},T={data:function(){return{messageList:[],scrollView:"",scrollTo:"",endItem:"",scrollTop:null,scrollRefreshing:!1,scrollTriggered:!0,nextReqMessageID:"",isSend:!1,isCompleted:!1}},components:{TUITextMessage:l,TUIImageMessage:u,TUIVideoMessage:d,TUIAudioMessage:f,TUICustomMessage:m,TUITipMessage:g,TUISystemMessage:h,TUIFaceMessage:p,TUIFileMessage:v},props:{conversation:{type:Object,default:function(){}},topbarOffsetHeight:{type:Number,default:0},scrollHeight:{type:Number,default:0}},watch:{conversation:{handler:function(e){e&&e.conversationID&&!this.isSend&&(console.log(e.conversationID),this.conversation=e,this.getMessageList(e))},immediate:!0,deep:!0}},computed:{mineUserInfo:function(){return JSON.parse(e.getStorageSync("userInfo"))}},mounted:function(){var t=this;e.$TUIKit.on(e.$TUIKitEvent.MESSAGE_RECEIVED,this.$onMessageReceived,this),e.$TUIKit.on(e.$TUIKitEvent.MESSAGE_READ_BY_PEER,this.$onMessageReadByPeer,this),this.$EventBus.$on("sendMessage",(function(e){t.isSend=!0,t.updateMessageList(e)}))},destroyed:function(){e.$TUIKit.off(e.$TUIKitEvent.MESSAGE_RECEIVED,this.$onMessageReceived)},methods:{scrollPulling:function(e){},scrollRestore:function(){this.scrollTriggered=!0},scrollAbort:function(){},scrollToBottom:function(){},scrollRefresh:function(){var e=this;if(this.scrollRefreshing||this.isCompleted)return this.isSend=!1,this.isCompleted=!0,this.scrollTriggered=!1,void(this.scrollRefreshing=!1);this.scrollRefreshing=!0,this.getMessageList(this.conversation),setTimeout((function(){e.scrollTriggered=!1,e.scrollRefreshing=!1}),1e3)},getMessageList:function(t){var n=this;this.isCompleted||e.$TUIKit.getMessageList({conversationID:t.conversationID,nextReqMessageID:this.nextReqMessageID,count:15}).then((function(e){var t=e.data.messageList;console.log(e),n.nextReqMessageID=e.data.nextReqMessageID,n.isCompleted=e.data.isCompleted,n.messageList=[].concat(s(t),s(n.messageList)),n.$handleMessageRender(n.messageList,t)}))},updateMessageList:function(e){this.messageList.push(e),this.scrollToButtom()},$onMessageReadByPeer:function(){this.messageList=this.messageList},scrollToButtom:function(){var t=this,n=e.createSelectorQuery().in(this),s=n.select("#message-scroll");s.boundingClientRect((function(e){e&&t.$nextTick((function(){t.scrollTop=e.height,console.log("滑动到底部了")}))})).exec()},$onMessageReceived:function(e){this.isSend=!0,this.messageList.push(e.data[0]),this.scrollToButtom()},$handleMessageRender:function(e){var t=this;e.length>0&&(this.messageList=e,setTimeout((function(){t.$nextTick((function(){t.scrollTop=99999,console.log("滑动到底部了")}))}),500))}}};t.default=T}).call(this,n("543d")["default"])},c49f:function(e,t,n){"use strict";n.r(t);var s=n("5556"),o=n("831e");for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);n("b3a0");var a,r=n("f0c5"),c=Object(r["a"])(o["default"],s["b"],s["c"],!1,null,null,null,!1,s["a"],a);t["default"]=c.exports}}]);
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'components/tui-chat/message-list/index-create-component',
- {
- 'components/tui-chat/message-list/index-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('543d')['createComponent'](__webpack_require__("c49f"))
- })
- },
- [['components/tui-chat/message-list/index-create-component']]
- ]);
|