health_center.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <uv-toast ref="toast"></uv-toast>
  3. <view class="">
  4. <navbar :title="$t('health_center')" size="48" :backtext="$t('back')" color="#fff" :backShow="false"></navbar>
  5. </view>
  6. <view class="app_content">
  7. <view class="" v-for="(item,index) in list" :key="index">
  8. <uv-row customStyle="margin-bottom: 10px">
  9. <uv-col span="12" >
  10. <video :id="'myVideo'+item.id" class="myVideo" :src="item.vurl"
  11. @error="videoErrorCallback" controls
  12. :poster-for-crawler="item.vjpg"
  13. :danmu-btn="false"
  14. :poster="item.vjpg"
  15. >
  16. </video>
  17. <uv-text type="info" :text="item.vname" align="center"></uv-text>
  18. </uv-col>
  19. </uv-row>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {gethealthcenterlist} from "@/common/api/data.js"
  25. export default {
  26. data() {
  27. return {
  28. list:[],
  29. }
  30. },
  31. methods: {
  32. getlist(){
  33. gethealthcenterlist().then(res=>{
  34. console.log(res)
  35. var data =res.data
  36. if(200!=data.code){
  37. this.$refs.toast.show({
  38. type: 'error',
  39. message: data.errMsg
  40. })
  41. return
  42. }
  43. this.list = data.resultData
  44. })
  45. },
  46. init(){
  47. this.getlist()
  48. },
  49. videoErrorCallback: function(e) {
  50. this.$refs.toast.show({
  51. type: 'error',
  52. message: e.target.errMsg
  53. })
  54. },
  55. },
  56. mounted(){
  57. uni.setNavigationBarTitle({
  58. title: this.$t('health_center')
  59. });
  60. this.init()
  61. },
  62. }
  63. </script>
  64. <style scoped>
  65. .myVideo{
  66. margin: 0 auto;
  67. width: 95%;
  68. margin-top: 10px;
  69. }
  70. .app_content{
  71. margin-top: 3em;
  72. padding-top: 2em;
  73. }
  74. </style>