webviewPage.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view>
  3. <web-view :webview-styles="webviewStyles" :src="url"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. url: "",
  11. webviewStyles: {
  12. progress: {
  13. color: '#F07423'
  14. }
  15. },
  16. type: "",
  17. iOS: true
  18. };
  19. },
  20. onLoad(param) {
  21. this.type = param.type;
  22. let title = ""
  23. if (this.type == 1) {
  24. title = "用户使用协议"
  25. } else if (this.type == 2) {
  26. title = "隐私协议"
  27. } else if (this.type == 3) {
  28. title = "入驻协议"
  29. }
  30. uni.setNavigationBarTitle({
  31. title: title
  32. })
  33. this.webviewStyles.progress.color = getApp().globalData.color1;
  34. this.queryProtocolConfigView();
  35. },
  36. methods: {
  37. async queryProtocolConfigView() {
  38. let res = await this.$myRequest({
  39. url: "/project/queryProtocolConfigView",
  40. data: {},
  41. })
  42. if (res.data.success) {
  43. if (this.type = '1') { //使用协议
  44. this.url = res.data.single.userUseProtocol;
  45. } else if (this.type = '2') { //隐私协议
  46. this.url = res.data.single.userPrivacyProtocol;
  47. } else if (this.type = '3') { //业主注册协议
  48. this.url = res.data.single.ownerRegistProtocol;
  49. }
  50. }
  51. },
  52. }
  53. }
  54. </script>
  55. <style lang="scss">
  56. </style>