From b1d8b40bbe5ba37566eab4785eaa5d6671432d98 Mon Sep 17 00:00:00 2001 From: zhaoyongnian <541231643@qq.com> Date: Wed, 9 Sep 2020 19:59:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=88=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/pages/newsDetail/newsDetail.js | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/epdc-resident-mp-yushan/subpages/home/pages/newsDetail/newsDetail.js b/epdc-resident-mp-yushan/subpages/home/pages/newsDetail/newsDetail.js index cff57f1..395ecbc 100644 --- a/epdc-resident-mp-yushan/subpages/home/pages/newsDetail/newsDetail.js +++ b/epdc-resident-mp-yushan/subpages/home/pages/newsDetail/newsDetail.js @@ -132,13 +132,34 @@ Page({ newsId: this.data.detailId, attitude: attitudeState } + if (attitudeState == 0) { //表态 0赞;1踩;2取消赞;3取消踩 + api.newsSupport(para).then(() => { + + }).catch(err => { + console.log(err) + }) + } else if (attitudeState == 1) { + api.newsOpposition(para).then(() => { + + }).catch(err => { + console.log(err) + }) + } else { + // const res = await newsPosition(para) + // console.log('新闻表态', res) + api.newsPosition(para).then(() => { + + }).catch(err => { + console.log(err) + }) + } // const res = await newsPosition(para) // console.log('新闻表态', res) - api.newsPosition(para).then(res => { + // api.newsPosition(para).then(res => { - }).catch(err => { - console.log(err) - }) + // }).catch(err => { + // console.log(err) + // }) } }, // 获取默认配置, 阅读时间, 获取默认网格