xieyi.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view style="padding: 24rpx;" v-html="content">
  3. </view>
  4. </template>
  5. <script>
  6. export default {
  7. data(){
  8. return{
  9. type:1,
  10. content:''
  11. }
  12. },
  13. onLoad(option) {
  14. this.type = option.type
  15. this.getdata()
  16. },
  17. onShow() {
  18. if(this.type == 1){
  19. uni.setNavigationBarTitle({
  20. title:'用户协议'
  21. })
  22. }
  23. if(this.type == 2){
  24. uni.setNavigationBarTitle({
  25. title:' 隐私政策'
  26. })
  27. }
  28. if(this.type == 3){
  29. uni.setNavigationBarTitle({
  30. title:' 报备活动规则'
  31. })
  32. }
  33. if(this.type == 4){
  34. uni.setNavigationBarTitle({
  35. title:' 佣金说明'
  36. })
  37. }
  38. },
  39. methods:{
  40. getdata(){
  41. if(this.type == 1){
  42. this.$u.post('/api/Index/platform_config').then(res => {
  43. const regex = new RegExp('<img', 'gi')
  44. this.content = res.data.agreement.replace(regex, `<img style="max-width: 100%; height: auto"`)
  45. })
  46. }
  47. if(this.type == 2){
  48. this.$u.post('/api/Index/platform_config').then(res => {
  49. const regex = new RegExp('<img', 'gi')
  50. this.content = res.data.privacy_policy.replace(regex, `<img style="max-width: 100%; height: auto"`)
  51. })
  52. }
  53. if(this.type == 3){
  54. this.$u.post('/api/Index/platform_config').then(res => {
  55. const regex = new RegExp('<img', 'gi')
  56. this.content = res.data.report_rule.replace(regex, `<img style="max-width: 100%; height: auto"`)
  57. })
  58. }
  59. if(this.type == 4){
  60. this.$u.post('/api/Index/platform_config').then(res => {
  61. const regex = new RegExp('<img', 'gi')
  62. this.content = res.data.brokerage_explain.replace(regex, `<img style="max-width: 100%; height: auto"`)
  63. })
  64. }
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. </style>