PBcms的PJAX开发记录

2023-09-11 0 1,024

首先要记录的就是产品列表的返回格式,官方获取内容列表的文档如下:

10、指定内容列表接口
http://IP/api.php/list/* 此处传递需要调用的栏目scode
http://IP/api.php/list/*/page/2 调取第二页,如果数据已获取完,返回类似{“code”:0,”data”:”已经到底了!”,”rowtotal”:”5″}
同时还支持URL中传递num/*参数控制数量,传递order/* 控制排序方式,用POST方式会更好传递值

其返回的时json数据,数据示例如下:

{"code":1,
	"data":[
	{
	"id":"40",//内容ID
	"acode":"cn",//内容所属站点语言
	"scode":"15",//分类ID
	"subscode":"",//副栏目ID
	"title":"产品内容识别一下吧",//内容标题
	"titlecolor":"#333333",//标题颜色,基本用不上
	"subtitle":"",//副标题
	"filename":"",
	"author":"超级管理员",//内容作者
	"source":"本站",//内容来源
	"outlink":"",//内容跳转到连接,注意这里不是分类的跳转连接
	"date":"2023-07-19 17:31:24",//内容发布日期
	"ico":"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094527833.jpg",//内容的缩略图
	"pics":"",//内容多图
    "content":"<p><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094527833.jpg\"\/><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094529877.jpg\"\/><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094524663.jpg\"\/><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094525825.jpg\"\/><\/p>",//内容内容
	"tags":"",//内容标签
	"enclosure":"",
	"keywords":"",//内容关键字
    "description":"您好,感谢您选择NICE源码网(niceym.com,以下简称NICE源码)的原创模板,这里的内容填充为统一的文字填充,它与本模板的行业不相干,仅供您查看模板的效果,在您下载使用本模板时,请您通过后台将产品内容、新闻内容替换为您自己的内容。 2023年,NICE源码成立了一个官方模板小组,专业从事网站模板的设计",//内容描述
	"sorting":"255",//内容排序
	"status":"1",//
	"istop":"0",//是否置顶 1为置顶
	"isrecommend":"0",//是否推荐 1为推荐
	"isheadline":"0",
	"visits":"1",
	"likes":0,//喜欢内容数量
	"oppose":0,
	"create_user":"admin",//发布者账号
	"update_user":"admin",//上传者账号
	"create_time":"2023-07-19 17:31:59",//发布的时间
	"update_time":" 2023-08-02 16:31:50",//更新的时间
	"gtype":"4",
	"gid":"0",
	"gnote":"",
	"picstitle":"",
	"sortname":"企业及大型办公",//分类名称
	"sortfilename":"",
	"subsortname":null,
	"type":"2",
	"modelname":"产品",//产品模型
	"urlname":"list",//内容链接URL
	"extid":"9",
	"contentid":"40",//内容ID
	"ext_price":"2333",//ext_开头的是自定义模型字段,这个因人而异
	"ext_type":null,
	"ext_color":null,
	"ext_zprs":null,
	"ext_gzcs":null,
	"ext_zdzd":null,
	"ext_biaoqian":"最新",
	"apilink":"\/api.php?p=\/content\/40",//内容链接
	"likeslink":"\/api.php?p=\/home\/Do\/likes\/id\/40",
	"opposelink":"\/api.php?p=\/home\/Do\/oppose\/id\/40",
	"contentlink":"\/?list_15\/40.html"//内容链接
	},
	
	{"id":"39","acode":"cn","scode":"15","subscode":"","title":"产品内容","titlecolor":"#333333","subtitle":"","filename":"","author":"超级管理员","source":"本站","outlink":"","date":"2023-07-19 17:31:24","ico":"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094527833.jpg","pics":"","content":"<p><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094527833.jpg\"\/><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094529877.jpg\"\/><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094524663.jpg\"\/><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094525825.jpg\"\/><\/p>","tags":"","enclosure":"","keywords":"","description":"您好,感谢您选择NICE源码网(niceym.com,以下简称NICE源码)的原创模板,这里的内容填充为统一的文字填充,它与本模板的行业不相干,仅供您查看模板的效果,在您下载使用本模板时,请您通过后台将产品内容、新闻内容替换为您自己的内容。 2023年,NICE源码成立了一个官方模板小组,专业从事网站模板的设计","sorting":"255","status":"1","istop":"0","isrecommend":"0","isheadline":"0","visits":"1","likes":0,"oppose":0,"create_user":"admin","update_user":"admin","create_time":"2023-07-19 17:31:59","update_time":" 2023-08-02 16:31:37","gtype":"4","gid":"0","gnote":"","picstitle":"","sortname":"企业及大型办公","sortfilename":"","subsortname":null,"type":"2","modelname":"产品","urlname":"list","extid":null,"contentid":null,"ext_price":null,"ext_type":null,"ext_color":null,"ext_zprs":null,"ext_gzcs":null,"ext_zdzd":null,"ext_biaoqian":null,"apilink":"\/api.php?p=\/content\/39","likeslink":"\/api.php?p=\/home\/Do\/likes\/id\/39","opposelink":"\/api.php?p=\/home\/Do\/oppose\/id\/39","contentlink":"\/?list_15\/39.html"},
	
	{"id":"38","acode":"cn","scode":"15","subscode":"","title":"产品内容","titlecolor":"#333333","subtitle":"","filename":"","author":"超级管理员","source":"本站","outlink":"","date":"2023-07-19 17:31:24","ico":"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094527833.jpg","pics":"","content":"<p><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094527833.jpg\"\/><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094529877.jpg\"\/><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094524663.jpg\"\/><img src=\"https:\/\/www.niceym.com\/wp-content\/uploads\/2023\/07\/20230719094525825.jpg\"\/><\/p>","tags":"","enclosure":"","keywords":"","description":"您好,感谢您选择NICE源码网(niceym.com,以下简称NICE源码)的原创模板,这里的内容填充为统一的文字填充,它与本模板的行业不相干,仅供您查看模板的效果,在您下载使用本模板时,请您通过后台将产品内容、新闻内容替换为您自己的内容。 2023年,NICE源码成立了一个官方模板小组,专业从事网站模板的设计","sorting":"255","status":"1","istop":"0","isrecommend":"0","isheadline":"0","visits":0,"likes":0,"oppose":0,"create_user":"admin","update_user":"admin","create_time":"2023-07-19 17:31:59","update_time":" 2023-08-02 16:31:37","gtype":"4","gid":"0","gnote":"","picstitle":"","sortname":"企业及大型办公","sortfilename":"","subsortname":null,"type":"2","modelname":"产品","urlname":"list","extid":null,"contentid":null,"ext_price":null,"ext_type":null,"ext_color":null,"ext_zprs":null,"ext_gzcs":null,"ext_zdzd":null,"ext_biaoqian":null,"apilink":"\/api.php?p=\/content\/38","likeslink":"\/api.php?p=\/home\/Do\/likes\/id\/38","opposelink":"\/api.php?p=\/home\/Do\/oppose\/id\/38","contentlink":"\/?list_15\/38.html"},
	
	],
    "tourl":"",//这是分类的跳转链接,请区分开内容分的跳转链接
    "rowtotal":22//这里是该列表下的总内容数量,可以用于判断分页。
}


 

免责声明:
1、本网站所有发布的源码、软件和资料均为收集各大资源网站整理而来;仅限用于学习和研究目的,您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。 不得使用于非法商业用途,不得违反国家法律。否则后果自负!

2、本站信息来自网络,版权争议与本站无关。一切关于该资源商业行为与www.niceym.com无关。
如果您喜欢该程序,请支持正版源码、软件,购买注册,得到更好的正版服务。
如有侵犯你版权的,请邮件与我们联系处理(邮箱:skknet@qq.com),本站将立即改正。

NICE源码网 个人笔记 PBcms的PJAX开发记录 https://www.niceym.com/64053.html

发表评论
暂无评论