rules.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="content">
  3. <view class="title">大卫博士学位争霸赛规则</view>
  4. <video style="width:100%; height:200px" v-if="pathVideo && seat == 0" :src="pathVideo" controls="controls" />
  5. <!-- <rich-text :nodes="contents"></rich-text> -->
  6. <view class="ql-container ql-snow" style="border:none">
  7. <view class="ql-editor" v-html="contents"></view>
  8. <video style="width:100%; height:200px" v-if="pathVideo && seat == 1" :src="pathVideo" controls="controls" />
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import { GetRule } from '../../api.js'
  14. import 'quill/dist/quill.snow.css'
  15. export default {
  16. data() {
  17. return {
  18. pageTitle: '赛季规则',
  19. contents: '',
  20. pathVideo:'',
  21. seat: 0
  22. };
  23. },
  24. onLoad() {
  25. this.getRules()
  26. },
  27. methods:{
  28. getRules() {
  29. this.$ajax.get(`${GetRule}`).then(([, { data: { code, msg, data }}]) => {
  30. if (code == 200) {
  31. this.contents = data.body
  32. this.pathVideo = data.video_url
  33. this.seat = data.seat
  34. } else {
  35. uni.showModal({ title: '提示', showCancel: false, content: msg })
  36. }
  37. })
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .content {
  44. padding: 28rpx 20rpx;
  45. .title {
  46. text-align: center;
  47. font-size: 36rpx;
  48. font-weight: bold;
  49. margin-bottom: 20rpx;
  50. }
  51. .title1 {
  52. font-size: 28rpx;
  53. }
  54. .text {
  55. font-size: 26rpx;
  56. text-indent: 2em;
  57. }
  58. .item {
  59. font-size: 24rpx;
  60. text-indent: 2em;
  61. }
  62. }
  63. </style>