微信小程序开发之投票管理及小程序UI的使用

news2024/10/1 23:34:36

目录

一、小程序UI

1.讲述

2. 介绍vantWeapp

3. 使用vantWeapp

安装

构建

依赖

引用

二、后端

1. 后端实体对象

2. 后端接口

3. 实现类

4. 请求处理类

三、前端

1. 定义路径

2. 页面引用

3. 页面

4. 页面美化

5. 数据

6. 效果展示


一、小程序UI

1.讲述

小程序UI(User Interface)是指小程序的用户界面,包括小程序的整体布局、样式、交互等方面的设计。小程序UI的设计目的是为了提供用户友好的界面,使用户能够方便地使用小程序的功能。

小程序UI的设计原则通常包括以下几点:

    1. 简洁明了:小程序的界面设计应该简洁明了,避免过多的视觉干扰和复杂的布局。用户可以通过一目了然的界面结构快速找到所需的功能。

    2. 一致性:小程序的不同页面之间应该保持一致的界面设计,包括颜色、字体、按钮等方面的统一。这样可以提高用户的学习和使用效率,减少用户的困惑。

    3. 易用性:小程序的界面设计应该考虑用户的使用习惯和心理需求,尽量减少用户的操作步骤和思考负担。例如,常用的功能应该放在显眼的位置,操作按钮应该易于点击等。

    4. 可访问性:小程序的界面设计应该考虑到不同用户的特殊需求,例如视力障碍者、听力障碍者等。设计师应该通过合适的颜色对比度、字体大小等方式来提高小程序的可访问性。

    5. 反馈机制:小程序的界面设计应该提供即时的反馈机制,告知用户他们的操作是否成功或失败。例如,可以通过动画、弹窗等方式来提示用户操作的结果。

小程序UI的设计通常由UI设计师负责,他们需要根据小程序的功能和定位进行界面设计,包括页面的布局、颜色的选择、图标的设计等。同时,他们还需要与开发人员密切合作,确保设计的界面能够被准确地实现。

2. 介绍vantWeapp

vantWeapp是一个基于微信小程序的组件库,是Vant组件库的小程序版本。它包括了常用的UI组件、业务组件和功能组件,可以帮助开发者快速构建出优秀的小程序页面。

vantWeapp的主要作用包括:

1. 提供常用UI组件:vantWeapp提供了丰富的UI组件,包括按钮、表单、列表、卡片、标签、导航、弹窗等,可以帮助开发者快速构建出美观、易用的小程序页面。

2. 提高开发效率:vantWeapp的组件具有可复用性,可以减少开发者的重复工作,提高开发效率。

3. 提供业务组件:vantWeapp还提供了一些常用的业务组件,例如地址选择器、城市选择器、日期选择器等,可以帮助开发者快速实现一些常用的业务需求。

4. 提供功能组件:vantWeapp还提供了一些功能组件,例如图片预览、下拉刷新、上拉加载等,可以帮助开发者实现一些常用的功能需求。

总之,vantWeapp是一个非常实用的小程序组件库,可以帮助开发者快速构建出美观、易用、功能丰富的小程序页面,提高开发效率,降低开发成本。

3. 使用vantWeapp

我们进入 vantWeapp 的官网进行快速上手 :   https://vant-contrib.gitee.io/vant-weapp/0.x/#/quickstarticon-default.png?t=N7T8https://vant-contrib.gitee.io/vant-weapp/0.x/#/quickstart

安装

在前端项目的跟路径中,打开CMD窗口,输入以下命令安装npm。

npm i vant-weapp -S --production

如图 : 

构建

打开微信开发者工具,点击 工具 -> 构建 npm,并勾选 使用 npm 模块 选项,构建完成后,即可引入组件

如图 : 

注 : 有些版本的开发工具是不需要勾选使用 npm 模块 选项的

依赖

在前端项目的跟路径中,打开CMD窗口,输入以下命令安装项目依赖。

npm install

如图 : 

