|
@@ -1,40 +1,50 @@
|
|
|
<template>
|
|
|
- <view>
|
|
|
- <web-view v-if="webSrc" :src="webSrc" @message="onPostMessage" />
|
|
|
- </view>
|
|
|
+ <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
|
|
|
- })
|
|
|
- },
|
|
|
- onUnload() {
|
|
|
- this.$Http.innerAudioContext && this.$Http.innerAudioContext.destroy()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- onPostMessage(e) {
|
|
|
- console.log("onPostMessage", e)
|
|
|
- }
|
|
|
- },
|
|
|
-}
|
|
|
+ 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;
|
|
|
+ position: fixed;
|
|
|
+ bottom: 10px;
|
|
|
+ left: 10px;
|
|
|
+ color: #fff;
|
|
|
+ z-index: 999999999;
|
|
|
}
|
|
|
</style>
|