1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/messages/messages"],{"04ff":function(t,e,n){"use strict";n.r(e);var o=n("cd16"),s=n.n(o);for(var i in o)"default"!==i&&function(t){n.d(e,t,(function(){return o[t]}))}(i);e["default"]=s.a},"6e8f":function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));var o={TabBar:function(){return Promise.all([n.e("common/vendor"),n.e("components/TabBar/TabBar")]).then(n.bind(null,"a31d"))},uniPopup:function(){return n.e("node-modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup").then(n.bind(null,"8eb5"))},Popup:function(){return n.e("components/Popup/Popup").then(n.bind(null,"5643"))},Status:function(){return n.e("components/Status/Status").then(n.bind(null,"177c"))}},s=function(){var t=this,e=t.$createElement;t._self._c},i=[]},7515:function(t,e,n){"use strict";n.r(e);var o=n("6e8f"),s=n("04ff");for(var i in s)"default"!==i&&function(t){n.d(e,t,(function(){return s[t]}))}(i);n("c800");var a,u=n("f0c5"),c=Object(u["a"])(s["default"],o["b"],o["c"],!1,null,"a8cd628a",null,!1,o["a"],a);e["default"]=c.exports},c800:function(t,e,n){"use strict";var o=n("e405"),s=n.n(o);s.a},cd16:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=s(n("dbb0"));function s(t){return t&&t.__esModule?t:{default:t}}var i=function(){Promise.all([n.e("common/vendor"),n.e("components/TabBar/TabBar")]).then(function(){return resolve(n("a31d"))}.bind(null,n)).catch(n.oe)},a=function(){n.e("components/Popup/Popup").then(function(){return resolve(n("5643"))}.bind(null,n)).catch(n.oe)},u=function(){n.e("components/Popup/VipPopup").then(function(){return resolve(n("82d5"))}.bind(null,n)).catch(n.oe)},c=function(){n.e("components/Popup/PayPopup").then(function(){return resolve(n("db93"))}.bind(null,n)).catch(n.oe)},r=function(){n.e("components/Status/Status").then(function(){return resolve(n("177c"))}.bind(null,n)).catch(n.oe)},l=new o.default({key:"E5SBZ-T2YC3-CBL3F-YGFQQ-26PP2-ERFII"}),p={components:{TabBar:i,Popup:a,VipPopup:u,PayPopup:c,Status:r},data:function(){return{scrollHeight:0,topNavAlpha:0,assetsUrl:this.$util.assetsUrl,startTime:0,startPosition:0,endPosition:0,showDelIndex:-1,tabIndex:1,messagesList:[],popup:{content1:"",content2:"",tip1:"",tip2:"",btntext:""},payPopupIndex:-1,vipPopupIndex:-1,userInfo:null,showNoMsg:!1,systemMsg:{}}},computed:{statusBarHeight:function(){return this.$store.state.statusBarHeight},topbarOffsetHeight:function(){return this.$store.state.topbarOffsetHeight},platform:function(){return this.$store.state.platform},mineInfo:function(){return this.$store.state.userInfo}},onLoad:function(){this.computedScollviewHeight(),t.getStorageSync("token")?t.$TUIKit.on(t.$TUIKitEvent.CONVERSATION_LIST_UPDATED,this.onConversationListUpdated):this.showNoMsg=!0},onShow:function(){t.getStorageSync("token")&&(this.getSystemMessages(),this.getUserMessages())},onShareAppMessage:function(){return{title:"糖果公园",path:"/pages/login/login?share=".concat(this.userInfo.inviteCode)}},methods:{computedScollviewHeight:function(){var e=this,n=t.createSelectorQuery().in(this),o=this.$store.state.tabbarHeight/2;n.select("#topnav").boundingClientRect((function(t){o+=t.height})).exec((function(){var n=t.getSystemInfoSync();e.scrollHeight=n.windowHeight-o}))},toLogin:function(){t.reLaunch({url:"/pages/login/login"})},closePopup:function(){this.$refs.popup.close()},closePayPopup:function(){this.payPopupIndex=-1,this.$refs.paypopup.close()},closeVipPopup:function(){this.vipPopupIndex=-1,this.$refs.vippopup.close()},touchStart:function(t){this.startTime=Date.now(),this.startPosition=t.changedTouches[0].clientX},touchEnd:function(t){var e=Date.now();if(!(e-this.startTime<100)&&Math.abs(this.endPosition-this.startPosition)>100){this.endPosition=t.changedTouches[0].clientX;var n=this.endPosition-this.startPosition<0?"toLeft":"toRight";console.log(n),this.showDelIndex="toLeft"===n?t.currentTarget.dataset.index:-1}},onConversationListUpdated:function(t){if(0===t.data.length)return this.messagesList=[],void(this.showNoMsg=!0);this.getUserMessages()},delConversation:function(){t.$TUIKit.deleteConversation(this.messagesList[this.showDelIndex].conversationID),this.showDelIndex=-1},openSetting:function(){var e=this;if(!t.getStorageSync("token"))return this.popup={content1:"您还未登录",content2:"该功能登录后才能使用",tip1:"",tip2:"",btntext:"去登录"},void this.$refs.popup.open();t.showActionSheet({itemList:["全部已读","清空消息"],success:function(n){0===n.tapIndex&&t.$TUIKit.setAllMessageRead({scope:t.$TUIKitTypes.READ_ALL_MSG}),1===n.tapIndex&&t.showModal({title:"清空消息列表",content:"清空消息列表后,暂无恢复,请确认是否清空消息列表",success:function(n){n.confirm&&e.messagesList.forEach((function(e){t.$TUIKit.deleteConversation(e.conversationID)}))}})},fail:function(t){console.log(t.errMsg)}})},getSystemMessages:function(){var e=this,n=JSON.parse(t.getStorageSync("user"));this.$api.public.notifyActive({}).then((function(t){e.$api.public.loadSystemMsgs({completeUser:n,onlineRecent:!1,page:{index:1,size:20,sortValue:null}}).then((function(t){}))}))},getUserMessages:function(){var e=this;t.$TUIKit.getConversationList().then((function(t){console.log(t.data.conversationList);for(var n=0;n<t.data.conversationList.length;n++)if(t.data.conversationList[n].lastMessage.lastTimeStr=e.$moment(1e3*t.data.conversationList[n].lastMessage.lastTime).format("YYYY-MM-DD hh:mm:ss"),"TIMImageElem"===t.data.conversationList[n].lastMessage.type&&(t.data.conversationList[n].lastMessage.payload.text="[图片消息]"),"TIMVideoFileElem"===t.data.conversationList[n].lastMessage.type&&(t.data.conversationList[n].lastMessage.payload.text="[视频消息]"),"TIMSoundElem"===t.data.conversationList[n].lastMessage.type&&(t.data.conversationList[n].lastMessage.payload.text="[音频消息]"),"TIMCustomElem"===t.data.conversationList[n].lastMessage.type){var o=JSON.parse(t.data.conversationList[n].lastMessage.payload.data);99===o.type&&(t.data.conversationList[n].lastMessage.payload.text="[系统消息]"),5===o.type&&(t.data.conversationList[n].lastMessage.payload.text="[图片消息]"),6===o.type&&(t.data.conversationList[n].lastMessage.payload.text="[视频消息]"),100===o.type&&(t.data.conversationList.splice(n,1),n--)}e.messagesList=t.data.conversationList,0===e.messagesList.length?e.showNoMsg=!0:e.showNoMsg=!1}))},toTalk:function(e){var n=this;t.showLoading({mask:!0,title:"加载中"});var o=JSON.parse(t.getStorageSync("user"));this.$api.public.userDetail({getAlbum:!0,completeUser:o,uponUserId:e}).then((function(o){console.log(o),n.userInfo=o.data;var s=[],i={latitude:0,longitude:0};i.latitude=n.userInfo.geo.lat,i.longitude=n.userInfo.geo.lon,s.push(i),l.calculateDistance({mode:"straight",from:{latitude:n.$store.state.latitude,longitude:n.$store.state.longitude},to:s,success:function(o){if(t.hideLoading(),"query ok"===o.message){console.log(o,n.mineInfo);for(var s=0;s<o.result.elements.length;s++)n.userInfo.distance=o.result.elements[s].distance>1e3?"".concat(Math.floor(o.result.elements[s].distance/100)/10,"km"):"".concat(o.result.elements[s].distance,"m");if("Male"===n.mineInfo.sex&&!n.mineInfo.vip)return"ios"===n.platform?(n.vipPopupIndex=0,void n.$refs.vippopup.open()):(n.payPopupIndex=0,void n.$refs.paypopup.open());if("Famale"===n.mineInfo.sex&&!n.mineInfo.realMan)return n.popup={content1:"认证后才能开启私聊哦",content2:"给客服回复关键词「真人认证」",tip1:"",tip2:"",btntext:"联系客服去认证"},void n.$refs.popup.open();t.navigateTo({url:"/pagesSub/chatting/chatting?conversationid=C2C".concat(e)})}else t.showToast({title:"计算距离失败",icon:"none"}),t.navigateTo({url:"/pagesSub/chatting/chatting?conversationid=C2C".concat(e)})},fail:function(t){console.log(t)}})}))}}};e.default=p}).call(this,n("543d")["default"])},cdce:function(t,e,n){"use strict";(function(t){n("39a3");o(n("66fd"));var e=o(n("7515"));function o(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=n,t(e.default)}).call(this,n("543d")["createPage"])},e405:function(t,e,n){}},[["cdce","common/runtime","common/vendor"]]]);
|