【微信小程序】6天精准入门(第3天:小程序flex布局、轮播图组件及mock运用以及综合案例)附源码

news2025/7/19 6:46:44

一、flex布局

布局的传统解决方案,基于[盒状模型],依赖display属性 + position属性 + float属性

1、什么是flex布局?

  1. Flex是Flexible Box的缩写,意为”弹性布局”,用来为盒状模型提供最大的灵活性。
  2. 任何一个容器都可以指定为Flex布局。
  3. display: ‘flex’

        容器默认存在两根轴:水平的主轴(main axis)和垂直的交叉轴(cross axis)

  • 主轴的开始位置(与边框的交叉点)叫做main start,结束位置叫做main end;
  • 交叉轴的开始位置叫做cross start,结束位置叫做cross end。

        项目默认沿主轴排列。单个项目占据的主轴空间叫做main size,占据的交叉轴空间叫做cross size。

2、flex属性

属性作用
flex-direction主轴的方向  默认为row
flex-wrap如果一条轴线排不下,如何换行
flex-flow是flex-direction属性和flex-wrap属性的简写形式
justify-content定义了项目在主轴上的对齐方式
align-items定义项目在交叉轴上如何对齐
align-content属性定义了多根轴线的对齐方式

【注意】设为Flex布局以后,子元素的float、clear和vertical-align属性将失效。

  • flex-direction 定义了子元素在主轴(沿着容器的主轴线)上的排列方式。它包括以下几个值:

    • row(默认值):子元素在主轴上从左往右排列。
    • row-reverse:子元素在主轴上从右往左排列。
    • column:子元素在主轴上从上往下排列。
    • column-reverse:子元素在主轴上从下往上排列。
  • flex-wrap 定义了子元素在容器宽度不足时如何换行。它包括以下几个值:

    • nowrap(默认值):子元素不换行,超出容器宽度部分会被压缩。
    • wrap:子元素按行换行,超出容器宽度的子元素会移动到下一行。
    • wrap-reverse:子元素按行反向换行,超出容器宽度的子元素会从下一行开始排列。
  • flex-flow 是 flex-direction 和 flex-wrap 两个属性的简写形式。它包含两个值,以空格分隔:

    • flex-direction 的值(默认为 row)。
    • flex-wrap 的值(默认为 nowrap)。
  • justify-content 定义了子元素在主轴上的对齐方式。它包括以下几个值:

    • flex-start(默认值):子元素靠容器的起始边排列。
    • flex-end:子元素靠容器的末尾边排列。
    • center:子元素在容器的主轴上居中排列。
    • space-between:子元素均匀分布在容器上,首个子元素在起始边,末尾子元素在末尾边。
    • space-around:子元素均匀分布在容器上,子元素之间有空白间隔。
  • align-items 定义了子元素在交叉轴(与主轴垂直的轴线)上的对齐方式。它包括以下几个值:

    • stretch(默认值):子元素拉伸以填满交叉轴。
    • flex-start:子元素靠交叉轴的起始边对齐。
    • flex-end:子元素靠交叉轴的末尾边对齐。
    • center:子元素在容器的交叉轴上居中对齐。
    • baseline:子元素根据它们的基线对齐。
  • align-content 定义了多行子元素在交叉轴上的对齐方式。它只在有多行子元素的情况下生效,包括以下几个值:

    • stretch(默认值):多行子元素拉伸以填满交叉轴。
    • flex-start:多行子元素靠交叉轴的起始边对齐。
    • flex-end:多行子元素靠交叉轴的末尾边对齐。
    • center:多行子元素在容器的交叉轴上居中对齐。
    • space-between:多行子元素均匀分布在容器上,首行在起始边,末行在末尾边。
    • space-around:多行子元素均匀分布在容器上,各行之间有空白间隔。

更多实例需要自己进行测试,更详情的可以查看官网AIP小程序配置 | 微信开放文档,或者查看Flex 布局语法教程 | 菜鸟教程 (runoob.com)

