friends.vue 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363
  1. <template>
  2. <view class="container">
  3. <TabBar :tabIndex="tabIndex" ></TabBar>
  4. <uni-popup ref="popup" type="center">
  5. <Popup :content1="popup.content1" :content2="popup.content2" :tip1="popup.tip1" :tip2="popup.tip2" :btntext="popup.btntext" @closePopup="closePopup" @toLogin="toLogin" :btnEvent="'toLogin'"></Popup>
  6. </uni-popup>
  7. <view id="topnav" class="topnav flex-start"
  8. :style="{'height':`${topbarOffsetHeight-statusBarHeight}px`,'padding-top':`${statusBarHeight}px`}">
  9. <view class="nav-item" v-for="(item,index) in navs" :key="index" :style="{
  10. 'font-size':`${navIndex===index?'40rpx':'32rpx'}`,
  11. 'color':`${navIndex===index?'#ffffff':''}`,
  12. 'font-weight':`${navIndex===index?'#ffffff':''}`}"
  13. @click="navClick(index)">
  14. <view class="nav-item-text fw700">{{item}}</view>
  15. </view>
  16. <image :src="`${assetsUrl}friends-searchicon.png`" mode="aspectFit" class="nav-search" @click="toSearch"></image>
  17. <image :src="`${assetsUrl}friends-circle.png`" mode="aspectFit" class="nav-item-bg" :style="{'left':`${navIndex*158}rpx`}" ></image>
  18. </view>
  19. <swiper class="outer-swiper" :current="navIndex" :style="{'height':`${scrollHeight}px`}" @change="outerSwiperChange">
  20. <swiper-item class="outer-swiper-item">
  21. <scroll-view class="scroll-view"
  22. v-if="scrollHeight>0"
  23. scroll-y="true"
  24. lower-threshold="200"
  25. :style="{'height':`${scrollHeight}px`}"
  26. refresher-enabled="true"
  27. :refresher-triggered="recommendTriggered"
  28. :refresher-threshold="45"
  29. refresher-default-style="white"
  30. refresher-background="#151126"
  31. @refresherrefresh="recommendRefresh"
  32. @refresherpulling="recommendPulling"
  33. @refresherrestore="recommendRestore"
  34. @refresherabort="recommendAbort"
  35. @scrolltolower="recommendToBottom"
  36. show-scrollbar="false"
  37. >
  38. <view slot="refresher" class="refresh-container" style="display: block; width: 100%; height: 80px; background: blue; display: flex; align-items: center;">
  39. <view class="view1" style="position: absolute; text-align: center; width: 100%;">
  40. 下拉刷新
  41. </view>
  42. </view>
  43. <image :src="`${assetsUrl}friends-bg.png`" mode="widthFix" class="tops-bg" v-if="recommendTopsM.length>0"></image>
  44. <view class="tops-nav flex-center" v-if="recommendTopsM.length>0">
  45. <view class="tops-nav-item" :class="topsIndex===index?'font32 fw600 tops-nav-item-active':''" v-for="(item,index) in tops" :key="index" @click="topsNavClick(index)">
  46. {{item}}
  47. </view>
  48. <view class="tops-line" :style="{'left':`${topsIndex*160+250}rpx`}"></view>
  49. </view>
  50. <swiper :current="topsIndex" class="swiper" @change="swiperChange" v-if="recommendTopsM.length>0">
  51. <swiper-item class="swiper-item">
  52. <view class="tops flex-between">
  53. <view class="tops-third flex-center">
  54. <view class="tt-item flex-center" @click="toDetail(recommendTopsM[1].userId)">
  55. <view class="tt-item-bg"></view>
  56. <image :src="`${assetsUrl}friends-2.png`" mode="aspectFill" class="tt-item-img"></image>
  57. <image :src="recommendTopsM[1].icon" class="tt-item-head-box" style="border: 2rpx solid #E2E2E2;"></image>
  58. <view class="tt-item-name font28 fw600 el">
  59. {{recommendTopsM[1].nick}}
  60. </view>
  61. <view class="tt-item-num-box flex-center">
  62. <image :src="`${assetsUrl}friends-heart.png`" mode="aspectFill" class="tt-item-num-img"></image>
  63. <view class="tt-item-num-text font22 fw600">
  64. {{recommendTopsM[1].val}}
  65. </view>
  66. </view>
  67. </view>
  68. <view class="tt-item flex-center" style="margin: 0rpx 16rpx;" @click="toDetail(recommendTopsM[0].userId)">
  69. <view class="tt-item-bg-center" style="width: 228rpx;"></view>
  70. <image :src="`${assetsUrl}friends-1.png`" mode="aspectFill" class="tt-item-img" style="transform: translateY(0rpx);"></image>
  71. <image :src="`${assetsUrl}friends-1-bling.png`" mode="aspectFill" class="tt-item-img-border" style="transform: translateY(-60rpx);"></image>
  72. <image :src="recommendTopsM[0].icon" class="tt-item-head-box" style="border: 2rpx solid #FFEC36;transform: translateY(-18rpx);"></image>
  73. <view class="tt-item-name font28 fw600 el">
  74. {{recommendTopsM[0].nick}}
  75. </view>
  76. <view class="tt-item-num-box flex-center">
  77. <image :src="`${assetsUrl}friends-heart.png`" mode="aspectFill" class="tt-item-num-img"></image>
  78. <view class="tt-item-num-text font22 fw600">
  79. {{recommendTopsM[0].val}}
  80. </view>
  81. </view>
  82. </view>
  83. <view class="tt-item flex-center" @click="toDetail(recommendTopsM[2].userId)">
  84. <view class="tt-item-bg"></view>
  85. <image :src="`${assetsUrl}friends-3.png`" mode="aspectFill" class="tt-item-img"></image>
  86. <image :src="recommendTopsM[2].icon" class="tt-item-head-box" style="border: 2rpx solid #E19865;"></image>
  87. <view class="tt-item-name font28 fw600 el">
  88. {{recommendTopsM[2].nick}}
  89. </view>
  90. <view class="tt-item-num-box flex-center">
  91. <image :src="`${assetsUrl}friends-heart.png`" mode="aspectFill" class="tt-item-num-img"></image>
  92. <view class="tt-item-num-text font22 fw600">
  93. {{recommendTopsM[2].val}}
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </swiper-item>
  100. <swiper-item class="swiper-item">
  101. <view class="tops flex-between">
  102. <view class="tops-third flex-center">
  103. <view class="tt-item flex-center" @click="toDetail(recommendTopsH[1].userId)">
  104. <view class="tt-item-bg"></view>
  105. <image :src="`${assetsUrl}friends-2.png`" mode="aspectFill" class="tt-item-img"></image>
  106. <image :src="recommendTopsH[1].icon" class="tt-item-head-box" style="border: 2rpx solid #E2E2E2;"></image>
  107. <view class="tt-item-name font28 fw600 el">
  108. {{recommendTopsH[1].nick}}
  109. </view>
  110. <view class="tt-item-num-box flex-center">
  111. <image :src="`${assetsUrl}friends-sugar.png`" mode="aspectFill" class="tt-item-num-img"></image>
  112. <view class="tt-item-num-text font22 fw600">
  113. {{recommendTopsH[1].val}}
  114. </view>
  115. </view>
  116. </view>
  117. <view class="tt-item flex-center" style="margin: 0rpx 16rpx;" @click="toDetail(recommendTopsH[0].userId)">
  118. <view class="tt-item-bg-center" style="width: 228rpx;"></view>
  119. <image :src="`${assetsUrl}friends-1.png`" mode="aspectFill" class="tt-item-img" style="transform: translateY(-5rpx);"></image>
  120. <image :src="`${assetsUrl}friends-1-bling.png`" mode="aspectFill" class="tt-item-img-border" style="transform: translateY(-60rpx);"></image>
  121. <image :src="recommendTopsH[0].icon" class="tt-item-head-box" style="border: 2rpx solid #FFEC36;transform: translateY(-18rpx);"></image>
  122. <view class="tt-item-name font28 fw600 el">
  123. {{recommendTopsH[0].nick}}
  124. </view>
  125. <view class="tt-item-num-box flex-center">
  126. <image :src="`${assetsUrl}friends-sugar.png`" mode="aspectFill" class="tt-item-num-img"></image>
  127. <view class="tt-item-num-text font22 fw600">
  128. {{recommendTopsH[0].val}}
  129. </view>
  130. </view>
  131. </view>
  132. <view class="tt-item flex-center" @click="toDetail(recommendTopsH[2].userId)">
  133. <view class="tt-item-bg"></view>
  134. <image :src="`${assetsUrl}friends-3.png`" mode="aspectFill" class="tt-item-img"></image>
  135. <image :src="recommendTopsH[2].icon" class="tt-item-head-box" style="border: 2rpx solid #E19865;"></image>
  136. <view class="tt-item-name font28 fw600 el">
  137. {{recommendTopsH[2].nick}}
  138. </view>
  139. <view class="tt-item-num-box flex-center">
  140. <image :src="`${assetsUrl}friends-sugar.png`" mode="aspectFill" class="tt-item-num-img"></image>
  141. <view class="tt-item-num-text font22 fw600">
  142. {{recommendTopsH[2].val}}
  143. </view>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. </swiper-item>
  149. </swiper>
  150. <view class="location flex-between" @click="computedLocation" v-if="showGetLocation">
  151. <image :src="`${assetsUrl}friends-pos.png`" mode="aspectFill" class="l-pos"></image>
  152. <text class="l-text font24 fw400">点此开启位置权限,获得更精准推荐!</text>
  153. <view class="l-open font24 fw400">开启</view>
  154. </view>
  155. <view class="list-item flex-start" v-for="(item,index) in recommendList" :key="index" @click="toDetail(item.id)">
  156. <view class="list-head-box">
  157. <image :src="item.iconThumbnail" mode="aspectFill" class="list-head-img"></image>
  158. <view class="list-head-dot" style="background-color: #38E825;" v-if="item.lastActiveTime<=30"></view>
  159. <view class="list-head-dot" style="background-color: #0ABDEF;" v-else-if="item.lastActiveTime>30&&item.lastActiveTime<=1440"></view>
  160. </view>
  161. <view class="list-info-box">
  162. <view class="name-box flex-between">
  163. <view class="name flex-start">
  164. <view class="name-text font28 fw600">
  165. {{item.nick}}
  166. </view>
  167. <image :src="`${assetsUrl}friends-vip.png`" mode="aspectFill" class="name-img" v-if="item.vip"></image>
  168. <image :src="`${assetsUrl}friends-godness.png`" mode="aspectFill" class="name-img-godness" v-if="item.goddess"></image>
  169. <image :src="`${assetsUrl}friends-real.png`" mode="aspectFill" class="name-img" v-else-if="item.realMan"></image>
  170. </view>
  171. <view class="distance font22 fw400" v-if="item.distance&&item.distance!=='NaNm'">
  172. {{item.distance}}
  173. </view>
  174. </view>
  175. <view class="sex-box flex-center" :style="{'background-color':`${item.sex==='Male'?'rgba(108,82,244,0.21)':''}`}">
  176. <image :src="`${assetsUrl}friends-female.png`" mode="aspectFill" class="sex-img" v-if="item.sex==='Famale'"></image>
  177. <image :src="`${assetsUrl}friends-male.png`" mode="aspectFill" class="sex-img" v-if="item.sex==='Male'"></image>
  178. <view class="el font20 fw500 sex-text1" v-if="item.sex==='Famale'">
  179. {{item.ageInfo.age}}
  180. </view>
  181. <view class="el font20 fw500 sex-text2" v-if="item.sex==='Male'">
  182. {{item.ageInfo.age}}
  183. </view>
  184. </view>
  185. <view class="tip-box font28 fw400 el" v-if="item.desc">
  186. 签名:{{item.desc}}
  187. </view>
  188. <view class="tip-box font28 fw400 el" v-else>
  189. 签名:暂无介绍
  190. </view>
  191. </view>
  192. <view class="img-box flex-between" v-if="item.lastNews">
  193. <image :src="item.lastNews.mediaUrls[0]" mode="aspectFill" class="ib1"></image>
  194. <image :src="item.lastNews.mediaUrls[1]" mode="aspectFill" class="ib2"></image>
  195. <image :src="item.lastNews.mediaUrls[2]" mode="aspectFill" class="ib3"></image>
  196. </view>
  197. </view>
  198. <view class="no-more font24 fw400" v-if="recommendList.length!==0&&recommendList.length>=recommendTotal">没有更多了</view>
  199. </scroll-view>
  200. </swiper-item>
  201. <swiper-item class="outer-swiper-item">
  202. <scroll-view class="scroll-view"
  203. v-if="scrollHeight>0"
  204. scroll-y="true"
  205. lower-threshold="200"
  206. :style="{'height':`${scrollHeight}px`}"
  207. refresher-enabled="true"
  208. :refresher-triggered="nearTriggered"
  209. :refresher-threshold="45"
  210. refresher-default-style="white"
  211. refresher-background="#151126"
  212. @refresherrefresh="nearRefresh"
  213. @refresherpulling="nearPulling"
  214. @refresherrestore="nearRestore"
  215. @refresherabort="nearAbort"
  216. @scrolltolower="nearToBottom"
  217. :show-scrollbar="false"
  218. >
  219. <image :src="`${assetsUrl}friends-bg.png`" mode="widthFix" class="tops-bg" v-if="!showGetLocation"></image>
  220. <view class="tops-nav flex-center" v-if="!showGetLocation">
  221. <view class="tops-nav-item" :class="topsIndex===index?'font32 fw600 tops-nav-item-active':''" v-for="(item,index) in tops" :key="index" @click="topsNavClick(index)">
  222. {{item}}
  223. </view>
  224. <view class="tops-line" :style="{'left':`${topsIndex*160+250}rpx`}"></view>
  225. </view>
  226. <swiper :current="topsIndex" class="swiper" @change="swiperChange" v-if="!showGetLocation">
  227. <swiper-item class="swiper-item">
  228. <view class="tops flex-between">
  229. <view class="tops-third flex-center">
  230. <view class="tt-item flex-center" @click="toDetail(nearTopsM[1].userId)">
  231. <view class="tt-item-bg"></view>
  232. <image :src="`${assetsUrl}friends-2.png`" mode="aspectFill" class="tt-item-img"></image>
  233. <image :src="nearTopsM[1].icon" class="tt-item-head-box" style="border: 2rpx solid #E2E2E2;"></image>
  234. <view class="tt-item-name font28 fw600 el">
  235. {{nearTopsM[1].nick}}
  236. </view>
  237. <view class="tt-item-num-box flex-center">
  238. <image :src="`${assetsUrl}friends-heart.png`" mode="aspectFill" class="tt-item-num-img"></image>
  239. <view class="tt-item-num-text font22 fw600">
  240. {{nearTopsM[1].val}}
  241. </view>
  242. </view>
  243. </view>
  244. <view class="tt-item flex-center" style="margin: 0rpx 16rpx;" @click="toDetail(nearTopsM[0].userId)">
  245. <view class="tt-item-bg-center" style="width: 228rpx;"></view>
  246. <image :src="`${assetsUrl}friends-1.png`" mode="aspectFill" class="tt-item-img" style="transform: translateY(-5rpx);"></image>
  247. <image :src="`${assetsUrl}friends-1-bling.png`" mode="aspectFill" class="tt-item-img-border" style="transform: translateY(-60rpx);"></image>
  248. <image :src="nearTopsM[0].icon" class="tt-item-head-box" style="border: 2rpx solid #FFEC36;transform: translateY(-18rpx);"></image>
  249. <view class="tt-item-name font28 fw600 el">
  250. {{nearTopsM[0].nick}}
  251. </view>
  252. <view class="tt-item-num-box flex-center">
  253. <image :src="`${assetsUrl}friends-heart.png`" mode="aspectFill" class="tt-item-num-img"></image>
  254. <view class="tt-item-num-text font22 fw600">
  255. {{nearTopsM[0].val}}
  256. </view>
  257. </view>
  258. </view>
  259. <view class="tt-item flex-center" @click="toDetail(nearTopsM[2].userId)">
  260. <view class="tt-item-bg"></view>
  261. <image :src="`${assetsUrl}friends-3.png`" mode="aspectFill" class="tt-item-img"></image>
  262. <image :src="nearTopsM[2].icon" class="tt-item-head-box" style="border: 2rpx solid #E19865;"></image>
  263. <view class="tt-item-name font28 fw600 el">
  264. {{nearTopsM[2].nick}}
  265. </view>
  266. <view class="tt-item-num-box flex-center">
  267. <image :src="`${assetsUrl}friends-heart.png`" mode="aspectFill" class="tt-item-num-img"></image>
  268. <view class="tt-item-num-text font22 fw600">
  269. {{nearTopsM[2].val}}
  270. </view>
  271. </view>
  272. </view>
  273. </view>
  274. </view>
  275. </swiper-item>
  276. <swiper-item class="swiper-item">
  277. <view class="tops flex-between">
  278. <view class="tops-third flex-center">
  279. <view class="tt-item flex-center" @click="toDetail(nearTopsH[1].userId)">
  280. <view class="tt-item-bg"></view>
  281. <image :src="`${assetsUrl}friends-2.png`" mode="aspectFill" class="tt-item-img"></image>
  282. <image :src="nearTopsH[1].icon" class="tt-item-head-box" style="border: 2rpx solid #E2E2E2;"></image>
  283. <view class="tt-item-name font28 fw600 el">
  284. {{nearTopsH[1].nick}}
  285. </view>
  286. <view class="tt-item-num-box flex-center">
  287. <image :src="`${assetsUrl}friends-sugar.png`" mode="aspectFill" class="tt-item-num-img"></image>
  288. <view class="tt-item-num-text font22 fw600">
  289. {{nearTopsH[1].val}}
  290. </view>
  291. </view>
  292. </view>
  293. <view class="tt-item flex-center" style="margin: 0rpx 16rpx;" @click="toDetail(nearTopsH[0].userId)">
  294. <view class="tt-item-bg-center" style="width: 228rpx;"></view>
  295. <image :src="`${assetsUrl}friends-1.png`" mode="aspectFill" class="tt-item-img" style="transform: translateY(-5rpx);"></image>
  296. <image :src="`${assetsUrl}friends-1-bling.png`" mode="aspectFill" class="tt-item-img-border" style="transform: translateY(-60rpx);"></image>
  297. <image :src="nearTopsH[0].icon" class="tt-item-head-box" style="border: 2rpx solid #FFEC36;transform: translateY(-18rpx);"></image>
  298. <view class="tt-item-name font28 fw600 el">
  299. {{nearTopsH[0].nick}}
  300. </view>
  301. <view class="tt-item-num-box flex-center">
  302. <image :src="`${assetsUrl}friends-sugar.png`" mode="aspectFill" class="tt-item-num-img"></image>
  303. <view class="tt-item-num-text font22 fw600">
  304. {{nearTopsH[0].val}}
  305. </view>
  306. </view>
  307. </view>
  308. <view class="tt-item flex-center" @click="toDetail(nearTopsH[2].userId)">
  309. <view class="tt-item-bg"></view>
  310. <image :src="`${assetsUrl}friends-3.png`" mode="aspectFill" class="tt-item-img"></image>
  311. <image :src="nearTopsH[2].icon" class="tt-item-head-box" style="border: 2rpx solid #E19865;"></image>
  312. <view class="tt-item-name font28 fw600 el">
  313. {{nearTopsH[2].nick}}
  314. </view>
  315. <view class="tt-item-num-box flex-center">
  316. <image :src="`${assetsUrl}friends-sugar.png`" mode="aspectFill" class="tt-item-num-img"></image>
  317. <view class="tt-item-num-text font22 fw600">
  318. {{nearTopsH[2].val}}
  319. </view>
  320. </view>
  321. </view>
  322. </view>
  323. </view>
  324. </swiper-item>
  325. </swiper>
  326. <view class="list-item flex-start" v-for="(item,index) in nearList" :key="index" @click="toDetail(item.id)">
  327. <view class="list-head-box">
  328. <image :src="item.iconThumbnail" mode="aspectFill" class="list-head-img"></image>
  329. <view class="list-head-dot" style="background-color: #38E825;" v-if="item.lastActiveTime<=30"></view>
  330. <view class="list-head-dot" style="background-color: #0ABDEF;" v-else-if="item.lastActiveTime>30&&item.lastActiveTime<=1440"></view>
  331. </view>
  332. <view class="list-info-box">
  333. <view class="name-box flex-between">
  334. <view class="name flex-start">
  335. <view class="name-text font28 fw600">
  336. {{item.nick}}
  337. </view>
  338. <image :src="`${assetsUrl}friends-vip.png`" mode="aspectFill" class="name-img" v-if="item.vip"></image>
  339. <image :src="`${assetsUrl}friends-godness.png`" mode="aspectFill" class="name-img-godness" v-if="item.goddess"></image>
  340. <image :src="`${assetsUrl}friends-real.png`" mode="aspectFill" class="name-img" v-else-if="item.realMan"></image>
  341. </view>
  342. <view class="distance font22 fw400" v-if="item.distance&&item.distance!=='NaNm'">
  343. {{item.distance}}
  344. </view>
  345. </view>
  346. <view class="sex-box flex-center" :style="{'background-color':`${item.sex==='Male'?'rgba(108,82,244,0.21)':''}`}">
  347. <image :src="`${assetsUrl}friends-female.png`" mode="aspectFill" class="sex-img" v-if="item.sex==='Famale'"></image>
  348. <image :src="`${assetsUrl}friends-male.png`" mode="aspectFill" class="sex-img" v-if="item.sex==='Male'"></image>
  349. <view class="el font20 fw500 sex-text1" v-if="item.sex==='Famale'">
  350. {{item.ageInfo.age}}
  351. </view>
  352. <view class="el font20 fw500 sex-text2" v-if="item.sex==='Male'">
  353. {{item.ageInfo.age}}
  354. </view>
  355. </view>
  356. <view class="tip-box font28 fw400 el" v-if="item.desc">
  357. 签名:{{item.desc}}
  358. </view>
  359. <view class="tip-box font28 fw400 el" v-else>
  360. 签名:暂无介绍
  361. </view>
  362. </view>
  363. <view class="img-box flex-between" v-if="item.lastNews">
  364. <image :src="item.lastNews.mediaUrls[0]" mode="aspectFill" class="ib1"></image>
  365. <image :src="item.lastNews.mediaUrls[1]" mode="aspectFill" class="ib2"></image>
  366. <image :src="item.lastNews.mediaUrls[2]" mode="aspectFill" class="ib3"></image>
  367. </view>
  368. </view>
  369. <view class="no-more font24 fw400" v-if="nearList.length!==0&&nearList.length>=nearTotal">没有更多了</view>
  370. <Status :type="statusType" :btnText="statusBtnText" :text="statusText" @btnEvent="computedLocation" v-if="showGetLocation"></Status>
  371. <Status type="noData" text="暂无数据" v-if="showNoData"></Status>
  372. </scroll-view>
  373. </swiper-item>
  374. </swiper>
  375. </view>
  376. </template>
  377. <script>
  378. import TabBar from '@/components/TabBar/TabBar.vue';
  379. import Status from '@/components/Status/Status.vue';
  380. import wxMap from '@/static/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js';
  381. import TIM from 'tim-wx-sdk';
  382. import Popup from '@/components/Popup/Popup.vue';
  383. // import COS from 'cos-wx-sdk-v5';
  384. import TIMUploadPlugin from 'tim-upload-plugin';
  385. // 腾讯位置服务,手机账号:18996226740
  386. const wxMapSdk=new wxMap({key:'E5SBZ-T2YC3-CBL3F-YGFQQ-26PP2-ERFII'});
  387. import {get} from '@/util/index.js'
  388. export default {
  389. components: {
  390. TabBar,Status,Popup
  391. },
  392. data() {
  393. return {
  394. statusType:'noPos',
  395. statusBtnText:'开启定位',
  396. statusText:'开启定位后才能帮你找到身边的TA哦',
  397. assetsUrl: this.$util.assetsUrl,
  398. tabIndex: 0,
  399. navs: ['推荐', '附近'],
  400. navIndex:0,
  401. tops:['魅力榜','壕气榜'],
  402. topsIndex:0,
  403. scrollHeight:0,
  404. rankingOptions:{
  405. city:'',
  406. cityCode:'',
  407. number:3,
  408. type:'M'
  409. },
  410. popup:{
  411. content1:'',
  412. content2:'',
  413. tip1:'',
  414. tip2:'',
  415. btntext:''
  416. },
  417. recommendListOptions:{
  418. filterIds:[],
  419. page:{
  420. index:1,
  421. size:20,
  422. sortValues:[]
  423. },
  424. queryPre:{
  425. city:'',
  426. cityCode:'',
  427. femaleGoddess:false,
  428. femaleNew:false,
  429. geo:{
  430. lat:0,
  431. lon:0
  432. },
  433. maleNew:false,
  434. maleVip:false
  435. },
  436. showList: true,
  437. type: {}
  438. },
  439. nearListOptions:{
  440. filterIds:[],
  441. page:{
  442. index:1,
  443. size:20,
  444. sortValues:[]
  445. },
  446. queryPre:{
  447. city:'',
  448. cityCode:'',
  449. femaleGoddess:false,
  450. femaleNew:false,
  451. geo:{
  452. lat:0,
  453. lon:0
  454. },
  455. maleNew:false,
  456. maleVip:false
  457. },
  458. showList: true,
  459. type: {}
  460. },
  461. showGetLocation:false,
  462. showNoData:false,
  463. latitude:0,
  464. longitude:0,
  465. locationCity:'',
  466. locationCityCode:'',
  467. recommendTopsM:[],
  468. recommendTopsH:[],
  469. recommendList:[],
  470. recommendTotal:0,
  471. recommendRefreshing:false,
  472. recommendTriggered:true,
  473. nearTopsM:[],
  474. nearTopsH:[],
  475. nearList:[],
  476. nearTotal:0,
  477. nearRefreshing:false,
  478. nearTriggered:true,
  479. otherInfo:null
  480. };
  481. },
  482. computed: {
  483. statusBarHeight() {
  484. return this.$store.state.statusBarHeight||20;
  485. },
  486. topbarOffsetHeight() {
  487. return this.$store.state.topbarOffsetHeight||40;
  488. },
  489. userInfo(){
  490. return this.$store.state.userInfo||{};
  491. }
  492. },
  493. onLoad(options) {
  494. console.log('options',options)
  495. if(options.invite){
  496. uni.setStorageSync('invited',options.invite);
  497. }
  498. uni.showLoading({
  499. mask:true,
  500. title:'加载中'
  501. })
  502. this.$api.public.aliossCdn({}).then(cdnRes=>{
  503. console.log('cdnRes',cdnRes)
  504. this.$store.commit('setImageCdn',cdnRes.data.pictureCdn);
  505. this.$store.commit('setVideoCdn',cdnRes.data.videoCdn);
  506. uni.setStorageSync('imageCdn',cdnRes.data.pictureCdn);
  507. uni.setStorageSync('videoCdn',cdnRes.data.videoCdn);
  508. }).catch((error)=>{
  509. console.log('error---aliossCdn',error)
  510. });
  511. this.login();
  512. this.computedScollviewHeight();
  513. },
  514. onShow() {
  515. if(uni.getStorageSync('needFreshList')==='1'){
  516. this.recommendRefresh();
  517. this.nearRefresh();
  518. uni.setStorageSync('needFreshList','0');
  519. }
  520. },
  521. // #ifdef MP
  522. onShareAppMessage(){
  523. return {
  524. title: '糖果公园',
  525. path: `/pages/login/login?share=${this.userInfo.inviteCode}`,
  526. }
  527. },
  528. // #endif
  529. methods: {
  530. getMineData(){
  531. let user=JSON.parse(uni.getStorageSync('user'));
  532. this.$api.public.mineDetail({
  533. getAlbum:true,
  534. completeUser:user
  535. }).then(res=>{
  536. this.$store.commit('setUserInfo',res.data);
  537. uni.setStorageSync('userInfo',JSON.stringify(res.data));
  538. if(!res.data.regDone){
  539. uni.reLaunch({
  540. url:'/pages/info/sex'
  541. })
  542. return;
  543. }
  544. })
  545. },
  546. login(){
  547. const that=this;
  548. if(uni.getStorageSync('isLogin')==='yes'){
  549. console.log('uni.getStorageSync(isLogin)',uni.getStorageSync('isLogin'))
  550. this.getMineData();
  551. this.computedLocation();
  552. return;
  553. }
  554. uni.login({//免密登录
  555. success:(res)=>{
  556. that.$api.login.wxLogin({
  557. scene: "WxMPLogin",
  558. miniProgramEncryUserInfoParam:{
  559. jsCode:res.code
  560. }
  561. }).then(result=>{
  562. console.log('result',result)
  563. if(result.status==='Succ'){
  564. uni.setStorageSync('openId',result.data.wxLoginInfo.openId);
  565. uni.setStorageSync('unionId',result.data.wxLoginInfo.unionId);
  566. this.computedLocation();
  567. this.getRecommendTopsMData();
  568. this.getRecommendTopsHData();
  569. uni.setStorageSync('LL_Ukn',result.data.userToken.ukn);
  570. uni.setStorageSync('token',result.data.userToken.token);
  571. uni.setStorageSync('userInfo',JSON.stringify(result.data));
  572. uni.setStorageSync('user',JSON.stringify(result.data.userToken.user));
  573. uni.setStorageSync('isLogin','yes');
  574. this.$api.public.aliossCdn({}).then(cdnRes=>{
  575. this.$store.commit('setImageCdn',cdnRes.data.pictureCdn);
  576. this.$store.commit('setVideoCdn',cdnRes.data.videoCdn);
  577. })
  578. }
  579. }).catch((error)=>{
  580. console.log('uni.login',error)
  581. })
  582. },
  583. fail: (err) => {
  584. console.log('免密登录',err)
  585. }
  586. });
  587. },
  588. closePopup(){
  589. this.$refs.popup.close();
  590. },
  591. imInit(){
  592. /**
  593. * IM初始化
  594. */
  595. if(uni.$TUIKit){
  596. uni.$TUIKit.logout();
  597. }
  598. const SDKAppID = this.$util.IMSDKCode,that=this;
  599. uni.$TUIKit = TIM.create({
  600. SDKAppID: SDKAppID
  601. });
  602. uni.$TUIKitTIM = TIM;
  603. uni.$TUIKitEvent = TIM.EVENT;
  604. uni.$TUIKitVersion = TIM.VERSION;
  605. uni.$TUIKitTypes = TIM.TYPES; // 监听系统级事件
  606. uni.$TUIKit.on(uni.$TUIKitEvent.SDK_READY, this.onSDKReady);
  607. uni.$TUIKit.on(uni.$TUIKitEvent.SDK_NOT_READY, this.onSdkNotReady);
  608. uni.$TUIKit.on(uni.$TUIKitEvent.KICKED_OUT, this.onKickedOut);
  609. uni.$TUIKit.on(uni.$TUIKitEvent.ERROR, this.onTIMError);
  610. uni.$TUIKit.on(uni.$TUIKitEvent.NET_STATE_CHANGE, this.onNetStateChange);
  611. uni.$TUIKit.on(uni.$TUIKitEvent.SDK_RELOAD, this.onSDKReload);
  612. uni.$resetLoginData = this.resetLoginData();
  613. uni.$TUIKit.registerPlugin({ 'tim-upload-plugin':TIMUploadPlugin });
  614. },
  615. resetLoginData() {
  616. if(!uni.getStorageSync('userInfo')){
  617. return;
  618. }
  619. let user=JSON.parse(uni.getStorageSync('userInfo'));
  620. this.$api.IM.loadSig({}).then(res=>{
  621. this.$store.commit('setImLoadSig',res.data.sig);
  622. uni.$TUIKit.login({
  623. userID:String(user.id),
  624. userSig:this.$store.state.IMloadSig
  625. })
  626. }).catch((err)=>{
  627. console.log('IM.loadSig',err)
  628. })
  629. },
  630. onTIMError(error) {
  631. },
  632. onSDKReady({name}) {
  633. const isSDKReady = name === uni.$TUIKitEvent.SDK_READY ? true : false;
  634. if(isSDKReady){
  635. uni.$emit('isSDKReady', {
  636. isSDKReady: true
  637. });
  638. uni.hideLoading();
  639. }
  640. },
  641. onNetStateChange() {},
  642. onSDKReload() {},
  643. onSdkNotReady() {},
  644. onKickedOut() {
  645. uni.showToast({
  646. title: '您被踢下线',
  647. icon: 'error'
  648. });
  649. uni.reLaunch({
  650. url: '/pages/login/login'
  651. })
  652. },
  653. /**
  654. * 推荐下拉刷新、加载更多
  655. */
  656. recommendRefresh(){
  657. if(!uni.getStorageSync('token')){
  658. setTimeout(() => {
  659. this.recommendTriggered = false;
  660. this.recommendRefreshing = false;
  661. }, 1000)
  662. return;
  663. }
  664. if (this.recommendRefreshing)
  665. {
  666. return;
  667. }
  668. this.recommendRefreshing = true;
  669. setTimeout(() => {
  670. this.recommendTriggered = false;
  671. this.recommendRefreshing = false;
  672. }, 1000)
  673. this.recommendListOptions.page={
  674. index:1,
  675. size:20,
  676. sortValues:[]
  677. }
  678. this.getRecommendTopsMData();
  679. this.getRecommendTopsHData();
  680. this.getRecommendList();
  681. },
  682. recommendPulling(e) {},
  683. recommendRestore() {this.recommendTriggered = true;},
  684. recommendAbort() {},
  685. recommendToBottom(){
  686. if(!uni.getStorageSync('token')){return;}
  687. if(this.recommendList.length>=this.recommendTotal){return;}
  688. this.recommendListOptions.page.index++;
  689. this.getRecommendList();
  690. },
  691. /**
  692. * 附近下拉刷新、加载更多
  693. */
  694. nearRefresh(){
  695. if (this.nearRefreshing)
  696. {
  697. return;
  698. }
  699. this.nearRefreshing = true;
  700. setTimeout(() => {
  701. this.nearTriggered = false;
  702. this.nearRefreshing = false;
  703. }, 1000)
  704. this.nearListOptions.page={
  705. index:1,
  706. size:20,
  707. sortValues:[]
  708. }
  709. this.getNearTopsMData();
  710. this.getNearTopsHData();
  711. this.getNearList();
  712. },
  713. nearPulling(e) {},
  714. nearRestore() {this.nearTriggered = true;},
  715. nearAbort() {},
  716. nearToBottom(){
  717. if(this.nearList.length>=this.nearTotal){return;}
  718. this.nearListOptions.page.index++;
  719. this.getNearList();
  720. },
  721. /**
  722. * 计算scroll高度
  723. */
  724. computedScollviewHeight() {
  725. let query = uni.createSelectorQuery().in(this);
  726. let heightLeaf = this.$store.state.tabbarHeight/2;
  727. query.select('#topnav').boundingClientRect(data => {
  728. heightLeaf += data.height;
  729. }).exec(() => {
  730. let sysInfo = uni.getSystemInfoSync();
  731. this.scrollHeight = sysInfo.windowHeight - heightLeaf;
  732. });
  733. },
  734. /**
  735. * 计算列表定位距离
  736. */
  737. computedLocation(){
  738. uni.getFuzzyLocation({
  739. type:'gcj02',
  740. success:res=>{
  741. wxMapSdk.reverseGeocoder({
  742. location:{
  743. latitude:res.latitude,
  744. longitude:res.longitude
  745. },
  746. success:result=>{
  747. this.locationCity=result.result.ad_info.city;
  748. this.latitude=result.result.location.lat;
  749. this.longitude=result.result.location.lng;
  750. this.$store.commit('setLatitude',result.result.location.lat);
  751. this.$store.commit('setLongitude',result.result.location.lng);
  752. uni.setStorageSync('latitude',result.result.location.lat);
  753. uni.setStorageSync('longitude',result.result.location.lng);
  754. uni.setStorageSync('city',this.locationCity);
  755. this.locationCityCode=result.result.ad_info.city_code.split(result.result.ad_info.nation_code)[1];
  756. if(!uni.getStorageSync('token')){
  757. this.getTempRecommendList();
  758. }
  759. else{
  760. this.getNearTopsMData();
  761. this.getNearTopsHData();
  762. this.getRecommendTopsMData();
  763. this.getRecommendTopsHData();
  764. this.getNearList();
  765. this.getRecommendList();
  766. this.showGetLocation=false;
  767. setTimeout(()=>{
  768. this.imInit();
  769. },2000)
  770. }
  771. }
  772. })
  773. },
  774. fail:err=>{
  775. this.showGetLocation=true;
  776. uni.showModal({
  777. content: '检测到您没打开地址信息权限,是否去设置打开?',
  778. confirmText: "确认",
  779. cancelText: '取消',
  780. success:res=>{
  781. if(res.confirm){
  782. uni.openSetting({
  783. success:ress=>{
  784. if(ress.authSetting){
  785. this.computedLocation();
  786. }
  787. }
  788. })
  789. }
  790. }
  791. })
  792. }
  793. })
  794. },
  795. toLogin(){
  796. uni.reLaunch({
  797. url:'/pages/login/login'
  798. })
  799. },
  800. navClick(index){
  801. if(!uni.getStorageSync('token')){
  802. this.popup={
  803. content1:'您还未登录',
  804. content2:'该功能登录后才能使用',
  805. tip1:'',
  806. tip2:'',
  807. btntext:'去登录'
  808. }
  809. this.$refs.popup.open();
  810. return;
  811. }
  812. this.rankingOptions.city=(index===0?'':this.locationCity);
  813. this.rankingOptions.cityCode=(index===0?'':this.locationCityCode);
  814. this.navIndex=index;
  815. },
  816. toSearch(){
  817. if(!uni.getStorageSync('token')){
  818. this.popup={
  819. content1:'您还未登录',
  820. content2:'该功能登录后才能使用',
  821. tip1:'',
  822. tip2:'',
  823. btntext:'去登录'
  824. }
  825. this.$refs.popup.open();
  826. return;
  827. }
  828. uni.navigateTo({
  829. url:'/pages/search/search'
  830. })
  831. },
  832. topsNavClick(index){
  833. this.topsIndex=index;
  834. },
  835. outerSwiperChange(e){
  836. this.navIndex=e.detail.current;
  837. },
  838. swiperChange(e){
  839. this.topsIndex=e.detail.current;
  840. },
  841. getRecommendTopsMData(){
  842. this.rankingOptions.type='M';
  843. this.$api.public.ranking(this.rankingOptions).then(res=>{
  844. this.recommendTopsM=res.data.list;
  845. })
  846. },
  847. getRecommendTopsHData(){
  848. this.rankingOptions.type='H';
  849. this.$api.public.ranking(this.rankingOptions).then(res=>{
  850. this.recommendTopsH=res.data.list;
  851. })
  852. },
  853. getNearTopsMData(){
  854. this.rankingOptions.type='M';
  855. this.rankingOptions.city=this.locationCity;
  856. this.rankingOptions.cityCode=this.locationCityCode;
  857. this.$api.public.ranking(this.rankingOptions).then(res=>{
  858. this.nearTopsM=res.data.list;
  859. })
  860. },
  861. getNearTopsHData(){
  862. this.rankingOptions.type='H';
  863. this.rankingOptions.city=this.locationCity;
  864. this.rankingOptions.cityCode=this.locationCityCode;
  865. this.$api.public.ranking(this.rankingOptions).then(res=>{
  866. this.nearTopsH=res.data.list;
  867. })
  868. },
  869. getTempRecommendList(){//获取免登录体验数据
  870. this.recommendListOptions.type='FamaleReco';
  871. this.$api.public.friendsNoAuth(this.recommendListOptions).then(res=>{
  872. if(res.status==='Succ'){
  873. uni.hideLoading();
  874. this.recommendTotal=res.data.page.recordCount;
  875. this.recommendListOptions.page.sortValues=res.data.sortValues;
  876. let arr=[],obj={latitude:0,longitude:0};
  877. for(let i=0;i<res.data.users.length;i++){
  878. res.data.users[i].lastActiveTime=this.$moment(new Date()).diff(res.data.users[i].lastActive,'minutes');
  879. obj={latitude:0,longitude:0};
  880. obj.latitude=res.data.users[i].geo.lat;
  881. obj.longitude=res.data.users[i].geo.lon;
  882. arr.push(obj)
  883. }
  884. wxMapSdk.calculateDistance({
  885. mode:'straight',
  886. from:{
  887. latitude: this.latitude,
  888. longitude: this.longitude
  889. },
  890. to:arr,
  891. success:dists=>{
  892. if(dists.message==="query ok"){
  893. for(let j=0;j<dists.result.elements.length;j++){
  894. res.data.users[j].distance=(dists.result.elements[j].distance>1000?`${Math.floor(dists.result.elements[j].distance/100)/10}km`:`${dists.result.elements[j].distance}m`)
  895. }
  896. if(this.recommendListOptions.page.index>1){
  897. this.recommendList=[...this.recommendList,...res.data.users];
  898. }
  899. else{
  900. this.recommendList=res.data.users;
  901. }
  902. this.$forceUpdate();
  903. }
  904. }
  905. })
  906. this.recommendList=res.data.users;
  907. }
  908. })
  909. },
  910. getRecommendList(){
  911. let user=JSON.parse(uni.getStorageSync('user'));
  912. this.recommendListOptions.type=user.sex==='male'?'MaleReco':'FamaleReco';
  913. this.recommendListOptions.queryPre.city=this.locationCity;
  914. this.recommendListOptions.queryPre.cityCode=this.locationCityCode;
  915. this.recommendListOptions.queryPre.geo.lat=this.latitude;
  916. this.recommendListOptions.queryPre.geo.lon=this.longitude;
  917. this.$api.public.friends(this.recommendListOptions).then(res=>{
  918. if(res.status==='Succ'){
  919. this.recommendTotal=res.data.page.recordCount;
  920. this.recommendListOptions.page.sortValues=res.data.sortValues;
  921. let arr=[],obj={latitude:0,longitude:0};
  922. for(let i=0;i<res.data.users.length;i++){
  923. res.data.users[i].lastActiveTime=this.$moment(new Date()).diff(res.data.users[i].lastActive,'minutes');
  924. obj={latitude:0,longitude:0};
  925. obj.latitude=res.data.users[i].geo.lat;
  926. obj.longitude=res.data.users[i].geo.lon;
  927. arr.push(obj)
  928. }
  929. wxMapSdk.calculateDistance({
  930. mode:'straight',
  931. from:{
  932. latitude: this.latitude,
  933. longitude: this.longitude
  934. },
  935. to:arr,
  936. success:dists=>{
  937. if(dists.message==="query ok"){
  938. for(let j=0;j<dists.result.elements.length;j++){
  939. res.data.users[j].distance=(dists.result.elements[j].distance>1000?`${Math.floor(dists.result.elements[j].distance/100)/10}km`:`${dists.result.elements[j].distance}m`)
  940. }
  941. if(this.recommendListOptions.page.index>1){
  942. this.recommendList=[...this.recommendList,...res.data.users];
  943. }
  944. else{
  945. this.recommendList=res.data.users;
  946. }
  947. uni.hideLoading();
  948. this.$forceUpdate();
  949. }
  950. }
  951. })
  952. }
  953. })
  954. },
  955. getNearList(){
  956. let user=JSON.parse(uni.getStorageSync('user'));
  957. this.nearListOptions.type=user.sex==='male'?'MaleNearby':'FamaleNearby';
  958. this.nearListOptions.queryPre.city=this.locationCity;
  959. this.nearListOptions.queryPre.cityCode=this.locationCityCode;
  960. this.nearListOptions.queryPre.geo.lat=this.latitude;
  961. this.nearListOptions.queryPre.geo.lon=this.longitude;
  962. this.$api.public.friends(this.nearListOptions).then(res=>{
  963. if(res.status==='Succ'&&res.data.users.length>0){
  964. this.nearTotal=res.data.page.recordCount;
  965. this.nearListOptions.page.sortValues=res.data.sortValues;
  966. this.showNoData=res.data.users.length===0?true:false;
  967. let arr=[],obj={latitude:0,longitude:0};
  968. for(let i=0;i<res.data.users.length;i++){
  969. res.data.users[i].lastActiveTime=this.$moment(new Date()).diff(res.data.users[i].lastActive,'minutes');
  970. obj={latitude:0,longitude:0};
  971. obj.latitude=res.data.users[i].geo.lat;
  972. obj.longitude=res.data.users[i].geo.lon;
  973. arr.push(obj)
  974. }
  975. wxMapSdk.calculateDistance({
  976. mode:'straight',
  977. from:{
  978. latitude: this.latitude,
  979. longitude: this.longitude
  980. },
  981. to:arr,
  982. success:dists=>{
  983. if(dists.message==="query ok"){
  984. for(let j=0;j<dists.result.elements.length;j++){
  985. res.data.users[j].distance=(dists.result.elements[j].distance>1000?`${Math.floor(dists.result.elements[j].distance/100)/10}km`:`${dists.result.elements[j].distance}m`)
  986. }
  987. if(this.nearListOptions.page.index>1){
  988. this.nearList=[...this.nearList,...res.data.users];
  989. }
  990. else{
  991. this.nearList=res.data.users;
  992. }
  993. uni.hideLoading()
  994. this.$forceUpdate();
  995. }
  996. }
  997. })
  998. }
  999. else{
  1000. this.showNoData=this.nearList.length===0?true:false;
  1001. }
  1002. })
  1003. },
  1004. toDetail(id){
  1005. if(!uni.getStorageSync('token')){
  1006. this.popup={
  1007. content1:'您还未登录',
  1008. content2:'该功能登录后才能使用',
  1009. tip1:'',
  1010. tip2:'',
  1011. btntext:'去登录'
  1012. }
  1013. this.$refs.popup.open();
  1014. return;
  1015. }
  1016. uni.showLoading({})
  1017. let user=JSON.parse(uni.getStorageSync('user'));
  1018. this.$api.public.userDetail({getAlbum:true,completeUser:user,uponUserId:id}).then(res=>{
  1019. if(res.data.frozen){
  1020. uni.showToast({
  1021. title:'该用户已被冻结',
  1022. icon:'none'
  1023. });
  1024. return;
  1025. }
  1026. if(res.data.sex===user.sex){
  1027. uni.showToast({
  1028. title:'同性用户不能查看主页',
  1029. icon:'none'
  1030. })
  1031. }
  1032. else{
  1033. uni.setStorageSync('otherInfo',JSON.stringify(res.data));
  1034. uni.hideLoading();
  1035. uni.navigateTo({
  1036. url:`/pages/friends/user?id=${id}`
  1037. })
  1038. }
  1039. })
  1040. },
  1041. }
  1042. }
  1043. </script>
  1044. <style lang="scss" scoped>
  1045. .container {
  1046. width: 100vw;
  1047. min-height: 100vh;
  1048. background-color: $bgcolor1;
  1049. overflow: hidden;
  1050. .topnav {
  1051. margin: 0 60rpx;
  1052. align-items: center;
  1053. position: relative;
  1054. .nav-item {
  1055. color: $fontcolor3;
  1056. margin-right: 72rpx;
  1057. transition: all 0.3s;
  1058. padding: 0 10rpx;
  1059. .nav-item-text{
  1060. position: relative;
  1061. z-index: 1;
  1062. }
  1063. }
  1064. .nav-search{
  1065. width:56rpx;
  1066. height: 56rpx;
  1067. margin-left: 110rpx;
  1068. }
  1069. .nav-item-bg{
  1070. position: absolute;
  1071. left: 0;
  1072. bottom: 10rpx;
  1073. width: 92rpx;
  1074. height: 68rpx;
  1075. z-index: 0;
  1076. transition: all .3s;
  1077. }
  1078. }
  1079. .location{
  1080. margin-top: 40rpx;
  1081. padding: 12rpx;
  1082. background-color: $bgcolor3;
  1083. border-radius: 36rpx;
  1084. .l-pos{
  1085. width: 32rpx;
  1086. height: 32rpx;
  1087. }
  1088. .l-text{
  1089. color: $fontcolor2;
  1090. flex: 1;
  1091. text-align: left;
  1092. margin-left: 8rpx;
  1093. }
  1094. .l-open{
  1095. width: 88rpx;
  1096. height: 48rpx;
  1097. border-radius: 24rpx;
  1098. line-height: 48rpx;
  1099. text-align: center;
  1100. background-color: $primary;
  1101. color: $fontcolor5;
  1102. }
  1103. }
  1104. .scroll-view{
  1105. padding: 24rpx 32rpx 0rpx 32rpx;
  1106. box-sizing: border-box;
  1107. .tops-bg{
  1108. width: 100%;
  1109. height: 100%;
  1110. position: absolute;
  1111. left: 0;
  1112. top: 0;
  1113. z-index: 0;
  1114. }
  1115. .tops-nav{
  1116. position: relative;
  1117. height: 86rpx;
  1118. z-index: 1;
  1119. .tops-nav-item{
  1120. width: 160rpx;
  1121. text-align: center;
  1122. color: $fontcolor3;
  1123. }
  1124. .tops-nav-item-active{
  1125. color: $fontcolor5 !important;
  1126. }
  1127. .tops-line{
  1128. width: 24rpx;
  1129. height: 4rpx;
  1130. background: $fontcolor5;
  1131. border-radius: 2rpx;
  1132. position: absolute;
  1133. bottom: 0;
  1134. transition: all 0.3s;
  1135. }
  1136. }
  1137. .swiper{
  1138. height: 396rpx;
  1139. .swiper-item{
  1140. height: 100%;
  1141. .tops{
  1142. position: relative;
  1143. height: 100%;
  1144. flex-direction: column;
  1145. .tops-third{
  1146. height: 100%;
  1147. .tt-item{
  1148. position: relative;
  1149. flex-direction: column;
  1150. height: 100%;
  1151. width: 208rpx;
  1152. .tt-item-bg{
  1153. width: 196rpx;
  1154. height: 208rpx;
  1155. background: linear-gradient(180deg, rgba(226,226,226,0.1000) 0%, rgba(226,226,226,0) 100%);
  1156. border-radius: 16rpx 16rpx 0rpx 0rpx;
  1157. position: absolute;
  1158. bottom: 0;
  1159. }
  1160. .tt-item-bg-center{
  1161. width: 196rpx;
  1162. height: 248rpx;
  1163. background: linear-gradient(180deg, rgba(255,236,54,0.1000) 0%, rgba(255,236,54,0) 100%);
  1164. border-radius: 16rpx 16rpx 0rpx 0rpx;
  1165. position: absolute;
  1166. bottom: 0;
  1167. }
  1168. .tt-item-img{
  1169. width: 92rpx;
  1170. height: 40rpx;
  1171. transform: translateY(20rpx);
  1172. position: relative;
  1173. z-index:20;
  1174. }
  1175. .tt-item-img-border{
  1176. width: 196rpx;
  1177. height: 192rpx;
  1178. position: absolute;
  1179. left: 0;
  1180. right: 0;
  1181. margin: auto;
  1182. transform: translateY(-30rpx);
  1183. }
  1184. .tt-item-head-box{
  1185. width: 136rpx;
  1186. height: 136rpx;
  1187. border-radius: 68rpx;
  1188. position: relative;
  1189. z-index: 10;
  1190. }
  1191. .tt-item-name{
  1192. width: 136rpx;
  1193. height: 40rpx;
  1194. text-align: center;
  1195. line-height: 40rpx;
  1196. color: $fontcolor5;
  1197. margin-bottom: 16rpx;
  1198. margin-top: 14rpx;
  1199. }
  1200. .tt-item-num-box{
  1201. .tt-item-num-img{
  1202. width: 32rpx;
  1203. height: 32rpx;
  1204. }
  1205. .tt-item-num-text{
  1206. color: $fontcolor5;
  1207. margin-left: 8rpx;
  1208. }
  1209. }
  1210. }
  1211. }
  1212. }
  1213. }
  1214. }
  1215. .list-item{
  1216. flex-wrap: wrap;
  1217. padding: 40rpx 0rpx;
  1218. .list-head-box{
  1219. width: 136rpx;
  1220. height: 136rpx;
  1221. position: relative;
  1222. .list-head-img{
  1223. width: 136rpx;
  1224. height: 136rpx;
  1225. background-color: #ffffff;
  1226. border-radius: 136rpx;
  1227. }
  1228. .list-head-dot{
  1229. width: 24rpx;
  1230. height: 24rpx;
  1231. border-radius: 24rpx;
  1232. position: absolute;
  1233. background-color: aqua;
  1234. bottom: 2rpx;
  1235. right: 2rpx;
  1236. border: 2rpx solid $bgcolor2;
  1237. }
  1238. }
  1239. .list-info-box{
  1240. box-sizing: border-box;
  1241. width: 544rpx;
  1242. padding-left: 32rpx;
  1243. height: 136rpx;
  1244. flex-direction: column;
  1245. display: flex;
  1246. justify-content: flex-start;
  1247. align-items: flex-start;
  1248. .name-box{
  1249. width: 100%;
  1250. .name{
  1251. .name-text{
  1252. color: $fontcolor5;
  1253. }
  1254. .name-img{
  1255. width: 68rpx;
  1256. height: 32rpx;
  1257. margin-left: 8rpx;
  1258. }
  1259. .name-img-godness{
  1260. width: 76rpx;
  1261. height: 40rpx;
  1262. margin-left: 8rpx;
  1263. transform: translateY(-5rpx);
  1264. }
  1265. }
  1266. .distance{
  1267. color: $fontcolor3;
  1268. }
  1269. }
  1270. .sex-box{
  1271. padding: 0 15rpx;
  1272. height: 32rpx;
  1273. background: rgba(226, 53, 104, 0.2);
  1274. border-radius: 25rpx;
  1275. margin-top: 12rpx;
  1276. .sex-img{
  1277. width: 24rpx;
  1278. height: 24rpx;
  1279. }
  1280. .sex-text1{
  1281. color:#E23568;
  1282. margin-left: 4rpx;
  1283. }
  1284. .sex-text2{
  1285. color:#6C52F4;
  1286. margin-left: 4rpx;
  1287. }
  1288. }
  1289. .tip-box{
  1290. color: $fontcolor3;
  1291. width: 100%;
  1292. margin-top: 10rpx;
  1293. }
  1294. }
  1295. .img-box{
  1296. width: 544rpx;
  1297. height: 168rpx;
  1298. margin-left: 168rpx;
  1299. margin-top: 24rpx;
  1300. .ib1{
  1301. width: 168rpx;
  1302. height: 168rpx;
  1303. border-radius: 16rpx 0rpx 0rpx 16rpx;
  1304. background: $fontcolor5;
  1305. }
  1306. .ib2{
  1307. width: 168rpx;
  1308. height: 168rpx;
  1309. background: $fontcolor5;
  1310. }
  1311. .ib3{
  1312. width: 168rpx;
  1313. height: 168rpx;
  1314. border-radius: 0rpx 16rpx 16rpx 0rpx;
  1315. background: $fontcolor5;
  1316. }
  1317. }
  1318. }
  1319. }
  1320. }
  1321. </style>