文件
mashangyoujiu/Application/Retail/View/Binding/scan_login.html

226 行
6.5 KiB
HTML
可执行文件

<!DOCTYPE html>
<html>
<!--[1.6.9]-->
<head>
<meta charset="utf-8"/>
<meta name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
<title>确认登录</title>
<link rel="stylesheet" href="__PUBLIC__/vip/css/accredit.css">
<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
<style type="text/css">
[v-cloak] {
display: none;
}
body {
background: white;
}
#login {
margin-top: 80px;
}
.icon {
display: block;
width: 100px;
height: 100px;
margin: auto;
}
.texta {
text-align: center;
line-height: 30px;
font-size: 14px;
box-sizing: border-box;
padding-bottom: 20px;
color: #666;
font-weight: bold;
margin-top: 20px;
}
.textb {
text-align: center;
font-size: 13px;
color: #999;
font-weight: 500;
}
.item-btn {
width: 50%;
height: 40px;
line-height: 40px;
font-size: 16px;
outline: none;
color: white;
font-weight: bold;
background-color: #07c160;
border: 1px solid #07c160;
border-radius: 5px;
}
.item-div-btn {
width: 100%;
display: flex;
justify-content: center;
}
.item-btn-one {
width: 90%;
height: 40px;
background: #FFffff;
line-height: 40px;
color: #333;
font-size: 16px;
outline: none;
border: none;
margin-top: 20px;
}
.login-btn {
width: 150px;
padding: 5px 0;
color: #666;
margin: 10px auto;
border-radius: 5px;
outline: none;
box-shadow: none;
text-align: center;
cursor: pointer;
border: 1px solid #ccc;
}
.select {
border-color: #07c160;
color: #07c160;
}
.fixed {
position: fixed;
left: 0;
bottom: 40px;
width: 100%;
}
.tips {
text-align: center;
color: #07c160;
}
</style>
</head>
<body>
<div id="login" v-cloak :style="userList.length==4?'margin-top:50px':userList.length==5?'margin-top:20px':''">
<div class="item-img">
<img class="icon" src="__PUBLIC__/login/images/4.png">
</div>
<div class="texta">
<if condition="$canScan eq 1">
<span style="font-size: 16px">登录确认</span>
<else/>
<span style="font-size: 16px;color:#07c160">您没有登陆权限</span>
</if>
<p class="textb">
<if condition="$canScan eq 1">为保障账户安全,请确保是本人操作
<else/>
请取消登陆
</if>
</p>
</div>
<div class="fixed" :style="userList.length>3?'bottom:20px':''">
<if condition="$canScan eq 1">
<div class="form-btn" @click="userLogin">
<button class='item-btn'>登录</button>
</div>
<div class="item-div-btn" @click="user_call_off">
<button class='item-btn-one'>取消登录</button>
</div>
<else/>
<div class="form-btn" @click="userClose">
<button class='item-btn'>关闭扫码</button>
</div>
</if>
</div>
<div id="userList" v-if="userList.length>1">
<div class="tips">请选择登录角色</div>
<template v-for="(item,index) in userList">
<div class="login-btn" @click="doSelect(index)" :class="selectIndex==index?'select':''">{{ item.name }}
</div>
</template>
</div>
</div>
<script src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
<script src="__PUBLIC__/vip/js/jquery-3.2.1.min.js"></script>
<script src="__PUBLIC__/vip/js/window-reload.js"></script>
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
<script type="text/javascript">
var layer;
layui.use(['layer'], function () {
layer = layui.layer;
});
new Vue({
el: "#login",
data: {
userList: {$userList},
selectIndex: -1,
},
methods: {
doSelect: function (index) {
this.selectIndex = index;
},
/* 用户登陆 */
userLogin: function () {
if (this.userList.length > 1 && this.selectIndex == -1) {
layer.msg('请选择登录角色', {time: 1000});
return;
} else {
this.selectIndex = this.selectIndex == -1 ? 0 : this.selectIndex;
}
var jurId = this.userList[this.selectIndex]['id'];
var index = layer.load(1, {
shade: [0.1, '#ccc']
});
var token = "{$token}";
$.post("{:U('userLogin')}", {
token: token,
jurId: jurId
}, function (res) {
layer.close(index);
layer.msg(res.msg, {time: 1500}, function () {
if (res.status == 1) {
WeixinJSBridge.call('closeWindow');
}
});
})
},
/* 用户取消 */
user_call_off: function () {
var token = "{$token}";
$.post("{:U('user_call_off')}", {
token: token
}, function (res) {
top.layer.msg(res.msg, {time: 1500}, function () {
WeixinJSBridge.call('closeWindow');
});
})
},
userClose: function () {
var token = "{$token}";
$.post("{:U('userClose')}", {
token: token
}, function (res) {
top.layer.msg(res.msg, {time: 1500}, function () {
WeixinJSBridge.call('closeWindow');
});
})
}
},
created: function () {
},
})
</script>
</body>
</html>