前端-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 对象

相关推荐
parade岁月31 分钟前
SolidJS 2.0 正式发布:异步成为响应式的一部分
前端
lcy_2443 分钟前
防抖节流、并发控制、指数退避重试——我把它收进了一个库 async-concurrency-kit
前端
程序员大阳1 小时前
副队长Vue3教程(5)--事件绑定 v-on
前端·javascript·vue.js·vue3·事件绑定·v-on
艾莉丝努力练剑1 小时前
【AI大模型接入SDK】C++的SessionManager 线程安全
java·开发语言·前端·c++·人工智能·学习·安全
泯泷1 小时前
Vercel AI SDK 6 完整教程系列 - 第二部分:结构化数据与工具调用
前端·javascript
OpenTiny社区3 小时前
我用Vue 100%复制DeepSeek开源的网页App,代码更少,功能还更多!
前端·vue.js·github
MyBili3 小时前
Chrome开发者工具入门:从看懂页面到高效调试
前端·chrome·谷歌浏览器·开发工具·chrome devtools·网页调式·网络请求分析
云起SAAS3 小时前
手机靓号选号商城H5源码 完整前后台可直接运行
前端·javascript·后端
code2cat3 小时前
JavaScript编程篇之异步请求:切换到待办,为什么又显示了全部任务
前端·javascript
Moment4 小时前
RSI 是怎样让 AI 改进自己的 ❓❓❓
前端·后端·面试