二、综合案例

1、swiper

1.1、通用属性

属性类型默认值必填说明最低版本
indicator-dotsbooleanfalse是否显示面板指示点1.0.0
indicator-colorcolorrgba(0, 0, 0, .3)指示点颜色1.1.0
indicator-active-colorcolor#000000当前选中的指示点颜色1.1.0
autoplaybooleanfalse是否自动切换1.0.0
currentnumber0当前所在滑块的 index1.0.0
intervalnumber5000自动切换时间间隔1.0.0
durationnumber500滑动动画时长1.0.0
circularbooleanfalse是否采用衔接滑动1.0.0
verticalbooleanfalse滑动方向是否为纵向1.0.0
display-multiple-itemsnumber1同时显示的滑块数量1.9.0
easing-functionstring"default"指定 swiper 切换缓动动画类型2.6.5
合法值说明
default默认缓动函数
linear线性动画
easeInCubic缓入动画
easeOutCubic缓出动画
easeInOutCubic缓入缓出动画
bindchangeeventhandlecurrent 改变时会触发 change 事件,event.detail = {current, source}1.0.0
bindtransitioneventhandleswiper-item 的位置发生改变时会触发 transition 事件,event.detail = {dx: dx, dy: dy}。Skyline 仅支持非 worklet 的组件方法作为回调。2.4.3
bindanimationfinisheventhandle动画结束时会触发 animationfinish 事件,event.detail 同上。Skyline 仅支持非 worklet 的组件方法作为回调。1.9.0

2、首页底部菜单

创建新的小程序项目之后,在app.json里面pages新建页面和绑定tabBer

app.json

{
    "pages": [
        "pages/index/index",
        "pages/meeting/list/list",
        "pages/vote/list/list",
        "pages/ucenter/index/index",
        "pages/logs/logs"
    ],
    "window": {
        "backgroundTextStyle": "light",
        "navigationBarBackgroundColor": "#fff",
        "navigationBarTitleText": "Weixin",
        "navigationBarTextStyle": "black"
    },
    "tabBar": {
        "list": [
            {
                "pagePath": "pages/index/index",
                "text": "首页",
                "iconPath": "/static/tabBar/coding.png",
                "selectedIconPath": "/static/tabBar/coding-active.png"
            },
            {
                "pagePath": "pages/meeting/list/list",
                "iconPath": "/static/tabBar/sdk.png",
                "selectedIconPath": "/static/tabBar/sdk-active.png",
                "text": "会议"
            },
            {
                "pagePath": "pages/vote/list/list",
                "iconPath": "/static/tabBar/template.png",
                "selectedIconPath": "/static/tabBar/template-active.png",
                "text": "投票"
            },
            {
                "pagePath": "pages/ucenter/index/index",
                "iconPath": "/static/tabBar/component.png",
                "selectedIconPath": "/static/tabBar/component-active.png",
                "text": "设置"
            }
        ]
    },
    "style": "v2",
    "sitemapLocation": "sitemap.json"
}

效果

3、首页内容搭建

3.1、创建后端结口

在你的项目里面创建一个文件config/api.js

// 以下是业务服务器API地址
 // 本机开发API地址
 var WxApiRoot = 'http://localhost:8080/demo/wx/';
 // 测试环境部署api地址
 // var WxApiRoot = 'http://192.168.0.101:8070/demo/wx/';
 // 线上平台api地址
 //var WxApiRoot = 'https://www.oa-mini.com/demo/wx/';
 
 module.exports = {
   IndexUrl: WxApiRoot + 'home/index', //首页数据接口
   SwiperImgs: WxApiRoot+'swiperImgs', //轮播图
   MettingInfos: WxApiRoot+'meeting/list', //会议信息
 };

3.2、Mock创建数据

液位我们没有连接到后台,所以我们可以利用小程序里面的Mock模拟一些假的数据。

利用我们的假数据放进7

