微信小程序酒店选择日期和入住人数(有效果图)

效果图

请添加图片描述

请添加图片描述
在这里插入图片描述

app.vue

	onLaunch:function(options){
		this.defaultcache()
	}
	defaultcache(){
		// 入住信息缓存
		var arr = this.getDateTime();
		var ReserVation = {
			reservType:0,//1  人数  2日期
			InCheckin:{},//入离日期
			peopleArr:[
				{title:'成人',num:2},
				{title:'儿童',num:0},
				{title:'宝子',num:1},
				{title:'房间数',num:1},
			],//入住人数
			IntimeCur:[
				{len:0,str:0},
				{len:0,str:0}
			],//选择日期
			timeDataArr:[],//日期数组
		}
		ReserVation.timeDataArr = arr[0]
		ReserVation.IntimeCur = arr[1]
		ReserVation.InCheckin = arr[2][0]
		uni.setStorageSync('ReserVation',ReserVation)
	},
	// 获取日期
	getDateTime(){
		var that = this
		var showY = 3;//显示几个月
		var timeData = [];//日期数组
		var timestamp = Date.parse(new Date());
		var date = new Date(timestamp);
		//年
		var Y = date.getFullYear();
		//月  
		var M = date.getMonth() + 1;
		//日
		var D = date.getDate();
		// 周几和月份天数
		var time = {};
		var Yday = 0,Mday = 0,data = {},param = {},toDays = 2;//toDays	默认住几天
		for(let i = 0;i < showY;i++){
			if(12 < (M + i)){
				Yday = Y + 1
				Mday = (M + i) - 12
			}else{
				Yday = Y
				Mday = M + i
			}
			time = that.getDaysInMonth(Yday,Mday)
			data = {year:Yday,moon:Mday,arr:[],days:time.days,Z:time.Z}
			for(let k = 0;k < time.Z;k++){
				data.arr.push({date:''});
			}
			for(let j = 0;j < time.days;j++){
				param = {};
				param.date = j + 1;
				param.Z = that.getDaysInMonth(Yday,Mday,param.date)
				param.price = 0;
				if(i == 0 && (j + 1) < D){
					param.status = 1
				}else if(i == 0 && (j + 1) == D){
					param.status = 2
				}
				data.arr.push(param)
			}
			timeData.push(data)
		}
		var start = {
			len:0,str:D
		};
		// if(that.timeData[start.len].days < (D + 1)){
		// 	start.len = 1
		// 	start.str = 0
		// }
		var end = {
			len:0,str:D + toDays - 1
		}
		if(timeData[end.len].days < end.str){
			end.str = end.str - timeData[end.len].days
			end.len = 1
		}
		start.str = start.str + parseInt(timeData[start.len].Z) - 1
		end.str = end.str + parseInt(timeData[end.len].Z) - 1
		var timeCur = [
			start,
			end
		]
		var Checkin = {
			start_Y:timeData[timeCur[0].len].year,
			start_M:timeData[timeCur[0].len].moon,
			start_D:timeData[timeCur[0].len].arr[timeCur[0].str].date,
			start_Z:timeData[timeCur[0].len].arr[timeCur[0].str].Z,
			end_Y:timeData[timeCur[1].len].year,
			end_M:timeData[timeCur[1].len].moon,
			end_D:timeData[timeCur[1].len].arr[timeCur[1].str].date,
			end_Z:timeData[timeCur[1].len].arr[timeCur[1].str].Z,
			days:toDays,
		}
		return [timeData,timeCur,[Checkin]];
	},
	// 获取周几和月份天数
	getDaysInMonth(Y,M,D){
		if(D){
			return this.getWeekByDate(`${Y}-${M}-${D}`,true)
		}
		//一号周几
		var Z = this.getWeekByDate(`${Y}-${M}-1`);
		// 月份天数
		var days = new Date(Y, M, 0).getDate();
		return {Z,days}
	},
	// 返回周几
	getWeekByDate(dates,status){
	  let show_day = status?['周日', '周一', '周二', '周三', '周四', '周五', '周六']:['0', '1', '2', '3', '4', '5', '6'];
	  let date = new Date(dates);
	  date.setDate(date.getDate());
	  let day = date.getDay();
	  return show_day[day];
	},

