detail.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="detail">
  3. <view class="head">
  4. <u-navbar :leftText="$t('navbar.txt9')" bgColor="transparent" leftIconColor="#fff" :titleStyle="{color:'#fff'}" :fixed="false" leftIconSize="48" :autoBack="true"></u-navbar>
  5. <view class="flex-start head-info">
  6. <image :src="playerInfo.image_path || '/static/image/common/[email protected]'" mode="aspectFit"></image>
  7. <view class="head-info-left">
  8. <view class="title font32">
  9. {{playerInfo.full_name}}
  10. </view>
  11. <view class="t">
  12. {{playerInfo.type}}
  13. </view>
  14. <view class="t">
  15. {{playerInfo.birth}}
  16. </view>
  17. </view>
  18. </view>
  19. <view class="select-tab flex-center">
  20. <u-tabs
  21. :list="list1"
  22. @click="changeTab"
  23. :isscroll="false"
  24. lineHeight="4"
  25. :current="tabIndex"
  26. lineColor="#DC3C23"
  27. :activeStyle="{color:'#DC3C23',fontSize:'32rpx',fontWeight:'Bold'}"
  28. :inactiveStyle="{color:'#333',fontSize:'32rpx'}"
  29. ></u-tabs>
  30. </view>
  31. </view>
  32. <Bio v-show="tabIndex == 0" ref="bio"></Bio>
  33. <career v-show="tabIndex == 1" ref="career"></career>
  34. </view>
  35. </template>
  36. <script>
  37. import Bio from '@/pages/Match/compontent/Bio.vue'
  38. import career from '@/pages/Match/compontent/Career.vue'
  39. export default {
  40. components:{Bio,career},
  41. data() {
  42. return {
  43. parent:{},
  44. list1: [
  45. {
  46. name: this.$t('match.lab29'),
  47. },
  48. {
  49. name: this.$t('match.lab30'),
  50. },
  51. // {
  52. // name: this.$t('match.lab31'),
  53. // }
  54. ],
  55. tabIndex:1,
  56. playerInfo:{}
  57. }
  58. },
  59. onLoad(option) {
  60. this.parent = option;
  61. this.getDetail()
  62. this.$nextTick(res=>{
  63. this.$refs.bio.getBio(option.id)
  64. this.$refs.career.getInfo(this.parent.id)
  65. })
  66. },
  67. methods:{
  68. changeTab(e) {
  69. this.tabIndex = e.index
  70. if(e.index == 1) {
  71. this.$nextTick(res=>{
  72. this.$refs.career.getInfo(this.parent.id)
  73. })
  74. }
  75. },
  76. /* 获取详情 */
  77. getDetail() {
  78. uni.$u.http.post('/api/CricketPlayer/cricket_player_index',{player_id:this.parent.id}).then(res=>{
  79. this.playerInfo = res
  80. }).catch(res=>{})
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .info {
  87. }
  88. .select-tab {
  89. margin: 0 24rpx;
  90. margin-bottom: 40rpx;
  91. border-radius: 40rpx 40rpx 0 0;
  92. background-color: white;
  93. }
  94. .head {
  95. background-color: #1D2550;
  96. }
  97. .head-info {
  98. color: #fff;
  99. margin-top: 26rpx;
  100. padding: 24rpx 28rpx;
  101. image {
  102. width: 120rpx;
  103. height: 120rpx;
  104. margin-right: 24rpx;
  105. }
  106. .title {
  107. font-weight: bold;
  108. }
  109. .t {
  110. color: #999;
  111. font-size: 24rpx;
  112. }
  113. }
  114. </style>