detail.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="wrap">
  3. <div class="preview-conatiner">
  4. <view class="title">视频详情</view>
  5. <view class="preview">
  6. <video v-if="result.sportVedioPath" id="video" :src="result.sportVedioPath" @error="videoErrorCallback" controls></video>
  7. <uni-icons color="#AEAEAE" type="videocam-filled" size="70" v-else></uni-icons>
  8. </view>
  9. </div>
  10. <view class="content">
  11. <view class="result">
  12. <view class="title">识别结果</view>
  13. <view class="result-conatiner">
  14. <h3>{{!isEmpty(result.sportGrade)?'':'正在评分中请稍后重试'}}</h3>
  15. <view class="collapse-item-content" v-if="!isEmpty(result.sportGrade)">
  16. <div class="sportGrade-card">
  17. <div class="sportGrade">
  18. <text>{{result.sportGrade}}</text>
  19. <text class="util">分</text>
  20. </div>
  21. <view class="text">{{result.sportSuggestion}}</view>
  22. </div>
  23. <view class="text" >
  24. <view class="text-item" v-for="(item,key) in formateSportRetReport(result.sportRetReport)" :key="key">
  25. <view class="explain-title">{{item.explain}}</view>
  26. <video class="sportVideo" :src="item.url"></video>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default{
  37. data(){
  38. return{
  39. result:{
  40. sportGrade:undefined,
  41. sportSuggestion:"",
  42. sportRetReport:[]
  43. }
  44. }
  45. },
  46. onShow() {
  47. let info=uni.getStorageSync('detail-info')
  48. this.result=info
  49. },
  50. onUnload() {
  51. uni.removeStorageSync('detail-info')
  52. },
  53. methods:{
  54. formateSportRetReport(items){
  55. try{
  56. if(this.isEmpty(items)) return []
  57. return JSON.parse(items)
  58. }catch(e){
  59. return []
  60. }
  61. },
  62. isEmpty(val){
  63. if(val!=="undefined"&&val!==undefined&&val!==""&&val!==null){
  64. return false
  65. }
  66. return true
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. *{
  73. padding: 0;
  74. margin: 0;
  75. }
  76. .wrap{
  77. padding:20rpx;
  78. .title{
  79. height: 40rpx;
  80. font-size: 28rpx;
  81. font-family: PingFang SC;
  82. font-weight: bold;
  83. line-height: 40rpx;
  84. color: #333333;
  85. opacity: 1;
  86. padding:0 0 36rpx 20rpx;
  87. position: relative;
  88. &::after{
  89. width: 12rpx;
  90. height: 28rpx;
  91. background:#2A83EF;
  92. opacity: 1;
  93. border-radius: 6px;
  94. content: "";
  95. display: block;
  96. position: absolute;
  97. left: 0;
  98. top: 8rpx;
  99. }
  100. }
  101. .preview{
  102. width: 670rpx;
  103. display: flex;
  104. justify-content: center;
  105. align-items: center;
  106. background-color: #ccc;
  107. height: 300rpx;
  108. margin: 0 auto;
  109. background:#E8E8E8;
  110. opacity: 1;
  111. border-radius: 20rpx;
  112. #video{
  113. width:750rpx;
  114. height: 300rpx;
  115. display: block;
  116. border-radius: 20rpx;
  117. }
  118. }
  119. .content{
  120. padding: 10rpx;
  121. margin-top: 24rpx;
  122. .upload-bt{
  123. width: 446rpx;
  124. height: 66rpx;
  125. line-height: 66rpx;
  126. font-size: 28rpx;
  127. color: #fff;
  128. background-color: #409eff;
  129. border-color: #409eff;
  130. text-align: center;
  131. margin: 0 auto;
  132. border-radius: 42rpx;
  133. }
  134. .search-bt-container{
  135. padding: 24rpx 0 42rpx 0;
  136. }
  137. .search-bt{
  138. width: 446rpx;
  139. height: 66rpx;
  140. line-height: 66rpx;
  141. font-size: 28rpx;
  142. color: #fff;
  143. background-color: #ED834A;
  144. border-color: #ED834A;
  145. text-align: center;
  146. margin: 0 auto;
  147. display: block;
  148. border-radius: 42rpx;
  149. }
  150. .result{
  151. .sportGrade-card{
  152. &{
  153. width: 670rpx;
  154. background-image: url('/static/index/sportGradeBg.png');
  155. background-repeat: no-repeat;
  156. background-size: 100% 100%;
  157. margin: 0 auto 40rpx;
  158. }
  159. .sportGrade{
  160. font-size: 120rpx;
  161. font-family: PingFang SC;
  162. font-weight: bold;
  163. line-height: 168rpx;
  164. color: #FFFFFF;
  165. text-align: center;
  166. .util{
  167. font-size: 32rpx;
  168. font-family: PingFang SC;
  169. font-weight: bold;
  170. line-height: 44rpx;
  171. color: #FFFFFF;
  172. }
  173. }
  174. .text{
  175. width: 94%;
  176. min-height: 40rpx;
  177. font-size: 28rpx;
  178. font-family: PingFang SC;
  179. font-weight: 400;
  180. line-height: 40rpx;
  181. color: #FFFFFF;
  182. text-align: center;
  183. // white-space:nowrap;
  184. // overflow:hidden;
  185. // text-overflow:ellipsis;
  186. margin: 0 auto;
  187. padding-bottom: 20rpx;
  188. }
  189. }
  190. .text-item{
  191. padding-bottom: 10px;
  192. .explain-title{
  193. height: 40rpx;
  194. font-size: 28rpx;
  195. font-family: PingFang SC;
  196. font-weight: bold;
  197. line-height: 40rpx;
  198. color: #333333;
  199. padding:0 0 24rpx 20rpx;
  200. position: relative;
  201. &::after{
  202. width: 12rpx;
  203. height: 12rpx;
  204. background:#2A83EF;
  205. border-radius: 50%;
  206. content: "";
  207. display: block;
  208. position: absolute;
  209. left: 0;
  210. top: 16rpx;
  211. }
  212. }
  213. .sportVideo{
  214. width:100%;
  215. height: 293rpx;
  216. display: block;
  217. border-radius: 20rpx;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. </style>