friends.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354
  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)
  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. this.$store.commit('setImageCdn',cdnRes.data.pictureCdn);
  504. this.$store.commit('setVideoCdn',cdnRes.data.videoCdn);
  505. uni.setStorageSync('imageCdn',cdnRes.data.pictureCdn);
  506. uni.setStorageSync('videoCdn',cdnRes.data.videoCdn);
  507. });
  508. this.login();
  509. this.computedScollviewHeight();
  510. },
  511. onShow() {
  512. if(uni.getStorageSync('needFreshList')==='1'){
  513. this.recommendRefresh();
  514. this.nearRefresh();
  515. uni.setStorageSync('needFreshList','0');
  516. }
  517. },
  518. // #ifdef MP
  519. onShareAppMessage(){
  520. return {
  521. title: '糖果公园',
  522. path: `/pages/login/login?share=${this.userInfo.inviteCode}`,
  523. }
  524. },
  525. // #endif
  526. methods: {
  527. getMineData(){
  528. let user=JSON.parse(uni.getStorageSync('user'));
  529. this.$api.public.mineDetail({
  530. getAlbum:true,
  531. completeUser:user
  532. }).then(res=>{
  533. this.$store.commit('setUserInfo',res.data);
  534. uni.setStorageSync('userInfo',JSON.stringify(res.data));
  535. if(!res.data.regDone){
  536. uni.reLaunch({
  537. url:'/pages/info/sex'
  538. })
  539. return;
  540. }
  541. })
  542. },
  543. login(){
  544. const that=this;
  545. if(uni.getStorageSync('isLogin')==='yes'){
  546. this.getMineData();
  547. this.computedLocation();
  548. return;
  549. }
  550. uni.login({//免密登录
  551. success:(res)=>{
  552. that.$api.login.wxLogin({
  553. scene: "WxMPLogin",
  554. miniProgramEncryUserInfoParam:{
  555. jsCode:res.code
  556. }
  557. }).then(result=>{
  558. if(result.status==='Succ'){
  559. uni.setStorageSync('openId',result.data.wxLoginInfo.openId);
  560. uni.setStorageSync('unionId',result.data.wxLoginInfo.unionId);
  561. this.computedLocation();
  562. this.getRecommendTopsMData();
  563. this.getRecommendTopsHData();
  564. uni.setStorageSync('LL_Ukn',result.data.userToken.ukn);
  565. uni.setStorageSync('token',result.data.userToken.token);
  566. uni.setStorageSync('userInfo',JSON.stringify(result.data));
  567. uni.setStorageSync('user',JSON.stringify(result.data.userToken.user));
  568. uni.setStorageSync('isLogin','yes');
  569. this.$api.public.aliossCdn({}).then(cdnRes=>{
  570. this.$store.commit('setImageCdn',cdnRes.data.pictureCdn);
  571. this.$store.commit('setVideoCdn',cdnRes.data.videoCdn);
  572. })
  573. }
  574. })
  575. },
  576. fail: (err) => {
  577. console.log(err)
  578. }
  579. });
  580. },
  581. closePopup(){
  582. this.$refs.popup.close();
  583. },
  584. imInit(){
  585. /**
  586. * IM初始化
  587. */
  588. if(uni.$TUIKit){
  589. uni.$TUIKit.logout();
  590. }
  591. const SDKAppID = this.$util.IMSDKCode,that=this;
  592. uni.$TUIKit = TIM.create({
  593. SDKAppID: SDKAppID
  594. });
  595. uni.$TUIKitTIM = TIM;
  596. uni.$TUIKitEvent = TIM.EVENT;
  597. uni.$TUIKitVersion = TIM.VERSION;
  598. uni.$TUIKitTypes = TIM.TYPES; // 监听系统级事件
  599. uni.$TUIKit.on(uni.$TUIKitEvent.SDK_READY, this.onSDKReady);
  600. uni.$TUIKit.on(uni.$TUIKitEvent.SDK_NOT_READY, this.onSdkNotReady);
  601. uni.$TUIKit.on(uni.$TUIKitEvent.KICKED_OUT, this.onKickedOut);
  602. uni.$TUIKit.on(uni.$TUIKitEvent.ERROR, this.onTIMError);
  603. uni.$TUIKit.on(uni.$TUIKitEvent.NET_STATE_CHANGE, this.onNetStateChange);
  604. uni.$TUIKit.on(uni.$TUIKitEvent.SDK_RELOAD, this.onSDKReload);
  605. uni.$resetLoginData = this.resetLoginData();
  606. uni.$TUIKit.registerPlugin({ 'tim-upload-plugin':TIMUploadPlugin });
  607. },
  608. resetLoginData() {
  609. if(!uni.getStorageSync('userInfo')){
  610. return;
  611. }
  612. let user=JSON.parse(uni.getStorageSync('userInfo'));
  613. this.$api.IM.loadSig({}).then(res=>{
  614. this.$store.commit('setImLoadSig',res.data.sig);
  615. uni.$TUIKit.login({
  616. userID:String(user.id),
  617. userSig:this.$store.state.IMloadSig
  618. })
  619. })
  620. },
  621. onTIMError(error) {
  622. },
  623. onSDKReady({name}) {
  624. const isSDKReady = name === uni.$TUIKitEvent.SDK_READY ? true : false;
  625. if(isSDKReady){
  626. uni.$emit('isSDKReady', {
  627. isSDKReady: true
  628. });
  629. uni.hideLoading();
  630. }
  631. },
  632. onNetStateChange() {},
  633. onSDKReload() {},
  634. onSdkNotReady() {},
  635. onKickedOut() {
  636. uni.showToast({
  637. title: '您被踢下线',
  638. icon: 'error'
  639. });
  640. uni.reLaunch({
  641. url: '/pages/login/login'
  642. })
  643. },
  644. /**
  645. * 推荐下拉刷新、加载更多
  646. */
  647. recommendRefresh(){
  648. if(!uni.getStorageSync('token')){
  649. setTimeout(() => {
  650. this.recommendTriggered = false;
  651. this.recommendRefreshing = false;
  652. }, 1000)
  653. return;
  654. }
  655. if (this.recommendRefreshing)
  656. {
  657. return;
  658. }
  659. this.recommendRefreshing = true;
  660. setTimeout(() => {
  661. this.recommendTriggered = false;
  662. this.recommendRefreshing = false;
  663. }, 1000)
  664. this.recommendListOptions.page={
  665. index:1,
  666. size:20,
  667. sortValues:[]
  668. }
  669. this.getRecommendTopsMData();
  670. this.getRecommendTopsHData();
  671. this.getRecommendList();
  672. },
  673. recommendPulling(e) {},
  674. recommendRestore() {this.recommendTriggered = true;},
  675. recommendAbort() {},
  676. recommendToBottom(){
  677. if(!uni.getStorageSync('token')){return;}
  678. if(this.recommendList.length>=this.recommendTotal){return;}
  679. this.recommendListOptions.page.index++;
  680. this.getRecommendList();
  681. },
  682. /**
  683. * 附近下拉刷新、加载更多
  684. */
  685. nearRefresh(){
  686. if (this.nearRefreshing)
  687. {
  688. return;
  689. }
  690. this.nearRefreshing = true;
  691. setTimeout(() => {
  692. this.nearTriggered = false;
  693. this.nearRefreshing = false;
  694. }, 1000)
  695. this.nearListOptions.page={
  696. index:1,
  697. size:20,
  698. sortValues:[]
  699. }
  700. this.getNearTopsMData();
  701. this.getNearTopsHData();
  702. this.getNearList();
  703. },
  704. nearPulling(e) {},
  705. nearRestore() {this.nearTriggered = true;},
  706. nearAbort() {},
  707. nearToBottom(){
  708. if(this.nearList.length>=this.nearTotal){return;}
  709. this.nearListOptions.page.index++;
  710. this.getNearList();
  711. },
  712. /**
  713. * 计算scroll高度
  714. */
  715. computedScollviewHeight() {
  716. let query = uni.createSelectorQuery().in(this);
  717. let heightLeaf = this.$store.state.tabbarHeight/2;
  718. query.select('#topnav').boundingClientRect(data => {
  719. heightLeaf += data.height;
  720. }).exec(() => {
  721. let sysInfo = uni.getSystemInfoSync();
  722. this.scrollHeight = sysInfo.windowHeight - heightLeaf;
  723. });
  724. },
  725. /**
  726. * 计算列表定位距离
  727. */
  728. computedLocation(){
  729. uni.getFuzzyLocation({
  730. type:'gcj02',
  731. success:res=>{
  732. wxMapSdk.reverseGeocoder({
  733. location:{
  734. latitude:res.latitude,
  735. longitude:res.longitude
  736. },
  737. success:result=>{
  738. this.locationCity=result.result.ad_info.city;
  739. this.latitude=result.result.location.lat;
  740. this.longitude=result.result.location.lng;
  741. this.$store.commit('setLatitude',result.result.location.lat);
  742. this.$store.commit('setLongitude',result.result.location.lng);
  743. uni.setStorageSync('latitude',result.result.location.lat);
  744. uni.setStorageSync('longitude',result.result.location.lng);
  745. uni.setStorageSync('city',this.locationCity);
  746. this.locationCityCode=result.result.ad_info.city_code.split(result.result.ad_info.nation_code)[1];
  747. if(!uni.getStorageSync('token')){
  748. this.getTempRecommendList();
  749. }
  750. else{
  751. this.getNearTopsMData();
  752. this.getNearTopsHData();
  753. this.getRecommendTopsMData();
  754. this.getRecommendTopsHData();
  755. this.getNearList();
  756. this.getRecommendList();
  757. this.showGetLocation=false;
  758. setTimeout(()=>{
  759. this.imInit();
  760. },2000)
  761. }
  762. }
  763. })
  764. },
  765. fail:err=>{
  766. this.showGetLocation=true;
  767. uni.showModal({
  768. content: '检测到您没打开地址信息权限,是否去设置打开?',
  769. confirmText: "确认",
  770. cancelText: '取消',
  771. success:res=>{
  772. if(res.confirm){
  773. uni.openSetting({
  774. success:ress=>{
  775. if(ress.authSetting){
  776. this.computedLocation();
  777. }
  778. }
  779. })
  780. }
  781. }
  782. })
  783. }
  784. })
  785. },
  786. toLogin(){
  787. uni.reLaunch({
  788. url:'/pages/login/login'
  789. })
  790. },
  791. navClick(index){
  792. if(!uni.getStorageSync('token')){
  793. this.popup={
  794. content1:'您还未登录',
  795. content2:'该功能登录后才能使用',
  796. tip1:'',
  797. tip2:'',
  798. btntext:'去登录'
  799. }
  800. this.$refs.popup.open();
  801. return;
  802. }
  803. this.rankingOptions.city=(index===0?'':this.locationCity);
  804. this.rankingOptions.cityCode=(index===0?'':this.locationCityCode);
  805. this.navIndex=index;
  806. },
  807. toSearch(){
  808. if(!uni.getStorageSync('token')){
  809. this.popup={
  810. content1:'您还未登录',
  811. content2:'该功能登录后才能使用',
  812. tip1:'',
  813. tip2:'',
  814. btntext:'去登录'
  815. }
  816. this.$refs.popup.open();
  817. return;
  818. }
  819. uni.navigateTo({
  820. url:'/pages/search/search'
  821. })
  822. },
  823. topsNavClick(index){
  824. this.topsIndex=index;
  825. },
  826. outerSwiperChange(e){
  827. this.navIndex=e.detail.current;
  828. },
  829. swiperChange(e){
  830. this.topsIndex=e.detail.current;
  831. },
  832. getRecommendTopsMData(){
  833. this.rankingOptions.type='M';
  834. this.$api.public.ranking(this.rankingOptions).then(res=>{
  835. this.recommendTopsM=res.data.list;
  836. })
  837. },
  838. getRecommendTopsHData(){
  839. this.rankingOptions.type='H';
  840. this.$api.public.ranking(this.rankingOptions).then(res=>{
  841. this.recommendTopsH=res.data.list;
  842. })
  843. },
  844. getNearTopsMData(){
  845. this.rankingOptions.type='M';
  846. this.rankingOptions.city=this.locationCity;
  847. this.rankingOptions.cityCode=this.locationCityCode;
  848. this.$api.public.ranking(this.rankingOptions).then(res=>{
  849. this.nearTopsM=res.data.list;
  850. })
  851. },
  852. getNearTopsHData(){
  853. this.rankingOptions.type='H';
  854. this.rankingOptions.city=this.locationCity;
  855. this.rankingOptions.cityCode=this.locationCityCode;
  856. this.$api.public.ranking(this.rankingOptions).then(res=>{
  857. this.nearTopsH=res.data.list;
  858. })
  859. },
  860. getTempRecommendList(){//获取免登录体验数据
  861. this.recommendListOptions.type='FamaleReco';
  862. this.$api.public.friendsNoAuth(this.recommendListOptions).then(res=>{
  863. if(res.status==='Succ'){
  864. uni.hideLoading();
  865. this.recommendTotal=res.data.page.recordCount;
  866. this.recommendListOptions.page.sortValues=res.data.sortValues;
  867. let arr=[],obj={latitude:0,longitude:0};
  868. for(let i=0;i<res.data.users.length;i++){
  869. res.data.users[i].lastActiveTime=this.$moment(new Date()).diff(res.data.users[i].lastActive,'minutes');
  870. obj={latitude:0,longitude:0};
  871. obj.latitude=res.data.users[i].geo.lat;
  872. obj.longitude=res.data.users[i].geo.lon;
  873. arr.push(obj)
  874. }
  875. wxMapSdk.calculateDistance({
  876. mode:'straight',
  877. from:{
  878. latitude: this.latitude,
  879. longitude: this.longitude
  880. },
  881. to:arr,
  882. success:dists=>{
  883. if(dists.message==="query ok"){
  884. for(let j=0;j<dists.result.elements.length;j++){
  885. 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`)
  886. }
  887. if(this.recommendListOptions.page.index>1){
  888. this.recommendList=[...this.recommendList,...res.data.users];
  889. }
  890. else{
  891. this.recommendList=res.data.users;
  892. }
  893. this.$forceUpdate();
  894. }
  895. }
  896. })
  897. this.recommendList=res.data.users;
  898. }
  899. })
  900. },
  901. getRecommendList(){
  902. let user=JSON.parse(uni.getStorageSync('user'));
  903. this.recommendListOptions.type=user.sex==='male'?'MaleReco':'FamaleReco';
  904. this.recommendListOptions.queryPre.city=this.locationCity;
  905. this.recommendListOptions.queryPre.cityCode=this.locationCityCode;
  906. this.recommendListOptions.queryPre.geo.lat=this.latitude;
  907. this.recommendListOptions.queryPre.geo.lon=this.longitude;
  908. this.$api.public.friends(this.recommendListOptions).then(res=>{
  909. if(res.status==='Succ'){
  910. this.recommendTotal=res.data.page.recordCount;
  911. this.recommendListOptions.page.sortValues=res.data.sortValues;
  912. let arr=[],obj={latitude:0,longitude:0};
  913. for(let i=0;i<res.data.users.length;i++){
  914. res.data.users[i].lastActiveTime=this.$moment(new Date()).diff(res.data.users[i].lastActive,'minutes');
  915. obj={latitude:0,longitude:0};
  916. obj.latitude=res.data.users[i].geo.lat;
  917. obj.longitude=res.data.users[i].geo.lon;
  918. arr.push(obj)
  919. }
  920. wxMapSdk.calculateDistance({
  921. mode:'straight',
  922. from:{
  923. latitude: this.latitude,
  924. longitude: this.longitude
  925. },
  926. to:arr,
  927. success:dists=>{
  928. if(dists.message==="query ok"){
  929. for(let j=0;j<dists.result.elements.length;j++){
  930. 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`)
  931. }
  932. if(this.recommendListOptions.page.index>1){
  933. this.recommendList=[...this.recommendList,...res.data.users];
  934. }
  935. else{
  936. this.recommendList=res.data.users;
  937. }
  938. uni.hideLoading();
  939. this.$forceUpdate();
  940. }
  941. }
  942. })
  943. }
  944. })
  945. },
  946. getNearList(){
  947. let user=JSON.parse(uni.getStorageSync('user'));
  948. this.nearListOptions.type=user.sex==='male'?'MaleNearby':'FamaleNearby';
  949. this.nearListOptions.queryPre.city=this.locationCity;
  950. this.nearListOptions.queryPre.cityCode=this.locationCityCode;
  951. this.nearListOptions.queryPre.geo.lat=this.latitude;
  952. this.nearListOptions.queryPre.geo.lon=this.longitude;
  953. this.$api.public.friends(this.nearListOptions).then(res=>{
  954. if(res.status==='Succ'&&res.data.users.length>0){
  955. this.nearTotal=res.data.page.recordCount;
  956. this.nearListOptions.page.sortValues=res.data.sortValues;
  957. this.showNoData=res.data.users.length===0?true:false;
  958. let arr=[],obj={latitude:0,longitude:0};
  959. for(let i=0;i<res.data.users.length;i++){
  960. res.data.users[i].lastActiveTime=this.$moment(new Date()).diff(res.data.users[i].lastActive,'minutes');
  961. obj={latitude:0,longitude:0};
  962. obj.latitude=res.data.users[i].geo.lat;
  963. obj.longitude=res.data.users[i].geo.lon;
  964. arr.push(obj)
  965. }
  966. wxMapSdk.calculateDistance({
  967. mode:'straight',
  968. from:{
  969. latitude: this.latitude,
  970. longitude: this.longitude
  971. },
  972. to:arr,
  973. success:dists=>{
  974. if(dists.message==="query ok"){
  975. for(let j=0;j<dists.result.elements.length;j++){
  976. 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`)
  977. }
  978. if(this.nearListOptions.page.index>1){
  979. this.nearList=[...this.nearList,...res.data.users];
  980. }
  981. else{
  982. this.nearList=res.data.users;
  983. }
  984. uni.hideLoading()
  985. this.$forceUpdate();
  986. }
  987. }
  988. })
  989. }
  990. else{
  991. this.showNoData=this.nearList.length===0?true:false;
  992. }
  993. })
  994. },
  995. toDetail(id){
  996. if(!uni.getStorageSync('token')){
  997. this.popup={
  998. content1:'您还未登录',
  999. content2:'该功能登录后才能使用',
  1000. tip1:'',
  1001. tip2:'',
  1002. btntext:'去登录'
  1003. }
  1004. this.$refs.popup.open();
  1005. return;
  1006. }
  1007. uni.showLoading({})
  1008. let user=JSON.parse(uni.getStorageSync('user'));
  1009. this.$api.public.userDetail({getAlbum:true,completeUser:user,uponUserId:id}).then(res=>{
  1010. if(res.data.frozen){
  1011. uni.showToast({
  1012. title:'该用户已被冻结',
  1013. icon:'none'
  1014. });
  1015. return;
  1016. }
  1017. if(res.data.sex===user.sex){
  1018. uni.showToast({
  1019. title:'同性用户不能查看主页',
  1020. icon:'none'
  1021. })
  1022. }
  1023. else{
  1024. uni.setStorageSync('otherInfo',JSON.stringify(res.data));
  1025. uni.hideLoading();
  1026. uni.navigateTo({
  1027. url:`/pages/friends/user?id=${id}`
  1028. })
  1029. }
  1030. })
  1031. },
  1032. }
  1033. }
  1034. </script>
  1035. <style lang="scss" scoped>
  1036. .container {
  1037. width: 100vw;
  1038. min-height: 100vh;
  1039. background-color: $bgcolor1;
  1040. overflow: hidden;
  1041. .topnav {
  1042. margin: 0 60rpx;
  1043. align-items: center;
  1044. position: relative;
  1045. .nav-item {
  1046. color: $fontcolor3;
  1047. margin-right: 72rpx;
  1048. transition: all 0.3s;
  1049. padding: 0 10rpx;
  1050. .nav-item-text{
  1051. position: relative;
  1052. z-index: 1;
  1053. }
  1054. }
  1055. .nav-search{
  1056. width:56rpx;
  1057. height: 56rpx;
  1058. margin-left: 110rpx;
  1059. }
  1060. .nav-item-bg{
  1061. position: absolute;
  1062. left: 0;
  1063. bottom: 10rpx;
  1064. width: 92rpx;
  1065. height: 68rpx;
  1066. z-index: 0;
  1067. transition: all .3s;
  1068. }
  1069. }
  1070. .location{
  1071. margin-top: 40rpx;
  1072. padding: 12rpx;
  1073. background-color: $bgcolor3;
  1074. border-radius: 36rpx;
  1075. .l-pos{
  1076. width: 32rpx;
  1077. height: 32rpx;
  1078. }
  1079. .l-text{
  1080. color: $fontcolor2;
  1081. flex: 1;
  1082. text-align: left;
  1083. margin-left: 8rpx;
  1084. }
  1085. .l-open{
  1086. width: 88rpx;
  1087. height: 48rpx;
  1088. border-radius: 24rpx;
  1089. line-height: 48rpx;
  1090. text-align: center;
  1091. background-color: $primary;
  1092. color: $fontcolor5;
  1093. }
  1094. }
  1095. .scroll-view{
  1096. padding: 24rpx 32rpx 0rpx 32rpx;
  1097. box-sizing: border-box;
  1098. .tops-bg{
  1099. width: 100%;
  1100. height: 100%;
  1101. position: absolute;
  1102. left: 0;
  1103. top: 0;
  1104. z-index: 0;
  1105. }
  1106. .tops-nav{
  1107. position: relative;
  1108. height: 86rpx;
  1109. z-index: 1;
  1110. .tops-nav-item{
  1111. width: 160rpx;
  1112. text-align: center;
  1113. color: $fontcolor3;
  1114. }
  1115. .tops-nav-item-active{
  1116. color: $fontcolor5 !important;
  1117. }
  1118. .tops-line{
  1119. width: 24rpx;
  1120. height: 4rpx;
  1121. background: $fontcolor5;
  1122. border-radius: 2rpx;
  1123. position: absolute;
  1124. bottom: 0;
  1125. transition: all 0.3s;
  1126. }
  1127. }
  1128. .swiper{
  1129. height: 396rpx;
  1130. .swiper-item{
  1131. height: 100%;
  1132. .tops{
  1133. position: relative;
  1134. height: 100%;
  1135. flex-direction: column;
  1136. .tops-third{
  1137. height: 100%;
  1138. .tt-item{
  1139. position: relative;
  1140. flex-direction: column;
  1141. height: 100%;
  1142. width: 208rpx;
  1143. .tt-item-bg{
  1144. width: 196rpx;
  1145. height: 208rpx;
  1146. background: linear-gradient(180deg, rgba(226,226,226,0.1000) 0%, rgba(226,226,226,0) 100%);
  1147. border-radius: 16rpx 16rpx 0rpx 0rpx;
  1148. position: absolute;
  1149. bottom: 0;
  1150. }
  1151. .tt-item-bg-center{
  1152. width: 196rpx;
  1153. height: 248rpx;
  1154. background: linear-gradient(180deg, rgba(255,236,54,0.1000) 0%, rgba(255,236,54,0) 100%);
  1155. border-radius: 16rpx 16rpx 0rpx 0rpx;
  1156. position: absolute;
  1157. bottom: 0;
  1158. }
  1159. .tt-item-img{
  1160. width: 92rpx;
  1161. height: 40rpx;
  1162. transform: translateY(20rpx);
  1163. position: relative;
  1164. z-index:20;
  1165. }
  1166. .tt-item-img-border{
  1167. width: 196rpx;
  1168. height: 192rpx;
  1169. position: absolute;
  1170. left: 0;
  1171. right: 0;
  1172. margin: auto;
  1173. transform: translateY(-30rpx);
  1174. }
  1175. .tt-item-head-box{
  1176. width: 136rpx;
  1177. height: 136rpx;
  1178. border-radius: 68rpx;
  1179. position: relative;
  1180. z-index: 10;
  1181. }
  1182. .tt-item-name{
  1183. width: 136rpx;
  1184. height: 40rpx;
  1185. text-align: center;
  1186. line-height: 40rpx;
  1187. color: $fontcolor5;
  1188. margin-bottom: 16rpx;
  1189. margin-top: 14rpx;
  1190. }
  1191. .tt-item-num-box{
  1192. .tt-item-num-img{
  1193. width: 32rpx;
  1194. height: 32rpx;
  1195. }
  1196. .tt-item-num-text{
  1197. color: $fontcolor5;
  1198. margin-left: 8rpx;
  1199. }
  1200. }
  1201. }
  1202. }
  1203. }
  1204. }
  1205. }
  1206. .list-item{
  1207. flex-wrap: wrap;
  1208. padding: 40rpx 0rpx;
  1209. .list-head-box{
  1210. width: 136rpx;
  1211. height: 136rpx;
  1212. position: relative;
  1213. .list-head-img{
  1214. width: 136rpx;
  1215. height: 136rpx;
  1216. background-color: #ffffff;
  1217. border-radius: 136rpx;
  1218. }
  1219. .list-head-dot{
  1220. width: 24rpx;
  1221. height: 24rpx;
  1222. border-radius: 24rpx;
  1223. position: absolute;
  1224. background-color: aqua;
  1225. bottom: 2rpx;
  1226. right: 2rpx;
  1227. border: 2rpx solid $bgcolor2;
  1228. }
  1229. }
  1230. .list-info-box{
  1231. box-sizing: border-box;
  1232. width: 544rpx;
  1233. padding-left: 32rpx;
  1234. height: 136rpx;
  1235. flex-direction: column;
  1236. display: flex;
  1237. justify-content: flex-start;
  1238. align-items: flex-start;
  1239. .name-box{
  1240. width: 100%;
  1241. .name{
  1242. .name-text{
  1243. color: $fontcolor5;
  1244. }
  1245. .name-img{
  1246. width: 68rpx;
  1247. height: 32rpx;
  1248. margin-left: 8rpx;
  1249. }
  1250. .name-img-godness{
  1251. width: 76rpx;
  1252. height: 40rpx;
  1253. margin-left: 8rpx;
  1254. transform: translateY(-5rpx);
  1255. }
  1256. }
  1257. .distance{
  1258. color: $fontcolor3;
  1259. }
  1260. }
  1261. .sex-box{
  1262. padding: 0 15rpx;
  1263. height: 32rpx;
  1264. background: rgba(226, 53, 104, 0.2);
  1265. border-radius: 25rpx;
  1266. margin-top: 12rpx;
  1267. .sex-img{
  1268. width: 24rpx;
  1269. height: 24rpx;
  1270. }
  1271. .sex-text1{
  1272. color:#E23568;
  1273. margin-left: 4rpx;
  1274. }
  1275. .sex-text2{
  1276. color:#6C52F4;
  1277. margin-left: 4rpx;
  1278. }
  1279. }
  1280. .tip-box{
  1281. color: $fontcolor3;
  1282. width: 100%;
  1283. margin-top: 10rpx;
  1284. }
  1285. }
  1286. .img-box{
  1287. width: 544rpx;
  1288. height: 168rpx;
  1289. margin-left: 168rpx;
  1290. margin-top: 24rpx;
  1291. .ib1{
  1292. width: 168rpx;
  1293. height: 168rpx;
  1294. border-radius: 16rpx 0rpx 0rpx 16rpx;
  1295. background: $fontcolor5;
  1296. }
  1297. .ib2{
  1298. width: 168rpx;
  1299. height: 168rpx;
  1300. background: $fontcolor5;
  1301. }
  1302. .ib3{
  1303. width: 168rpx;
  1304. height: 168rpx;
  1305. border-radius: 0rpx 16rpx 16rpx 0rpx;
  1306. background: $fontcolor5;
  1307. }
  1308. }
  1309. }
  1310. }
  1311. }
  1312. </style>