引用

以 Button 组件为例,只需要在app.jsonindex.json中配置 Button 对应的路径即可。如果你是通过下载源代码的方式使用 vant-weapp,请将路径修改为项目中 vant-weapp 所在的目录。

例如 : 

{
    "navigationBarTitleText": "投票管理",
    "usingComponents": {
        "tabs":"/components/tabs/tabs",
        "van-button": "vant-weapp/button",
    }
}

引入组件后,可以在 wxml 中直接使用组件,如以下代码 :

<van-button type="default">默认按钮</van-button>
<van-button type="primary">主要按钮</van-button>
<van-button type="info">信息按钮</van-button>
<van-button type="warning">警告按钮</van-button>
<van-button type="danger">危险按钮</van-button>

效果图  :

二、后端

以下后端代码都是使用SpringMVCmybatis的技术学习,还有前后端分离的技术应用,在我博客中也信息的学习及技术,通过这些来完成后端的代码及功能的实现。如有不懂可以在我博客中自行学习,你肯定是技术大牛。

1.  后端实体对象

Vote : 投票

package com.CloudJun.ssm.model;

import lombok.Data;

@Data
public class Vote {
    private Integer id;

    private Integer meetingId;

    private String name;

    private String remark;

    private Integer state;

    private String images;

    public Vote(Integer id, Integer meetingId, String name, String remark, Integer state, String images) {
        this.id = id;
        this.meetingId = meetingId;
        this.name = name;
        this.remark = remark;
        this.state = state;
        this.images = images;
    }

    @Override
    public String toString() {
        return "Vote{" +
                "id=" + id +
                ", meetingId=" + meetingId +
                ", name='" + name + '\'' +
                ", remark='" + remark + '\'' +
                ", state=" + state +
                ", images='" + images + '\'' +
                '}';
    }
}

2. 后端接口

VoteMapper : 自动生成的对象接口

package com.CloudJun.ssm.mapper;

import com.CloudJun.ssm.model.Vote;

import java.util.List;

public interface VoteMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Vote record);

    int insertSelective(Vote record);

    Vote selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Vote record);

    int updateByPrimaryKey(Vote record);

    List<Vote> selectByList(Integer state);
}

VoteService : 自己为了实现方法创建的接口

package com.CloudJun.ssm.service;

import com.CloudJun.ssm.model.Vote;

import java.util.List;

/**
 * @author CloudJun
 * @create  2023-10-24 14:41
 */
public interface VoteService {

    int deleteByPrimaryKey(Integer id);

    int insert(Vote record);

    int insertSelective(Vote record);

    Vote selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Vote record);

    int updateByPrimaryKey(Vote record);

    List<Vote> selectByList(Integer state);

}

3. 实现类

VoteServiceimpl : 实现调用方法功能而创建的实现类

package com.CloudJun.ssm.service.impl;

import com.CloudJun.ssm.mapper.VoteMapper;
import com.CloudJun.ssm.model.Vote;
import com.CloudJun.ssm.service.VoteService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author CloudJun
 * @create  2023-10-24 14:42
 */
public class VoteServiceimpl implements VoteService {

    @Autowired
    private VoteMapper voteMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return voteMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Vote record) {
        return voteMapper.insert(record);
    }

    @Override
    public int insertSelective(Vote record) {
        return voteMapper.insertSelective(record);
    }

    @Override
    public Vote selectByPrimaryKey(Integer id) {
        return voteMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Vote record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(Vote record) {
        return 0;
    }

    @Override
    public List<Vote> selectByList(Integer state) {
        return voteMapper.selectByList(state);
    }
}

4. 请求处理类

VoteController : 处理前端发送的请求及处理数据,并且给予回馈数据到前端

package com.CloudJun.ssm.wxcontroller;

import com.CloudJun.ssm.mapper.VoteMapper;
import com.CloudJun.ssm.model.Info;
import com.CloudJun.ssm.model.Vote;
import com.CloudJun.ssm.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author CloudJun
 * @create  2023-10-24 14:24
 */
