1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <template>
- <view>
- <web-view v-if="webSrc" :src="webSrc" @message="onPostMessage" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- webSrc: "",
- };
- },
- onLoad(options) {
- /* encodeURIComponent(``) */
- if (options.parems)
- this.webSrc = `http://61.164.207.46:8200/webviewtools/index.html#/pages/photoGallery/index?parems=${
- options.parems
- }&title=${options.title || "电子相册"}`;
- if (options.title) {
- uni.setNavigationBarTitle({
- title: options.title,
- });
- setTimeout(() => {
- uni.setNavigationBarTitle({
- title: options.title,
- });
- }, 500);
- }
- },
- onUnload() {
- this.$Http.innerAudioContext && this.$Http.innerAudioContext.destroy();
- },
- methods: {
- onPostMessage(e) {
- console.log("onPostMessage", e);
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .coverView {
- position: fixed;
- bottom: 10px;
- left: 10px;
- color: #fff;
- z-index: 999999999;
- }
- </style>
|