index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class='rule-box'>
  3. <u-parse :content="ruleHtmlParse"></u-parse>
  4. </view>
  5. </template>
  6. <script>
  7. var md5 = require('../../../common/md5.js');
  8. import uParse from '@/components/gaoyia-parse/parse.vue'
  9. export default {
  10. data() {
  11. return {
  12. inviteId: getApp().globalData.user_id,
  13. ruleHtmlParse: ''
  14. };
  15. },
  16. components: {
  17. uParse,
  18. },
  19. onLoad(options) {
  20. this.getRuleRequest();
  21. },
  22. onShow() {
  23. //this.getUserTimes();
  24. },
  25. onShareAppMessage() {
  26. return {
  27. title: '阿拉灯神丁',
  28. path: '/pages/index/index?inviteId=' + getApp().globalData.user_id
  29. };
  30. },
  31. methods: {
  32. getRuleRequest() {
  33. let that = this;
  34. uni.showLoading({
  35. title: '加载中'
  36. });
  37. uni.request({
  38. url: getApp().globalData.shareUrl, //需要设置为全局
  39. method: 'POST',
  40. header: {
  41. 'content-type': 'application/x-www-form-urlencoded'
  42. },
  43. data: {
  44. method: 'get_protocal',
  45. timestamp: getApp().globalData.globalTimestamp, //Date.now()
  46. sign: md5('get_protocal' + getApp().globalData.globalTimestamp)
  47. },
  48. success: res => {
  49. uni.hideLoading();
  50. if (res.data.code === 200) {
  51. that.ruleHtmlParse = res.data.msg;
  52. } else {
  53. uni.showToast({
  54. title: res.data.msg,
  55. icon: 'none'
  56. });
  57. }
  58. }
  59. });
  60. },
  61. }
  62. };
  63. </script>
  64. <style>
  65. page {
  66. height: 100%;
  67. }
  68. .rule-box {
  69. text-align: left;
  70. padding: 20upx;
  71. }
  72. </style>