team.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <template>
  2. <view>
  3. <view class="select-head">
  4. <u-navbar :leftText="$t('navbar.txt2')" bgColor="transparent" leftIconColor="#fff" :titleStyle="{color:'#fff'}"
  5. :fixed="false" leftIconSize="48" :autoBack="true"></u-navbar>
  6. </view>
  7. <view class="main">
  8. <view class="heander-info cfff pd24">
  9. <view class="flex size28">
  10. <view class="flex-col align-center">
  11. <text>{{obj.home_name}}</text>
  12. <image :src="obj.home_logo" mode="aspectFill" class="team-icon"></image>
  13. </view>
  14. <image src="../../static/image/match/matches_detail_vs_ico.png" mode="aspectFit" class="vs-icon">
  15. </image>
  16. <view class="flex-col align-center">
  17. <text>{{obj.away_name}}</text>
  18. <image :src="obj.away_logo" mode="aspectFill" class="team-icon"></image>
  19. </view>
  20. </view>
  21. <!-- <view class="flex">
  22. </view> -->
  23. <view class="flex mg-tp34 size28 cfff Bold">
  24. <text>{{obj.home_win_probabilities}}%</text>
  25. <text>{{obj.away_win_probabilities}}%</text>
  26. </view>
  27. <u-line-progress activeColor="#C8C8C8" inactiveColor="#DC3C23" :percentage="obj.home_win_probabilities"
  28. :showText="false"></u-line-progress>
  29. <view class="text-center size-28 cfff mg-tp10">
  30. <!-- WIN PROBABILITY -->
  31. {{ $t('match.labe85') }}
  32. </view>
  33. </view>
  34. <view class="size32 c3 mg-tp40">
  35. <text class="Bold">
  36. <!-- Matches Played Recently -->
  37. {{ $t('match.labe86') }}
  38. </text>
  39. <view class="size28 c6">
  40. <!-- The Hundred -->
  41. {{ $t('match.labe87') }}
  42. </view>
  43. </view>
  44. <view class="table-list">
  45. <view class="table-list-item" v-for="row in 2" :key="row">
  46. <view class="table-list-item-header flex" @click="rowAcIndex=rowAcIndex==row?'':row">
  47. <view class="list-left flexcenter">
  48. <text class="size32 c3">{{row == 1?obj.home_name:obj.away_name}}</text>
  49. </view>
  50. <view class="flexcenter">
  51. <view class="l-w" :class="{lwRed:item == 'L'}"
  52. v-for="(item,index) in row == 1?obj.home:obj.away" :key="index">
  53. {{item}}
  54. </view>
  55. </view>
  56. <!-- <view class="flexcenter" v-else>
  57. <view class="l-w" v-for="(item,index) in obj.away_site" :key="index">
  58. {{item}}
  59. </view>
  60. </view> -->
  61. <view class="list-left flex-end">
  62. <image src="../../static/image/match/expert_down_ico.png" class="right-icon"
  63. mode="widthFix"></image>
  64. </view>
  65. </view>
  66. <view :class="{actives:row==rowAcIndex}" class="table-list-item-content bgE5">
  67. <u-row justify="space-between" v-for="(item,index) in row == 1?obj.home_list:obj.away_list"
  68. :key="index">
  69. <view class="flex-col align-center">
  70. <text class="size32 Bold" v-if="row == 1"
  71. :style="{color:item.winner_id == obj.home_id?'#219430':'#DC3C23' }">{{item.home_display_score || 0}}</text>
  72. <text class="size32 Bold" v-else
  73. :style="{color:item.winner_id == obj.away_id?'#219430':'#DC3C23'}">{{item.home_display_score || 0}}</text>
  74. <text class="c6 size24">({{item.home_display_overs || 0}})</text>
  75. </view>
  76. <view class="flex-col align-center table-list-item-content-views">
  77. <view class="text-center size24 mg-bt10 c9">
  78. {{item.date}} <br>
  79. {{item.venue}}
  80. </view>
  81. <text class="c3 size28" style="text-align: center;">{{item.match_result}}</text>
  82. </view>
  83. <view class="flex-col align-center">
  84. <text class="c6 size24">{{row == 2?obj.home_name:obj.away_name}}</text>
  85. <text class="c3 size32n Bold">{{item.away_display_score || 0}}</text>
  86. <text class=" size24">({{item.away_display_overs || 0}})</text>
  87. </view>
  88. </u-row>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. <u-gap bgColor="#f3f3f3" height="24"></u-gap>
  94. <view class="main">
  95. <view class="mg-tp12 size32 c3">
  96. Team Strengths
  97. </view>
  98. <text class="size28 c6">
  99. {{ $t('match.labe87') }}
  100. </text>
  101. <view class="disflex mg-tp24">
  102. <view class="disflex-img">
  103. <image src="../../static/image/match/team_context_avatar.png" mode="widthFix"
  104. class="team-avatar mg-rt24"></image>
  105. <text>{{obj.home_win_num + obj.away_win_num + obj.no_result}}</text>
  106. </view>
  107. <view class="flex-col justify-between progress-l-w">
  108. <view>
  109. <view class="flex size28">
  110. <text class="c6">{{obj.home_name}} {{ $t('match.labe89') }}</text>
  111. <text class="c3">{{obj.home_win_num}}</text>
  112. </view>
  113. <u-line-progress activeColor="#DC3C23" inactiveColor="#C8C8C8"
  114. :percentage="getNum(obj.home_win_num)" :showText="false"></u-line-progress>
  115. <!-- <view class="progress-box bgc8"></view> -->
  116. </view>
  117. <view>
  118. <view class="flex size28">
  119. <text class="c6">{{obj.away_name}} {{ $t('match.labe89') }}</text>
  120. <text class="c3">{{obj.away_win_num}}</text>
  121. </view>
  122. <u-line-progress activeColor="#DC3C23" inactiveColor="#C8C8C8"
  123. :percentage="getNum(obj.away_win_num)" :showText="false"></u-line-progress>
  124. </view>
  125. <view>
  126. <view class="flex size28">
  127. <text class="c6">
  128. {{ $t('match.labe90') }}
  129. </text>
  130. <text class="c3">{{obj.no_result}}</text>
  131. </view>
  132. <u-line-progress activeColor="#DC3C23" inactiveColor="#C8C8C8"
  133. :percentage="getNum(obj.no_result)" :showText="false"></u-line-progress>
  134. </view>
  135. </view>
  136. </view>
  137. <view class="recent" v-for="(item,index) in obj.historical_confrontation" :key="index">
  138. <view class="flex size32 c3">
  139. <text class="Bold">
  140. {{ $t('match.labe91') }}
  141. </text>
  142. <text class="size24 c9">
  143. {{ $t('match.labe92') }}
  144. </text>
  145. </view>
  146. <view class="flex mg-tp33">
  147. <view class="lns-wnr bg831">{{obj.home_name}}</view>
  148. <view class="lns-wnr bgc23">{{obj.away_name}}</view>
  149. </view>
  150. <view class="mg-tp24 flex align-start">
  151. <view>
  152. <text class="size32 c3 Bold">{{item.home_display_score}}</text>
  153. <view class="size24 c6">
  154. ({{item.home_display_overs}})
  155. </view>
  156. </view>
  157. <view class="flex-col align-center">
  158. <view class="text-center size24 c9 text-center mg-bt10">
  159. {{item.date}} <br>
  160. {{item.venue}}
  161. </view>
  162. <text class="size28 c3" style="text-align: center;">{{item.match_result}}</text>
  163. </view>
  164. <view class="flex-col align-end">
  165. <text class="size32 c3 Bold">{{item.away_display_score}}</text>
  166. <text class="size24 c6">({{item.away_display_overs}})</text>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. <!-- <u-gap bgColor="#f3f3f3" height="24"></u-gap> -->
  172. <view class="main" style="display: none;">
  173. <view class="recent mg-tp12 recent2">
  174. <view class="flex size32 c3">
  175. <text class="Bold">
  176. {{ $t('match.labe88') }}
  177. </text>
  178. <view class="size24 c9">
  179. {{ $t('match.labe93') }}
  180. </view>
  181. </view>
  182. <view class="flex mg-tp33">
  183. <view class="lns-wnr bg831">LNS</view>
  184. <view class="lns-wnr bgc23">WNR</view>
  185. </view>
  186. <view class="mg-tp24 flex">
  187. <view>
  188. <text class="size32 c3 Bold">17</text>
  189. </view>
  190. <view class="flex driver-line">
  191. <text> </text>
  192. <view class="size28 cc6 text-center">{{ $t('match.labe94') }} <br>
  193. ({{ $t('match.labe95') }})</view>
  194. <text> </text>
  195. </view>
  196. <view class="flex-col align-end">
  197. <text class="size32 c3 Bold">16</text>
  198. </view>
  199. </view>
  200. <view class="mg-tp24 flex">
  201. <image src="../../static/image/common/teams_avatar_ico@2x.png" mode="widthFix"
  202. class="team-vs-avatar"></image>
  203. <view class="flexcenter driver-line">
  204. <text> </text>
  205. <view class="size28 cc6 text-center">{{ $t('match.labe934') }} <br>
  206. ({{ $t('match.labe95') }})</view>
  207. <text> </text>
  208. </view>
  209. <image src="../../static/image/common/teams_avatar_ico@2x.png" mode="widthFix"
  210. class="team-vs-avatar"></image>
  211. </view>
  212. <view class="flex size24 c9 mg-tp16">
  213. <text>
  214. {{ $t('match.labe96') }}
  215. </text>
  216. <text>
  217. {{ $t('match.labe97') }}
  218. </text>
  219. </view>
  220. </view>
  221. <u-row class="mg-tp50">
  222. <u-col span="6">
  223. <view class="flex size24 c6">
  224. <text>
  225. {{ $t('match.labe98') }}
  226. </text>
  227. <text>50%</text>
  228. </view>
  229. <view class="progrees-serve">
  230. <u-line-progress activeColor="#DC3C23" inactiveColor="#C8C8C8" :percentage="50"
  231. :showText="false"></u-line-progress>
  232. </view>
  233. </u-col>
  234. <u-col span="6">
  235. <view class="flex size24 c6">
  236. <text>
  237. {{ $t('match.labe99') }}
  238. </text>
  239. <text>25%</text>
  240. </view>
  241. <view>
  242. <u-line-progress activeColor="#219430" inactiveColor="#C8C8C8" :percentage="25"
  243. :showText="false"></u-line-progress>
  244. </view>
  245. </u-col>
  246. </u-row>
  247. <u-row class="mg-tp50">
  248. <u-col span="6">
  249. <view class="flex size24 c6">
  250. <text>
  251. {{ $t('match.labe98') }}
  252. </text>
  253. <text>50%</text>
  254. </view>
  255. <view class="progrees-serve">
  256. <u-line-progress activeColor="#DC3C23" inactiveColor="#C8C8C8" :percentage="50"
  257. :showText="false"></u-line-progress>
  258. </view>
  259. </u-col>
  260. <u-col span="6">
  261. <view class="flex size24 c6">
  262. <text>
  263. {{ $t('match.la') }}
  264. </text>
  265. <text>25%</text>
  266. </view>
  267. <view>
  268. <u-line-progress activeColor="#219430" inactiveColor="#C8C8C8" :percentage="25"
  269. :showText="false"></u-line-progress>
  270. </view>
  271. </u-col>
  272. </u-row>
  273. </view>
  274. </view>
  275. </template>
  276. <script>
  277. export default {
  278. data() {
  279. return {
  280. rowAcIndex: null,
  281. obj: {
  282. }
  283. };
  284. },
  285. onLoad(option) {
  286. // 35240243
  287. this.getDetail(option.match_id)
  288. },
  289. methods: {
  290. getDetail(id) {
  291. uni.$u.http.post('/api/Cricket/cricket_match_detail_fantasy_info', {
  292. match_id: id
  293. }).then(res => {
  294. this.obj = res;
  295. }).catch(res => {})
  296. },
  297. // 获取百分比
  298. getNum(num) {
  299. let {
  300. home_win_num,
  301. away_win_num,
  302. no_result
  303. } = this.obj;
  304. let total = home_win_num + away_win_num + no_result;
  305. return (num / total) * 100
  306. }
  307. }
  308. }
  309. </script>
  310. <style lang="scss">
  311. .select-head {
  312. position: sticky;
  313. top: 0;
  314. z-index: 99;
  315. background-color: $color1;
  316. .select-tab {
  317. padding: 0 28rpx;
  318. margin-top: 20rpx;
  319. }
  320. }
  321. .main {
  322. padding: 24rpx 28rpx;
  323. .heander-info {
  324. background: url(../../static/image/match/team_context.png) center center/ 100% auto no-repeat;
  325. border-radius: 10rpx;
  326. .team-icon {
  327. width: 80rpx;
  328. height: 80rpx;
  329. }
  330. .vs-icon {
  331. width: 48rpx;
  332. height: 48rpx;
  333. }
  334. }
  335. .table-list {
  336. box-shadow: 0rpx 0rpx 8rpx 1rpx $color7;
  337. border-radius: 10rpx 10rpx 10rpx 10rpx;
  338. overflow: hidden;
  339. margin-top: 24rpx;
  340. .table-list-item {
  341. .table-list-item-header {
  342. background: #FFFFFF;
  343. padding: 36rpx 0;
  344. .list-left {
  345. width: 86rpx;
  346. padding: 0 24rpx;
  347. image {
  348. width: 19rpx;
  349. height: 19rpx;
  350. }
  351. }
  352. .l-w {
  353. width: 48rpx;
  354. height: 48rpx;
  355. background-color: #219430;
  356. margin-left: 16rpx;
  357. text-align: center;
  358. color: #FFFFFF;
  359. &:first-child {
  360. margin-left: 0;
  361. }
  362. }
  363. .lwRed {
  364. background-color: #DC3C23;
  365. margin-left: 16rpx;
  366. }
  367. }
  368. .table-list-item-content {
  369. height: 0;
  370. overflow: hidden;
  371. .u-row {
  372. padding: 24rpx 0;
  373. border-bottom: 1rpx solid #ccc;
  374. view {
  375. padding: 0 24rpx;
  376. }
  377. .table-list-item-content-views {
  378. flex: 1;
  379. }
  380. }
  381. }
  382. .actives {
  383. height: inherit;
  384. }
  385. }
  386. }
  387. .team-avatar {
  388. width: 227rpx;
  389. height: 216rpx;
  390. border-radius: 10rpx;
  391. }
  392. .disflex-img {
  393. position: relative;
  394. text {
  395. position: absolute;
  396. right: 42rpx;
  397. bottom: 22rpx;
  398. color: #fff;
  399. font-size: 40rpx;
  400. }
  401. }
  402. .progress-l-w {
  403. flex: 1;
  404. .progress-box {
  405. height: 16rpx;
  406. width: 100%;
  407. border-radius: 30rpx;
  408. }
  409. }
  410. .recent {
  411. background: #FFFFFF;
  412. box-shadow: 0rpx 0rpx 6rpx 1rpx rgba(0, 0, 0, 0.3);
  413. border-radius: 10rpx 10rpx 10rpx 10rpx;
  414. margin-top: 24rpx;
  415. padding: 24rpx;
  416. .lns-wnr {
  417. padding: 0 17rpx;
  418. display: block;
  419. color: #FFFFFF;
  420. font-size: 24rpx;
  421. }
  422. .team-vs-avatar {
  423. width: 66rpx;
  424. height: 66rpx;
  425. }
  426. .driver-line {
  427. flex: 1;
  428. text {
  429. display: block;
  430. width: 100%;
  431. flex: 1;
  432. height: 1rpx;
  433. background-color: #ccc;
  434. margin: 0 22rpx;
  435. }
  436. view {
  437. margin: 0 8rpx;
  438. color: #666;
  439. font-size: 24rpx;
  440. }
  441. }
  442. }
  443. .recent2 {
  444. box-shadow: none;
  445. }
  446. .progrees-serve {
  447. transform: rotateZ(180deg);
  448. }
  449. }
  450. </style>