(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/tabbar/message/chat-page"],{"0682":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o={props:{size:{type:String,default:"90"},userId:{type:String,default:""},userName:{type:String,default:"H"}},computed:{photoStyle:function(){return"font-size: ".concat(this.size,"rpx; width: ").concat(2*this.size,"rpx; height: ").concat(2*this.size,"rpx; line-height: ").concat(2*this.size,"rpx;")}},data:function(){return{}},methods:{}};e.default=o},"1e27":function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var r=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.letterList,(function(e,n){var o=t.__get_orig(e),r=t.isMy(e,"self"),a=t.isMy(e,"bg-green");return{$orig:o,m0:r,m1:a}})));t.$mp.data=Object.assign({},{$root:{l0:n}})},a=[]},2837:function(t,e,n){"use strict";n.r(e);var o=n("1e27"),r=n("e371");for(var a in r)"default"!==a&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n("f4df");var u,i=n("f0c5"),s=Object(i["a"])(r["default"],o["b"],o["c"],!1,null,"54408d5d",null,!1,o["a"],u);e["default"]=s.exports},3221:function(t,e,n){},"8a48":function(t,e,n){},b91b:function(t,e,n){"use strict";var o=n("3221"),r=n.n(o);r.a},bd74:function(t,e,n){"use strict";(function(t){n("813a");o(n("66fd"));var e=o(n("2837"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},be8a:function(t,e,n){"use strict";n.r(e);var o=n("eea1"),r=n("f77d");for(var a in r)"default"!==a&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n("b91b");var u,i=n("f0c5"),s=Object(i["a"])(r["default"],o["b"],o["c"],!1,null,"79e5d186",null,!1,o["a"],u);e["default"]=s.exports},e371:function(t,e,n){"use strict";n.r(e);var o=n("f807"),r=n.n(o);for(var a in o)"default"!==a&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=r.a},eea1:function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return o}));var r=function(){var t=this,e=t.$createElement,n=(t._self._c,t.userName.slice(0,1));t.$mp.data=Object.assign({},{$root:{g0:n}})},a=[]},f4df:function(t,e,n){"use strict";var o=n("8a48"),r=n.n(o);r.a},f77d:function(t,e,n){"use strict";n.r(e);var o=n("0682"),r=n.n(o);for(var a in o)"default"!==a&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=r.a},f807:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("7cc2")),r=(a(n("45a9")),a(n("be8a")));function a(t){return t&&t.__esModule?t:{default:t}}var u={components:{avatar:r.default},data:function(){return{otherInfo:t.getStorageSync("otherInfo"),userInfo:t.getStorageSync("userInfo"),InputBottom:0,messageContent:"",letterList:[],interval:{}}},onShow:function(){var t=this;this.updateRead(),this.getTwoLetterApp();var e=0,n=setInterval((function(){t.getTwoLetterApp(),e+=1,5===e&&clearInterval(n)}),2e3)},onBackPress:function(){},onPullDownRefresh:function(){this.getTwoLetterApp(),t.startPullDownRefresh()},onLoad:function(){t.setNavigationBarTitle({title:this.otherInfo.real_name})},watch:{letterList:function(){this.$nextTick((function(){t.pageScrollTo({scrollTop:99999,duration:0})}))}},methods:{InputFocus:function(t){this.InputBottom=t.detail.height},InputBlur:function(t){this.InputBottom=0},goToOther:function(e){t.navigateTo({url:"/pages/person-info-page/person-info-page?userId=".concat(e.send_id)})},goToMy:function(){t.switchTab({url:"/pages/tabbar/my/my"})},getTwoLetterApp:function(){var e=this;o.default.post("/hs/getTwoLetterApp",{userId:t.getStorageSync("userInfo").user_id,otherId:this.otherInfo.user_id}).then((function(t){console.log("获取两个人的私信",t),null!==t.data&&(e.letterList=t.data)}),(function(t){console.log("err",t)}))},sendMessage:function(){var e=this;""===this.messageContent?t.showToast({icon:"none",title:"请输入消息，亲"}):o.default.post("/hs/sendLetter",{sendId:t.getStorageSync("userInfo").user_id,receiveId:this.otherInfo.user_id,content:this.messageContent}).then((function(t){e.messageContent="",console.log("发送消息",t),1===t.data&&(e.getTwoLetterApp(),e.messageContent="")}),(function(t){console.log("err",t)}))},updateRead:function(){o.default.post("/hs/updateReadApp",{userId:t.getStorageSync("userInfo").user_id,otherId:this.otherInfo.user_id}).then((function(t){console.log("改为已读",t)}),(function(t){console.log("err",t)}))},isMy:function(e,n){return e.send_id===t.getStorageSync("userInfo").user_id?n:""}}};e.default=u}).call(this,n("543d")["default"])}},[["bd74","common/runtime","common/vendor"]]]);