微信小程序(json文件作用、WXML模板、宿主环境、通信模型、运行机制、常用组件、宿主API、协同工作和发布)

简介

黑马程序员视频学习记录

视频链接:黑马程序员前端微信小程序开发教程,微信小程序从基础到发布全流程_企业级商城实战




———— json文件的作用 ————

image-20230312163713179

1. app.json

image-20230312163903890

2. project.config.json

image-20230312164034871

3. sitemap.json

image-20230312164353605

4. 页面.json配置文件

image-20230312164636333

5. 新建页面

image-20230312165341334

6. 修改首页

image-20230312165429552

———— WXML模板 ————

1. WXML和HTML的区别

image-20230312165540272

2. WXSS和CSS的区别

image-20230312165756525

3. JS逻辑交互

image-20230312165932610

———— 宿主环境 ————

1. 简介

image-20230312170014677

2. 小程序的宿主环境

image-20230312170056820

3. 小程序宿主环境包含的内容

image-20230312170116487

———— 通信模型 ————

1. 通信的主体

image-20230312170153228

2. 小程序的通信模型

image-20230312170230471

———— 运行机制 ————

1. 小程序启动的过程

image-20230312170328680

2. 页面的渲染过程

image-20230312170356493

———— 常用视图容器类组件 ————

  • 组件分类
image-20230312170450560 image-20230312170535573

1. view

image-20230312170557544
<!--pages/list/list.wxml-->
<view class="container1">
  <view>A</view>
  <view>B</view>
  <view>C</view>
</view>
/* pages/list/list.wxss */
.container1 view{
  width: 100px;
  height: 100px;
  text-align: center;
  line-height: 100px;
}

.container1 view:nth-child(1){
  background-color: lightgreen;
}
.container1 view:nth-child(2){
  background-color: lightskyblue;
}
.container1 view:nth-child(3){
  background-color: lightpink;
}

.container1 { 
  display: flex;
  justify-content: space-around;
}

2. scroll-view

image-20230312171156387
<!--pages/list/list.wxml-->
<scroll-view class="container1" scroll-y>
  <view>A</view>
  <view>B</view>
  <view>C</view>
</scroll-view>

/* pages/list/list.wxss */
.container1 view{
  width: 100px;
  height: 100px;
  text-align: center;
  line-height: 100px;
}

.container1 view:nth-child(1){
  background-color: lightgreen;
}
.container1 view:nth-child(2){
  background-color: lightskyblue;
}
.container1 view:nth-child(3){
  background-color: lightpink;
}

.container1 { 
  border: 1px solid red;
  width: 100px;
  height: 120px;
}

3. swiper和swiper-item

image-20230312171530025
<!-- 轮播图的结构 -->
<swiper class="swiper-container">
  <!-- 第一个轮播图 -->
  <swiper-item>
    <view class="item">
      A
    </view>
  </swiper-item>
  <!-- 第二个轮播图 -->
  <swiper-item>
    <view class="item">
      B
    </view>
  </swiper-item>
  <!-- 第三个轮播图 -->
  <swiper-item>
    <view class="item">
      C
    </view>
  </swiper-item>
</swiper>
/* 轮播图样式 */
.swiper-container{
  height: 150px;
}

.item{
  height: 100%;
  line-height: 150px;
  text-align: center;
}

swiper-item:nth-child(1) .item{
  background-color: lightgreen;
}
swiper-item:nth-child(2) .item{
  background-color: lightskyblue;
}
swiper-item:nth-child(3) .item{
  background-color: lightpink;
}

4. swiper

image-20230312172240958
<!-- 轮播图的结构 -->
<swiper class="swiper-container" 
        indicator-dots 
        indicator-color="white" 
        indicator-active-color="gray" 
        autoplay interval="2000" 
        circular>
  <!-- 第一个轮播图 -->
  <swiper-item>
    <view class="item">
      A
    </view>
  </swiper-item>
  <!-- 第二个轮播图 -->
  <swiper-item>
    <view class="item">
      B
    </view>
  </swiper-item>
  <!-- 第三个轮播图 -->
  <swiper-item>
    <view class="item">
      C
    </view>
  </swiper-item>
</swiper>

———— 常用基础内容组件 ————

image-20230312172941745

1. text

<view>
  长按选中
  <text selectable>18161811111</text>
</view>

2. rich-text

<rich-text nodes="<h1 style='color: red;'>标题</h1>"></rich-text>

———— 其他常用组件 ————

image-20230312173516341

1. button

<!-- 通过 type 指定按钮类型 -->
<button>普通按钮</button>
<button type="primary">主色调按钮</button>
<button type="warn">警告按钮</button>

<!--  size="mini" 小尺寸按钮-->
<button size="mini">普通按钮</button>
<button type="primary" size="mini">主色调按钮</button>
<button type="warn" size="mini">警告按钮</button>

<!-- plain 镂空按钮 -->
<button size="mini" plain>普通按钮</button>
<button type="primary" size="mini" plain>主色调按钮</button>
<button type="warn" size="mini" plain>警告按钮</button>

2 . image

image-20230312174640553
<!-- image 图片组件 -->
<image></image> 
<image src="/images/1.png" mode="heightFix"></image>

———— 小程序的宿主环境API ————

1. 概述

image-20230312174941494

2. 分类

image-20230312175102453

———— 协同工作和发布 ————

1. 协同工作

image-20230312175246060

2. 项目成员组织结构

image-20230312175311677

3. 开发流程

image-20230312175327409

4. 小程序成员管理

image-20230312175457165

5. 成员权限

image-20230312175530544

6. 开发者的权限说明

image-20230312175552830

7. 增加项目成员的体验成员

image-20230312175727686

8. 程序的版本

image-20230312175759385 image-20230312175806438

9. 发布上线

image-20230312175841853 image-20230312175906920 image-20230312175920456 image-20230312175942632 image-20230312175952999

10. 基于小程序码进行推广

image-20230312180318505

11. 运营数据

image-20230312180647449

———— 总结 ————

image-20230312181012496
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Kaiyue.zhao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值