From 57572a97a4b6643bbb245981eda310963e5bd4a8 Mon Sep 17 00:00:00 2001 From: zongzhimin Date: Sat, 14 Apr 2018 10:41:25 +0800 Subject: [PATCH] YOUFANG app 1.0.3 --- fangija-zsyf/views/news/newsDetail.html | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/fangija-zsyf/views/news/newsDetail.html b/fangija-zsyf/views/news/newsDetail.html index dcf49c4..ee4962e 100644 --- a/fangija-zsyf/views/news/newsDetail.html +++ b/fangija-zsyf/views/news/newsDetail.html @@ -170,15 +170,10 @@ function onPlusReady() { id = self.newsId; shareId = id shareUrl = shareUrl+id - $.ajax({ - type : 'get', - url : BASE_PATH + "/rest/news/detail", - data:{newsId:id}, - dataType:'json', - async:false, - success:function(result){ - if(result.code==200){ - data = result.data + + axios.get("/rest/news/detail",{params:{newsId:id}}).then(function(response){ + if(response.data.code==200){ + data = response.data.data $("#title").text(data.title) $("#title2").text(data.title) $("#source").text(data.source==null?"":"来源:"+data.source) @@ -200,10 +195,10 @@ function onPlusReady() { //是否收藏 isCollect(); } - }, - error:function(){ - } - }) + + }).catch(function(error){ + console.log(error) + }); getPosition(); updateSerivces(); }