@RestController
@RequestMapping("/wx/vote")
public class VoteController {

    @Autowired
    private VoteMapper voteMapper;

    @RequestMapping("/add")
    public Object Add (Vote vote){
        int i = voteMapper.insertSelective(vote);
        return ResponseUtil.ok();
    }

    @RequestMapping("/list")
    public Object list (Integer state){
        List<Vote> votes = voteMapper.selectByList(state);
        return ResponseUtil.ok(votes);
    }

    @RequestMapping("/update")
    public Object update (Vote vote){
        int i = voteMapper.updateByPrimaryKey(vote);
        return ResponseUtil.ok();
    }




}

三、前端

以下的前端代码基于我博客中的进行扩写 : 微信小程序之微信授权登入及授权的流程讲解icon-default.png?t=N7T8https://blog.csdn.net/SAME_LOVE/article/details/133963879?spm=1001.2014.3001.5501

1 . 定义路径

在项目中的  api.js 文件里,配置后端请求数据的请求地址。

// 以下是业务服务器API地址
 // 本机开发API地址
var WxApiRoot = 'http://localhost:8080/oapro/wx/';
// 测试环境部署api地址
// var WxApiRoot = 'http://192.168.191.1:8080/oapro/wx/';
// 线上平台api地址
//var WxApiRoot = 'https://www.oa-mini.com/demo/wx/';

module.exports = {
  IndexUrl: WxApiRoot + 'home/index', //首页数据接口
  SwiperImgs: WxApiRoot+'swiperImgs',
  MettingInfos: WxApiRoot+'meeting/list',
  MettingVote : WxApiRoot+'info/list',
  MettingVoteAdd : WxApiRoot+'vote/add',//增加投票
  MettingVoteList : WxApiRoot+'vote/list',//获取投票信息
  MettingVoteupdate : WxApiRoot+'vote/update',//确认投票
  AuthLoginByWeixin: WxApiRoot + 'auth/login_by_weixin', //微信登录
  UserIndex: WxApiRoot + 'user/index', //个人页面用户相关信息
  AuthLogout: WxApiRoot + 'auth/logout', //账号登出
  AuthBindPhone: WxApiRoot + 'auth/bindPhone' //绑定微信手机号
};

2. 页面引用

在项目的投票管理页面中配置引用的组件及自定义组件,在.JSON文件中编写 :

list.json

{
    "navigationBarTitleText": "投票管理",
    "usingComponents": {
        "tabs":"/components/tabs/tabs",
        "van-button": "vant-weapp/button",
        "van-notice-bar": "vant-weapp/notice-bar/index",
        "van-toast": "vant-weapp/toast/index"
    }
}

3. 页面

在项目的投票管理页面中,进行编写页面标签,对数据进行显示,在.wxml文件中

list.wxml

<!--pages/vote/list/list.wxml-->
<tabs tabList="{{tabs}}"  bindtabsItemChange="tabsItemChange">
</tabs>
<view style="height: 100rpx;"></view>

<view class="{{componentStatus[0] ? '' : 'hidden'}}">
<!-- 发起投票版块 -->
<view class="publish">

<form bindsubmit='votesubmit'>
  <view class="img">
<view class="img_left" >
<image class="imgs"  src="{{imageUrl=='' ? '/static/persons/15.gif':imageUrl }}" mode="aspectFit" bindtap="handleUploadImage"></image>
<input hidden="true"  type="text" name="images" value="{{imageUrl}}" />
</view>
</view>
  <view class="meeting_id">
  <view class="meeting_title">所属会议 : </view>
  <picker bindchange="meetingChange" name="meetingId" value="{{array[meeting_id].id}}"    range-key="title" range="{{array}}">
    <view class="meeting_text" >{{array[meeting_id].title==null?'请选择会议':array[meeting_id].title}}</view>
  </picker>
</view>
<view class="meeting_id" id="meeting_id">
  <view class="meeting_title">投票标题 : </view>
   <input class="vote_text" placeholder="请输入标题" type="text" name="name" />
</view>
<view class="textarea" id="vote_text">
  <view class="meeting_textarea">投票说明 : </view>
   <textarea class="vote_textarea"  name="remark"  type="text" ></textarea>
</view>
<view class="vote_button">
  <button class="vote_button_empty" type="default" formType="reset"  plain="true">清空内容</button>
  <view style="width: 70rpx;"></view>
  <button class="vote_button_submit" type="primary" formType="submit" plain="true">确认发起</button>
</view>
</form>
</view>

</view>

  <view class="{{componentStatus[1] ? '' : 'hidden'}}">
    <van-notice-bar
  left-icon="flower-o"
  mode="closeable"
  color="#6d9d9e"
  delay="100"
  backgroundColor="#e4ecec"
  text="无论我们能活多久,我们能够享受的只有无法分割的此刻,不会回头,离弦的箭、逝去的生活和失去的机会。此外别无其他。"
/>
<!-- 已参与投票 -->
<block wx:for-items="{{engage}}" wx:for-item="item" wx:key="item.id">
<view class="vote_carryout">
<image class="vote_carryout_img" src="{{item.images}}"></image>
<view class="vote_carryout_text">
<view style="width: 450rpx;display: flex;flex-direction:column;">
<text class="vote_carryout_text_f" >{{item.name}}</text>
<text class="vote_carryout_text_t">{{item.remark}}</text>
</view>
<button class="vote_carryout_text_btn" bindtap="voteparticipate"  data-item="{{item.id}}"  size="mini">参与</button>
</view>
</view>
</block>


  </view>
  <view class="{{componentStatus[2] ? '' : 'hidden'}}">
  
    <van-notice-bar
  left-icon="flower-o"
  mode="closeable"
  color="#6d9d9e"
  delay="100"
  backgroundColor="#e4ecec"
  text="无论我们能活多久,我们能够享受的只有无法分割的此刻,不会回头,离弦的箭、逝去的生活和失去的机会。此外别无其他。"
/>
<!-- 未参与投票 -->
<block wx:for-items="{{not}}" wx:for-item="item" wx:key="item.id">
<view class="vote_carryout">
<image class="vote_carryout_img" src="{{item.images==null?'/static/persons/15.gif':item.images}}"></image>
<view class="vote_carryout_text">
<view style="width: 450rpx;display: flex;flex-direction:column;">
<text class="vote_carryout_text_f" >{{item.name}}</text>
<text class="vote_carryout_text_t">{{item.remark}}</text>
</view>
<button class="vote_carryout_text_btn" bindtap="Votenotbtn"  size="mini">已参与</button>
</view>
</view>
</block>
  
  </view>
  <view class="{{componentStatus[3] ? '' : 'hidden'}}">
  
    <van-notice-bar
  left-icon="flower-o"
  mode="closeable"
  color="#6d9d9e"
  delay="100"
  backgroundColor="#e4ecec"
  text="无论我们能活多久,我们能够享受的只有无法分割的此刻,不会回头,离弦的箭、逝去的生活和失去的机会。此外别无其他。"
/>
<!-- 未参与投票 -->
<block wx:for-items="{{lists}}" wx:for-item="item" wx:key="item.id">
<view class="vote_carryout">
<image class="vote_carryout_img" src="{{item.images==null?'/static/persons/15.gif':item.images}}"></image>
<view class="vote_carryout_text">
<view style="width: 450rpx;display: flex;flex-direction:column;">
<text class="vote_carryout_text_f" >{{item.name}}</text>
<text class="vote_carryout_text_t">{{item.remark}}</text>
</view>
<button class="vote_carryout_text_btn"  size="mini">{{item.state==0?'未参与':'已参与'}}</button>
</view>
</view>
</block>
 

  </view>

4. 页面美化

在项目的投票管理页面中,编写标签样式,对页面的美化,在.wxss文件中编写

