8 changed files with 56 additions and 6 deletions
@ -0,0 +1,34 @@ |
|||||
|
// pages/billboards/park/park-detail/index.js
|
||||
|
import { BillboardModel } from '../../../../models/billboard.js' |
||||
|
|
||||
|
let billboard = new BillboardModel() |
||||
|
|
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
content: '', |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function (options) { |
||||
|
const {code, name} = options |
||||
|
console.log(code) |
||||
|
wx.setNavigationBarTitle({ |
||||
|
title: name, |
||||
|
}) |
||||
|
this.fetchCategoryIntro(code) |
||||
|
}, |
||||
|
fetchCategoryIntro (code) { |
||||
|
billboard.fetchCategoryArtice(code, res => { |
||||
|
console.log(res) |
||||
|
this.setData({ |
||||
|
content: res.result.brief |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
}) |
@ -0,0 +1,3 @@ |
|||||
|
{ |
||||
|
"usingComponents": {} |
||||
|
} |
@ -0,0 +1,4 @@ |
|||||
|
<!--pages/billboards/park/park-detail/index.wxml--> |
||||
|
<view class="container"> |
||||
|
<rich-text nodes="{{content}}"></rich-text> |
||||
|
</view> |
@ -0,0 +1,4 @@ |
|||||
|
/* pages/billboards/park/park-detail/index.wxss */ |
||||
|
.container { |
||||
|
padding: 0 10px; |
||||
|
} |
Loading…
Reference in new issue