百富门答题小程序
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.

110 lines
2.0 KiB

7 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
7 months ago
2 months ago
7 months ago
2 months ago
7 months ago
2 months ago
7 months ago
2 months ago
7 months ago
2 months ago
7 months ago
2 months ago
2 months ago
7 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
7 months ago
2 months ago
7 months ago
2 months ago
7 months ago
2 months ago
2 months ago
7 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. openContent(content) {
  58. this.content = content
  59. this.$refs.popup.open('bottom');
  60. },
  61. open(key) {
  62. this.content = this.configList[key]
  63. this.$refs.popup.open('bottom');
  64. },
  65. openkeys() {
  66. this.index = 0
  67. this.content = this.configList[this.keys[this.index]]
  68. this.$refs.popup.open('bottom');
  69. },
  70. success() {
  71. console.log('click success');
  72. if (this.index == this.keys.length - 1) {
  73. this.$emit('success')
  74. this.$refs.popup.close();
  75. return
  76. }
  77. this.index++
  78. this.content = this.configList[this.keys[this.index]]
  79. this.scrollTop = 100
  80. this.$nextTick(res => {
  81. this.scrollTop = 0
  82. })
  83. },
  84. },
  85. computed: {
  86. ...mapState(['configList'])
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .configPopup {
  92. .content {
  93. padding: 30rpx 20rpx;
  94. overflow: scroll;
  95. height: 50vh;
  96. box-sizing: border-box;
  97. .uv-parse{
  98. width: 100%;
  99. }
  100. }
  101. }
  102. </style>