详情小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

167 lines
4.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <template>
  2. <view>
  3. <!-- 头部搜索框 -->
  4. <view class="head-bar">
  5. <view class="lf-flex search" @click="$url('/pages/userList/userList?name=搜索')">
  6. <text class="lf-iconfont icon-linedesign-12 lf-font-30 lf-m-l-20"></text>
  7. <view class="lf-m-l-10 lf-font-24">搜索</view>
  8. </view>
  9. <!-- <view class="botton" @click="$url('/pages/signIn/signIn')">签到</view> -->
  10. </view>
  11. <!-- 上墙部分 -->
  12. <view class="up-the-wall">
  13. <view class="lf-row-between">
  14. <view class="lf-font-32 lf-color-black">最新上墙</view>
  15. <!-- <view class="lf-color-999" @click="$url('/pages/wallMember/wallMember')">
  16. <text class="lf-font-28">查看全部</text>
  17. <text class="lf-iconfont icon-xiangyou"></text>
  18. </view> -->
  19. </view>
  20. <scroll-view class="scroll-bar" :scroll-x="true">
  21. <view class="lf-flex">
  22. <!-- <view class="user-item" @click="$url('/pages/upTheWall/upTheWall')">
  23. <lf-image class="add-icon" src="../../static/images/add_icon.png"></lf-image>
  24. <view class="lf-m-t-12 lf-color-555 lf-font-24 lf-line-1">我要上墙</view>
  25. </view> -->
  26. <view class="user-item" v-for="item in 6" :key="item">
  27. <image class="avatar" src="https://picsum.photos/200"></image>
  28. <view class="lf-m-t-12 lf-color-555 lf-font-24 lf-line-1">编号 73949</view>
  29. </view>
  30. </view>
  31. </scroll-view>
  32. </view>
  33. <self-line />
  34. <!-- 推荐单身 -->
  35. <view>
  36. <view class="lf-row-between lf-p-30 lf-p-32 lf-p-b-20">
  37. <view class="lf-font-32 lf-color-black">推荐单身</view>
  38. <view class="lf-color-999" @click="$url('/pages/userList/userList?name=最新')">
  39. <text class="lf-font-28">最新</text>
  40. <text class="lf-iconfont icon-xiangyou"></text>
  41. </view>
  42. </view>
  43. <lf-user-list></lf-user-list>
  44. </view>
  45. <!-- 加载 -->
  46. <view class="loading-more">
  47. <text class="loading-more-text">正在加载中</text>
  48. </view>
  49. <!-- 回到顶部 -->
  50. <u-back-top :scrollTop="pageScrollTop"></u-back-top>
  51. </view>
  52. </template>
  53. <script>
  54. import lfUserList from '@/components/lf-userList/lf-userList.vue';
  55. export default {
  56. components: { lfUserList },
  57. data() {
  58. return {
  59. }
  60. },
  61. onLoad(){
  62. // #ifdef H5
  63. this.href_str = JSON.stringify(location.href);
  64. let options = this.strToObj();
  65. console.log("options", options)
  66. if(options.code){
  67. this.login(options.code)
  68. }
  69. // #endif
  70. },
  71. methods: {
  72. strToObj(){
  73. let val = this.href_str;
  74. let obj = {};
  75. if(!val) return obj;
  76. if(val.indexOf('?') < 0) return obj;
  77. let indexA = val.indexOf('?') + 1;
  78. let str = val.substr(indexA);
  79. str = str.substr(0, str.length - 1);
  80. let indexB = str.indexOf('#');
  81. if(indexB >= 0){
  82. str = str.substr(0, indexB);
  83. }
  84. let arr = str.split('&');
  85. arr.map(item => {
  86. let a = item.split('=');
  87. obj[a[0]] = a[1];
  88. });
  89. return obj;
  90. },
  91. login(code){
  92. this.$http(this.API.API_OFFICIAL_LOGIN, {
  93. code: code,
  94. scopes: 'snsapi_userinfo'
  95. }).then(res => {
  96. console.log(res)
  97. uni.setStorageSync('user_info', res?.data?.user);
  98. }).catch(err => {
  99. console.log(err)
  100. })
  101. }
  102. }
  103. }
  104. </script>
  105. <style lang="scss" scoped>
  106. .head-bar{
  107. width: 750rpx;
  108. height: max-content;
  109. padding: 21rpx 32rpx;
  110. display: flex;
  111. justify-content: space-between;
  112. box-sizing: border-box;
  113. .search{
  114. // width: 530rpx;
  115. width: 100%;
  116. height: 62rpx;
  117. background: #F7F7F7;
  118. border-radius: 32rpx;
  119. color: #999999;
  120. }
  121. .botton{
  122. width: 140rpx;
  123. height: 62rpx;
  124. background: #F7F7F7;
  125. border-radius: 32rpx;
  126. text-align: center;
  127. line-height: 62rpx;
  128. color: #222222;
  129. }
  130. }
  131. .up-the-wall{
  132. width: 750rpx;
  133. height: max-content;
  134. padding: 21rpx 32rpx 0;
  135. .scroll-bar{
  136. width: 100%;
  137. height: 164rpx;
  138. padding: 30rpx 0;
  139. .user-item{
  140. width: 136rpx;
  141. margin-right: 40rpx;
  142. display: flex;
  143. justify-content: center;
  144. flex-wrap: wrap;
  145. &:last-child{
  146. margin-right: 0rpx;
  147. }
  148. }
  149. .add-icon{
  150. width: 110rpx;
  151. height: 110rpx;
  152. border-radius: 50%;
  153. }
  154. .avatar{
  155. width: 110rpx;
  156. height: 110rpx;
  157. border: 5rpx solid #E21196;
  158. border-radius: 50%;
  159. box-sizing: border-box;
  160. }
  161. }
  162. }
  163. </style>