rule.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <app-layout>
  3. <view class="about">
  4. <view class="title">{{title}}</view>
  5. <view class="content">
  6. <text space='nbsp'>{{rule}}</text>
  7. </view>
  8. </view>
  9. </app-layout>
  10. </template>
  11. <script>
  12. import { mapState } from "vuex";
  13. export default {
  14. data() {
  15. return {
  16. title: '',
  17. rule: ''
  18. }
  19. },
  20. computed: {
  21. ...mapState({
  22. theme: state => state.mallConfig.theme
  23. })
  24. },
  25. methods: {
  26. getList() {
  27. let that = this;
  28. that.$showLoading({
  29. type: 'global',
  30. text: '加载中...'
  31. });
  32. that.$request({
  33. url: that.$api.composition.config,
  34. }).then(response=>{
  35. that.$hideLoading();
  36. if(response.code == 0) {
  37. that.title = response.data.title;
  38. that.rule = response.data.rule;
  39. }else {
  40. that.$hideLoading();
  41. uni.showToast({
  42. title: response.msg,
  43. icon: 'none',
  44. duration: 1000
  45. });
  46. }
  47. }).catch(response => {
  48. that.$hideLoading();
  49. });
  50. },
  51. },
  52. onLoad(option) {
  53. this.getList();
  54. },
  55. }
  56. </script>
  57. <style scoped lang="scss">
  58. .about {
  59. position: absolute;
  60. top: 0;
  61. left: 0;
  62. background-color: #fff;
  63. width: 100%;
  64. height: 100%;
  65. z-index: 2;
  66. color: #353535;
  67. font-size: #{28rpx};
  68. .title {
  69. padding: #{28rpx} #{24rpx} 0;
  70. }
  71. .content {
  72. background-color: #fff;
  73. padding: #{20rpx} #{24rpx};
  74. }
  75. }
  76. </style>