前端-uniapp-开发指南

美团外卖微信小程序开发

uni-app框架调用https接口

开发小程序

提高vue技术

前端技术

课程需要具备vue基础知识

uniapp-美团外卖微信小程序开发

P1 成果展示




nodejs 后台

P2外卖小程序后端,学习给小程序写http接口


P3 主界面配置

uniapp 小程序 vue

新建界面

添加配置

资源文件

底部导航栏

拾色器

P4 首页组件拆分

P13 外卖列表布局

筛选组件

  • 发生事件穿透

商家 布局

  • 引进子组件

    复制代码
      import Take from './components/takeout.vue'
       
      export default {
      	components:{
      		Take
      	},
复制代码
<template>
  <view>
	<block v-for="(item,index) in  shoperlist"  :key="index">
		<view class="content-view">
			<view class="content_img">
				<image :src="item.logo" mode="aspectFill"></image>
			</view>
			
			<view class="content_title">
				<text class="content_shoper">{{item.shoper}}</text>
				<view class="content_result">
					<text>月销售{{1}}</text>
					<text>距您约{{item.duration}}分钟</text>
				</view>
				<view class="content_end"> 
					<image src=""></image>
					<text>{{item.types}}</text>
				</view>
			</view>
		</view>
	
	</block>
  </view>
</template>

测试数据

  • 写死数据 数组对象
    https://www.bilibili.com/video/BV1Zt4y117RR?p=13\&vd_source=f21773b7086456ae21a58a6cc59023be

创建样式

复制代码
.content-view text{display: block;}
.content-view{display: flex;
justify-content: space-between;
height: 200upx !important;
overflow: hidden;
border-bottom: 1rpx solid #E4E8EB;
padding-bottom: 5upx;
margin: 30upx 0;
color: #898989;}

.content_img{
	width: 350upx !important;
	height: 200upx !important;
}


.content_img image{
	width: 100%;
	height: 100%;
	border-radius: 10upx;
}

.content_title{
	width: 100%;
	padding-left: 10upx;
	font-size: 24upx;
}

.content_shoper{
	color: #333333;
	height: 50upx;
	font-size: 33upx;
	font-weight: bold;
	line-height: 50upx;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	overflow: hidden;
}

.content_result{
	display: flex;
	justify-content: space-between;
	height: 50upx;
	line-height: 50upx;
}

.content_end{
	display: flex;
	align-items: center;
	height: 50upx;
	line-height: 50upx;
}

.content_end text {width: 130upx;}
.content_end image {width: 24upx; height: 24upx;
padding-right: 10upx;}

<style scoped>
	@import '../../../common/css/take.css'
</style>

请求商家外卖数据

封装请求

父页面引入

并发请求

同时并发请求 多个接口,同时得到 多个接口数据



object 对象

相关推荐
禅思院12 分钟前
路由性能高可用架构实战方案
前端·架构·前端框架
IT_陈寒29 分钟前
React状态更新总是不及时?你可能漏了这步批处理机制
前端·人工智能·后端
恋猫de小郭38 分钟前
AI Agent 开发究竟是啥?如何用 AI 开发 Agent ?深入浅出给你一套概念
android·前端·ai编程
前端双越老师41 分钟前
我开发 AI Agent 项目踩过的 5个坑
前端·agent·全栈
晓得迷路了1 小时前
栗子前端技术周刊第 134 期 - React Router v8、TypeScript 7 RC、React Native 0.86...
前端·javascript·react.js
Carson带你学Android1 小时前
Android 17 正式发布:AI 终于成了系统能力
android·前端·ai编程
Mike_jia1 小时前
ZbxTable:Zabbix开源报表神器,从运维数据到决策洞察的最后一公里
前端
LinXunFeng10 小时前
Obsidian - 使用 Share Note 分享笔记并自部署
前端·笔记·github
乘风gg14 小时前
为什么AI 时代来临,大部分人吃不到红利
前端·ai编程·claude
恋猫de小郭14 小时前
Android 限制侧载新进展,谷歌联合国内厂商推验证计划
android·前端·flutter