phb.vue 9.5 KB

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