phb.vue 7.1 KB

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