微信小程序之vue按钮切换内容变化

效果图如下;

上代码

<template>
	<view class="content">
		<view class="searchDiv">
			 <view class="paytab">
			 	 <view class="buttab" v-for="(t,index) in tabList" :key="index" @click="tabsOn(t.id)" >
					 <text :class="t.id == tabsId ? 'fontColorBox' : 'default'">{{t.title}}</text>
					 <hr :class="t.id == tabsId ? 'lineBox' : 'default'"/>
			 	 </view>
			 </view>
			<view class="jzalldiv">
				<image class="paylog" src="../../static/images/1.png"></image>
				<view class="jzall" bindtap="showSelectBox">
				  支付宝	
				</view> 
				<image class="sanjiao" src="../../static/sanjiao.png"></image>
				<input type="text" class="moneyInput" placeholder="¥0.00"/>
			</view>
		</view>
		  
	
	   <!-- 内容布局 -->
	    <swiper @click="slideOn" :current="tabsId" circular>
	        <!-- circular 启用循环滑动 -->
	        <swiper-item>
	            <view class="paytypelist">
	            	<view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	</view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	  <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	  </view>
	            	  <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	  </view>
	            	  <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	  </view>
	            	  <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			自定义
	            		</view>
	            	  </view>
	            </view>
	        </swiper-item>
	        <swiper-item>
	            <view class="paytypelist">
	            	<view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	</view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	 <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	 </view>
	            	  <view class="paytype">
	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            		<view class="typeName">
	            			蔬菜
	            		</view>
	            	  </view>
	            	
	            </view>
	        </swiper-item>
	        <swiper-item>
	            <view class="paytype">
	            	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            	            		<view class="typeName">
	            	            			蔬菜
	            	            		</view>
	            </view>
	            <view class="paytype">
	            	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            	            		<view class="typeName">
	            	            			蔬菜
	            	            		</view>
	            </view>
	            <view class="paytype">
	            	            		<image src="../../static/images/1.png" class="typeImg"></image>
	            	            		<view class="typeName">
	            	            			自定义
	            	            		</view>
	            </view>
	        </swiper-item>
	    </swiper>
	 
		 
	</view>

</template>

<script>
 
		export default {
  
			data() {
				return {
			 
				 "tabList": [// tab选项
							 {title: "支出",id: "0",},
							 {title: "收入",id: "1",},
							 {title: "转账",id: "2",},
						  ],
				 "tabsId": 0, //默认选型为装备
				}
			},
			 
			methods: { 
				 // 滑动时触发的事件
				    slideOn(e) {
				      this.tabsId=e;
				    },
				    //点击tab时触发
				    tabsOn(e) {
				        this.tabsId= e;
				    },
				 
			}
		}
	
</script>

