diff --git a/api/webView/webViewApi.js b/api/webView/webViewApi.js index a97b98d..a12b04b 100644 --- a/api/webView/webViewApi.js +++ b/api/webView/webViewApi.js @@ -42,6 +42,8 @@ const ACTION_NAVIGATE_TO_PAGE = "navigateToPage"; const ACTION_PAY_ORDER = "payOrder"; const ACTION_SET_TITLE = "setTitle"; const ACTION_NAVIGATE_HOME = "navigateHome"; +const ACTION_NAVIGATE_BACK = "navigateBack"; + @@ -217,4 +219,13 @@ export function reciveMessage(event, that) {   title:_data.title }) } + else if (_data.action == ACTION_NAVIGATE_BACK) { + //_data.url = encodeUrl(_data.url); + setStorageSync('_go_back_refresh',1); + uni.navigateBack({ + delta:1 + }) + } + + } diff --git a/pages/homemaking/homemaking.vue b/pages/homemaking/homemaking.vue index 311c954..94151b3 100644 --- a/pages/homemaking/homemaking.vue +++ b/pages/homemaking/homemaking.vue @@ -32,6 +32,15 @@ _that.url = conf.mallUrl+"#/pages/homemaking/index?mallFrom=HC&hcCommunityId="+_that.communityId; }) + }, + onShow() { + let _goBackRefresh = getStorageSync('_go_back_refresh'); + if(_goBackRefresh == 1){ + let wv = this.$refs.webview + wv.reload(true); + } + setStorageSync('_go_back_refresh',0) + }, methods: { onReciveMessage: function(event) { diff --git a/pages/mall/mall.vue b/pages/mall/mall.vue index 9bb590d..a39fa25 100644 --- a/pages/mall/mall.vue +++ b/pages/mall/mall.vue @@ -10,7 +10,10 @@ reciveMessage, getHcCode } from '../../api/webView/webViewApi.js' - + import { + getStorageSync, + setStorageSync + } from '../../utils/StorageUtil.js' import { decodeUrl } from '../../utils/UrlUtil.js'; @@ -27,8 +30,6 @@ let _that = this; let _url = options.url; _url = decodeUrl(_url); - - //刷新hcCode this.vc.getCurCommunity() .then(function(_communityInfo) { @@ -38,6 +39,15 @@ _that.url = conf.mallUrlIndexPage + "&hcCommunityId=" + _that.communityId; }) + }, + onShow() { + let _goBackRefresh = getStorageSync('_go_back_refresh'); + if (_goBackRefresh == 1) { + let wv = this.$refs.webview + wv.currentWebview().reload(true); + } + setStorageSync('_go_back_refresh', 0); + }, methods: { onReciveMessage: function(event) {