h5.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view >
  3. <!-- <web-view :src="webUrl"></web-view> -->
  4. <view v-html="contText"></view>
  5. </view>
  6. </template>
  7. <script>
  8. import {getuserAgreement,getprivacyPolicy} from'@/api/common.js'
  9. export default {
  10. data() {
  11. return {
  12. webUrl:"",
  13. contText:''
  14. }
  15. },
  16. onLoad(option) {
  17. this.webUrl=uni.getStorageSync('url');
  18. console.log(this.webUrl)
  19. if(option.val==1){
  20. this.getuserAgreements()
  21. }else{
  22. this.getprivacyPolicys()
  23. }
  24. },
  25. methods:{
  26. getuserAgreements(){
  27. getuserAgreement().then(res=>{
  28. console.log(res)
  29. if(res.code==200){
  30. this.contText=res.data
  31. }else{
  32. uni.showToast({
  33. title: res.msg,
  34. icon: 'none'
  35. });
  36. }
  37. })
  38. },
  39. getprivacyPolicys(){
  40. getprivacyPolicy().then(res=>{
  41. console.log(res)
  42. if(res.code==200){
  43. this.contText=res.data
  44. }else{
  45. uni.showToast({
  46. title: res.msg,
  47. icon: 'none'
  48. });
  49. }
  50. })
  51. }
  52. }
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. page{
  57. height: 100%;
  58. }
  59. .content{
  60. width: 100%;
  61. height: 100%;
  62. display: flex;
  63. align-items: center;
  64. justify-content: center;
  65. }
  66. </style>