小程序接口数据调用怎么使用,wx.request

接口:返回值说明code 				成功与否标志,1表示成功,2表示失败message 			说明data				返回数据	data.teacher		导师信息	data.teacher.id		导师id	data.teacher.teacher_name 导师名称data.teacher.teacher_img	导师头像data.teacher.teacher_remark	导师说明data.teacher_lesson	导师课程列表data.teacher_lesson.id	课程iddata.teacher_lesson.lesson_name 课程名称data.teacher_lesson.lesson_img 课程图片data.teacher_lesson.lesson_alltime 课程时长data.teacher_lesson.viewCount	观看次数例{	"code": 1,	"message": "操作成功",	"data": {		"teacher": {			"0": "9",			"id": "9",			"1": "朱颖磊",			"teacher_name": "朱颖磊",			"2": "https://static.dazhao100.cn/pic/1514341463l440714795.jpg",			"teacher_img": "https://static.dazhao100.cn/pic/1514341463l440714795.jpg",			"3": "“POA行动力”联合发起人;POA高级促动师;多家著名机构签约双语讲师;曾任世界500强企业全球总部内部培训师;曾任世界500强企业区域经理及大客户经理",			"teacher_remark": "“POA行动力”联合发起人;POA高级促动师;多家著名机构签约双语讲师;曾任世界500强企业全球总部内部培训师;曾任世界500强企业区域经理及大客户经理"		},		"teacher_lesson": [{			"0": "10",			"id": "10",			"1": "打动了马云的面试术,到底是什么鬼?",			"lesson_name": "打动了马云的面试术,到底是什么鬼?",			"2": "https://static.dazhao100.cn/pic/1514294626l572118429.png",			"lesson_img": "https://static.dazhao100.cn/pic/1514294626l572118429.png",			"3": "57:01",			"lesson_alltime": "57:01",			"4": "0",			"viewCount": "0"		}]	}}
<view class="gerenxiangjie"><view class=""><image src='{{teacher_img}}'></image></view><view class="name"><text>{{teacher_name}}</text></view><view class="jieshao"><text>{{teacher_remark}}</text></view></view><view class="zuoping"><text>相关作品</text></view><block wx:for="{{kecheng}}" wx:for-item="item" wx:key="kecheng_key" ><navigator url="/pages/curriculum/show?id={{item.id}}"><view class="xianmu"><view class="xianmutx"><image src='{{item.teacher_img}}'></image></view><view class="xianmu-name"><text>{{item.teacher_name}}</text></view><view class="xianmu-biaoti"><text>{{item.lesson_name}}</text></view><view class="xianmu-ren"><text>{{item.viewCount}}人学过</text></view><view class="xianmu-sj"><text>时长:{{item.lesson_alltime}}</text></view><view class="xianmuimg"><image src="{{item.lesson_img}}"></image></view></view></navigator><view class='kb'></view></block><view class="xianmu"><view class="xianmutx"><image src='/image/5.png'></image></view><view class="xianmu-name"><text>朱颖磊</text></view><view class="xianmu-biaoti"><text>打动了马云的面试术,到底是什...</text></view><view class="xianmu-ren"><text>18人学过</text></view><view class="xianmu-sj"><text>时长:57:01</text></view><view class="xianmuimg"><image src="/image/crab.png"></image></view></view>


慕设计6413631
浏览 1350回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript