微信小程序实训day02-微信小程序项目环境搭建

 

1、申请微信小程序帐号

进入小程序注册页 根据指引填写信息和提交相应的资料,就可以拥有自己的小程序帐号。

在这个小程序管理平台,你可以管理你的小程序的权限,查看数据报表,发布小程序等操作。

登录 小程序后台 ,我们可以在菜单 “设置”-“开发设置” 看到小程序的 AppID 了 。

小程序的 AppID 相当于小程序平台的一个身份证,后续你会在很多地方要用到 AppID (注意这里要区别于服务号或订阅号的 AppID)。

有了小程序帐号之后,我们需要一个工具来开发小程序。

2、安装开发工具

前往 开发者工具下载页面 ,根据自己的操作系统下载对应的安装包进行安装,有关开发者工具更详细的介绍可以查看 《开发者工具介绍》 。

打开小程序开发者工具,用微信扫码登录开发者工具,准备开发你的第一个小程序吧!

3、你的第一个小程序

新建项目选择小程序项目,选择代码存放的硬盘路径,填入刚刚申请到的小程序的 AppID,给你的项目起一个好听的名字,最后,勾选 "创建 QuickStart 项目" (注意: 你要选择一个空的目录才会有这个选项),点击确定,你就得到了你的第一个小程序了,点击顶部菜单编译就可以在微信开发者工具中预览你的第一个小程序。

4、小程序代码构成

  1. json 后缀的 JSON 配置文件
  2. wxml 后缀的 WXML 模板文件
  3. wxss 后缀的 WXSS 样式文件
  4. js 后缀的 JS 脚本逻辑文件

5、小程序配置 app.json

app.json 是当前小程序的全局配置,包括了小程序的所有页面路径、界面表现、网络超时时间、底部 tab 等。QuickStart 项目里边的 app.json 配置内容如下:

{
  "pages":[
    "pages/index/index",
    "pages/logs/logs"
  ],
  "window":{
    "backgroundTextStyle":"light",
    "navigationBarBackgroundColor": "#fff",
    "navigationBarTitleText": "WeChat",
    "navigationBarTextStyle":"black"
  }
}

6、全局配置

小程序根目录下的 app.json 文件用来对微信小程序进行全局配置。文件内容为一个 JSON 对象,有以下属性:

属性类型必填描述最低版本
pagesstring[]页面路径列表 
windowObject全局的默认窗口表现 
tabBarObject底部 tab 栏的表现 
networkTimeoutObject网络超时时间 
debugboolean是否开启 debug 模式,默认关闭 
functionalPagesboolean是否启用插件功能页,默认关闭2.1.0
subpackagesObject[]分包结构配置1.7.3
workersstringWorker 代码放置的目录1.9.90
requiredBackgroundModesstring[]需要在后台使用的能力,如「音乐播放」 
pluginsObject使用到的插件1.9.6
preloadRuleObject分包预下载规则2.3.0
resizablebooleaniPad 小程序是否支持屏幕旋转,默认关闭2.3.0
navigateToMiniProgramAppIdListstring[]需要跳转的小程序列表,详见 wx.navigateToMiniProgram2.4.0
usingComponentsObject全局自定义组件配置开发者工具 1.02.1810190
permissionObject小程序接口权限相关设置微信客户端 7.0.0
sitemapLocationString指明 sitemap.json 的位置

7、微信小程序开发文档

微信小程序开发文档

8、作业

 1、骰子布局,把整个骰子布局做出来到页面上(flex布局)
 2、把小程序(底部导航功能等)完成,能在手机上看或能在开发者工具调试都可以

1、
index.html

<!DOCTYPE html>
<html>
<head>
	<title>骰子布局</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body style="background-color: black;width: 100%;height: 100%">
<h1 style="color: white;text-align: center;">骰子布局</h1>
<div style="display: flex ;flex-wrap: wrap;padding:5px">
	<div class="box1" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box2" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box3" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box4" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box5" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box6" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box7" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box8" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box9" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box10" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box11" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box12" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box13" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box14" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px" ></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px" class="box14dot2"></div>
	</div>
	<div class="box15" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px" ></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px" class="box15dot2"></div>
	</div>
	<div class="box16" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px" class="box16dot2"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px" class="box16dot3"></div>
	</div>
	<div class="box17" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;padding: 1px;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box18" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;padding: 1px;margin: 10px">
		<div class="box18column">
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		</div>
		<div class="box18column">
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		</div>
	</div>
	<div class="box19" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;padding: 1px;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box20" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;padding: 1px;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
	<div class="box21" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;padding: 1px;margin: 10px">
		<div class="box21row1">
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		</div>
		<div class="box21row2">
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px" ></div>
		</div>
		<div class="box21row3">
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
			<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		</div>
	</div>
	<div class="box22" style="background-color: white;height: 100px;width: 100px;border-radius: 10px ;padding: 1px;margin: 10px">
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
		<div style="background-color: black;height: 30px;width: 30px;border-radius: 100%;margin: 1px"></div>
	</div>
</div>
</body>
</html>

index.css

.box1{
	display: flex;
}
.box2{
	display: flex;
	justify-content: center;
}
.box3{
	display: flex;
	justify-content: flex-end;
}
.box4{
	display: flex;
	align-items: center;
}
.box5{
	display: flex;
	justify-content: center;
	align-items: center;
}
.box6{
	display: flex;
	justify-content: flex-end;
	align-items: center;
}
.box7{
	display: flex;
	align-items: flex-end;
}
.box8{
	display: flex;
	justify-content: center;
	align-items: flex-end;
}
.box9{
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
}
.box10{
	display: flex;
	justify-content: space-between;
}
.box11{
	display: flex;
	justify-content: space-between;
	flex-direction: column;
}
.box12{
	display: flex;
	justify-content: space-between;
	flex-direction: column;
	align-items: center;
}
.box13{
	display: flex;
	justify-content: space-between;
	flex-direction: column;
	align-items: flex-end;
}
.box14{
	display: flex;
}
.box14dot2{
	align-self: center;
}
.box15{
	display: flex;
	justify-content: space-between;
}
.box15dot2{
	align-self: flex-end;
}
.box16{
	display: flex;
}
.box16dot2{
	align-self: center;
}
.box16dot3{
	align-self: flex-end;
}
.box17{
	display: flex;
	flex-wrap: wrap;
	align-content: space-between;
	justify-content: flex-end;
}
.box18{
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
.box18column{
	display: flex;
	justify-content: space-between;
}
.box19{
	display: flex;
	flex-wrap: wrap;
	align-content: space-between;
}
.box20{
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	align-content: space-between;
}
.box21{
	display: flex;
	flex-wrap: wrap;
}
.box21row1{
	display: flex;
	flex-basis: 100%;
}
.box21row2{
	display: flex;
	flex-basis: 100%;
	justify-content: center;
}
.box21row3{
	display: flex;
	flex-basis: 100%;
	justify-content: space-between;
}
.box22{
	display: flex;
	flex-wrap: wrap;
}

2、

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip软件工程实践案例分析+报告(微信小程序+mysql数据库+web后台管理).zip
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值