From 1188a2b9afaa026e8158d82698593a859fb023ea Mon Sep 17 00:00:00 2001 From: link_1999 <1402246900@qq.com> Date: Fri, 8 Apr 2022 22:25:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20'=E6=96=B0=E9=97=BB=E5=B0=8F=E7=A8=8B=E5=BA=8F/pages/news-de?= =?UTF-8?q?tail'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 新闻小程序/pages/news-detail/news-detail.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/新闻小程序/pages/news-detail/news-detail.js b/新闻小程序/pages/news-detail/news-detail.js index 3923538..cd81e55 100644 --- a/新闻小程序/pages/news-detail/news-detail.js +++ b/新闻小程序/pages/news-detail/news-detail.js @@ -1,4 +1,5 @@ // pages/news-detail/news-detail.js +let newsType = ''; Page({ /** @@ -12,8 +13,13 @@ Page({ */ onLoad: function (options) { // console.log('从主页传递来的id:', options.id) - // console.log('从主页传递来的newsType:', options.newsType) - let newsType = options.newsType + // console.log('从主页传递来的currentIndex:', options.currentIndex) + let currentIndex = options.currentIndex + if (currentIndex == 0) {newsType='nd-news'} + else if (currentIndex == 1) {newsType='xg-news'} + else if (currentIndex == 2) {newsType='tw-news'} + else if (currentIndex == 3) {newsType='gj-news'} + else if (currentIndex == 4) {newsType='junshi-news'} wx.cloud.database().collection(newsType).doc(options.id) .get() .then(res => {