{
  "data": {
    "images":[
  {
    "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner1.png",
    "text": "1"
  },
  {
    "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner2.png",
    "text": "2"
  },
  {
    "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner3.png",
    "text": "3"
  },
  {
    "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner4.png",
    "text": "4"
  },
  {
    "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner5.png",
    "text": "5"
  },
  {
    "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner6.png",
    "text": "6"
  }
]
  },
  "statusCode": "200",
  "header": {
    "content-type":"applicaiton/json;charset=utf-8"
  }
}

我们在主页编写方法测试

index.js

// index.js
// 获取应用实例
const app = getApp()
const api = require("../../config/api") 
Page({
  data: {
    imgSrcs:[]
   },
  // 事件处理函数
  bindViewTap() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
//   轮播图的方法
loadSwiperImgs(){
    let that=this;
    wx.request({
        url: api.SwiperImgs,
        dataType: 'json',
        success(res) {
          console.log(res)
          that.setData({
              imgSrcs:res.data.images
          })
        }
      })
  },
  onLoad() {
    if (wx.getUserProfile) {
      this.setData({
        canIUseGetUserProfile: true
      })
    }
    // 一进来就调用轮播图的方法
    this.loadSwiperImgs();
  },
  getUserProfile(e) {
    // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
    wx.getUserProfile({
      desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
      success: (res) => {
        console.log(res)
        this.setData({
          userInfo: res.userInfo,
          hasUserInfo: true
        })
      }
    })
  },
  getUserInfo(e) {
    // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息
    console.log(e)
    this.setData({
      userInfo: e.detail.userInfo,
      hasUserInfo: true
    })
  }
})

关键性的代码

const api = require("../../config/api") 

Page({
  data: {
    imgSrcs:[]
   },
//   轮播图的方法
loadSwiperImgs(){
    let that=this;
    wx.request({
        url: api.SwiperImgs,
        dataType: 'json',
        success(res) {
          console.log(res)
          that.setData({
              imgSrcs:res.data.images
          })
        }
      })
  },
  onLoad() {
    if (wx.getUserProfile) {
      this.setData({
        canIUseGetUserProfile: true
      })
    }
    // 一进来就调用轮播图的方法
    this.loadSwiperImgs();
  }
})

【注意】记得在这个位置把这个打开

我们编译之后查看编译器里打印的数据

3.3、建立轮播图

液位我们在前面已经建立了数据,所以我们在这里进行一个轮播图的的页面编写

<view>
    <swiper autoplay="true" indicator-dots="true" indicator-color="#fff" indicator-active-color="#00f">
        <block wx:for="{{imgSrcs}}" wx:key="text">
            <swiper-item>
                <view>
                    <image src="{{item.img}}" class="swiper-item" />
                </view>
            </swiper-item>
        </block>
    </swiper>
</view>

3.4、案例--首页内容搭建

我们利用一个会议的案例进行一个内容的实例

在之前的基础上,创建首页调用的方法

    //首页内容
    loadMeetingInfos() {
        let that = this;
        wx.request({
            url: api.MettingInfos,
            dataType: 'json',
            success(res) {
                console.log(res)
                that.setData({
                    lists: res.data.lists
                })
            }
        })
    }

利用Mack模拟数据

JSON数据包

