上传文件至 '新闻小程序/pages/news-detail'
This commit is contained in:
parent
74328ebb6d
commit
1188a2b9af
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue