百富门答题小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
1.9 KiB

8 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
8 months ago
4 months ago
8 months ago
4 months ago
8 months ago
4 months ago
8 months ago
4 months ago
8 months ago
4 months ago
8 months ago
4 months ago
8 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
8 months ago
4 months ago
8 months ago
4 months ago
8 months ago
4 months ago
4 months ago
8 months ago
  1. <template>
  2. <view class="configPopup">
  3. <uv-popup ref="popup" :round="30" :closeOnClickOverlay="!required">
  4. <view class="content" v-if="required">
  5. <scroll-view
  6. id="scrollView"
  7. scroll-y="true"
  8. :scroll-top="scrollTop"
  9. style="height: 100%;">
  10. <rich-text :nodes="content"></rich-text>
  11. <!-- <view class="uv-parse"
  12. v-html="content">
  13. </view> -->
  14. <view class="uni-color-btn" @click="success">
  15. 下一步
  16. </view>
  17. </scroll-view>
  18. </view>
  19. <view class="content" v-else>
  20. <rich-text :nodes="text || content"></rich-text>
  21. <!-- <uv-parse :content="text || content"></uv-parse> -->
  22. </view>
  23. </uv-popup>
  24. </view>
  25. </template>
  26. <script>
  27. import {
  28. mapState
  29. } from 'vuex'
  30. export default {
  31. name: 'configPoup',
  32. props: {
  33. text: {
  34. default: ''
  35. },
  36. keys: {
  37. default: [],
  38. },
  39. required: {
  40. default: false,
  41. },
  42. },
  43. data() {
  44. return {
  45. content: '',
  46. index: 0,
  47. scrollTop : 0,
  48. }
  49. },
  50. created() {
  51. uni.$on('initConfig', data => {
  52. this.content = data[this.keys[this.index]]
  53. })
  54. },
  55. methods: {
  56. //打开配置信息菜单
  57. open(key) {
  58. this.content = this.configList[key]
  59. this.$refs.popup.open('bottom');
  60. },
  61. openkeys() {
  62. this.index = 0
  63. this.content = this.configList[this.keys[this.index]]
  64. this.$refs.popup.open('bottom');
  65. },
  66. success() {
  67. console.log('click success');
  68. if (this.index == this.keys.length - 1) {
  69. this.$emit('success')
  70. this.$refs.popup.close();
  71. return
  72. }
  73. this.index++
  74. this.content = this.configList[this.keys[this.index]]
  75. this.scrollTop = 100
  76. this.$nextTick(res => {
  77. this.scrollTop = 0
  78. })
  79. },
  80. },
  81. computed: {
  82. ...mapState(['configList'])
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .configPopup {
  88. .content {
  89. padding: 30rpx 20rpx;
  90. overflow: scroll;
  91. height: 50vh;
  92. box-sizing: border-box;
  93. .uv-parse{
  94. width: 100%;
  95. }
  96. }
  97. }
  98. </style>