{
  "data": {
    "lists": [
        {
          "id": "1",
          "image": "/static/persons/1.jpg",
          "title": "对话产品总监 | 深圳·北京PM大会 【深度对话小米/京东/等产品总监】",
          "num":"304",
          "state":"进行中",
          "starttime": "2022-03-13 00:00:00",
          "location": "深圳市·南山区"
        },
        {
          "id": "1",
          "image": "/static/persons/2.jpg",
          "title": "AI WORLD 2016世界人工智能大会",
          "num":"380",
          "state":"已结束",
          "starttime": "2022-03-15 00:00:00",
          "location": "北京市·朝阳区"
        },
        {
          "id": "1",
          "image": "/static/persons/3.jpg",
          "title": "H100太空商业大会",
          "num":"500",
          "state":"进行中",
          "starttime": "2022-03-13 00:00:00",
          "location": "大连市"
        },
        {
          "id": "1",
          "image": "/static/persons/4.jpg",
          "title": "报名年度盛事,大咖云集!2016凤凰国际论坛邀您“与世界对话”",
          "num":"150",
          "state":"已结束",
          "starttime": "2022-03-13 00:00:00",
          "location": "北京市·朝阳区"
        },
        {
          "id": "1",
          "image": "/static/persons/5.jpg",
          "title": "新质生活 · 品质时代 2016消费升级创新大会",
          "num":"217",
          "state":"进行中",
          "starttime": "2022-03-13 00:00:00",
          "location": "北京市·朝阳区"
        }
      ]
  },
  "statusCode": "200",
  "header": {
    "content-type":"applicaiton/json;charset=utf-8"
  }
}

布局

<view class="indexbg">
    <swiper autoplay="true" indicator-dots="true" indicator-color="#fff" indicator-active-color="#00f">
        <block wx:for="{{imgSrcs}}" wx:key="text">
            <swiper-item>
                <view>
                    <image src="{{item.img}}" class="swiper-item" />
                </view>
            </swiper-item>
        </block>
    </swiper>
    <view class="mobi-title">
        <text class="mobi-icon">❤</text>
        <text class="mobi-text">会议信息</text>
    </view>
    <block wx:for-items="{{lists}}" wx:for-item="item" wx:key="item.id" class="bg">
        <view class="list" data-id="{{item.id}}">
            <view class="list-img">
                <image class="video-img" mode="scaleToFill" src="{{item.image}}"></image>
            </view>
            <view class="list-detail">
                <view class="list-title"><text>{{item.title}}</text></view>
                <view class="list-tag">
                    <view class="state">{{item.state}}</view>
                    <view class="join"><text class="list-num">{{item.num}}</text>人报名</view>
                </view>
                <view class="list-info"><text>{{item.location}}</text>|<text>{{item.starttime}}</text></view>
            </view>
        </view>
    </block>
    <view class="section">
        <text>到底啦</text>
    </view>
</view>

index.js

// index.js
// 获取应用实例
const app = getApp()
const api = require("../../config/api")
Page({
    data: {
        imgSrcs: [{
            "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner1.png",
            "text": "1"
        },
        {
            "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner2.png",
            "text": "2"
        },
        {
            "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner3.png",
            "text": "3"
        },
        {
            "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner4.png",
            "text": "4"
        },
        {
            "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner5.png",
            "text": "5"
        },
        {
            "img": "https://cdn-we-retail.ym.tencent.com/tsr/home/v2/banner6.png",
            "text": "6"
        }],
        "lists": [
            {
                "id": "1",
                "image": "/static/persons/1.jpg",
                "title": "对话产品总监 | 深圳·北京PM大会 【深度对话小米/京东/等产品总监】",
                "num": "304",
                "state": "进行中",
                "starttime": "2022-03-13 00:00:00",
                "location": "深圳市·南山区"
            },
            {
                "id": "1",
                "image": "/static/persons/2.jpg",
                "title": "AI WORLD 2016世界人工智能大会",
                "num": "380",
                "state": "已结束",
                "starttime": "2022-03-15 00:00:00",
                "location": "北京市·朝阳区"
            },
            {
                "id": "1",
                "image": "/static/persons/3.jpg",
                "title": "H100太空商业大会",
                "num": "500",
                "state": "进行中",
                "starttime": "2022-03-13 00:00:00",
                "location": "大连市"
            },
            {
                "id": "1",
                "image": "/static/persons/4.jpg",
                "title": "报名年度盛事,大咖云集!2016凤凰国际论坛邀您“与世界对话”",
                "num": "150",
                "state": "已结束",
                "starttime": "2022-03-13 00:00:00",
                "location": "北京市·朝阳区"
            },
            {
                "id": "1",
                "image": "/static/persons/5.jpg",
                "title": "新质生活 · 品质时代 2016消费升级创新大会",
                "num": "217",
                "state": "进行中",
                "starttime": "2022-03-13 00:00:00",
                "location": "北京市·朝阳区"
            }
        ]
    },
    // 事件处理函数
    bindViewTap() {
        wx.navigateTo({
            url: '../logs/logs'
        })
    },
    //   轮播图的方法
    loadSwiperImgs() {
        let that = this;
        wx.request({
            url: api.SwiperImgs,
            dataType: 'json',
            success(res) {
                console.log(res)
                that.setData({
                    imgSrcs: res.data.images
                })
            }
        })
    },
    //首页会议信息的ajax
    loadMeetingInfos() {
        let that = this;
        wx.request({
            url: api.MettingInfos,
            dataType: 'json',
            success(res) {
                console.log(res)
                that.setData({
                    lists: res.data.lists
                })
            }
        })
    },
    onLoad() {
        if (wx.getUserProfile) {
            this.setData({
                canIUseGetUserProfile: true
            })
        }
        // 一进来就调用轮播图的方法
        this.loadSwiperImgs();
    },
    getUserProfile(e) {
        // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
        wx.getUserProfile({
            desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
            success: (res) => {
                console.log(res)
                this.setData({
                    userInfo: res.userInfo,
                    hasUserInfo: true
                })
            }
        })
    },
    getUserInfo(e) {
        // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息
        console.log(e)
        this.setData({
            userInfo: e.detail.userInfo,
            hasUserInfo: true
        })
    }
})

