activity.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="wrap">
  3. <u-navbar :autoBack="true" title="答题" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view class="b-image" v-if="activityImage" @click="onPreview">
  5. <image :src="activityImage || '/static/imgs/activity_loading.jpg'" mode="widthFix"></image>
  6. </view>
  7. <view class="b-rich" v-else>
  8. <rich-text :nodes="activityRich"></rich-text>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import mixinsCommon from '@/mixins/common.js';
  14. import mixinsAuth from '../../mixins/auth.js';
  15. import { formatRichText } from '@/common/util.js';
  16. export default {
  17. mixins: [mixinsCommon, mixinsAuth],
  18. data() {
  19. return {};
  20. },
  21. onLoad() {},
  22. computed: {
  23. activityRich() {
  24. return formatRichText(this.$store.getters.globalConfig.activity_rich);
  25. },
  26. activityImage() {
  27. return this.$store.getters.globalConfig.activity_img;
  28. }
  29. },
  30. methods: {
  31. onPreview() {
  32. uni.previewImage({
  33. current: 0,
  34. urls: [this.activityImage]
  35. });
  36. }
  37. }
  38. };
  39. </script>
  40. <style>
  41. .b-rich {
  42. background: #fff;
  43. font-size: 28upx;
  44. }
  45. .b-image image {
  46. width: 100%;
  47. height: 460upx;
  48. }
  49. </style>