list.wxss

/* pages/vote/list/list.wxss */
.hidden {
  display: none;
}

.img {
  height: 450rpx;
  /* display: flex; */
  /* border-radius: 6px; */
  /* align-items: center; */
}

.imgs {
  height: 420rpx;
  width: 419rpx;
  margin-left: 105rpx;
  box-shadow: 0 0 20px rgb(117, 241, 241);
  border-radius: 10rpx;
}

.img_left {
  margin-top: 28rpx;
  height: 450rpx;
  width: 600rpx;
  margin-left: 57rpx;
  /* border-radius: 23rpx; */
  /* background-color: deeppink; */
}

.publish {
  width: 100%;
}

.meeting_id {
  height: 100rpx;
  background-color: rgb(230, 243, 243);
  display: flex;
  /* border-radius: 6px; */
  align-items: center;
}

.meeting_title {
  margin-left: 20rpx;
}

.meeting_text {
  /* background-color: aqua; */
  margin-left: 20rpx;
  margin-top: 10rpx;
  padding-left: 20rpx;
  font-size: 14px;
  height: 50rpx;
  width: 520rpx;
}

#meeting_id {
  border-top: 2px solid #fafafa;
}

#vote_text {
  display: flex;
  align-items: center;
}

.vote_text {
  margin-left: 35rpx;
}

.meeting_textarea {
  margin-left: 20rpx;
  width: 440rpx;
}

.vote_textarea {
  height: 160rpx;
  width: 490px;
  padding-right: 10rpx;
  padding-top: 10rpx;
  padding-left: 10rpx;
  border: 2px solid #c0f0f1;
  border-radius: 20rpx;
}

.textarea {
  border-top: 2px solid #fafafa;
  background-color: rgb(238, 247, 247);
}

.vote_button {
  border-top: 4px solid #fafafa;
  display: flex;
  width: 80%;
  align-items: center;
  margin-left: 73rpx;
}
.vote_carryout{
  background-color: rgba(150, 250, 250, 0.315);
  box-shadow: 0 0 20px rgb(117, 241, 241);
  margin: 20rpx 30rpx 0rpx 70rpx;
  border-radius: 20rpx;
  height: 460rpx;
  width: 620rpx;
}
.vote_carryout_img{ 
  height: 350rpx;
  width: 620rpx;
  border-radius: 20rpx;
}
.vote_carryout_text{
display: flex;
height: 100rpx;
border-radius: 20rpx;
}
.vote_carryout_text_f{
  margin-left: 50rpx;
  height: 40rpx;
  font-size: 12px;
}
.vote_carryout_text_t{
  margin-left: 50rpx;
  height: 40rpx;
  color: rgba(116, 114, 114, 0.89);
  font-size: 12px;
}
.vote_carryout_text_btn{
  margin-top: 10rpx;
  height: 80rpx;
  font-size: 12px;
  size: 12px;
  background-color: rgb(174, 249, 252);
}

5. 数据

在项目的投票管理页面中,编写后台请求的数据进行回应到前端,在.js文件中

list.js

// pages/vote/list/list.js
var app = getApp();
const api = require('../../../config/api');
const util = require('../../../utils/util.js');
Page({
  /**
   * 页面的初始数据
   */
  data: {
    tabs: ['发起投票', '未参与', '已参与', '全部投票'],//顶部导航栏
    componentStatus: [true, false, false, false],//用于处理内容显示
    array: ['美国', '中国', '巴西', '日本'],
    engage:[],//未参与的投票
    not:[],//已参与的投票
    lists:[],//全部投票信息
    meeting_id: '请选择会议',
    imageUrl: '',//图片路径
    votename: '123'
  },
  //选择所属会议的事件
  meetingChange(e) {
    // console.log(e.detail.value) 
    this.setData({
      meeting_id: e.detail.value
    })
  },
  //初始会议信息
  meetingini() {
    util.request(api.MettingVote).then(res => {
      this.setData({
        array: res.data.infoList
      })
    }).catch(res => {
      console.log('服器没有开启,使用模拟数据!')
    })
  },
  //初始化未参与的投票
  Voteiniengage() {
    util.request(api.MettingVoteList,{state:0}).then(res => {
      // console.log(res);
      this.setData({
        engage: res.data
      })
    }).catch(res => {
      console.log('服器没有开启,使用模拟数据!')
    })
  },
    //初始化已参与的投票
    Voteininot() {
      util.request(api.MettingVoteList,{state:1}).then(res => {
        // console.log(res);
        this.setData({
          not: res.data
        })
      }).catch(res => {
        console.log('服器没有开启,使用模拟数据!')
      })
    },
    //初始化全部投票信息
    VoteiniList() {
      util.request(api.MettingVoteList).then(res => {
        // console.log(res);
        this.setData({
          lists: res.data
        })
      }).catch(res => {
        console.log('服器没有开启,使用模拟数据!')
      })
    },
    //参与投票的点击事件
    voteparticipate(id){
      // console.log(id.target.dataset.item)
      wx.showModal({
        title: '提示',
        content: '你是否要贡献出你宝贵的一票?',
        success: function (res) {
          if (res.confirm) {
            //这里是点击了确定以后
            util.request(api.MettingVoteupdate, {id:id.target.dataset.item}).then(res => {
              // console.log(res)
              if (res.errno == 0) {
                wx.showToast({
                  title: '成功投票!!',
                  icon: 'none',
                  duration: 1000//持续的时间
                })
              }
            }).catch(res => {
              console.log('服器没有开启,发布失败')
            })
          } else {//这里是点击了取消以后
            console.log('用户点击取消')
          }
        }
      })
    },
  //发起投票的事件
  votesubmit(data) {
    console.log(data.detail.value)
    wx.showModal({
      title: '提示',
      content: '确定发起该投票吗?',
      success: function (res) {
        if (res.confirm) {
          //这里是点击了确定以后
          util.request(api.MettingVoteAdd, data.detail.value).then(res => {
            // console.log(res)
            if (res.errno == 0) {
              wx.showToast({
                title: '发布投票成功',
                icon: 'none',
                duration: 1500//持续的时间
              })
            }
          }).catch(res => {
            console.log('服器没有开启,发布失败')
          })
        } else {//这里是点击了取消以后
          console.log('用户点击取消')
        }
      }
    })
  },
  //已参与按钮的点击事件
  Votenotbtn() {
    wx.showToast({
      title: '已进行投票,不可再投',
      icon: 'none',
      duration: 1000//持续的时间
    })
  },
  //图片选择器
  handleUploadImage() {
    wx.chooseImage({
      count: 1,
      success: (res) => {
        const imagePath = res.tempFilePaths[0];
        // 处理选择的图片路径
        // console.log('选择的图片路径:', imagePath);
        this.setData({
          imageUrl: imagePath // 更新图片路径,触发重新渲染
        });
      }
    });
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.meetingini();
    this.Voteiniengage();
    this.Voteininot();
    this.VoteiniList();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  },
  //点击导航栏进行切换下方内容
  tabsItemChange(e) {
    let index = e.detail.index;
    //全部的组件赋值为false
    const lists = [false, false, false, false];
    //将所点击的组件赋值为true
    lists[index] = true;
    this.setData({
      componentStatus: lists // 更新 data 中的 componentStatus 属性值
    });
  },
  // tabsItemChange(e){
  //     let index = e.detail.index;
  //     console.log('vote.index='+index)
  //     if(index==1 || index==2){
  //         if (app.globalData.hasLogin) {

  //         }else{
  //             wx.navigateTo({
  //               url: '/pages/auth/login/login',
  //             })
  //         }
  //     }
  // }
})

6. 效果展示

发起投票

参与投票

查看所有投票

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

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

相关文章

IMU预积分的过程详解