<style>
	
	 .paytype,.jdheadtitle1,.jdtop,.jdbottom,.jdheaddiv,.jdlist,.jdhead,.jdtitle,.selectTime,
	.picsView,.moneyInput,.paylog,.buttab,.paytab,.quxBut,.submitBut,.paybeizhu,.paytypelist,.outmoney,.jzalldiv,.sanjiao,.jzall{
		float: left;
	}
	.default{}
	.fontColorBox {
	  /* 选中tab样式 */
	  color: black;
	  font-size: 25px;
	  font-weight: bold;
	  
	}
	.lineBox {
	  /* 线条样式 */
	  width: 90rpx;
	  height: 8rpx;
	  background: black;
	  margin-top: 7rpx;
	  border-radius: 4rpx;
	}
	.addImgBtn {
		width:100%;
		float: left;
		margin-left: 30rpx;
		margin-top: 20rpx;
		border-top: 1rpx solid rgba(68,68,68,0.1);
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 12rpx 24rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		
	}
	.addImgBtn image {
		float: left;
		width: 50rpx;
		height: 50rpx;
	}
	.picsView{
		margin-left: 30rpx;
	}
	.addImgBtn text{
		font-size: 11px;
		color: #2979FF;
		font-weight: 100;
	}
	.moneyInput{
		width: 50%;
		height: 40px;
		text-align: right;
		margin-left: 8%;
		font-size: 22px;
		font-weight: bold;
	}
	.buttab{
		height: 100%;
		margin-left: 10%;
		font-size: 20px;
		/* border-bottom: 2px solid red; */
	}
	 
	.paytab{
		width: 80%;
		margin-left: 15%;
		height: 30px;
	}
	.quxBut{
		background-color: red;
	}
	.submitBut{
	background-color: #7CFC00;	
	margin-bottom: 30px;
	}
	.quxBut,.submitBut{
		width: 80%;
		height: 25px;
		margin-left: 10%;
		margin-top: 15px;
		border-radius: 5px;
	    text-align: center;
		padding-top: 5px;
		color: 	white;
	}
	
	.paybeizhu{
		width: 80%;
		height: 120px;
		padding-left: 5px;
		padding-top: 5px;
		border-radius: 10px;
		margin-left: 10%;
		margin-top: 20px;
		border: 1px solid #C0C0C0;
	}
	.paytypelist{
		width: 80%;
		margin-top: 10px;
		margin-left: 10%;
	}
	 
	.paytype{
		width: 13%;
		height: 60px;
		margin-top: 10px;
		margin-left: 6%;
		font-size: 12px;
		border-radius: 10px;
	}
    .typeImg{
		float: left;
		width: 100%;
		height: 40px;
		border-radius: 50%
	}
    .typeName{
		float: left;
		width: 100%;
		height: 20px;
		padding-top: 5px;
		text-align: center;
	}
	 
	.dbTab{
		position: fixed;
		z-index: 29;
		width:40px;
		height:40px;
		border-radius: 50%;
		display: block;
		bottom: 10px;
		left: 48%;
	}
	.jdheadtitle1,.jdheadtitle2{
		font-size: 17px;
	}
	.jdheadtitle1{
		width: 70%;
		margin-top: 2%;
		overflow:hidden;
		white-space:nowrap; 
		text-overflow:ellipsis;
	}
	.jdheadtitle2{
		float: right;
		margin-right: 3%;
	    margin-top: 2%;
	}
	.jdtop,.jdbottom{
		width:100%;
		height: 30px;
	}
 
	.jdbottom{
		 padding-top: 5px;
		 color: #cdcdcd;
		 font-size: 12px;
	}
	.jdlist:first-child{
		margin-top: 120px;
	}
	.jdlist{
		width: 100%;
		height: 60px;
	}
	.jdheaddiv{
		width: 20%;
		height: 60px;
	}
	.jdhead{
		width: 50px;
		height: 50px;
		margin-top: 5px;
		margin-left: 15px;
	}
	.jdtitle{
		width:80%;
		height: 60px;
		border-bottom: 1px solid #e7e6e1;
	}
	 
	.jzalldiv{
		width: 90%;
		height: 40px;
		margin-top: 20px;
		padding-bottom: 5px;
		padding-top: 10px;
		background-color: #F5F5F5;
		margin-left: 5%;
		border-radius: 10px;
	}

	 
	.jzall{
		margin-left: 10px;
		margin-top: 5px;
		font-weight: bold;
		font-size: 20px;
	}
	.paylog{
		width: 35px;
		height:35px;
		margin-left: 10px;
	}
	.sanjiao{
		width: 12px;
		height: 12px;
		margin-left: 5px;
		margin-top: 15px;
	}
	 
    .headall1{
		float: left;
		width: 100%;
		height: 50%;
	}
	 
	.searchDiv{
		width: 100%;
		float: left;
		/* background-color:#F5F5F5; */
	}
	page{
		font-family: "Lucida Calligraphy", cursive, serif, sans-serif;
		 /* background-color: #e7e6e1; e6e6e6*/
	}
</style>

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

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

相关文章

基于java+springboot开发的计算机毕业设计网文论坛管理系统设计与实现【附源码】

基于javaspringboot开发的计算机毕业设计网文论坛管理系统设计与实现【附源码】 &#x1f345; 作者主页 央顺技术团队 &#x1f345; 欢迎点赞 &#x1f44d; 收藏 ⭐留言 &#x1f4dd; &#x1f345; 文末获取源码联系方式 &#x1f4dd; &#x1f345; 查看下方微信号获取联…

