From bdd744da32fcc2baf464dd02ff50fdfc4b5e7d1b Mon Sep 17 00:00:00 2001 From: fengshuo <963787902@qq.com> Date: Thu, 2 Dec 2021 20:34:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=94=A8=E6=88=B7=E8=B5=84?= =?UTF-8?q?=E6=96=99=E4=B8=AD=E5=BF=83=20=E7=A7=81=E8=81=8A=20=E8=B7=9F?= =?UTF-8?q?=E9=9A=8F=E8=BF=9B=E6=88=BF=20=E5=85=B3=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xplan-ios.xcodeproj/project.pbxproj | 6 - .../Contents.json | 22 +++ ...e_user_info_bottom_attention_normal@2x.png | Bin 0 -> 717 bytes ...e_user_info_bottom_attention_normal@3x.png | Bin 0 -> 1033 bytes .../Contents.json | 22 +++ ...e_user_info_bottom_attention_select@2x.png | Bin 0 -> 614 bytes ...e_user_info_bottom_attention_select@3x.png | Bin 0 -> 918 bytes .../Contents.json | 22 +++ .../mine_user_info_bottom_chat@2x.png | Bin 0 -> 474 bytes .../mine_user_info_bottom_chat@3x.png | Bin 0 -> 745 bytes xplan-ios/Base/MVP/Model/UserInfoModel.h | 2 + .../Main/Home/Model/HomeSearchResultModel.h | 2 + .../Home/Presenter/XPHomeSearchPresenter.m | 2 +- .../View/Cell/XPSearchListTableViewCell.m | 3 +- xplan-ios/Main/Mine/Api/Api+Mine.h | 27 +++ xplan-ios/Main/Mine/Api/Api+Mine.m | 26 +++ .../Mine/Presenter/XPMineUserInfoPresenter.h | 10 + .../Mine/Presenter/XPMineUserInfoPresenter.m | 33 +++- .../Mine/Protocol/XPMineUserInfoProtocol.h | 6 + .../MineInfo/XPMineUserInfoTableViewCell.m | 26 +++ .../MineInfo/XPMineUserInfoViewController.m | 145 +++++++++++--- .../MineInfo/XPMineUserInfoHeaderView.h | 11 +- .../MineInfo/XPMineUserInfoHeaderView.m | 184 +++++++++++++++--- .../SubViews/MineInfo/XPMineUserTableView.h | 16 -- .../SubViews/MineInfo/XPMineUserTableView.m | 24 --- 25 files changed, 482 insertions(+), 107 deletions(-) create mode 100644 xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_normal.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_normal.imageset/mine_user_info_bottom_attention_normal@2x.png create mode 100644 xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_normal.imageset/mine_user_info_bottom_attention_normal@3x.png create mode 100644 xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/mine_user_info_bottom_attention_select@2x.png create mode 100644 xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/mine_user_info_bottom_attention_select@3x.png create mode 100644 xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/mine_user_info_bottom_chat@2x.png create mode 100644 xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/mine_user_info_bottom_chat@3x.png delete mode 100644 xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserTableView.h delete mode 100644 xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserTableView.m diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 6b391573..fa1f303b 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -168,7 +168,6 @@ E84B0E3F2727EDF6008818C6 /* XPRoomMessageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E84B0E3E2727EDF6008818C6 /* XPRoomMessageTableViewCell.m */; }; E84B0E422727EE0A008818C6 /* XPRoomMessageHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = E84B0E412727EE0A008818C6 /* XPRoomMessageHeaderView.m */; }; E84B0E462727EF9D008818C6 /* XPRoomMessageParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E84B0E452727EF9D008818C6 /* XPRoomMessageParser.m */; }; - E865963F27015A9C00846EBD /* XPMineUserTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = E865963E27015A9C00846EBD /* XPMineUserTableView.m */; }; E86596432701611A00846EBD /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = E86596412701611A00846EBD /* UIImage+ImageEffects.m */; }; E86596512701A1C000846EBD /* StatisticsService.m in Sources */ = {isa = PBXBuildFile; fileRef = E86596502701A1C000846EBD /* StatisticsService.m */; }; E86596542701A55500846EBD /* StatisticsServiceHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = E86596532701A55500846EBD /* StatisticsServiceHelper.m */; }; @@ -625,8 +624,6 @@ E84B0E442727EF9D008818C6 /* XPRoomMessageParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessageParser.h; sourceTree = ""; }; E84B0E452727EF9D008818C6 /* XPRoomMessageParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMessageParser.m; sourceTree = ""; }; E84B0E4927280289008818C6 /* XPRoomMessageConstant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessageConstant.h; sourceTree = ""; }; - E865963D27015A9C00846EBD /* XPMineUserTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserTableView.h; sourceTree = ""; }; - E865963E27015A9C00846EBD /* XPMineUserTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserTableView.m; sourceTree = ""; }; E86596412701611A00846EBD /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ImageEffects.m"; sourceTree = ""; }; E86596422701611A00846EBD /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ImageEffects.h"; sourceTree = ""; }; E865964F2701A1C000846EBD /* StatisticsService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StatisticsService.h; sourceTree = ""; }; @@ -1981,8 +1978,6 @@ E88B5CC426FB42B000DA9178 /* XPMineUserInfoHeaderView.m */, E8EEB91B26FC9D58007C6EBA /* XPMineUserInfoDateView.h */, E8EEB91C26FC9D58007C6EBA /* XPMineUserInfoDateView.m */, - E865963D27015A9C00846EBD /* XPMineUserTableView.h */, - E865963E27015A9C00846EBD /* XPMineUserTableView.m */, ); path = MineInfo; sourceTree = ""; @@ -2662,7 +2657,6 @@ E8C6FFD42754AA87004DC9F0 /* XPNoteView.m in Sources */, E82325F9274E2E42003A3332 /* Api+UserCard.m in Sources */, E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */, - E865963F27015A9C00846EBD /* XPMineUserTableView.m in Sources */, E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */, E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */, E8B825CA26EA1231009E8E9F /* LoginVerifCodeViewController.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_normal.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_normal.imageset/Contents.json new file mode 100644 index 00000000..7130e4f1 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_normal.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_info_bottom_attention_normal@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_info_bottom_attention_normal@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_normal.imageset/mine_user_info_bottom_attention_normal@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_normal.imageset/mine_user_info_bottom_attention_normal@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..ca9643d7485b1b77ab961b0e30a4adbbb23b91cd GIT binary patch literal 717 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k3?#4J%UA`ZHU{{FxB}__Lkeu4Q8WkWXsePS zzhH*HAHPa)GN!2ie0*t7fFLi+neFRVwMF?D>L|(Gy>YZCA;eDf_4C^YHZ7Xk>mhu6 zZcjr+j+>R)%lk{Lw;R+mFfdN^ba4!^IDK@|&9Wv30hgJMF03N1M{VEz&NK1+`@elD zU$YV0$<==^EpLzZEj=&szGIL0l$Mff3+3fY^u9W7Ez8RGDQ~byd(Nf$&}l``nuueY zBqz-geb7aa>hNH;`XZ1)g_29eKSeskv&9JWM0>hb&kNzqeD$Sm=Dwj)-EjgX( z+u?boCExR&2W~oeCFvi-s>)oh{fk1w{7VZO6TcPRP)hj4wCiR7_X|T#h55WwEk%WE zqi+VVPVm_hcA|~TVSeV%TR)bUoboZ-5c2P}zJfT%%vT54gB=&l@HUiXJa{=qP|0XB zgOp|l>y<0V!~@?Jp4vbA6N^Eba^Jg^;@g*N{eN>S#I5ke#K0nb1h1O z{DK+&Fn|Bd{y<8YmrF(b=ey^(c9q8m%f3F*>Z`S|p{6J^)x*w6|Iogz%dO1L&zuzf z{?8tCF$;4FK6=FUI=r^jj^ zO4wa6Q#7bM9B*#Gu)+5v6DBs+ib6Pnl!>bPkv9*;5-Llf>@1&;1nZIp{gH<^4LVY`; z_8y(R&-~Jf3X3ax8V8sE*7drxC#d01iOHL|xw2C>F!pM%k(wd5fK%g<{H({OqVFVZ zcs^$S@L8;>v(u`(u<`uUWgGZ@%#INkOgI}ao{%?l?cdiq_cQ+P(aZ_1o82FFWa~aB zvw5pp{k+tIGqPj3jdRq*jD9)YKNO_8EsDK(yN%x?fOA4lywf@{wNexcYbNvq3pSdmhE-Zm#%SLB7ASE#l#2RR~2TyoUR*_ zWM0EO`*MKyhB-4iJ{YGZFR|XI63mgiz)eJMPWNRmL+&^1pSU@XwcL_gVdnJZLEf@- zp0ob*PRw8v>UElb&zM*5TqeVuOOFFzEs~fb{AvsDm6_t(nycH7pOsjc(;x6;V}-(l z%a7dDBb_!}og=k3+4XzH;_ru*{?6;4yVSzm{U+iI%zrUw(4D1%6eX`;HaMQyX0+7Mdh;9b5>MZi(EA=@cFp&XKwHY z?)lyN>AFEr=GSjoz{hbUEbDEL{P&aEGs-l2wku32xfZom?LFsoZ};%4`?d?^?lQa; zng4n6jN-I;m)x4mYj(KHvSqEFc=F*3bwz1M4PM_9dR<3mloZ%?UV3(*;Qg+9p?~Vn b|6{Ii=sMUlW6>mFCSmY&^>bP0l+XkK)^a>0 literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/Contents.json new file mode 100644 index 00000000..e4ce0f4a --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_info_bottom_attention_select@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_info_bottom_attention_select@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/mine_user_info_bottom_attention_select@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/mine_user_info_bottom_attention_select@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..3b51a081f69a0a919f39dbf85f0256928c482bf1 GIT binary patch literal 614 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k3?#4J%UA`ZdINkyT!FMt)JGt4ary5P^$E!E zi+t%D_0c>0Gmz^Il!^oje)5U@>=OZ008$A>KyeWI;2rhFH~PJ2)K}jam=xF?kg~{+ zp3!f?CVYVC0vhNW^~pE-Baq<@F&}CLSa18o89)c=l?3?(GyMI+m>kUgLG!9$YjvJ3h+8Ub)(8h4;2gml+rsqdZ+4Lo7}oo%C{D zlYu~M=E66tn-*-^q5Z=4{r`&cLz5O=x<9XFj^wAgnX|)wx0XD#?2*^cwD|X8UH!XN zpUjQb$_=%uW{G(E=VaXcX<#^)S@Ze4ofC@OPu&S#!s)d8YxS&)+gJC7PrDW}wTk~I zLq5Bm35W6$&9-|B4umS-tkF2O(f4IoWqcpA(&QT6HD7*u@^9AbVQk*Rk~b^JOBSl(PlzhjKSyfYhI#h4qVxEfm4u<@9tFl@cE-$`zR8n;AQYnNtO!rwH% zhV@M~53YzaJ=mEfz<#8FUoYV0Y3oVh-;%nR?=f8S^JV^U)_n8E2JW3TWu1Rd-r)Re znkpag?1y7+c*9q-{|8l6C8zCs&Jy@h=la{upH=DQi*yW2GhNOc>Xer`aP!^tT>(wq zN8Kfw+iX84$p$`5xwVKdJz>)Jt07fy*i{xTy~5?1`tg%o*8VH@FIaSPtkt?d0^^6l M)78&qol`;+0C~6=y8r+H literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/mine_user_info_bottom_attention_select@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_attention_select.imageset/mine_user_info_bottom_attention_select@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..851f8a9d225491e745a7e39de0b373b4c74afa99 GIT binary patch literal 918 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL3?z5Yp7kC`%@6PiaRt&oQ6F6+KKev`@{9iH z8}-3E@)J-5$OV$#5g&jIU!Zs-kO35gh(i>7^oEE;LKXW&eFo`@gouOHM1BIB24Mr0 z0S)=!3sMhM15^xVL;@{^DEQzV@g8D@cho0{;o8rx^8lS_QWE4B%%@A8pFb6j+GB(9z|aeux)0|Qf$ zr;B5V$ML6AZZ@ql;AzwKj&vy#aJeaRw6>(;f4cROrZryYzdq?&^7GaN`?qiMZz$c% z@bV*{`oWR6hp@ zyX~(Lua@avm$@y*sb7Axu+i zByHi`4G&cFd^PPK%&%GY>wI&H>4QI;PRAFXo8c^a-L=*7^d-^vYuP@Y`@^bx{nH{& zcO99!)n9}bIz2KuX3P3|i_f3D66QHyS7mYUzO_T0lP@;%RJG&LW}%u*^PD={FA7Sy zC~fuOQ>bf@vOUFkM6841ERW-6*|!h8F0}L1@&0;oDe1S-%@VDB2^ofbOKxA2`1_XW z%!-Xi>*u?vOv&8nJoC(<{XZ{wwu{|%P+$DXneFbiEjKn_Rdk|I(DPz9k*3+_ZIT6u38g$Ygx>KzjeBbGTVEWt(4|&FWmZi z#)oM>W|O@iZt#6P|KRnH;bQKIq3@6Me{{Nd`J?vrPI<_sv?{)T~tb6FMi(MpJo^-dxvjYXd9${&DUuA z*=fz&M8enYUohdn*113JV)iGC1j-L@a^Lp*q`lvHDT|UXw-4$l&aR9<5_nDL=FPh2 z1y+p$0rPpiizlU8%G`Wbs5T`*Tllk-&^iNuw)HtdjTWn#(}UHP=Ug;2o4Qgi&NDlB z(YdoLdJ6U5GhaNKns!C3dRD^(O*V6;i??k}dgh)v^Kaf?X3GVI;d>ag_<*UG!PC{x JWt~$(69B#3xk~^5 literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/Contents.json new file mode 100644 index 00000000..967476cf --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_info_bottom_chat@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_info_bottom_chat@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/mine_user_info_bottom_chat@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/mine_user_info_bottom_chat@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..6864c3cb058f4bc826d4531070e1b7abd09480eb GIT binary patch literal 474 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k3?#4J%UA`ZVgr0aT!FMt)JMOF|K3rbfD9n= zjsEBp`O!P-eL(bUA0Qhj2;@e8@{aiA9sAim<|_lkf1l_NU~w=BR1gDXfVG3fKY4@A z0V??Q=~zF|0=bePzhH)M?6Y27RIYR6IdQPl#zIGuG5kULy9q{@Hf8LMP!*Nwwq{^p zi-11~D?v>l6V zzEvT)BmR8W^3S4@-m$th2MoC4a{by4Z(o(6b}8Gbd)9F&lSNg(-x&8;g@&@PzVe&% ztES_Qi(Aq@3q84BGf~4MK%uLj-=t{50!H52ngw~vj%-uKJ%j`|mN12Ii7&jwB$;&f zjsBFMmJ<3#`uV9vN(X&pAb&|a7l?VLw`)bO{69v2Wb%<3iJ(c?VRnfC5rkaez x>~mi?&;C3A=?v39hxVK8@_F_9(rWY9@?8fM9eIk_4*|oF!PC{xWt~$(6962>(XIdh literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/mine_user_info_bottom_chat@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_chat.imageset/mine_user_info_bottom_chat@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..c3eeaedef97241ea8497f6b5bfd1dd25ac61c62b GIT binary patch literal 745 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL3?z5Yp7kC`H3s;ExB_XPsE;7z^Tjv#txwb^ zpO}xnF(1H!pM0Y}c}D@+pL`=egG3_1;*p;~%D}n;V!l9BdPjl{0gHP_ee{j`;1&4+ z$N(a+Vvt7PXsEG1K*f;|lRwT#RlWjrgjPwAUob<%Zx*iSnnK%iX4*gr+?ak)jX$SvwU`GHz!N~%*ZIy%D%i%&tGzG z@Y78>o88O@}S>-sLBmF1uBf?78%mvK!|@ol{eN zdRz0^UEdr(uwh+Ey;FGUk7Nz$394mRug2N==k12o81kboP?w0!&2#MX=oGE#` z*>lpOyR0#hj%fk~N4wvYZ!V8mrnEUE;mYsY-78umURBO)lMcK$_vWEzlPVMr-hZ20 z(6V=Gzt6$UKH16f#qyE&O6CY8|48q6vwZu(cfWrgs!4g1({uAKo4{Y@uM;ma|M+8O zaG&K!H-pio`zdKFCu%rP*O{8g@F!K`ovYEFnC?{F^7Tf(J6;|Z?%K3b-hIijR_<^& z`#bkdjQdkGq`kR*>6W-Wob7fqgG*@ng7cmWyv0;)rs#UEmw42hZsdN0HE3S?ONTE~ zLDSP0I@vwc3E#h|BZZgkl 100) { self.numberLabel.text = [NSString stringWithFormat:@"%ld", resultModel.onlineNum]; } else { self.numberLabel.text = [NSString stringWithFormat:@" %ld ", resultModel.onlineNum]; } + self.numberView.hidden = !resultModel.valid; } } } diff --git a/xplan-ios/Main/Mine/Api/Api+Mine.h b/xplan-ios/Main/Mine/Api/Api+Mine.h index e0f075dc..5973a0b5 100644 --- a/xplan-ios/Main/Mine/Api/Api+Mine.h +++ b/xplan-ios/Main/Mine/Api/Api+Mine.h @@ -136,6 +136,33 @@ NS_ASSUME_NONNULL_BEGIN + (void)logoutCurrentAccount:(HttpRequestHelperCompletion)complection access_token:(NSString *)access_token; +/// 查询两个人的关注状态 +/// @param complection 完成 +/// @param uid 自己的uid +/// @param isLikeUid 要查询的那个人的uid ++ (void)attentionStatusComplection:(HttpRequestHelperCompletion)complection + uid:(NSString *)uid + isLikeUid:(NSString *)isLikeUid; + +/// 关注某人 +/// @param complection 完成 +/// @param uid 发起关注的人 +/// @param likedUid 被关注的人 +/// @param ticket ticket +/// @param type l类型默认1 ++ (void)attentionComplection:(HttpRequestHelperCompletion)complection + uid:(NSString *)uid + likedUid:(NSString *)likedUid + ticket:(NSString *)ticket + type:(NSString *)type; + +/// 获取用户详情 +/// @param complection 完成 +/// @param uid 发起关注的人 +/// @param page page +/// @param pageSize pagesize ++ (void)userDetailInfoComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize; + @end diff --git a/xplan-ios/Main/Mine/Api/Api+Mine.m b/xplan-ios/Main/Mine/Api/Api+Mine.m index b8296756..f31f11d5 100644 --- a/xplan-ios/Main/Mine/Api/Api+Mine.m +++ b/xplan-ios/Main/Mine/Api/Api+Mine.m @@ -138,5 +138,31 @@ [self makeRequest:@"acc/logout" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, access_token, nil]; } +/// 查询两个人的关注状态 +/// @param complection 完成 +/// @param uid 自己的uid +/// @param isLikeUid 要查询的那个人的uid ++ (void)attentionStatusComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid isLikeUid:(NSString *)isLikeUid { + [self makeRequest:@"fans/islike" method:HttpRequestHelperMethodGET completion:complection,__FUNCTION__, uid, isLikeUid, nil]; +} + +/// 关注某人 +/// @param complection 完成 +/// @param uid 发起关注的人 +/// @param likedUid 被关注的人 +/// @param ticket ticket +/// @param type 1 关注 2取消关注 ++ (void)attentionComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid likedUid:(NSString *)likedUid ticket:(NSString *)ticket type:(NSString *)type { + [self makeRequest:@"fans/like" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, uid, likedUid, ticket, type, nil]; +} + +/// 获取用户详情 +/// @param complection 完成 +/// @param uid 发起关注的人 +/// @param page page +/// @param pageSize pagesize ++ (void)userDetailInfoComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize { + [self makeRequest:@"user/detail/get" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, uid, page, pageSize, nil]; +} @end diff --git a/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.h b/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.h index f18a5440..0d1ef7ac 100644 --- a/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.h +++ b/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.h @@ -12,6 +12,16 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMineUserInfoPresenter : BaseMvpPresenter // 获取用户信息 - (void)getUserInfoWithUid:(NSString *)uid; +// 获取用户详细信息 +- (void)getUserDetailInfoWithUid:(NSString *)uid; +/// 两个人的关注状态 +/// @param targetUid 对方的uid +- (void)getUserAttentionState:(NSString *)targetUid; + +/// 关注用户 /取消该关注 +/// @param targetUid 目标用户的uid +/// @param state 是否关注 yes 关注 NO 取消关注 +- (void)attentionUser:(NSString *)targetUid state:(BOOL)state; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.m b/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.m index 188d01bd..3d5a348d 100644 --- a/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.m +++ b/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.m @@ -6,8 +6,9 @@ // #import "XPMineUserInfoPresenter.h" -///Api +///Tool #import "Api+Mine.h" +#import "AccountInfoStorage.h" ///Model #import "UserInfoModel.h" ///P @@ -25,5 +26,35 @@ }] uid:uid]; } +// 获取用户详细信息 +- (void)getUserDetailInfoWithUid:(NSString *)uid { + [Api userDetailInfoComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data]; + [[self getView] ongetDetailInfoSuccess:infoModel]; + }] uid:uid page:@"1" pageSize:@"20"]; +} + +/// 两个人的关注状态 +/// @param targetUid 对方的uid +- (void)getUserAttentionState:(NSString *)targetUid; { + NSString * uid = [[AccountInfoStorage instance] getUid]; + [Api attentionStatusComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + BOOL isLike = ((NSNumber *)data.data).boolValue; + [[self getView] getAttentionStateSuccess:isLike]; + }] uid:uid isLikeUid:targetUid]; +} + + +/// 关注用户 /取消该关注 +/// @param targetUid 目标用户的uid +/// @param state 是否关注 yes 关注 NO 取消关注 +- (void)attentionUser:(NSString *)targetUid state:(BOOL)state { + NSString * uid = [[AccountInfoStorage instance] getUid]; + NSString * ticket = [[AccountInfoStorage instance] getTicket]; + NSString * type = state ? @"1" : @"2"; + [Api attentionComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + [[self getView] attentionUserSuccess:state]; + }] uid:uid likedUid:targetUid ticket:ticket type:type]; +} @end diff --git a/xplan-ios/Main/Mine/Protocol/XPMineUserInfoProtocol.h b/xplan-ios/Main/Mine/Protocol/XPMineUserInfoProtocol.h index 4469d93d..383867c2 100644 --- a/xplan-ios/Main/Mine/Protocol/XPMineUserInfoProtocol.h +++ b/xplan-ios/Main/Mine/Protocol/XPMineUserInfoProtocol.h @@ -12,6 +12,12 @@ NS_ASSUME_NONNULL_BEGIN @protocol XPMineUserInfoProtocol ///获取用户信息成功 - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo; +///获取用户详细信息成功 +- (void)ongetDetailInfoSuccess:(UserInfoModel *)userInfo; +///关注/取消关注 +- (void)attentionUserSuccess:(BOOL)status; +///获取关注状态 +- (void)getAttentionStateSuccess:(BOOL)status; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoTableViewCell.m b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoTableViewCell.m index e5caffb7..79054a40 100644 --- a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoTableViewCell.m +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoTableViewCell.m @@ -24,6 +24,8 @@ @property (nonatomic,strong) UILabel *idLabel; ///签名 @property (nonatomic,strong) UILabel *signLabel; +///正在直播中 +@property (nonatomic,strong) UIButton *onlineButton; @end @implementation XPMineUserInfoTableViewCell @@ -46,6 +48,7 @@ [self.backView addSubview:self.sexImageView]; [self.backView addSubview:self.idLabel]; [self.backView addSubview:self.signLabel]; + [self.backView addSubview:self.onlineButton]; } - (void)initSubViewConstraints { @@ -73,6 +76,12 @@ make.left.mas_equalTo(self.nameLabel); make.top.mas_equalTo(self.idLabel.mas_bottom).offset(18); }]; + + [self.onlineButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(55, 18)); + make.right.mas_equalTo(self.backView).offset(-15); + make.top.mas_equalTo(self.backView).offset(10); + }]; } #pragma mark - Getters And Setters @@ -137,5 +146,22 @@ return _signLabel; } +- (UIButton *)onlineButton { + if (!_onlineButton) { + _onlineButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_onlineButton setTitle:@"直播中" forState:UIControlStateNormal]; + [_onlineButton setImage:[UIImage imageNamed:@"home_search_user_online"] forState:UIControlStateNormal]; + [_onlineButton setTitleColor:[ThemeColor appMainColor] forState:UIControlStateNormal]; + _onlineButton.backgroundColor = [UIColor clearColor]; + _onlineButton.titleLabel.font = [UIFont systemFontOfSize:10]; + _onlineButton.layer.masksToBounds = YES; + _onlineButton.layer.cornerRadius = 18/2; + _onlineButton.layer.borderColor = [ThemeColor appMainColor].CGColor; + _onlineButton.layer.borderWidth = 1; + [_onlineButton addTarget:self action:@selector(onlineButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _onlineButton; +} + @end diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.m b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.m index aa2b55ad..34ba718d 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.m +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.m @@ -16,29 +16,35 @@ #import "AccountInfoStorage.h" #import "TTPopup.h" #import "XPHtmlUrl.h" +#import "UIImage+Utils.h" ///View #import "XPMineUserInfoTableViewCell.h" #import "XPMineUserInfoHeaderView.h" #import "XPMineUserInfoCustomNavView.h" -#import "XPMineUserTableView.h" ///P #import "XPMineUserInfoPresenter.h" #import "XPMineUserInfoProtocol.h" ///VC #import "XPMineUserInfoEditViewController.h" #import "XPWebViewController.h" +#import "SessionViewController.h" +#import "XPRoomViewController.h" -@interface XPMineUserInfoViewController () +@interface XPMineUserInfoViewController () ///列别 -@property (nonatomic,strong) XPMineUserTableView *tableView; +@property (nonatomic,strong) UITableView *tableView; ///头部视图 @property (nonatomic,strong) XPMineUserInfoHeaderView *headView; -///table的顶部视图 -@property (nonatomic,strong) UIView * tableViewHeadView; ///自定义的导航栏 @property (nonatomic,strong) XPMineUserInfoCustomNavView *navView; ///用户信息 @property (nonatomic,strong) UserInfoModel *userInfo; +///底部的容器 +@property (nonatomic,strong) UIStackView *bottomStackView; +///私聊 +@property (nonatomic,strong) UIButton *chatButton; +///关注 +@property (nonatomic,strong) UIButton *attentionButton; @end @implementation XPMineUserInfoViewController @@ -55,6 +61,7 @@ [super viewDidLoad]; [self initSubViews]; [self initSubViewConstraints]; + [self initHttpRequest]; } - (void)viewWillAppear:(BOOL)animated { @@ -72,19 +79,24 @@ #pragma mark - Private Method - (void)initSubViews { - [self.view addSubview:self.headView]; [self.view addSubview:self.tableView]; [self.view addSubview:self.navView]; - self.tableView.tableHeaderView = self.tableViewHeadView; - self.tableView.userInfoVC = self; + + self.tableView.tableHeaderView = self.headView; + if (self.uid != [AccountInfoStorage instance].getUid.integerValue) { + [self.view addSubview:self.bottomStackView]; + [self.bottomStackView addArrangedSubview:self.chatButton]; + [self.bottomStackView addArrangedSubview:self.attentionButton]; + + [self.bottomStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self.view).inset(25); + make.height.mas_equalTo(36); + make.bottom.mas_equalTo(self.view).offset(-kSafeAreaBottomHeight - 15); + }]; + } } - (void)initSubViewConstraints { - [self.headView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.top.mas_equalTo(self.view); - make.height.mas_equalTo(250 + kSafeAreaTopHeight); - }]; - [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self.view); }]; @@ -93,6 +105,16 @@ make.left.right.top.mas_equalTo(self.view); make.height.mas_equalTo(kNavigationHeight); }]; + + +} + +- (void)initHttpRequest { + NSString *uid = [NSString stringWithFormat:@"%ld", self.uid]; + [self.presenter getUserAttentionState:uid]; + + //获取用户详细信息 跟随进房目前使用的这个接口 + [self.presenter getUserDetailInfoWithUid:uid]; } #pragma mark - 拉黑 移除黑名单 @@ -157,12 +179,9 @@ } #pragma mark - UITableViewDelegate And UITableViewDataSource -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 1; + return 0; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { @@ -192,13 +211,42 @@ [self.navigationController popViewControllerAnimated:YES]; } +#pragma mark - XPMineUserInfoHeaderViewDelegate +- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGoToRoom:(NSString *)roomUid { + [XPRoomViewController openRoom:roomUid viewController:self]; +} + #pragma mark - XPMineUserInfoProtocol - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo { self.userInfo = userInfo; - self.headView.userInfo = userInfo; [self.tableView reloadData]; } +- (void)ongetDetailInfoSuccess:(UserInfoModel *)userInfo { + self.headView.userInfo = userInfo; +} + +- (void)getAttentionStateSuccess:(BOOL)status { + self.attentionButton.selected = status; +} + +- (void)attentionUserSuccess:(BOOL)status { + self.attentionButton.selected = status; +} + +#pragma mark - Event Response +- (void)chatButtonAction:(UIButton *)sender { + NSString * sessionId = [NSString stringWithFormat:@"%ld",self.uid]; + NIMSession * session = [NIMSession session:sessionId type:NIMSessionTypeP2P]; + SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session]; + [self.navigationController pushViewController:sessionVC animated:YES]; +} + +- (void)attentionButtonAction:(UIButton *)sender { + NSString *uid = [NSString stringWithFormat:@"%ld", self.uid]; + [self.presenter attentionUser:uid state:!sender.selected]; +} + #pragma mark - Getters And Setters - (void)setUid:(NSInteger)uid { _uid = uid; @@ -216,9 +264,9 @@ } } -- (XPMineUserTableView *)tableView { +- (UITableView *)tableView { if (!_tableView) { - _tableView = [[XPMineUserTableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; + _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; _tableView.delegate = self; _tableView.dataSource = self; _tableView.tableFooterView = [UIView new]; @@ -235,19 +283,12 @@ - (XPMineUserInfoHeaderView *)headView { if (!_headView) { _headView = [[XPMineUserInfoHeaderView alloc] init]; + _headView.frame = CGRectMake(0, 0, KScreenWidth, 270 + kSafeAreaTopHeight); + _headView.delegate = self; } return _headView; } -- (UIView *)tableViewHeadView { - if (!_tableViewHeadView) { - _tableViewHeadView = [[UIView alloc] init]; - _tableViewHeadView.frame = CGRectMake(0, 0, KScreenWidth, 179 + kSafeAreaTopHeight); - _tableViewHeadView.backgroundColor = [UIColor clearColor]; - } - return _tableViewHeadView; -} - - (XPMineUserInfoCustomNavView *)navView { if (!_navView) { _navView = [[XPMineUserInfoCustomNavView alloc] init]; @@ -256,4 +297,50 @@ return _navView; } +- (UIStackView *)bottomStackView { + if (!_bottomStackView) { + _bottomStackView = [[UIStackView alloc] init]; + _bottomStackView.axis = UILayoutConstraintAxisHorizontal; + _bottomStackView.distribution = UIStackViewDistributionFillEqually; + _bottomStackView.alignment = UIStackViewAlignmentFill; + _bottomStackView.spacing = 25; + } + return _bottomStackView; +} + +- (UIButton *)chatButton { + if (!_chatButton) { + _chatButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_chatButton setTitle:@"私信" forState:UIControlStateNormal]; + [_chatButton setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateNormal]; + [_chatButton setImage:[UIImage imageNamed:@"mine_user_info_bottom_chat"] forState:UIControlStateNormal]; + _chatButton.titleLabel.font = [UIFont systemFontOfSize:15]; + [_chatButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor], [ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; + _chatButton.layer.masksToBounds = YES; + _chatButton.layer.cornerRadius = 36/2; + [_chatButton addTarget:self action:@selector(chatButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _chatButton; +} + +- (UIButton *)attentionButton { + if (!_attentionButton) { + _attentionButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_attentionButton setTitle:@"关注" forState:UIControlStateNormal]; + [_attentionButton setTitle:@"已关注" forState:UIControlStateSelected]; + [_attentionButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal]; + [_attentionButton setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateSelected]; + [_attentionButton setImage:[UIImage imageNamed:@"mine_user_info_bottom_attention_normal"] forState:UIControlStateNormal]; + [_attentionButton setImage:[UIImage imageNamed:@"mine_user_info_bottom_attention_select"] forState:UIControlStateSelected]; + _attentionButton.titleLabel.font = [UIFont systemFontOfSize:15]; + [_attentionButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; + [_attentionButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor], [ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateSelected]; + _attentionButton.layer.masksToBounds = YES; + _attentionButton.layer.cornerRadius = 36/2; + [_attentionButton addTarget:self action:@selector(attentionButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _attentionButton; +} + + @end diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.h b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.h index 562b2f28..273539fa 100644 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.h +++ b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.h @@ -8,12 +8,19 @@ #import NS_ASSUME_NONNULL_BEGIN -@class UserInfoModel, SDCycleScrollView; +@class UserInfoModel, SDCycleScrollView,XPMineUserInfoHeaderView; +@protocol XPMineUserInfoHeaderViewDelegate + +- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGoToRoom:(NSString *)roomUid; + +@end + @interface XPMineUserInfoHeaderView : UIView -/// @property (nonatomic,strong) UserInfoModel *userInfo; ///轮播图 @property (nonatomic,strong, readonly) SDCycleScrollView *cycleScrollView; +///代理 +@property (nonatomic,weak) id delegate; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m index ed7618ea..a9fa23d4 100644 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m +++ b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m @@ -71,6 +71,18 @@ @property (nonatomic,strong) UILabel *pageLabel; ///图片数组 @property (nonatomic,strong) NSArray *imageUrls; +///背景 +@property (nonatomic,strong) UIView * backView; +///名字 +@property (nonatomic,strong) UILabel *nameLabel; +///sex +@property (nonatomic,strong) UIImageView *sexImageView; +///id +@property (nonatomic,strong) UILabel *idLabel; +///签名 +@property (nonatomic,strong) UILabel *signLabel; +///正在直播中 +@property (nonatomic,strong) UIButton *onlineButton; @end @implementation XPMineUserInfoHeaderView @@ -84,17 +96,7 @@ return self; } -- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { - UIView * view = [self.cycleScrollView hitTest:point withEvent:event]; - return view; -} - #pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.cycleScrollView]; - [self addSubview:self.pageLabel]; -} - - (void)initSubViewConstraints { [self.cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self); @@ -106,7 +108,51 @@ make.height.mas_equalTo(16); make.top.mas_equalTo(self).offset(148 + kSafeAreaTopHeight); }]; + + [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self).inset(15); + make.bottom.mas_equalTo(self).offset(20); + make.height.mas_equalTo(100); + }]; + + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.backView).offset(15); + make.top.mas_equalTo(self.backView).offset(15); + }]; + + [self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.nameLabel.mas_right).offset(5); + make.centerY.mas_equalTo(self.nameLabel); + }]; + + [self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.nameLabel); + make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(10); + }]; + + [self.signLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.nameLabel); + make.top.mas_equalTo(self.idLabel.mas_bottom).offset(18); + }]; + + [self.onlineButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(55, 18)); + make.right.mas_equalTo(self.backView).offset(-15); + make.top.mas_equalTo(self.backView).offset(10); + }]; } + +- (void)initSubViews { + [self addSubview:self.cycleScrollView]; + [self addSubview:self.pageLabel]; + [self addSubview:self.backView]; + [self.backView addSubview:self.nameLabel]; + [self.backView addSubview:self.sexImageView]; + [self.backView addSubview:self.idLabel]; + [self.backView addSubview:self.signLabel]; + [self.backView addSubview:self.onlineButton]; +} + #pragma mark - SDPhotoBrowserDelegate - (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index { NSString * photoUrl = [self.imageUrls objectAtIndex:index]; @@ -130,7 +176,7 @@ } -(void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index { - self.pageLabel.text = [NSString stringWithFormat:@"%d/%lu",(index + 1), (unsigned long)self.imageUrls.count]; + self.pageLabel.text = [NSString stringWithFormat:@"%ld/%lu",(index + 1), (unsigned long)self.imageUrls.count]; } // 轮播图点击 @@ -144,30 +190,114 @@ browser.isMe = NO; [browser show]; } + +#pragma mark - Event Response +- (void)onlineButtonAction:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoHeaderView:didClickGoToRoom:)]) { + [self.delegate xPMineUserInfoHeaderView:self didClickGoToRoom:self.userInfo.roomUid]; + } +} #pragma mark - Getters And Setters - (void)setUserInfo:(UserInfoModel *)userInfo { _userInfo = userInfo; - // 轮播图 - NSMutableArray * imageUrls; - if (self.userInfo.privatePhoto.count > 0) { - imageUrls = [[[self.userInfo.privatePhoto.rac_sequence map:^id _Nullable(UserPhoto * _Nullable value) { - return value.photoUrl; - }] array] mutableCopy] ; - } - if (self.userInfo.avatar.length > 0) { - if (imageUrls.count >0) { - [imageUrls addObject:self.userInfo.avatar]; + if (_userInfo) { + self.nameLabel.text = _userInfo.nick; + self.idLabel.text = [NSString stringWithFormat:@"%@号:%ld",AppName, (long)_userInfo.erbanNo]; + self.signLabel.text = _userInfo.userDesc.length > 0 ? _userInfo.userDesc : @"我是个默认签名"; + NSString * sexStr; + if (_userInfo.gender == GenderType_Male) { + sexStr = @"common_male"; } else { - imageUrls = [NSMutableArray array]; - [imageUrls addObject:self.userInfo.avatar]; + sexStr = @"common_female"; } + self.sexImageView.image = [UIImage imageNamed:sexStr]; + self.onlineButton.hidden = _userInfo.roomUid.length <=0; + + // 轮播图 + NSMutableArray * imageUrls; + if (self.userInfo.privatePhoto.count > 0) { + imageUrls = [[[self.userInfo.privatePhoto.rac_sequence map:^id _Nullable(UserPhoto * _Nullable value) { + return value.photoUrl; + }] array] mutableCopy] ; + } + if (self.userInfo.avatar.length > 0) { + if (imageUrls.count >0) { + [imageUrls addObject:self.userInfo.avatar]; + } else { + imageUrls = [NSMutableArray array]; + [imageUrls addObject:self.userInfo.avatar]; + } + } + if (imageUrls.count > 0) { + self.imageUrls = imageUrls; + self.cycleScrollView.imageURLStringsGroup = imageUrls; + self.pageLabel.text = [NSString stringWithFormat:@"1/%lu",(unsigned long)imageUrls.count]; + } } - if (imageUrls.count > 0) { - self.imageUrls = imageUrls; - self.cycleScrollView.imageURLStringsGroup = imageUrls; - self.pageLabel.text = [NSString stringWithFormat:@"1/%lu",(unsigned long)imageUrls.count]; +} + +- (UIView *)backView { + if (!_backView) { + _backView = [[UIView alloc] init]; + _backView.backgroundColor = [ThemeColor appCellBackgroundColor]; + _backView.layer.masksToBounds = YES; + _backView.layer.cornerRadius = 12; } + return _backView; +} + +- (UILabel *)nameLabel { + if (!_nameLabel) { + _nameLabel = [[UILabel alloc] init]; + _nameLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15]; + _nameLabel.textColor = [ThemeColor mainTextColor]; + } + return _nameLabel; +} + +- (UIImageView *)sexImageView { + if (!_sexImageView) { + _sexImageView = [[UIImageView alloc] init]; + _sexImageView.userInteractionEnabled = YES; + } + return _sexImageView; +} + +- (UILabel *)idLabel { + if (!_idLabel) { + _idLabel = [[UILabel alloc] init]; + _idLabel.font = [UIFont systemFontOfSize:11]; + _idLabel.textColor = [ThemeColor textThirdColor]; + } + return _idLabel; +} + +- (UILabel *)signLabel { + if (!_signLabel) { + _signLabel = [[UILabel alloc] init]; + _signLabel.font = [UIFont systemFontOfSize:11];; + _signLabel.textColor = [ThemeColor secondTextColor]; + } + return _signLabel; +} + +- (UIButton *)onlineButton { + if (!_onlineButton) { + _onlineButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_onlineButton setTitle:@"直播中" forState:UIControlStateNormal]; + [_onlineButton setImage:[UIImage imageNamed:@"home_search_user_online"] forState:UIControlStateNormal]; + [_onlineButton setTitleColor:[ThemeColor appMainColor] forState:UIControlStateNormal]; + _onlineButton.backgroundColor = [UIColor clearColor]; + _onlineButton.titleLabel.font = [UIFont systemFontOfSize:10]; + _onlineButton.layer.masksToBounds = YES; + _onlineButton.layer.cornerRadius = 18/2; + _onlineButton.layer.borderColor = [ThemeColor appMainColor].CGColor; + _onlineButton.layer.borderWidth = 1; + _onlineButton.hidden = YES; + [_onlineButton addTarget:self action:@selector(onlineButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _onlineButton; } - (SDCycleScrollView *)cycleScrollView { diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserTableView.h b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserTableView.h deleted file mode 100644 index ed213766..00000000 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserTableView.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// XPMineUserTableView.h -// xplan-ios -// -// Created by 冯硕 on 2021/9/27. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@interface XPMineUserTableView : UITableView -/// -@property (nonatomic,weak) UIViewController *userInfoVC; -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserTableView.m b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserTableView.m deleted file mode 100644 index c1f7a34a..00000000 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserTableView.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// XPMineUserTableView.m -// xplan-ios -// -// Created by 冯硕 on 2021/9/27. -// - -#import "XPMineUserTableView.h" -#import "XPMacro.h" -#import "XPMineUserInfoViewController.h" - -@implementation XPMineUserTableView - -- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { - if (point.y > (250 + kSafeAreaTopHeight)) { - return self; - } else { - UIView* topView= [(XPMineUserInfoViewController *)self.userInfoVC getHeadHitView]; - UIView * View = [topView hitTest:point withEvent:event]; - return View; - } -} - -@end