rule.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="container">
  3. <view class="title">{{ title }}:</view>
  4. <view class="textInfo" v-html="rulesHtml"></view>
  5. </view>
  6. </template>
  7. <script>
  8. import { rules } from './rule.js'
  9. export default {
  10. data() {
  11. return {
  12. rules: rules,
  13. rulesHtml: '',
  14. type: null,
  15. title: '规则与说明',
  16. }
  17. },
  18. onLoad(query) {
  19. console.log(query)
  20. if (query.type) {
  21. this.type = query.type
  22. this.typeInit()
  23. }
  24. },
  25. methods: {
  26. typeInit() {
  27. let titleText = '规则与说明'
  28. switch (this.type) {
  29. case '0':
  30. titleText = '规则与说明'
  31. this.rulesHtml = this.rules['all']
  32. break
  33. case '1':
  34. titleText = '无限赏规则与说明'
  35. this.rulesHtml = this.rules['wuxian']
  36. break
  37. case '2':
  38. titleText = 'last赏规则与说明'
  39. this.rulesHtml = this.rules['last']
  40. break
  41. case '3':
  42. titleText = '全套赏规则与说明'
  43. this.rulesHtml = this.rules['fullSet']
  44. break
  45. case '4':
  46. titleText = '抽盒机规则与说明'
  47. this.rulesHtml = this.rules['box']
  48. break
  49. case '5':
  50. titleText = 'first赏规则与说明'
  51. this.rulesHtml = this.rules['first']
  52. break
  53. case '6':
  54. titleText = '邀请好友规则与说明'
  55. this.rulesHtml = this.rules['invite']
  56. break
  57. }
  58. this.title = titleText
  59. wx.setNavigationBarTitle({
  60. title: titleText,
  61. })
  62. },
  63. },
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .container {
  68. font-size: 14px;
  69. padding: 10px;
  70. .title {
  71. }
  72. .textInfo {
  73. padding-bottom: 30px;
  74. p {
  75. margin: 5px 0;
  76. }
  77. }
  78. }
  79. </style>