使用 wx.miniProgram.navigateBack,示例代码:
$http({ method:'POST', url: '/your/url', headers: {'Content-Type': undefined}, data: $scope.postParams, transformRequest: function(data) { var formData = new FormData(); angular.forEach(data, function (value, key) { if(key == 'file'){ for(var i in value) { var f = value[i]; formData.append('file', f); } } else if(key == 'content') { formData.append('content', data['content']); } else { formData.append(key, value); } }); return formData; } }).success(function(res){ $scope.loadingShow = false; clearTimer(timer); if(res.success=='t') { fadeoutmessage("发布成功") setTimeout(function(){ // window.history.back(); wx.miniProgram.navigateBack(); }, 2000); } else { fadeoutmessage(res.error_msg); } saving = false; }).error(function(){ $scope.loadingShow = false; clearTimer(timer); fadeoutmessage("服务异常"); saving = false; });
参考:
https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html
棒棒哒