phb.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template>
  2. <view class="content">
  3. <view class="nav flex">
  4. <view class="nav-item" v-for="(item,index) in navList" @click="navClick(index)"
  5. :class="{'action': index == currentIndex}">
  6. {{item.title}}
  7. </view>
  8. </view>
  9. <image :src="top_bg" mode="" class="top-bg"></image>
  10. <view class="bd-wrap flex">
  11. <view class="bd">
  12. <image :src="tit_bg" mode="widthFix" class="bd-tit"></image>
  13. <view class="bd-top flex">
  14. <view class="top-item">
  15. <view class="top-logo yp">
  16. <image src="" mode=""></image>
  17. </view>
  18. <view class="top-name">
  19. 李小图
  20. </view>
  21. <view class="top-visit">
  22. 86.4W
  23. </view>
  24. </view>
  25. <view class="top-item-center">
  26. <view class="top-logo jp">
  27. <image src="" mode=""></image>
  28. </view>
  29. <view class="top-name">
  30. </view>
  31. <view class="top-visit">
  32. 86.4W
  33. </view>
  34. </view>
  35. <view class="top-item">
  36. <view class="top-logo tp">
  37. <image src="" mode=""></image>
  38. </view>
  39. <view class="top-name">
  40. 李小图
  41. </view>
  42. <view class="top-visit">
  43. 86.4W
  44. </view>
  45. </view>
  46. </view>
  47. <view class="bd-btm-item flex" v-for="item in 3">
  48. <image src="" mode="" class="item-img"></image>
  49. <view class="flex item-info">
  50. <view class="item-name">
  51. 杨阿姨 <image :src="rz" mode=""></image>
  52. </view>
  53. <view class="item-zy">
  54. 育儿嫂
  55. </view>
  56. <view class="item-where">
  57. 48岁 丨 甘肃人
  58. </view>
  59. <view class="" style="flex-grow: 1;">
  60. </view>
  61. <view class="item-vist">
  62. 浏览量:2362
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="" style="height: 60rpx;">
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. import { getInviteCountRank } from '@/api/user.js'
  74. import { getCardLookCountRank } from '@/api/index.js'
  75. export default {
  76. data() {
  77. return {
  78. times: '',
  79. top_bg: this.$store.state.baseURL + '/resource/icon/base/phb-bg.png',
  80. tit_bg: this.$store.state.baseURL + '/resource/icon/llph.png',
  81. rz: this.$store.state.baseURL + '/resource/icon/rz.png',
  82. navList: [{
  83. title: '周排行',
  84. time: ((new Date().setHours(0, 0, 0) - (new Date().getDay() - 1) *24 * 60 * 60 *1000)/1000).toFixed(0),
  85. times: ((new Date().setHours(0, 0, 0) + (7 - new Date().getDay()) *24 * 60 * 60 *1000)/1000).toFixed(0),
  86. list: [],
  87. loaded: false
  88. }, {
  89. title: '月排行',
  90. time: (new Date(new Date(new Date().getFullYear(), new Date().getMonth(), 1).setHours(0, 0, 0)).getTime()/1000).toFixed(0),
  91. times: ((new Date(new Date().getFullYear(), new Date().getMonth()+ 1, 0).setHours(23, 59, 59, 59))/1000).toFixed(0),
  92. list: [],
  93. loaded: false
  94. }],
  95. currentIndex: 0,
  96. }
  97. },
  98. onLoad() {
  99. },
  100. onShow() {
  101. console.log(this.$store.state.baseURL)
  102. this.times = ((new Date().setHours(0, 0, 0) - (new Date().getDay() - 1) *24 * 60 * 60 *1000)/1000).toFixed(0)
  103. this.getCardLookCountRank()
  104. },
  105. onReachBottom() {
  106. },
  107. onReady() {
  108. },
  109. methods: {
  110. navClick(index) {
  111. this.currentIndex = index
  112. this.getCardLookCountRank()
  113. },
  114. getCardLookCountRank() {
  115. let that = this
  116. let navitem = that.navList[that.currentIndex]
  117. if(navitem.loaded) {
  118. return
  119. }
  120. getCardLookCountRank({
  121. time: navitem.time,
  122. times: navitem.times
  123. }).then(res => {
  124. console.log(res);
  125. navitem.list = res.data
  126. navitem.loaded = true
  127. }).catch(err => {
  128. navitem.loaded = false
  129. })
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. page,
  136. .content {
  137. height: auto;
  138. min-height: 100%;
  139. background-color: #900408;
  140. }
  141. .nav {
  142. width: 750rpx;
  143. height: 88rpx;
  144. .nav-item {
  145. line-height: 88rpx;
  146. width: 50%;
  147. text-align: center;
  148. font-size: 30rpx;
  149. font-weight: 500;
  150. color: #333333;
  151. height: 100%;
  152. }
  153. .action {
  154. font-weight: bold;
  155. position: relative;
  156. &::after {
  157. content: '';
  158. width: 50rpx;
  159. height: 6rpx;
  160. background: #FE5B38;
  161. border-radius: 3rpx;
  162. position: absolute;
  163. left: 0;
  164. right: 0;
  165. bottom: 6rpx;
  166. margin: auto;
  167. }
  168. }
  169. background-color: #fff;
  170. }
  171. .top-bg {
  172. width: 750rpx;
  173. height: 742rpx;
  174. }
  175. .bd-wrap {
  176. width: 699rpx;
  177. background: #F6E7E4;
  178. border-radius: 14rpx;
  179. justify-content: center;
  180. margin: -150rpx auto 0;
  181. position: relative;
  182. padding: 16rpx;
  183. .bd {
  184. width: 666rpx;
  185. background: #FFFFFF;
  186. border: 2px solid #A30F0E;
  187. border-radius: 14rpx;
  188. position: relative;
  189. padding: 35rpx;
  190. .bd-tit {
  191. width: 443rpx;
  192. height: 69rpx;
  193. position: absolute;
  194. top: -35rpx;
  195. left: 0;
  196. right: 0;
  197. margin: auto;
  198. }
  199. .bd-top {
  200. height: 376rpx;
  201. width: 100%;
  202. padding-bottom: 47rpx;
  203. .jp,.yp,.tp {
  204. &::after {
  205. content: '';
  206. width: 58rpx;
  207. height: 66rpx;
  208. position: absolute;
  209. position: absolute;
  210. bottom: 10rpx;
  211. right: -10rpx;
  212. z-index: 999;
  213. }
  214. }
  215. .jp {
  216. &::after {
  217. background: url($base-url + '/resource/icon/jp.png') no-repeat;
  218. background-size: 100% 100%;
  219. }
  220. }
  221. .yp {
  222. &::after {
  223. right: -15rpx;
  224. background: url($base-url + '/resource/icon/yp.png') no-repeat;
  225. background-size: 100% 100%;
  226. }
  227. }
  228. .tp {
  229. &::after {
  230. right: -15rpx;
  231. background: url($base-url + '/resource/icon/tp.png') no-repeat;
  232. background-size: 100% 100%;
  233. }
  234. }
  235. .top-item, .top-item-center {
  236. height: 100%;
  237. display: flex;
  238. flex-direction: column;
  239. justify-content: flex-end;
  240. align-items: center;
  241. .top-logo {
  242. border-radius: 50%;
  243. border: #900408 1px solid;
  244. position: relative;
  245. image {
  246. width: 100%;
  247. height: 100%;
  248. background-color: #eee;
  249. border-radius: 50%;
  250. }
  251. }
  252. .top-name {
  253. font-size: 26rpx;
  254. font-weight: bold;
  255. color: #A30F0E;
  256. margin: 15rpx 0;
  257. }
  258. .top-visit {
  259. font-size: 22rpx;
  260. font-weight: bold;
  261. color: #171717;
  262. }
  263. }
  264. .top-item {
  265. flex-grow: 3;
  266. .top-logo {
  267. width: 139rpx;
  268. height: 139rpx;
  269. }
  270. }
  271. .top-item-center {
  272. flex-grow: 4;
  273. .top-logo {
  274. width: 198rpx;
  275. height: 197rpx;
  276. }
  277. }
  278. }
  279. .bd-btm-item {
  280. height: 260rpx;
  281. border-top: #f2f2f2 1px solid;
  282. justify-content: flex-start;
  283. .item-info {
  284. height: 100%;
  285. flex-grow: 1;
  286. flex-direction: column;
  287. justify-content: flex-start;
  288. align-items: flex-start;
  289. padding: 34rpx 0 21rpx;
  290. .item-name {
  291. font-size: 31rpx;
  292. font-weight: bold;
  293. color: #333333;
  294. display: flex;
  295. align-items: center;
  296. justify-content: flex-start;
  297. image {
  298. width: 100rpx;
  299. height: 30rpx;
  300. margin-left: 10rpx;
  301. }
  302. }
  303. .item-zy {
  304. padding: 6rpx 20rpx;
  305. background: #fee7e4;
  306. border-radius: 5rpx;
  307. font-size: 22rpx;
  308. font-weight: 500;
  309. color: #F86859;
  310. margin: 16rpx 0 20rpx;
  311. }
  312. .item-vist,.item-where {
  313. font-weight: 500;
  314. color: #969696;
  315. }
  316. .item-vist {
  317. font-size: 22rpx;
  318. justify-items: flex-end;
  319. }
  320. .item-where {
  321. font-size: 24rpx;
  322. }
  323. }
  324. .item-img {
  325. flex-shrink: 0;
  326. width: 160rpx;
  327. height: 220rpx;
  328. margin-right: 22rpx;
  329. background-color: #eee;
  330. }
  331. }
  332. }
  333. }
  334. </style>