迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
新闻的我看index.js代码得知他是通过
var app = getApp(); var http_url = app.globalData.http_api + "&function=dr_my_list¶m=list action=module catid=8 module=news num=2";
调用出来的,我把var 这段复制,并改为case,那结果就全部显示为case,而没有新闻。
请问我是哪里错了,需要修改哪一块才能实现,调用出新闻2条,case下的案例2条呢?
var http_url = app.globalData.http_api + "&function=dr_my_list¶m=list action=module module=case num=2";
var app = getApp(); var http_url = app.globalData.http_api + "&function=dr_my_list¶m=list action=module catid=8 module=news num=2"; var http_url2 = app.globalData.http_api + "&function=dr_my_list¶m=list action=module catid=9 module=case num=2"; Page({ /** * 页面的初始数据 */ data: { sdData: [], fabuData: [], banners: [ '../../images/20180822105245.jpg', '../../images/20180822154422.jpg', ], icons: [ { icon: '../../images/i1.jpg', name: '会员中心', url: '../member/my', }, { icon: '../../images/i2.jpg', name: '钱包', url: '../news/list', }, { icon: '../../images/i4.jpg', name: '创意', url: '../member/favorite', }, { icon: '../../images/i3.jpg', name: '应用', url: '../member/comment', } ], }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { app.showModel(); var self = this; wx.request({ url: http_url, method: 'GET', success: function (res) { wx.hideLoading(); if (res.data.code == 1) { self.setData({ fabuData: res.data.return, }); } } }); }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { app.showModel(); var self = this; wx.request({ url: http_url2, method: 'GET', success: function (res) { wx.hideLoading(); if (res.data.code == 1) { self.setData({ fabuData: res.data.return, }); } } }); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })
<view class="index-row"> <view class="index-row-index">最新案例</view> <view class="fabu-row"> <block wx:for="{{fabuData}}" wx:for-item="case"> <navigator url="../case/show?id={{case.id}}"> <view class="news-view"> <image class='news-thumb' src="{{case.thumb}}" wx:if="{{case.thumb!=''}}"/> <view class="news-title"> {{case.title}} </view> </view> </navigator> </block> </view> </view> <view class="index-row"> <view class="index-row-index">最新新闻</view> <view class="fabu-row"> <block wx:for="{{fabuData}}" wx:for-item="news"> <navigator url="../news/show?id={{news.id}}"> <view class="news-view"> <image class='news-thumb' src="{{news.thumb}}" wx:if="{{news.thumb!=''}}"/> <view class="news-title"> {{news.title}} </view> </view> </navigator> </block> </view> </view>
诚接二开/定制/使用解答我就是那么写的,也有加上,但是首页要么就是不显示,要么就是全news,要么就是全case的数据
wxml页