本文给大家带来的是微信小程序输入产品识别码查询页面设计制作开发教程,制作好以后效果图如下:
一、wxml页面代码如下:
<!--pages/index/verification.wxml-->
<view class="container">
<view wx:if="{{verification}}" class="verification-none">
<image src="/assets/images/zhuisuyanzhen@2x.png"></image>
<view class="magrin-top-50 font-color-999">追溯验真功能即将上线</view>
<view class="magrin-top-44 font-color-999">敬请期待</view>
</view>
<view wx:else class="verification">
<view class="list ">
<view class="list-hd font-color-c24e4e">请输入产品追溯识别码</view>
<view class="input-box">
<view class="box_bd" >
<input class="box_bd_input" bindinput="bindCodeInput1" placeholder="请输入识别码" />
</view>
<navigator url="verificationDetail?code={{code1}}" class="box_ft bg-color-c24e4e font-color-fefefe">查询</navigator>
</view>
<view class="list-ft font-color-999">本数据由仁怀市xxxx数据中心提供</view>
</view>
<view class="list">
<view class="list-hd font-color-c24e4e"> 请输入酱酒宝验真识别码</view>
<view class="input-box">
<view class="box_bd" >
<input class="box_bd_input" bindinput="bindCodeInput2" placeholder="请输入识别码" />
</view>
<navigator url="verificationDetail?code={{code2}}" class="box_ft bg-color-c24e4e font-color-fefefe">查询</navigator>
</view>
</view>
</view>
</view>
|
二、wxss样式文件代码如下:
/* pages/index/verification.wxss */
.verification-none{
padding-top: 200rpx;
text-align: center;
}
.verification-none image{
width: 200rpx;
height: 200rpx;
}
.magrin-top-50{
margin-top: 50rpx;
}
.magrin-top-44{
margin-top: 44rpx;
}
.list{
padding: 40rpx;
background-color:#fff;
margin-top: 20rpx;
}
.input-box{
margin: 40rpx 0 ;
display: flex;
justify-content: space-between;
}
.list .box_bd{
height: 100rpx;
display:flex;
box-sizing: border-box;
border: 1px solid #999999;
width: 450rpx;
align-items: center;
justify-content: center;
}
.list .box_ft{
width: 200rpx;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
}
|
三、js页面代码如下:
// pages/index/verification.js
Page({
data:{
verification:false,
code1:null,
code2:null
},
onLoad:function(options){
// 页面初始化 options为页面跳转所带来的参数
},
onReady:function(){
// 页面渲染完成
},
onShow:function(){
// 页面显示
},
onHide:function(){
// 页面隐藏
},
bindCodeInput1(e){
//console.log(e.detail.value)
this.setData({
code1:e.detail.value
})
},
bindCodeInput2(e){
this.setData({
code2:e.detail.value
})
},
onUnload:function(){
// 页面关闭
}
})
|