phb.vue 9.3 KB

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