一、IMU和相机数据融合保证位姿的有效性&#xff1a; 当运动过快时&#xff0c;相机会出现运动模糊&#xff0c;或者两帧之间重叠区域太少以至于无法进行特征匹配&#xff0c;所以纯视觉SLAM对快速的运动很敏感。而有了IMU&#xff0c;即使在相机数据无效的那段时间内&#xff…

python网络爬虫实例

目录 1、访问百度 2、输入单词百度翻译 3、豆瓣电影排行榜 4、豆瓣电影top250 5、下载美女壁纸 1、访问百度 from urllib.request import urlopen url"http://www.baidu.com" respurlopen(url)with open("mybaidu.html",mode"w") as f:f.wr…

Java面试(JVM篇)——JVM 面试题合集 深入理解JVM虚拟机

关于什么是JVM&#xff1f; 作用&#xff1a; 运⾏并管理Java 源码⽂件所⽣成的Class⽂件&#xff0c;在不同的操作系统上安装不同的JVM &#xff0c;从⽽实现了跨平台的保证。 ⼀般情况下&#xff0c;对于开发者⽽⾔&#xff0c;即使不熟悉JVM 的运⾏机制并不影响业务代码的…

【Java 进阶篇】Java XML解析:从入门到精通

XML&#xff08;可扩展标记语言&#xff09;是一种常用的数据格式&#xff0c;用于存储和交换数据。在Java中&#xff0c;XML解析是一项重要的任务&#xff0c;它允许您从XML文档中提取和操作数据。本篇博客将从基础开始&#xff0c;详细介绍如何在Java中解析XML文档&#xff0…

进程中的权限是如何操作的

任何一个进程都有父进程。所以&#xff0c;整个进程其实就是一棵进程树。而拥有同一父进程的所有进程都具有兄弟关系。 struct task_struct __rcu *real_parent; /* real parent process */ struct task_struct __rcu *parent; /* recipient of SIGCHLD, wait4() reports */ s…

超市商品管理系统 JAVA语言设计实现

目录 一、系统介绍 二、系统下载 三、系统截图 一、系统介绍 基于VueSpringBootMySQL的超市商品管理系统&#xff0c;超市区域模块、超市货架模块、商品类型模块、商品档案模块&#xff0c;分为用户网页端和管理后台&#xff0c;基于角色的访问控制&#xff0c;可将权限精确…

c++ qt连接操作sqlite

qt连接操作sqlite qt客户端编程,用到数据库的场景不多,但是部分项目还是需要数据库来保存同步数据,客户端用到的数据库,一般是sqlite。 Qt提供了数据库模块,但是qt本身的数据库模块并不好用,会有各种问题, 建议大家不要,可以自己封装数据库的操作。本篇博客介绍qt连接操…

AVS3:双向光流BIO

AVS3引入了双向光流&#xff08;BI-directional Optical flow,BIO&#xff09;技术&#xff0c;和H.266/VVC中的BDOF类似&#xff0c;BIO用于解决基于块的预测会存在块内某些区域仍会有偏差的现象导致需要划分更小的块。通过补偿小的像素区域的位移&#xff0c;BIO可以使用更大…

Leetcode刷题详解——最小覆盖子串

1. 题目链接&#xff1a;76. 最小覆盖子串 2. 题目描述&#xff1a; 给你一个字符串 s 、一个字符串 t 。返回 s 中涵盖 t 所有字符的最小子串。如果 s 中不存在涵盖 t 所有字符的子串&#xff0c;则返回空字符串 "" 。 注意&#xff1a; 对于 t 中重复字符&#xf…

VSCode 自动格式化

1.打开应用商店&#xff0c;搜索 prettier code formatter &#xff0c;选择第一个&#xff0c;点击安装。 2.安装完成后&#xff0c;点击文件&#xff0c;选择首选项&#xff0c;选择设置。 3.在搜索框内输入 save &#xff0c;勾选在保存时格式化文件。 4.随便打开一个文件&a…

