|
@@ -13,38 +13,8 @@ Page({
|
|
|
},
|
|
|
currentTab: 0,
|
|
|
// 國内新聞
|
|
|
- list: [
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- title: '國内信息',
|
|
|
- brief: '信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介',
|
|
|
- create_time: '2021-01-01',
|
|
|
- url: '/image/home/image1.jpg'
|
|
|
- },
|
|
|
- {
|
|
|
- id: '2',
|
|
|
- title: '國内信息',
|
|
|
- brief: '信息简介',
|
|
|
- create_time: '2021-01-01',
|
|
|
- url: '/image/home/image1.jpg'
|
|
|
- },
|
|
|
- ],
|
|
|
- lists: [
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- title: '健康资讯',
|
|
|
- brief: '信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介信息简介',
|
|
|
- create_time: '2021-01-01',
|
|
|
- url: '/image/home/image1.jpg'
|
|
|
- },
|
|
|
- {
|
|
|
- id: '2',
|
|
|
- title: '健康资讯',
|
|
|
- brief: '信息简介',
|
|
|
- create_time: '2021-01-01',
|
|
|
- url: '/image/home/image1.jpg'
|
|
|
- },
|
|
|
- ]
|
|
|
+ oneList: [],
|
|
|
+ twoList: []
|
|
|
},
|
|
|
// 禁止左右滑动
|
|
|
stopTab: function (e) {
|
|
@@ -70,7 +40,36 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
-
|
|
|
+ wx.request({
|
|
|
+ url: `${app.globalData.publicUrl}/api/st/system/news`,
|
|
|
+ method: "get",
|
|
|
+ header: { 'x-tenant': 'test' },
|
|
|
+ data: { "type": '国内新闻' },
|
|
|
+ success: res => {
|
|
|
+ this.setData({ oneList: res.data.data })
|
|
|
+ },
|
|
|
+ error: err => {
|
|
|
+ wx.showToast({
|
|
|
+ title: err.msg,
|
|
|
+ icon: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ wx.request({
|
|
|
+ url: `${app.globalData.publicUrl}/api/st/system/news`,
|
|
|
+ method: "get",
|
|
|
+ header: { 'x-tenant': 'test' },
|
|
|
+ data: { "type": '健康资讯' },
|
|
|
+ success: res => {
|
|
|
+ this.setData({ twoList: res.data.data })
|
|
|
+ },
|
|
|
+ error: err => {
|
|
|
+ wx.showToast({
|
|
|
+ title: err.msg,
|
|
|
+ icon: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|