wxss

/**index.wxss**/
.userinfo {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #aaa;
}

.userinfo-avatar {
    overflow: hidden;
    width: 128rpx;
    height: 128rpx;
    margin: 20rpx;
    border-radius: 50%;
}

.usermotto {
    margin-top: 200px;
}

/**index.wxss**/
.section {
    color: #aaa;
    display: flex;
    justify-content: center;
}

.list-info {
    color: #aaa;
}

.list-num {
    color: red;
    /* font-weight: 700; */
}

.join {
    padding: 0px 0px 0px 10px;
    color: #aaa;
}

.state {
    margin: 0px 6px 0px 6px;
    border: 1px solid #4083ff;
    color: #4083ff;
    padding: 3px 5px 3px 5px;
}

.list-tag {
    padding: 3px 0px 10px 0px;
    display: flex;
    align-items: center;
}

.list-title {
    display: flex;
    justify-content: space-between;
    font-size: 11pt;
    color: #333;
    font-weight: bold;


}

.list-detail {
    display: flex;
    flex-direction: column;
    margin: 0px 0px 0px 15px;
}

.video-img {
    width: 80px;
    height: 80px;
}

.list {
    display: flex;
    flex-direction: row;
    background-color: seashell;
    border-bottom: 1px solid #cecece;
    padding: 10px;
}

.mobi-text {
    font-weight: 700;
    padding: 15px;
}

/* .mobi-icon {
    border-left: 5px solid #57f564;
  } */
  .indexbg{
      background-color: rgba(219, 219, 219, 0.678);
  }

.mobi-title {
    /* background-color: rgba(219, 219, 219, 0.678); */
    margin: 10px 0px 10px 0px;
}

.swiper-item {
    height: 300rpx;
    width: 100%;
    border-radius: 10rpx;
}

.userinfo {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #aaa;
}

.userinfo-avatar {
    overflow: hidden;
    width: 128rpx;
    height: 128rpx;
    margin: 20rpx;
    border-radius: 50%;
}