page-reservation.vue

<template>
<view>
	<view :class="modalName == 'reservation'?'cu-modal bottom-modal show':'cu-modal bottom-modal'" @touchmove.stop="() => false"
	 :style="'--CustomBar--:'+CustomBar+'px;z-index:10000;'">
		<view class="cu-dialog reservation-index">
			<view class="cu-custom">
				<view class="cu-bar fixed bg-white dialog-title" :style="'height:'+CustomBar+'px;padding-top:'+StatusBar+'px;'">
					<view class="action" @click="showModal('')">
						<text class="cuIcon-close" style="font-size: 42upx;"></text>
					</view>
					<view class="content" :style="'top:'+StatusBar+'px'">
						<view>选择入住条件</view>
					</view>
				</view>
			</view>
			<!-- 房住 -->
			<view class="reser-room">
				<view>房住</view>
				<view @click="tabreser(1)">
					<view v-for="(item,index) in peopleArrCur" :key="index" 
					:class="item.num > 0?'reser-room-cur':''">
						{{item.num + item.title}}
					</view>
					<view :class="type == 1?'cuIcon-unfold':'cuIcon-unfold reser-rotate'"></view>
				</view>
			</view>
			<!-- list -->
			<view class="reser-room-list reser-cur" :style="type != 1?'height:0;box-shadow:0;':''">
				<view v-for="(item,index) in peopleArrCur" :key="index">
					<view>{{item.title}}</view>
					<view class="room-list-count">
						<view class="room-list-icon" :class="item.num < 1 || (index == 0 && item.num < 2) || (index == 3 && item.num < 2) || (isType && index == 2)?'list-icon-cur':''"
						@click="item.num < 1 || (index == 0 && item.num < 2) || (index == 3 && item.num < 2) || (isType && index == 2)?'':countTap(index,1)">
							<view class="cuIcon-move"></view>
						</view>
						<view>{{item.num}}</view>
						<view class="room-list-icon" :class="item.num > 20 || (isType && index == 2)?'list-icon-cur':''"
						@click="item.num > 20 || (isType && index == 2)?'':countTap(index,2)">
							<view class="cuIcon-add"></view>
						</view>
					</view>
				</view>
			</view>
			<!-- 日期 -->
			<view class="reser-room reser-money">
				<view>入离日期</view>
				<view @click="tabreser(2)">
					<view>
						<span class="reser-room-cur">{{Checkin.start_M}}月{{Checkin.start_D}}日</span>
						{{Checkin.start_Z}}
					</view>
					<view class="reser-room-ing">{{Checkin.days}}晚</view>
					<view v-if="Checkin.days > 1">
						<span class="reser-room-cur">{{Checkin.end_M}}月{{Checkin.end_D}}日</span>
						{{Checkin.end_Z}}
					</view>
					<view :class="type == 2?'cuIcon-unfold':'cuIcon-unfold reser-rotate'"></view>
				</view>
			</view>
			<view class="reser-time" :style="type == 2?'':'height:0;'">
				<view>*以下价格为单晚入住参考价</view>
				<!-- list -->
				<view class="reser-data">
					<view v-for="(item,index) in timeTitle" :key="index">{{item}}</view>
				</view>
				<scroll-view scroll-y class="reser-list"
				@scroll="getScrollTop">
					<view v-for="(item,index) in timeData" :key="index" class="list-time"
					:id="'Time_'+index">
						<view>
							<view :class="index == scroll_index && type == 2 && modalName == 'reservation'?'reser-fixed':''">{{item.year}}年{{item.moon}}月</view>
						</view>
						<view>
							<view v-for="(cell,cell_index) in item.arr" :key="cell_index" class="list-date"
							:class="timeCur[1].str != -1 && timeCur[0].len != timeCur[1].len && (index == timeCur[0].len && timeCur[0].str < cell_index || index == timeCur[1].len && timeCur[1].str > cell_index) ? 
							'list-cur-one':timeCur[1].str != -1 && timeCur[0].len == timeCur[1].len && (index == timeCur[0].len && timeCur[0].str < cell_index && index == timeCur[1].len && timeCur[1].str > cell_index) ? 
							'list-cur-one':timeCur[1].len - timeCur[0].len > 1 && index == timeCur[1].len - 1?'list-cur-one':(index == timeCur[0].len && cell_index == timeCur[0].str) || 
							(index == timeCur[1].len && cell_index == timeCur[1].str)?'list-cur-two':''" 
							:style="cell.date?'':'visibility: hidden;'"
							@click="cell.status == 1?'':timetap(index,cell_index)">
								<view>
									<view :class="cell.status == 1?'reser-hui':cell.status == 2?'reser-chen':''">
										{{cell.status == 2?'今天':cell.date}}
									</view>
									<view class="reser-cur-font" v-if="cell.price > 0">
									<span v-if="((timeCur[1].str != -1 && timeCur[0].len != timeCur[1].len && (index == timeCur[0].len && timeCur[0].str < cell_index || index == timeCur[1].len && timeCur[1].str > cell_index)) ||
									(timeCur[1].str != -1 && timeCur[0].len == timeCur[1].len && (index == timeCur[0].len && timeCur[0].str < cell_index && index == timeCur[1].len && timeCur[1].str > cell_index)) ||
									(timeCur[1].len - timeCur[0].len > 1 && index == timeCur[1].len - 1) || ((index == timeCur[0].len && cell_index == timeCur[0].str) || 
									(index == timeCur[1].len && cell_index == timeCur[1].str)))">
									¥{{cell.price}}
									</span>
									</view>
									<view class="reser-cur-font" v-if="(index == timeCur[0].len && cell_index == timeCur[0].str) || 
									(index == timeCur[1].len && cell_index == timeCur[1].str)">{{(index == timeCur[0].len && cell_index == timeCur[0].str)?'入住':'离店'}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="wdh" style="height: 162px;"></view>
				</scroll-view>
				<view class="reser-button">
					<button class="cu-btn round" @click="btnConfirm">确定</button>
				</view>
			</view>
		</view>
	</view>