windows环境,gitbash可以连接拉取代码,但是idea没有权限

问题如图&#xff1a; 解决办法&#xff1a; 将idea中的git设为本地 即&#xff1a;将git执行文件路径指向本地 githome\cmd\git.exe而非githome\bin\git.exe

15、设计模式之迭代器模式(Iterator)

一、什么是迭代器模式 迭代器模式是一种行为型设计模式&#xff0c;它提供了一种统一的方式来访问集合对象中的元素&#xff0c;而不是暴露集合内部的表示方式。简单地说&#xff0c;就是将遍历集合的责任封装到一个单独的对象中&#xff0c;我们可以按照特定的方式访问集合中的…

一道题学会如何使用哈希表

给你一个整数数组 nums 和一个整数 k &#xff0c;请你统计并返回 该数组中和为 k 的子数组的个数 。 子数组是数组中元素的连续非空序列。 示例 1&#xff1a; 输入&#xff1a;nums [1,1,1], k 2 输出&#xff1a;2示例 2&#xff1a; 输入&#xff1a;nums [1,2,3], …

【2024.03.12】定时执行专家 V7.2 发布 - TimingExecutor V7.2 Release

目录 ▉ 软件介绍 ▉ 新版本 V7.2 下载地址 ▉ V7.2 新功能 ▼2024-03-12 V7.2 - 更新日志 ▉ V7.x 新UI设计 ▉ 软件介绍 《定时执行专家》是一款制作精良、功能强大、毫秒精度、专业级的定时任务执行软件。软件具有 25 种【任务类型】、12 种【触发器】触发方式&#x…

Python合并两张图片 | 先叠透明度再合并 (附Demo)

目录 前言正文 前言 用在深度学习可增加噪音&#xff0c;增加数据集等 推荐阅读&#xff1a;Pytorch 图像增强 实现翻转裁剪色调等 附代码&#xff08;全&#xff09; 正文 使用Pillow库来处理图像&#xff08;以下两张图来自网络&#xff09; 图一&#xff1a; 图二&…

vscode ubuntu c++运行环境配置

官方教程地址&#xff1a;Get Started with C on Linux in Visual Studio Code&#xff08;Get Started with C on Linux in Visual Studio Code&#xff09; 1、下载安装vscode Visual Studio Code - Code Editing. Redefined&#xff08;Visual Studio Code - Code Editing…

多特征变量序列预测 -TCN 预测模型

往期精彩内容&#xff1a; 时序预测&#xff1a;LSTM、ARIMA、Holt-Winters、SARIMA模型的分析与比较-CSDN博客 风速预测&#xff08;一&#xff09;数据集介绍和预处理-CSDN博客 风速预测&#xff08;二&#xff09;基于Pytorch的EMD-LSTM模型-CSDN博客 风速预测&#xff…

[Java、Android面试]_01_多线程: 重要参数、状态、优雅停止线程等

本人今年参加了很多面试&#xff0c;也有幸拿到了一些大厂的offer&#xff0c;整理了众多面试资料&#xff0c;后续还会分享众多面试资料&#xff0c;感兴趣的朋友可收藏关注&#xff0c; 现分享如下&#xff1a; 文章目录 1. 线程池重要参数2. 线程池状态3. 优雅停止线程4. 线…

重载和覆盖以及隐藏有什么区别?

重载和重写以及重新定义&#xff08;隐藏&#xff09;有什么区别&#xff1f; 1.重载 重载是在一个作用域内进行的&#xff0c;多定义几个参数列表(参数类型和参数个数)不同但同名方法&#xff0c;这种叫做重载。重载通常发生在一个类内。 如: class Demo {void func() { ..…

在Linux/Ubuntu/Debian中设置字体