FineReport制作任务日历

文章目录 概要整体架构流程技术名词解释技术细节小结 概要 博主接触FineReport帆软报表有一段时间了&#xff0c;正好前几天做了一个任务日历的需求&#xff0c;把每天完成的任务量直观的展示在日历上&#xff0c;方便管理者更好的监控各业务的完成情况&#xff0c;做完后想着…

蜣螂优化(DBO)求解置换流水车间调度问题(PFSP)

先做一个声明&#xff1a;文章是由我的个人公众号中的推送直接复制粘贴而来&#xff0c;因此对智能优化算法感兴趣的朋友&#xff0c;可关注我的个人公众号&#xff1a;启发式算法讨论。我会不定期在公众号里分享不同的智能优化算法&#xff0c;经典的&#xff0c;或者是近几年…

gin 框架出现runtime error: index out of range [0] with length 0

之前是这样的&#xff1a; category : c.Request.Form["type"][0] 加上这一句就变成了 fmt.Println(c.Request.FormFile("type")) category : c.Request.Form["type"][0]

你所瞧不上的东西正以另外一种方式kill you

简单的例子就是&#xff1a; 360se & 360ee的份额比你想象中的大. 360se浏览器&#xff0c;安全浏览器 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.5735.196 Safari/537.36 360ee浏览器&#xff0c;极速浏览器 n…

摄像头工程师说 Camera-如何控制摄像头的输出尺寸(分辨率)

计算机视觉 Camera-如何控制摄像头的输出尺寸&#xff08;分辨率&#xff09; 摄像头工程师说 Camera-如何控制摄像头的输出尺寸&#xff08;分辨率&#xff09;windowingCroppingSkip/SubsampleScaleBinning总结 摄像头工程师说 Camera-如何控制摄像头的输出尺寸&#xff08;分…

Google Chrome的新“IP保护”功能将隐藏用户的IP地址

导语&#xff1a;在保护用户隐私方面&#xff0c;Google Chrome正在测试一项名为“IP保护”的新功能。通过使用代理服务器掩盖用户的IP地址&#xff0c;这项功能能够增强用户的隐私保护。在意识到IP地址可能被用于秘密追踪后&#xff0c;Google希望在确保用户隐私的同时&#x…

《 汇编语言的系统学习》一、编程语言、机器语言与汇编语言

目录 《 汇编语言的系统学习》1、编程语言1.1 语言1.2 程序 2 编程语言分类2.1 机器语言2.2 汇编语言2.3 高级程序语言2.3.1 编译型2.3.1 解释型 《 汇编语言的系统学习》 1、编程语言 1.1 语言 定义&#xff1a;一种系统的&#xff0c;人与人之间通过声音、符号等进行交流的…

Qwt-QwtPlot类详解

1.概述 QwtPlot类是Qwt库中最重要的类之一&#xff0c;用于创建和管理绘图窗口。 QwtPlot类具有以下主要功能&#xff1a; 提供一个绘图窗口&#xff0c;可以在其中绘制简单或复杂的二维数据图。支持多种类型的图表&#xff0c;包括曲线图、柱状图、散点图等。能够自定义图表…

第一章: LangChain 生成与加载知识库并根据匹配内容回答问题

LangChain——让文本大模型更加智能化系列文章目录 第一章 langchain生成与加载向量库并根据匹配内容回答问题 文章目录 LangChain——让文本大模型更加智能化系列文章目录前言文章简介一、使用步骤1.引入库2.LLM加载3.数据加载4.数据切分与转换向量5.构建prompt5.查询知识库并…

进程的优先级与LAMP项目部署实战

一、进程的优先级&#xff08;扩展&#xff09; 1、什么是进程的优先级 Linux是一个多用户、多任务的操作系统&#xff0c;系统中通常运行着非常多的进程。哪些进程先运行&#xff0c;哪些进程后运行&#xff0c;就由进程优先级来控制 思考&#xff1a;什么时候需要用到进程…