.usermotto {
    margin-top: 200px;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1102721.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

基于五折交叉验证的支持向量机SVR回归预测研究(Matlab代码实现)

&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; &#x1f3c6;博主优势&#xff1a;&#x1f31e;&#x1f31e;&#x1f31e;博客内容尽量做到思维缜密&#xff0c;逻辑清晰&#xff0c;为了方便读者。 ⛳️座右铭&a…

七大排序 (9000字详解直接插入排序,希尔排序,选择排序,堆排序,冒泡排序,快速排序,归并排序)

一&#xff1a;排序的概念及引入 1.1 排序的概念 1.1 排序的概念 排序&#xff1a;所谓排序&#xff0c;就是使一串记录&#xff0c;按照其中的某个或某些关键字的大小&#xff0c;递增或递减的排列起来的操作。 稳定性&#xff1a;假定在待排序的记录序列中&#xff0c;存在…

[Python中常用的回归模型算法大全2:从线性回归到XGBoost]

文章目录 概要多输出K近邻回归集成算法回归梯度提升决策树回归随机森林回归 概要 回归分析在数据科学领域扮演着关键角色&#xff0c;用于预测数值型目标变量。本文深入探讨了几种常用的回归模型&#xff0c;包括多输出K近邻回归&#xff0c;决策树回归&#xff0c;集成算法回…

告别手动调节!iOS 17让你全自动调节音量大小,那么如何实现个性化音量呢

多亏了iOS 17&#xff0c;你的AirPods Pro 2现在具有个性化音量功能&#xff0c;可以根据周围环境智能调整音频音量。 这很酷&#xff0c;任何喜欢尽可能降低音量以避免听力受损的人都会对此表示赞赏。使用个性化音量&#xff0c;你的iPhone将检测音量何时可以降低&#xff0c…

MyBatisPlus-02

一 查询条件的三种 1.按条件查询 //方式一&#xff1a;按条件查询QueryWrapper qw new QueryWrapper();qw.lt("age",18);List<User> userList userDao.selectList(qw);System.out.println(userList); 2.lambda格式按条件查询 //方式二&#xff1a;lambda格…

【前端学习】—函数节流(九)

【前端学习】—函数节流&#xff08;九&#xff09; 一、什么是函数节流 函数节流&#xff1a;规定在一个单位时间内&#xff0c;事件响应函数只能被触发一次&#xff0c;如果这个单位时间内触发多次函数&#xff0c;只有一次生效。 二、函数节流使用场景 window.onresize事…

pytorch代码实现之动态蛇形卷积模块DySnakeConv

动态蛇形卷积模块DySnakeConv 血管、道路等拓扑管状结构的精确分割在各个领域都至关重要&#xff0c;确保下游任务的准确性和效率。 然而&#xff0c;许多因素使任务变得复杂&#xff0c;包括薄的局部结构和可变的全局形态。在这项工作中&#xff0c;我们注意到管状结构的特殊…

安达发|大多数离散型生产模式适用APS自动排程系统

在离散型生产模式中&#xff0c;智能生产排程软件&#xff08;APS&#xff09;的应用越来越广泛。这是因为APS能够根据实时的生产需求和资源状况&#xff0c;自动进行生产计划的制定和调整&#xff0c;从而提高生产效率&#xff0c;降低生产成本&#xff0c;保证生产的顺利进行…

美国股票和加密货币平台【Alpaca】完成1500万美元融资

来源&#xff1a;猛兽财经 作者&#xff1a;猛兽财经 猛兽财经获悉&#xff0c;总部位于美国加利福尼亚州圣马特奥的股票和加密交易经纪平台提供商&#xff0c;近期宣布已从SBI集团获得了1500万美元融资。 该公司打算利用这笔资金加快业务扩张&#xff0c;并将其业务范围扩大到…

iPaaS混合集成平台,打造数字化生态

如今企业分工越来越细&#xff0c;上下游合作越来越紧密、各企业之间的业务系统需要相互协作完成业务、外部API依赖越来越多、同时企业系统运行在多个混合云环境及SaaS中&#xff0c;私有端大量业务系统与云端系统形成了错综复杂的集成关系&#xff0c;企业面临集成技术复杂多样…

Springboot整合taos时序数据库TDengine

1.首先安装TDengine服务端在linux上 TDengine多种安装包的安装和卸载 - TDengine | 涛思数据安装过程直接去官网看,非常详细简单 2.出现的问题 windows连接 invalid app version 版本不对应 版本不对应的问题,需要在linux上安装的版本和windows client版本一致,不然w…

Kubernetes基础(六)-常见 Kubernetes Pod 驱逐场景

Kubernetes Pod 被驱逐是什么意思&#xff1f; 它们被终止&#xff0c;通常是没有足够资源的结果。但是为什么会这样呢&#xff1f; 驱逐是指派给节点的Pod 被终止的过程。 Kubernetes 中最常见的情况之一是Preemption&#xff0c;为了在资源有限的节点中调度新的 Pod&#…

安卓14通过“冻结”缓存应用程序腾出CPU,提高性能和内存效率

本月早些时候&#xff0c;我们听说更新到安卓14似乎提高了谷歌Pixel 7和Pixel 6的效率——提高了电池寿命&#xff0c;并在这个过程中减少了热量的产生。现在看来&#xff0c;安卓14的增效功能细节已经公布。 安卓侦探Mishaal Rahman在X&#xff08;前身为Twitter&#xff09;…

林沛满--快递员的工作策略——TCP窗口

本文整理自&#xff1a;《Wireshark网络分析就这么简单 第1版》 作者&#xff1a;林沛满 著 出版时间&#xff1a;2014-12 假如你是一位勤劳的快递员&#xff0c;要送100个包裹到某公司去&#xff0c;怎样送货才科学? 最简单的方式是每次送1个&#xff0c;总共跑100趟。当然这…

uCOSIII实时操作系统 八 软件定时器

目录 软件定时器概述 使用步骤&#xff1a; 创建软件定时器&#xff1a; 启动软件定时器&#xff1a; 停止软件定时器&#xff1a; 删除软件定时器&#xff1a; 单次定时器&#xff1a; ​编辑周期定时器&#xff1a; 无初始化延时&#xff1a; 有初始化延时&#xff…

LabVIEW中使用Get LV Class Default Value 出现错误1498

LabVIEW中使用Get LV Class Default Value 出现错误1498 在LabVIEW中开发了一个应用程序&#xff0c;其中包含可以在执行时动态配置插件的基类。生成可执行文件后&#xff0c;当应用程序要执行子类时&#xff0c;收到以下错误信息。 Error1498 occurred at Gen LV Class Defa…

Sandboxie+Buster Sandbox Analyzer打造个人沙箱

一、运行环境和需要安装的软件 实验环境&#xff1a;win7_x32或win7_x64 用到的软件&#xff1a;WinPcap_4_1_3.exe、Sandboxie-3-70.exe、Buster Sandbox Analyzer 重点是Sandboxie必须是3.70版本。下载地址&#xff1a;https://github.com/sandboxie-plus/sandboxie-old/blo…

Linux性能优化--使用性能工具发现问题

9.0 概述 本章主要介绍综合运用之前提出的性能工具来缩小性能问题产生原因的范围。阅读本章后&#xff0c;你将能够&#xff1a; 启动行为异常的系统&#xff0c;使用Linux性能工具追踪行为异常的内核函数或应用程序。启动行为异常的应用程序&#xff0c;使用Linux性能工具追…

浪子带你【25天】玩转Python——期中福利

人生苦短&#xff0c;我用Python! 目录 回顾上文 正文 最后的话 回顾上文 浪子带你【25天】玩转Python——5.面向对象编程&#xff08;类和对象&#xff09;-CSDN博客 正文 哈喽&#xff0c;不知不觉中&#xff0c;浪子的【25天】玩转Python已经开播13天啦&#xff01…

【c++智能指针】

目录 一、智能指针的使用及原理二、auto_ptr三、unique_ptr三、shared_ptr四、weak_ptr五、定制删除器 一、智能指针的使用及原理 RAII&#xff08;Resource Acquisition Is Initialization&#xff09;是一种利用对象生命周期来控制程序资源&#xff08;如内存、文件句柄、网…