Browse Source

场景码校验

h5_css
yanyan 3 years ago
parent
commit
dcc70bf7e8
  1. 88
      subpkg/list/list.vue
  2. 2
      subpkg/message/message.vue

88
subpkg/list/list.vue

@ -26,6 +26,11 @@
<uni-search-bar class="my-search-box" @confirm="search" @input="input" cancel-button="none"></uni-search-bar> <uni-search-bar class="my-search-box" @confirm="search" @input="input" cancel-button="none"></uni-search-bar>
</view> </view>
</view> </view>
<view class="verify" v-if="showVerify ==true" >
<label @click="close()" class="close-button"></label>
<uni-easyinput type="text" v-model="validateCode" placeholder="请输入场景码"/>
<button class="uni-button" size="mini" type="" @click="verifyMethod()">确定</button>
</view>
<!-- 场景区域 --> <!-- 场景区域 -->
<view class="nav-list"> <view class="nav-list">
<view class="nav-item" v-for="(item, i) in sceneList" :key="i" @click="navClickHandler(item)"> <view class="nav-item" v-for="(item, i) in sceneList" :key="i" @click="navClickHandler(item)">
@ -55,8 +60,11 @@
}, },
time:1, time:1,
total:0, total:0,
showVerify:false,
validateCode:null,
search: false, search: false,
isloading:false, isloading:false,
item:null,
//轮播图数据列表 //轮播图数据列表
swiperList: [], swiperList: [],
//场景数据列表 //场景数据列表
@ -125,11 +133,29 @@
}, },
navClickHandler(item) { navClickHandler(item) {
if(item !== ""){ if(item !== ""){
uni.navigateTo({ if(this.queryObj.isOpen == 1){
url: '/subpkg/role/role?guid=' + item.guid+'&name='+item.name this.showVerify = true
}) this.item = item
} else{
uni.navigateTo({
url: '/subpkg/role/role?guid=' + item.guid+'&name='+item.name
})
}
} }
}, },
close(){
this.showVerify = false
},
verifyMethod(){
if (this.validateCode == null){
return uni.showToast({title:'场景码不能为空',icon:'none'})
} else if(parseInt(this.validateCode)!== this.item.code){
return uni.showToast({title:'场景码错误',icon:'none'})
}
uni.navigateTo({
url: '/subpkg/role/role?guid=' + this.item.guid+'&name='+this.item.name
})
},
input(e){ input(e){
clearTimeout(this.timer) clearTimeout(this.timer)
@ -231,5 +257,61 @@
.uni-searchbar__box { .uni-searchbar__box {
border: 1px solid #ddd; border: 1px solid #ddd;
} }
.verify {
border-radius: 10px;
background-color: #c0b9e1;
opacity: 0.9;
position: absolute;
top: 45%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 400rpx;
height: 300rpx;
padding: 30rpx;
z-index: 9999;
}
.uni-button {
margin-top: 40rpx;
font-size: 30rpx;
width: 100%;
height: 70rpx;
display: flex;
align-items: center;
justify-content: center;
background: #1367fe;
border-radius: 50rpx;
color: #fff;
line-height: 70rpx;
}
.close-button {
position: absolute;
top: -60rpx;
right: -10rpx;
width: 50rpx;
height: 50rpx;
background-color: rgba(255, 255, 255, .5);
border: 1rpx solid rgba(255, 255, 255, .7);
border-radius: 50%;
transform: rotate(45deg);
}
.close-button:before,
.close-button:after {
content: '';
position: absolute;
top: 50%;
left: 50%;
background: #333;
border-radius: 50%;
transform: translate(-50%, -50%);
height: 24rpx;
width: 4rpx;
}
.close-button:after {
height: 4rpx;
width: 24rpx;
}
</style> </style>

2
subpkg/message/message.vue

@ -26,7 +26,7 @@
messageList:[], messageList:[],
queryObj:{ queryObj:{
pageNum:1, pageNum:1,
pageSize:10, pageSize:9,
open:0 open:0
}, },
total:0, total:0,

Loading…
Cancel
Save