下载字体。 下载你喜欢的字体&#xff0c;双击并安装。 之后更新字体缓存&#xff1a; fc-cache -f -v安装 GNOME 调整。 GNOME Tweaks 是一个工具&#xff0c;允许你自定义 GNOME 桌面环境的各个方面&#xff0c;包括字体。 如果你还没有安装 GNOME Tweaks&#xff1a; …

「飞桨星河社区创作者激励计划」全新上线!丰富权益,等你领取~

为了助力更多的创作者实现在飞桨星河社区的成长&#xff0c;同时鼓励创作者们积极投入&#xff0c;记录创作者们的高光时刻&#xff0c;重磅推出**「创作者成长体系」&#xff0c;同时推出「每周精选&月度榜单」**活动&#xff0c;期待你一同加入精彩纷呈的AI学习与创作之旅…

【网络原理】TCP 协议中比较重要的一些特性(二)

目录 1、TCP 状态转换 1.1、三次握手状态 1.2、四次挥手状态 2、滑动窗口 3、流量控制 1、TCP 状态转换 TCP 状态和“线程状态”是类似的概念&#xff0c;用于描述 TCP 连接过程中正在执行什么操作。 TCP 服务器和客户端都有一定的数据结构来保存连接信息&#xff0c;而…

C++day2——引用、结构体、类

思维导图&#xff1a; 2、自己封装一个矩形类(Rect)&#xff0c; 拥有私有属性&#xff1a;宽度(width)、高度(height)&#xff0c; 定义公有成员函数初始化函数:void init(int w, int h) 更改宽度的函数:set_w(int w)更改高度的函数:set_h(int h) 输出该矩形的周长和面积函…

4款支持局域网环境使用的办公软件,可免费试用

在局域网环境下&#xff0c;选择一款合适的办公软件能极大提升团队协作效率。今天就为大家推荐4款支持局域网环境使用&#xff0c;且可免费试用的办公软件&#xff0c;分别是小鱼易连、有度即时通、石墨文档和坚果云。 一、小鱼易连 小鱼易连是一款高效的视频会议软件&#xff…

考察1学生学籍系统winform .net6 sqlserver

考察1学生学籍系统winform .net6 sqlserver 下载地址: 考察1学生学籍系统winform .net6 sqlserver winform(.net6)sqlserver数据库 只有数据库的表结构需要自己建表 启动程序 登录失败 进入主界面 项目获取&#xff1a; 项目获取&#xff1a;typora: typora/img (gitee.com…

idea Springboot 组卷管理系统LayUI框架开发mysql数据库web结构java编程计算机网页

一、源码特点 springboot 组卷管理系统是一套完善的完整信息系统&#xff0c;结合mvc框架和LayUI框架完成本系统springboot spring mybatis &#xff0c;对理解JSP java编程开发语言有帮助系统采用springboot框架&#xff08;MVC模式开发&#xff09;&#xff0c;系统具有完整…

无人机远程指挥控制系统技术,无人机远程指挥中心功能详解

无人机远程指挥控制系统是一种用于实现无人机远程控制和指挥的技术。它主要基于先进的通信技术和无人机控制技术&#xff0c;使得操作人员可以在远离无人机的地方对其进行实时的控制和监控。 无人机远程指挥控制系统关键部分&#xff1a; 1. 通信技术&#xff1a;这是无人机远…

2023年对我国精油品牌战略以及行业分析

环洋咨询Global Info Research的精油市场调研报告提供精油市场的基本概况&#xff0c;包括定义&#xff0c;分类&#xff0c;应用和产业链结构&#xff0c;同时还讨论发展政策和计划以及制造流程和成本结构&#xff0c;分析精油市场的发展现状与未来市场趋势&#xff0c;并从生…

<.Net>VisaulStudio2022下用VB.net实现socket与汇川PLC进行通讯案例(Eazy521)

前言 此前&#xff0c;我写过一个VB.net环境下与西门子PLC通讯案例的博文&#xff1a; VisaulStudio2022下用VB.net实现socket与西门子PLC进行通讯案例&#xff08;优化版&#xff09; 最近项目上会用到汇川PLC比较多&#xff0c;正好有个项目有上位机通讯需求&#xff0c;于是…
最新文章