前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >微信小程序加减号弹出框详解

微信小程序加减号弹出框详解

原创
作者头像
疯狂的小程序
发布于 2018-01-25 09:18:53
发布于 2018-01-25 09:18:53
1.8K00
代码可运行
举报
文章被收录于专栏:疯狂的小程序疯狂的小程序
运行总次数:0
代码可运行
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<view class='add-rob' bindtap="setModalStatus" data-status="0" wx:if="{{showModalStatus}}">view>
<view class='rob-box' wx:if="{{showModalStatus}}">

<view class="shade-shop-detail">

<view class="detail-right flexb">
<view class='detail-title-de'>购买数量view>

<view class="stepper">

<text class="{{minusStatuses?'disabled':''}}" disabled="true" data-idx="{{idx}}" data-index="{{index}}" bindtap="bindMinus">-text>

<view class="number" bindchange="bindManual">view>
<input maxlength='5' type='number' class="numberin" value='{{detailDatas.num}}' bindinput="bindChange" />

<text class="normal" data-idx="{{idx}}" data-index="{{index}}" bindtap="bindPlus">+text>
view>
view>
view>

<view class="shade-shop-button">
<view wx:if="{{myBtn==1?'true':''}}" class="button-add" data-cid='detailDatas.id' bindtap='addShopcar'>加入购物车view>
<view wx:if="{{myBtn==1?'':'true'}}" class="button-add" data-cid='detailDatas.id' bindtap='orderInto'>立即支付view>
view>
view>
// 弹出框显隐控制参数data------
showModalStatus: false,


弹窗