</view>
</template>
<script>
export default{
	data(){
		return{
			StatusBar:this.StatusBar,
			CustomBar: this.CustomBar,
			type:0,
			timeTitle:['周日','周一','周二','周三','周四','周五','周六'],
			timeData:[],
			timeCur:[
				{len:0,str:0},
				{len:0,str:0}
			],
			scroll_index:-1,//fiexd日期
			Checkin:{
				start_M:'',
				start_D:'',
				start_Z:'',
				end_M:'',
				end_D:'',
				end_Z:'',
				days:'',
			},//入离日期
			peopleArrCur:[],
		}
	},
	name: 'page-reservation',
	props: {
		modalName: {
			type: String,
			default: ''
		},
		ReserVation: {
			type: Object,
			default: {}
		},
		isType: {
			type: [Boolean, String],
			default: false
		},
	},
	created(){
		//默认显示日期或者人数
		this.type = this.ReserVation.reservType
		//房住
		this.peopleArrCur = this.ReserVation.peopleArr
		//选择的入住时间
		this.timeCur = this.ReserVation.IntimeCur
		//日期数组
		this.timeData = this.ReserVation.timeDataArr
		//入住时间信息
		this.Checkin = this.ReserVation.InCheckin
		this.list()
	},
	methods:{
		list(){
			var that = this
			setTimeout(() => {
				that.scroll_index = 0
			},500)
			setTimeout(() => {
				that.getDateHeight();
			},1000)
		},
		timetap(index,cell_index){
			var that = this
			if(that.timeCur[1].str != -1 || (cell_index < that.timeCur[0].str && index == that.timeCur[0].len) || (index < that.timeCur[0].len)){//选择开始
				that.timeCur[0].len = index
				that.timeCur[0].str = cell_index
				that.timeCur[1].len = index
				that.timeCur[1].str = -1
				that.Checkin = {
					start_M:that.timeData[that.timeCur[0].len].moon,
					start_D:that.timeData[that.timeCur[0].len].arr[that.timeCur[0].str].date,
					start_Z:that.timeData[that.timeCur[0].len].arr[that.timeCur[0].str].Z,
					end_M:'',
					end_D:'',
					end_Z:'',
					days:1,
				}
			}else{//选择结束
				var number = 0
				if(that.timeCur[0].len == index){
					number = cell_index - that.timeCur[0].str + 1
				}else{
					var time = index - that.timeCur[0].len;
					number += (that.timeData[that.timeCur[0].len].arr.length - that.timeCur[0].str)
					for(let i = that.timeCur[0].len + 1;i < index;i++){
						number += that.timeData[i].days
					}
					number += (cell_index - parseInt(that.timeData[index].Z)) + 1
				}
				if(number > 30){
					getApp().Tips('最多选择三十天')
				}else{
					that.timeCur[1].len = index
					that.timeCur[1].str = cell_index
					that.getCheckinDays(number)
				}
			}
		},
		// 入离日期
		getCheckinDays(D){
			var that = this
			that.Checkin = {
				start_Y:that.timeData[that.timeCur[0].len].year,
				start_M:that.timeData[that.timeCur[0].len].moon,
				start_D:that.timeData[that.timeCur[0].len].arr[that.timeCur[0].str].date,
				start_Z:that.timeData[that.timeCur[0].len].arr[that.timeCur[0].str].Z,
				end_Y:that.timeData[that.timeCur[1].len].year,
				end_M:that.timeData[that.timeCur[1].len].moon,
				end_D:that.timeData[that.timeCur[1].len].arr[that.timeCur[1].str].date,
				end_Z:that.timeData[that.timeCur[1].len].arr[that.timeCur[1].str].Z,
				days:D,
			}
		},
		btnConfirm(){
			if(this.Checkin.days < 2){
				return getApp().Tips('请选择离店时间~')
			}
			this.$emit('getHotelData', this.peopleArrCur,this.Checkin,this.timeCur);
		},
		getDateHeight(){
			var that = this
			var text = ''
			for(let i = 0;i < that.timeData.length;i++){
				text = '#Time_' + i
				uni.createSelectorQuery().in(that).select(text).boundingClientRect(function (res) {
					that.timeData[i].TimeHiehgt = res.height + (i == 0?0:that.timeData[i - 1].TimeHiehgt) - 5
				}).exec();
			}
		},
		getScrollTop(e){
			var i = this.scroll_index > 0?this.scroll_index - 1:0;
			for(i;i < this.timeData.length;i++){
				if(e.detail.scrollTop < this.timeData[i].TimeHiehgt){
					this.scroll_index = i;
					break;
				}
			}
		},
		showModal(target){
			this.$emit('showModal', target);
		},
		countTap(index,type){
			if(type == 1){
				this.peopleArrCur[index].num--
			}else{
				this.peopleArrCur[index].num++
			}
		},
		tabreser(type){
			var that = this
			if(that.type == type){
				that.type = 0
			}else{
				that.type = type
				if(type == 2){
					that.scroll_index = -1
					setTimeout(() => {
						that.scroll_index = 0
					},500)
				}
			}
		},
	},
}
</script>
<style>
/* 预定酒店 */
.reservation-index{height: 100vh;}
.dialog-title{position: relative !important;z-index: 0 !important;}
.reser-room{font-size: 26upx;display: flex;align-items: center;justify-content:space-between;color: #666;
height:53px;padding: 0 30upx;background: #fff;width: 100%;float: left;}
.reser-room>view:nth-child(2){display: flex;align-items:center;}
.reser-room>view:nth-child(2)>view{margin-left: 20upx;}
.reser-room>view:nth-child(2)>.cuIcon-unfold{color: #000;}
.reser-cur{box-shadow: inset 0rpx 3rpx 6rpx 1rpx rgba(0,0,0,0.16);}
.reser-room-cur{color: #FC9C39;}
.reser-room-list{width: 100%;float: left;padding: 0 30upx;transition: height 0.3s;background: #fff;height: 200px;overflow: hidden;}
.reser-room-list>view{width: 100%;float: left;height:50px;display:flex;align-items:center;
justify-content:space-between;font-size: 26upx;color: #666;}
.room-list-count{display: flex;align-items: center;}
.room-list-icon{display: flex;align-items: center;justify-content: center;width: 38upx;height: 38upx;border-radius: 50%;color: #fff;
background-color: #FF9800;}
.list-icon-cur{background-color: #939393 !important;}
.room-list-count>view:nth-child(2){margin: 0 10upx;min-width: 34upx;}
.cuIcon-unfold{transform:rotate(0deg);transition: all 0.3s;margin-left: 6upx !important;}
.reser-rotate{transform:rotate(-90deg);}
.reser-room-ing{background-color: #FAFAFA;border-radius: 20upx;padding: 0 20upx;height: 40upx;line-height: 40upx;font-size: 20upx;color: #666;}
/* 日期 */
.reser-money{margin-top: 10px;}
.reser-time{width: 100%;height:calc(100vh - 116px - var(--CustomBar--)) ;background-color: #fff;float: left;transition: height 0.3s;overflow: hidden;}
.reser-time>view{width: 100%;float: left;}
.reser-time>view:nth-child(1){background: #FFE3C6;color: #5F5F5F;height: 31px;display: flex;align-items: center;justify-content: center;}
.reser-data{width: calc(100% - 60upx) !important;float: left;height: 50px;display: flex;align-items: center;font-size: 24upx;
color: #5F5F5F;margin: 0 30upx;}
.reser-data>view{width: calc((100% - 60upx) / 7);margin-left: 10upx;}
.reser-data>view:nth-child(1){margin-left: 0;}
.reser-list{width: 100%;float: left;background: #fff;height:calc(100vh - 197px - var(--CustomBar--));}
.list-time{width: 100%;float: left;position: relative;}
.list-time>view:nth-child(1){padding-bottom:20upx;font-size: 30upx;color: #FC9C39;height: 31px;
width: calc(100% - 56upx);margin: 0 28upx;}
.list-time>view:nth-child(1)>view{height: 31px;border-bottom: 1px solid #F2F4F9;background: #fff;z-index: 1;}
.reser-fixed{position: fixed;top: calc(197px + var(--CustomBar--));width: calc(100% - 56upx);}
.list-time>view:nth-child(2){width: 100%;padding: 20upx 30upx 30upx;float: left;}
.list-date{width: calc((100% - 30px) / 7);height: 58px;border-radius: 10upx;float: left;display: flex;align-items: center;justify-content: center;
margin-left: 5px;margin-top: 5px;}
.list-date{font-size: 30upx;color: #252525;} 
.list-time>view:nth-child(2)>view:nth-child(7n+1){margin-left: 0 !important;}
.list-cur-one{background-color: #F8C691;}
.list-cur-two{background-color: #FC9C39;}
.list-cur-two>view>view:nth-child(1){color: #252525 !important;}
.reser-cur-font{font-size: 24upx;color: #FFFFFF;}
.reser-hui{color: #AAAAAA;}
.reser-chen{color: #FC9C39;}
</style>

需要引入的.vue

<template>
<view>
	<view @click="page_showModal('reservation',1)">打开房租</view>
	<view @click="page_showModal('reservation',2)">打开日历</view>
	<page-reservation v-if="page_modalName" :modalName="page_modalName" :ReserVation="ReserVation" @showModal="page_showModal"
	@getHotelData="getHotelData"></page-reservation>
</view>
</template>
<script>
import PageReservation from '@/colorui/components/page-reservation.vue'
export default {
	components:{ PageReservation },
	data() {
		return {
			page_modalName:'',
			ReserVation:uni.getStorageSync('ReserVation'),//入住人数日期
		}
	},
	methods: {
		// 修改入住信息
		getHotelData(peopleArr,InCheckin,IntimeCur){
			this.ReserVation.peopleArr = peopleArr
			this.ReserVation.InCheckin = InCheckin
			this.ReserVation.IntimeCur = IntimeCur
			uni.setStorage({key:"ReserVation",data:this.ReserVation})
			this.page_showModal('')
		},
		// 入住信息弹窗
		page_showModal(target,type){
			var that = this
			if(type){
				that.ReserVation.reservType = type
			}
			that.page_modalName = '1'
			setTimeout(() => {
				that.page_modalName = target
			},target?100:500)
		},
	},
</script>

默认选择当天和明天
入住一次性最多选择三十天
默认获取三个月日期数组

存储信息
InCheckin 选择的日期信息
IntimeCur 组件选择的日期
peopleArr 入住人数信息
timeDataArr 显示的日历

引入的组件库ColorUI组件库

用的是uni-app

遇到问题可以看我主页加我Q,很少看博客,对你有帮助别忘记点赞收藏。

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【C语言__动态内存管理__复习篇6】

目录 前言 一、动态内存管理 二、动态内存函数 2.1 malloc 2.2 free 2.3 calloc 2.4 realloc 三、动态内存常见的6个使用错误 3.1 接收malloc/calloc返回的参数后未及时检查是否为NULL 3.2 越界访问动态内存空间 3.3 对非动态开辟的内存使用free释放 3.4 使用free只释放了…

【GoWeb框架初探——GRPC】

1. GRPC介绍 1.1 什么是RPC RPC全程是Remote Procedure Call&#xff0c;远程过程调用。这是一种协议&#xff0c;是用来屏蔽分布式计算中的各种调用细节&#xff0c;使得你可以像是本地调用一样直接调用一个远程的函数。 调用流程 1&#xff09;客户端发送数据&#xff08;…

flutter 谷歌的苹果系统消息推送

flutter firebase 云消息通知教程 (android-安卓、ios-苹果) Android、ReactNative、Flutter集成Firebase推送注意事项 Android&#xff1a;Firebase 凭据 iOS&#xff1a;基于 p8 令牌的 APN 连接 iOS&#xff1a;p12 生成证书 Flutter之对接国外推送onesignal踩坑笔记&a…

基于SSM的平面设计课程在线学习平台系统(有报告)。Javaee项目。ssm项目。

演示视频&#xff1a; 基于SSM的平面设计课程在线学习平台系统&#xff08;有报告&#xff09;。Javaee项目。ssm项目。 项目介绍&#xff1a; 采用M&#xff08;model&#xff09;V&#xff08;view&#xff09;C&#xff08;controller&#xff09;三层体系结构&#xff0c;…

C++:STL-list模拟实现:迭代器的封装

STL-list模拟实现细节 一. 模拟实现的思想细节1.迭代器实现&#xff1a;用类进行封装2.和--的重载3.奇怪的->重载4.const迭代器 二.实现源码 一. 模拟实现的思想细节 1.迭代器实现&#xff1a;用类进行封装 为什么不使用原生指针&#xff1a; ​ 相比于vector和string&am…

9.Godot数组|遍历|静态变量|对象|调试

数组和字典的遍历 数组的概念 数组是一组数据的集合。在程序中负责批量处理数据。数组中的元素可以包括各个类型的数据&#xff0c;也可以对数组内数据类型进行限定。可以通过 数组名【数字】 的形式来访问数组元素&#xff0c;数字 0 代表数组的第一个元素。数组可以通过调用…

《中学科技》是什么级别的刊物?如何投稿?

《中学科技》是什么级别的刊物&#xff1f;如何投稿&#xff1f; 《中学科技》创刊于1976年&#xff0c;由上海世纪出版&#xff08;集团&#xff09;有限公司主管&#xff0c;上海科技教育出版社有限公司主办的省级学术期刊&#xff0c;《中学科技》以传播科技知识、启迪智慧…

蓝桥杯2024年第十五届省赛真题-宝石组合

思路&#xff1a;参考博客&#xff0c;对Ha,Hb,Hc分别进行质因数分解会发现&#xff0c;S其实就等于Ha&#xff0c;Hb&#xff0c;Hc的最大公约数&#xff0c;不严谨推导过程如下&#xff08;字丑勿喷&#xff09;&#xff1a; 找到此规律后&#xff0c;也不能枚举Ha&#xff…

AI容器化部署开发尝试 (一)(Pycharm连接docker,并部署django测试)

注意&#xff1a;从 Docker 19.03 开始&#xff0c;Docker 引入了对 NVIDIA GPU 的原生支持&#xff0c;因此若AI要调用GPU算力的话docker版本也是有要求的&#xff0c;后面博客测试。 当然本篇博客还没设计到GPU的调用&#xff0c;主要Pycharm加Anaconda的方案用习惯了&#…

基于Springboot的社区待就业人员信息管理系统(有报告)。Javaee项目,springboot项目。

演示视频&#xff1a; 基于Springboot的社区待就业人员信息管理系统&#xff08;有报告&#xff09;。Javaee项目&#xff0c;springboot项目。 项目介绍&#xff1a; 采用M&#xff08;model&#xff09;V&#xff08;view&#xff09;C&#xff08;controller&#xff09;三…

pdf加水印怎么加?自己原创的PDF资料分享到网络上需要采取一些版权保护的措施,添加水印就是个不错的选择

一&#xff0c;水印的基本概念 水印通常是一种用于标识文件来源、版权信息或防止非法复制的标记。它可以是文字、图形或图像等形式&#xff0c;以半透明或半淡化的方式嵌入到文件中&#xff0c;既不影响文件的正常阅读&#xff0c;又能起到标识和保护的作用。 二&#xff0c;…

mars3d实现禁止地图移动,禁止地图左右平移,但是鼠标可以移动的效果。

new mars3d.layer.GeoJsonLayer({渲染后实现鼠标左键按住不释放拖动时&#xff0c;地图不跟着拖动效果 当前问题&#xff1a; 1.在map初始化&#xff0c;或者是加载效果的时候&#xff0c;整个地球的场景都是一样的。 如果鼠标左键按住不释放&#xff0c;在屏幕上拖动的时候…

设计模式代码实战-责任链模式

1、问题描述 小明所在的公司请假需要在OA系统上发布申请&#xff0c;整个请求流程包括多个处理者&#xff0c;每个处理者负责处理不同范围的请假天数&#xff0c;如果一个处理者不能处理请求&#xff0c;就会将请求传递给下一个处理者&#xff0c;请你实现责任链模式&#xff…

C++:map和set的使用

一、关联式容器介绍 在学习map和set之前&#xff0c;我们接触到的容器有&#xff1a;vector、list、stack、queue、priority_queue、array&#xff0c;这些容器统称为序列式容器&#xff0c;因为其底层为线性序列的数据结构&#xff0c;里面存储的是元素本身。 关联式容器也是用…

Appian发布最新版本:通过AI流程自动化推动业务发展

Appian公司于2024年4月16日在弗吉尼亚州麦克莱恩宣布推出Appian平台的最新版本。此版本引入了Process HQ&#xff0c;这是一个集流程挖掘和企业AI于一体的系统&#xff0c;结合了Appian的数据平台。Process HQ为企业运营提供前所未有的可见性&#xff0c;支持数据驱动的决策和流…

微信小程序四(全局配置和页面配置页面跳转)

全局配置&#xff1a; 小程序根目录下的 app.json 文件用来对微信小程序进行全局配置&#xff0c;决定页面文件的路径、窗口表现、设置网络超时时间、设置多 tab 等 tabBar设置&#xff1a;最少两个最多5个 "tabBar": {"list":[{"pagePath": &qu…

【若依】代码生成详细教程(单表、主从表、树形表增删改查)

若依代码生成开发接口 修改代码生成配置一、单表实现增删改查1. 新建数据库表结构2. 新建模块&#xff0c;解决项目依赖3. 启动项目&#xff0c;新建菜单4. 导入数据表&#xff0c;自动生成代码5. 将生成代码粘贴到对应的模块&#xff0c;执行生成的sql&#xff08;用于生成菜单…

OpenHarmony网络协议通信—nanopb

简介 nanopb是一种小代码量的协议缓冲区实现&#xff0c;适用于任何内存受限的系统。 下载安装 直接在OpenHarmony-SIG仓中搜索nanopb并下载。 使用说明 以OpenHarmony 3.1 Beta的rk3568版本为例 将下载的Nanopb库代码存在以下路径&#xff1a;./third_party/nanopb 修改添…

一键设置个性手机壁纸:苹果手机怎么设置动态壁纸?

在苹果手机上设置动态壁纸是一种让你的手机屏幕更生动、更有趣的方式。无论是流动的水滴、绚丽的光影还是动态的星空&#xff0c;动态壁纸可以为你的手机带来全新的视觉体验。苹果手机怎么设置动态壁纸&#xff1f;在本文中&#xff0c;我们将介绍苹果手机上如何设置动态壁纸的…

李沐-16 PyTorch 神经网络基础【动手学深度学习v2】

注&#xff1a;1. 沐神对应章节视频出处 2.代码使用Jupyter Notebook运行更方便 3.文章笔记出处 一、层和块 层&#xff1a;层&#xff08;1&#xff09;接受一组输入&#xff0c; &#xff08;2&#xff09;生成相应的输出&#xff0c; &#xff08;3&#xff09;由一组可调整…
最新文章