index.vue 802 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <view>
  3. <web-view v-if="webSrc" :src="webSrc" @message="onPostMessage" />
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. webSrc: ""
  11. }
  12. },
  13. onLoad(options) {
  14. /* encodeURIComponent(``) */
  15. if (options.parems) this.webSrc = `http://61.164.207.46:8200/webviewtools/index.html#/pages/photoGallery/index?parems=${options.parems}&title=${options.title || '电子相册'}`;
  16. if (options.title) uni.setNavigationBarTitle({
  17. title: options.title
  18. })
  19. },
  20. onUnload() {
  21. this.$Http.innerAudioContext && this.$Http.innerAudioContext.destroy()
  22. },
  23. methods: {
  24. onPostMessage(e) {
  25. console.log("onPostMessage", e)
  26. }
  27. },
  28. }
  29. </script>
  30. <style lang="scss" scoped>
  31. .coverView {
  32. position: fixed;
  33. bottom: 10px;
  34. left: 10px;
  35. color: #fff;
  36. z-index: 999999999;
  37. }
  38. </style>