// 弹窗
setModalStatus: function (e) {
let that = this;
var animation = wx.createAnimation({
duration:200,
timingFunction: "linear",
delay: 0
})
this.animation = animation
animation.translateY(300).step();
this.setData({
animationData: animation.export(),
})
if (e.currentTarget.dataset.status == 1) {
this.setData(
{
showModalStatus: true
}
);
}
setTimeout(function () {
animation.translateY(0).step()
this.setData({
animationData: animation
})
if (e.currentTarget.dataset.status == 0) {
this.setData(
{
showModalStatus: false
}
);
}
}.bind(this), 200)
},
/*点击购买弹出购买框 遮照购买层 */
.shade{
width: 100%;
height:100%;
position: fixed;
top:0;
left: 0;
background: rgba(0,0,0,0.5);
}
.shade-shop{
width: 100%;
height: 290rpx;
">white;
position: absolute;
bottom: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
/* 待添加商品详情 */
.shade-shop-detail{
padding: 20rpx 24rpx 40rpx;
}
/* 关闭及加减 */
.detail-right {
/* width: 190rpx; */
}
.detail-title-de{
font-size: 30rpx;
color: #333333;
margin-bottom: 20rpx;
}
/* 右侧增加减少 */
/* 计算加减 */
.stepper{
display: flex;
border-radius: 5px;
text-align: center;
}
.stepper text{
display: block;
width: 50rpx;
height: 52rpx;
border:1px solid #999999;
line-height: 50rpx;
color: #666666;
}
.stepper input{
display: block;
width: 100rpx;
height: 50rpx;
border:1px solid #999999;
line-height: 50rpx;
color: #333333;
font-size: 28rpx;
text-align: center;
}
/* .stepper wx-input.numberin{
width: 120rpx;
} */
.stepper text:first-child{
border-right: none;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.stepper text:last-child{
border-left: none;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
/* 减号禁用样式 */
.stepper .disabled{
border-color: rgba(153,153,153,0.2)
}
.button-add{
width: 100%;
height: 100rpx;
color: white;
line-height: 100rpx;
text-align: center;
font-size: 32rpx;
}
.button-add{
">#b5c2cf;
}

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
Front end Web Development Tools in 2020
Web development is advancing rapidly, with numerous libraries and frameworks showing up and supplanting other, less effective, devices. Web Development Tools help the designers to work with an assortment of innovations. Web Development Tools ought to have the option to give quicker versatile development at lower costs. 
用户4822892
2020/01/08
6820
Why you should Learn Python in 2020
Why-you-should-learn-Python-Programming-Language-in.png
用户4822892
2020/01/31
3940
Why you should Learn Python in 2020
Best IDE for Web Development
Top_10_Full_Stack_Web_Development_IDEs_1.png
用户4822892
2019/12/12
1.2K0
Best IDE for Web Development
Top reasons why you should learn Node.js
Top 10 reasons you should learn Node.js. Open source programming and JavaScript in specific, can appear as though a spot where blast and bust is the standard of law: quick development before everybody proceeds onward to the following enormous thing. But Node.js is unique. In spite of the fact that it unquestionably couldn't be depicted as new, and it's development hasn't been sensational by any measure, over the most recent couple of years it has figured out how to propel itself forward as one of the most broadly used JavaScript tools on earth.
用户4822892
2019/10/23
8510
Top reasons why you should learn Node.js
Top 10 Reasons to learn Java in 2020
Java is an object-oriented programming language that was planned by James Gosling at Sun Microsystems in 1991. The gathering of the Java applications results in the bytecode that can be run on any stage utilizing the Java Virtual Machine.
用户4822892
2020/02/07
5300
Top 10 Reasons to learn Java in 2020
Top JavaScript Frameworks for Web Application Development
JavaScript is a multi-worldview language. It underpins occasion driven, utilitarian, and basic programming styles. JavaScript viewed as the language of the web for conventional customer side use, yet it is additionally now being utilized for server-side applications alongside local versatile application development, work area applications, machine learning for automation, progressive web apps.
用户4822892
2019/07/19
6400
Top JavaScript Frameworks for Web Application Development
Top 5 Programming Languages for Development
Perhaps the simplest approaches to pick the best programming language for web development by tuning in to what the market says.
用户4822892
2019/09/26
8750
Top 5 Programming Languages for Development
Top 10 Python Frameworks for Web Development for 2020
Top Python Frameworks for Web Development for 2020. Top 10 Python Frameworks to Learn in 2020. Here are the top 10 Python frameworks for web development. Python is a programming language that needs any presentation. On the off chance that you are here, it most likely implies that you have some fundamental programming abilities and that you may be looking for roads to investigate increasingly over this specific language.
用户4822892
2019/11/06
6380
Top 10 Python Frameworks for Web Development for 2020
Best JavaScript Frameworks 2020
Every year, many JavaScript libraries and frameworks enter the market. Some of them gain a raised popularity and picked by app development companies for creating futuristic applications, while others remain behind the curtains or go extinct.
用户4822892
2019/12/30
8410
Best JavaScript Frameworks 2020
How to Improve Your Programming Skills?
How-to-Improve-your-Programming-skills.png
用户4822892
2020/02/24
5600
How to Improve Your Programming Skills?
Top 10 Backend Frameworks for Web Development in 2020
Top-10-Backend-Frameworks-for-Web-Development-in-2020.png
用户4822892
2020/01/20
1.2K0
Top 10 Web Development Trends in 2020
Web development is in a transformational period. Clients are at last starting to play out most of their internet perusing on cell phones and are rapidly moving from conventionally composed inquiries to voice searches. 
用户4822892
2020/01/17
1.1K0
Modern Web Development, Design and Deployment
Modern web development, design and deployment can be effectively described as every one of the things that are being done in web development in 2019. In this way, how about we investigate how we got to where we are and the different manners by which 'modern web development' is, well, modern.
用户4822892
2019/10/22
5630
Modern Web Development, Design and Deployment
Free Java Development IDE in 2020
Java is the best programming language in the world. Java made this position by its simplicity and its robust ecosystem of IDEs. Java Development IDEs support specific and general objectives. Many IDEs are paid that are part of the enterprise development stack.
用户4822892
2020/03/30
1K0
Top 5 Python Frameworks for Web Development in 2020
top5pythonframeworksforwebdevelopment.png
用户4822892
2020/02/28
8900
Top 5 Python Frameworks for Web Development in 2020
Choosing a Technology Stack for Web App Development in 2019
ChoosingaWebDevelopment2.png How To Choose The Best Technology Stack For Web Application Development
用户4822892
2019/10/22
4880
Choosing a Technology Stack for Web App Development in 2019
How to Keep Up-to-Date as a Web Developer?
uptodate.jpg Stay Up To Date As A Software Developer. How to update yourself as a web/programming de
用户4822892
2019/11/12
4470
How to Keep Up-to-Date as a Web Developer?
Top 10 Frameworks for Web Application Development
Top frameworks for web application development. Web Application Framework is intended to help the advancement of web applications including web administrations, web assets, and web APIs. Frameworks are, so, libraries that assist you with building up your application quicker and more intelligent!
用户4822892
2019/11/04
7470
Top 10 Frameworks for Web Application Development
Java vs Python
Java and Python are two of the best programming languages in the market right now on account of their flexibility, productivity, and robotization abilities. The two languages remain imperfect, however, the fundamental contrast is that Java is statically composed and Python is progressively composed.
用户4822892
2020/02/19
6040
Java vs Python
Top Java Frameworks Analysis for 2020
Java has demonstrated itself to be the top universally useful programming language for custom programming development.
用户4822892
2019/12/18
6910
Top Java Frameworks Analysis for 2020
相关推荐
Front end Web Development Tools in 2020
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验