stats-detail.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <view>
  3. <view class="select-head">
  4. <u-navbar :leftText="parent.title" bgColor="transparent" leftIconColor="#fff" :titleStyle="{color:'#fff'}" :fixed="false" leftIconSize="48" :autoBack="true"></u-navbar>
  5. <view class="select-tab">
  6. <u-tabs
  7. :list="list1"
  8. @click="changeTab"
  9. :current="activeIndex"
  10. lineHeight="0"
  11. lineColor="#DC3C23"
  12. :activeStyle="{
  13. color:'#DC3C23',
  14. fontSize:'32rpx',
  15. padding:'2rpx 20rpx',
  16. border:'1rpx solid #DC3C23',
  17. borderRadius:'31rpx'
  18. }"
  19. :inactiveStyle="{
  20. color:'#fff',
  21. fontSize:'32rpx',
  22. padding:'2rpx 20rpx',
  23. border:'1rpx solid #FFF',
  24. borderRadius:'31rpx'
  25. }"
  26. ></u-tabs>
  27. </view>
  28. </view>
  29. <view class="list">
  30. <view class="list-item-tr size24 c6">
  31. <view> # </view>
  32. <view>
  33. <!-- TEAM -->
  34. {{ $t('live.lab25') }}
  35. </view>
  36. <view> {{activeIndex == 0?'B':'M'}} </view>
  37. <view> {{activeIndex == 0?'S/R':0 < activeIndex && activeIndex < 5?'INN':'O'}} </view>
  38. <view> {{activeIndex == 0?'VS':activeIndex == 1 || activeIndex == 5?'AVG':activeIndex == 6 || activeIndex == 7?'W':'R'}} </view>
  39. <view> {{activeIndex == 0 || activeIndex == 1?'RUNS':activeIndex == 2 || activeIndex == 6?'AVG':activeIndex == 3?'S/R':activeIndex == 4?'6S':activeIndex == 5?'W':'ECO'}} </view>
  40. </view>
  41. <view class="list-item-th" v-for="(item,index) in statsDetail.list" :key="index" :class="{actives:acIndex == index}"><!-- @click="acIndex=item" -->
  42. <view class="flex-end list-av" :name="index+1">
  43. <image :src="item.img || '/static/image/common/teams_avatar_ico@2x.png'" mode="aspectFill" class="list-avatar mg-rt16"></image>
  44. </view>
  45. <view class="size28 c6">
  46. <view class="size32 c3 mg-bt6">
  47. {{item.name}}
  48. </view>
  49. <text>{{item.abbreviation}}</text>
  50. </view>
  51. <view class="size28 c6">
  52. <text>{{activeIndex == 0?item.b:item.m}}</text>
  53. </view>
  54. <view class="size32 c3 ">
  55. <text>{{activeIndex == 0?item.sr:0 < activeIndex && activeIndex < 5?item.inn:item.o}}</text>
  56. </view>
  57. <view class="size32 c3 ">
  58. <text>{{activeIndex == 0?item.vscname:activeIndex == 1 || activeIndex == 5?item.avg:activeIndex == 6 || activeIndex == 7?item.w:item.runs}}</text>
  59. </view>
  60. <view class="size32 c3 ">
  61. <text>{{activeIndex == 0 || activeIndex == 1?item.runs:activeIndex == 2 || activeIndex == 6?item.avg:activeIndex == 3?item.sr:activeIndex == 4?item['sixs']:activeIndex == 5?item.w:item.eco}}</text>
  62. </view>
  63. </view>
  64. <u-empty
  65. v-if="statsDetail.list.length == 0"
  66. mode="data"
  67. width="474"
  68. height="312"
  69. textSize="28"
  70. marginTop="100"
  71. :text="$t('common.nodata')"
  72. icon="/static/image/common/nodata.png"
  73. ></u-empty>
  74. <view class="mg-tp36 size28 c9 text-center">
  75. {{statsDetail.updated_at}}
  76. </view>
  77. </view>
  78. <view class="bgE5 clossary mg-tp36">
  79. <!-- GLOSSARY -->
  80. {{ $t('live.lab14') }}
  81. </view>
  82. <view class="main size28 c6">
  83. <view class="mg-bt24"><text class="c3 Bold">#:</text>
  84. <!-- Rank -->
  85. {{ $t('live.lab15') }}
  86. </view>
  87. <view class="mg-bt24"><text class="c3 Bold">B:</text>
  88. <!-- Balls -->
  89. {{ $t('match.lab65') }}
  90. </view>
  91. <view class="mg-bt24"><text class="c3 Bold">M:</text>
  92. <!-- Matches -->
  93. {{ $t('match.lab83') }}
  94. </view>
  95. <view class="mg-bt24"><text class="c3 Bold">R:</text>
  96. <!-- Runs -->
  97. {{ $t('match.lab66') }}
  98. </view>
  99. <view class="mg-bt24"><text class="c3 Bold">O:</text>
  100. <!-- Overs -->
  101. {{ $t('match.lab67') }}
  102. </view>
  103. <view class="mg-bt24"><text class="c3 Bold">W:</text>
  104. <!-- Wickets -->
  105. {{ $t('match.lab68') }}
  106. </view>
  107. <view class="mg-bt24"><text class="c3 Bold">VS:</text>
  108. <!-- Versus Team -->
  109. {{ $t('match.lab69') }}
  110. </view>
  111. <view class="mg-bt24"><text class="c3 Bold">INN:</text>
  112. <!-- Innings -->
  113. {{ $t('match.lab70') }}
  114. </view>
  115. <view class="mg-bt24"><text class="c3 Bold">AVG:</text>
  116. <!-- Average -->
  117. {{ $t('match.lab71') }}
  118. </view>
  119. <view class="mg-bt24"><text class="c3 Bold">S/R:</text>
  120. <!-- Strike Rate -->
  121. {{ $t('match.lab72') }}
  122. </view>
  123. <view class="mg-bt24"><text class="c3 Bold">ECO:</text>
  124. <!-- Economy Rate -->
  125. {{ $t('match.lab73') }}
  126. </view>
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. export default {
  132. data() {
  133. return {
  134. acIndex:0,
  135. list1:[
  136. {
  137. name: this.$t('match.lab74'),
  138. },
  139. {
  140. name: this.$t('match.lab75'),
  141. },
  142. {
  143. name: this.$t('match.lab76'),
  144. },
  145. {
  146. name: this.$t('match.lab77'),
  147. },
  148. {
  149. name: this.$t('match.lab78'),
  150. },
  151. {
  152. name: this.$t('match.lab79'),
  153. },
  154. {
  155. name: this.$t('match.lab80'),
  156. },
  157. {
  158. name: this.$t('match.lab81'),
  159. },
  160. {
  161. name: this.$t('match.lab82'),
  162. },
  163. {
  164. name: this.$t('match.lab83'),
  165. },
  166. {
  167. name: this.$t('match.lab84'),
  168. }
  169. ],
  170. statsDetail:{
  171. list:[],
  172. updated_at:''
  173. },
  174. parent:{},
  175. activeIndex:0
  176. }
  177. },
  178. onLoad(option) {
  179. option.type = Number(option.type);
  180. this.activeIndex = option.type;
  181. this.parent = option;
  182. this.getList()
  183. },
  184. methods: {
  185. changeTab(e) {
  186. console.log("e: ",e);
  187. this.activeIndex = e.index;
  188. this.getList()
  189. },
  190. getList() {
  191. uni.$u.http.post('/api/Cricket/get_tournament_stats_list',{id:this.parent.id,type:this.activeIndex+1}).then(res=>{
  192. // this.stats = res
  193. this.statsDetail = res;
  194. }).catch(res=>{})
  195. }
  196. },
  197. }
  198. </script>
  199. <style lang="scss">
  200. .select-head {
  201. position: sticky;
  202. top: 0;
  203. z-index: 99;
  204. background-color: $color1;
  205. .select-tab {
  206. padding: 0 28rpx;
  207. margin-top: 20rpx;
  208. }
  209. }
  210. .list{
  211. .list-item-tr{
  212. display: grid;
  213. grid-template-columns: 130rpx 225rpx 90rpx 90rpx 90rpx 90rpx;
  214. padding: 24rpx;
  215. border-bottom: 1rpx solid #ccc;
  216. }
  217. .list-item-th{
  218. display: grid;
  219. grid-template-columns: 130rpx 225rpx 90rpx 90rpx 90rpx 90rpx;
  220. padding: 24rpx;
  221. border-bottom: 1rpx solid #ccc;
  222. .list-avatar{
  223. width: 90rpx;
  224. height: 90rpx;
  225. border-radius: 50px;
  226. // overflow: visible;
  227. }
  228. .list-av {
  229. position: relative;
  230. &:before{
  231. content: attr(name);
  232. position: absolute;
  233. left: 0rpx;
  234. top: 50%;
  235. width: 40rpx;
  236. height: 40rpx;
  237. border-radius: 200rpx;
  238. background-color: #E5E5E5;
  239. margin-top: -20rpx;
  240. font-size: 24rpx;
  241. color: #999;
  242. text-align: center;
  243. line-height: 40rpx;
  244. z-index: 1;
  245. }
  246. }
  247. }
  248. .actives{
  249. background: #FFE6E2;
  250. .list-av{
  251. &:before{
  252. background: #DC3C23;
  253. color: #fff;
  254. }
  255. }
  256. }
  257. }
  258. .clossary{
  259. padding: 20rpx 28rpx;
  260. }
  261. .main{
  262. padding: 24rpx 28rpx;
  263. margin-top: 30rpx;
  264. view{
  265. text{
  266. margin-right: 16rpx;
  267. display: inline-block;
  268. }
  269. }
  270. }
  271. </style>