534 行
20 KiB
HTML
可执行文件
534 行
20 KiB
HTML
可执行文件
<!DOCTYPE html>
|
|
<html>
|
|
<!--[1.1.31]-->
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>码上有酒后台管理系统</title>
|
|
<link href="{$logo['icourl']}" type="image/x-icon" rel="shortcut icon" >
|
|
<link rel="stylesheet" href="/Public/paper/css/css/font-awesome.min.css">
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/index.css"/>
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui/css/layui.css"/>
|
|
<link rel="stylesheet" href="__PUBLIC__/vue/element-ui.css">
|
|
<script src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
|
|
<style>
|
|
.left_logo>img{
|
|
width:140px;
|
|
height: auto;
|
|
}
|
|
/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
|
|
::-webkit-scrollbar
|
|
{
|
|
width: 8px;
|
|
height: 8px;
|
|
background-color: #F5F5F5;
|
|
}
|
|
/*定义滚动条轨道 内阴影+圆角*/
|
|
::-webkit-scrollbar-track
|
|
{
|
|
-webkit-box-shadow: inset 0 0 3px rgba(0,0,0,0.3);
|
|
border-radius: 10px;
|
|
background-color: #F5F5F5;
|
|
}
|
|
/*定义滑块 内阴影+圆角*/
|
|
::-webkit-scrollbar-thumb
|
|
{
|
|
border-radius: 10px;
|
|
-webkit-box-shadow: inset 0 0 3px rgba(0,0,0,.3);
|
|
background-color: #3f4c73;
|
|
}
|
|
.left_item>.fa{
|
|
font-size: 20px;
|
|
display: inline-block;
|
|
margin-right: 20px;
|
|
color:white;
|
|
width:30px;
|
|
}
|
|
.left_logo {
|
|
width: 100%;
|
|
height: auto;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 10px 30px;
|
|
}
|
|
|
|
.relieve, .binding {
|
|
color: white;
|
|
line-height: 65px;
|
|
margin-right: 100px;
|
|
display: block;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.code-box {
|
|
width: 200px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.code-big-box {
|
|
position: relative;
|
|
}
|
|
|
|
.code-box > img {
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.code-timeout {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 80px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-direction: column;
|
|
background-color: rgba(255, 255, 255, 0.8);
|
|
width: 200px;
|
|
height: 200px;
|
|
}
|
|
|
|
.refresh {
|
|
display: inline-block;
|
|
height: 32px;
|
|
line-height: 32px;
|
|
margin-top: 20px;
|
|
padding: 0 18px;
|
|
background-color: #4394ff;
|
|
color: #fff;
|
|
white-space: nowrap;
|
|
text-align: center;
|
|
font-size: 14px;
|
|
border: none;
|
|
border-radius: 2px;
|
|
cursor: pointer;
|
|
}
|
|
.item-suc-one-1{
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.item-suc-done-img{
|
|
height: 25px;
|
|
width: 25px;
|
|
margin-right: 5px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<div class="box">
|
|
<div class="left">
|
|
<div class="left_logo">
|
|
<img src="{$logoinfo['stageurl']}" onerror="this.onerror=null,this.src='__PUBLIC__/Retail/images/zhihuilogo4.png'" style="margin-left: 10px;margin-right: 0px"/>
|
|
</div>
|
|
<div class="left_item" data-src="{:U('AloneGuide/home')}" style="background-color: rgba(255,255,255,0.2);">
|
|
<i class="fa fa-home"></i>
|
|
<span>首页</span>
|
|
</div>
|
|
<div class="left_item" class="in_inner" data-src="{:U('AloneGuide/record')}">
|
|
<!--<img src="__PUBLIC__/retail/images/s01.png"/>-->
|
|
<i class="fa fa-user-circle-o"></i>
|
|
<span>记录</span>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="right">
|
|
<div class="right_title" style="position: relative">
|
|
<div style="flex:1;color:white;line-height: 65px;margin-left: 30px;display: block" >
|
|
<span>导购管理系统</span>
|
|
</div>
|
|
<div style="color:white;line-height: 65px;margin-right: 20px;display: block;cursor: pointer;">
|
|
<img src="__PUBLIC__/user/images/p1.png" width="15px" style="margin-top: -5px">
|
|
<span><a href="javascript:;" class="in_inners" data-src="{:U('Super/App/index')}" style="color:white;text-decoration: none">软件下载</a></span>
|
|
</div>
|
|
<div style="color:white;line-height: 65px;margin-right: 16px;display: block;cursor: pointer;" >
|
|
<i class="fa fa-question-circle"></i> <span><a href="{:U('Helps/MetInfo')}?types=1" target="_blank" style="color:white;">帮助中心</a></span>
|
|
</div>
|
|
<div style="color:white;line-height: 65px;margin-right: 16px;display: block;cursor: pointer;" >
|
|
<i class="fa fa-thermometer-full"></i> <span><a id="tochangepass" target="_blank" style="color:white;">修改密码</a></span>
|
|
</div>
|
|
<!-- 微信操作 -->
|
|
<div class="relieve" style="color:white;line-height: 65px;margin-right: 100px;display: block;cursor: pointer;" >
|
|
<i class="fa fa-comments"></i> <span><a id="relieve_wx" target="_blank" style="color:white;">解绑微信</a></span>
|
|
</div>
|
|
<div class="binding" style="color:white;line-height: 65px;margin-right: 100px;display: none;cursor: pointer;" >
|
|
<i class="fa fa-comments"></i> <span><a id="binding_wx" target="_blank" style="color:white;">绑定微信</a></span>
|
|
</div>
|
|
|
|
<div class="right_title_nickname" id="userimg">
|
|
<img src="" onerror="this.onerror=null,this.src='__PUBLIC__/Retail/images/s11.png'"/>
|
|
<span>{$guide_userinfo.guidename}</span>
|
|
</div>
|
|
<div class="right_title_quit" id="toclose">
|
|
<img src="__PUBLIC__/Retail/images/quit.png"/>
|
|
</div>
|
|
</div>
|
|
<div class="right_content" style="display: flex">
|
|
<!--右侧内容区-->
|
|
<iframe id="myiframe" width="100%" height="100%" style="flex: 1;" src="{:U('AloneGuide/home')}" frameborder="0" data-id="/Home/Index" scrolling="auto"></iframe>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="changepassalert" style="display: none;">
|
|
<form class="layui-form" action="" style="padding:20px; " autocomplete="off" id="changepassform">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">旧密码</label>
|
|
<div class="layui-input-inline">
|
|
<input type="password" name="oldpass" id="oldpass" placeholder="请输入密码" autocomplete="off" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">请输入旧密码</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">新密码</label>
|
|
<div class="layui-input-inline">
|
|
<input type="password" name="newpass" id="newpass" placeholder="请输入密码" autocomplete="off" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">只能是数字或者字母</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">新密码</label>
|
|
<div class="layui-input-inline">
|
|
<input type="password" name="newpass1" id="newpass1" placeholder="请输入密码" autocomplete="off" class="layui-input">
|
|
</div>
|
|
<div class="layui-form-mid layui-word-aux">只能是数字或者字母</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label"></label>
|
|
<div class="layui-input-inline">
|
|
<button type="button" class="layui-btn" id="dotochangepass">确定</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<!-- 绑定微信 -->
|
|
<el-dialog title="绑定微信" :visible.sync="showUserAuthCode" :width="'400px'" :before-close="closeCode">
|
|
<div class="code-big-box">
|
|
<div class="code-box" v-qrcode="{'value':code}"></div>
|
|
<div class="code-timeout" v-if="isTimeOut">
|
|
<span style="font-weight: bold;color: rgb(68, 68, 68);">二维码过期</span>
|
|
<div class="refresh" @click="refresh">点击刷新</div>
|
|
</div>
|
|
<div class="code-timeout" v-if="isScanCode">
|
|
<div class="item-suc-one-1">
|
|
<img src="__PUBLIC__/login/images/success.png" class="item-suc-done-img">
|
|
<span style="font-weight: bold;">成功扫码,等待确认</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</body>
|
|
<script src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
|
|
<script src="__PUBLIC__/vue/element-ui.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/receipt/Qrcode.js"></script>
|
|
<script type="text/javascript">
|
|
Vue.directive('qrcode',
|
|
function (el, binding) {
|
|
el.innerHTML = "";
|
|
var text = binding.value.value;
|
|
if (text) {
|
|
new QRCode(el, {
|
|
text: text,
|
|
width: 200,
|
|
height: 200,
|
|
colorDark: "#000000",
|
|
colorLight: "#ffffff",
|
|
correctLevel: QRCode.CorrectLevel.H
|
|
});
|
|
}
|
|
})
|
|
|
|
var check_scan;
|
|
var check_auth;
|
|
var app = new Vue({
|
|
el: "#app",
|
|
data: {
|
|
showUserAuthCode: false,
|
|
code: '',
|
|
isTimeOut: false,
|
|
isScanCode: false
|
|
},
|
|
methods: {
|
|
refresh: function () {
|
|
getTokenUrl();
|
|
},
|
|
closeCode:function () {
|
|
clearTimeout(check_scan);
|
|
clearTimeout(check_auth);
|
|
this.showUserAuthCode = false;
|
|
}
|
|
}
|
|
})
|
|
|
|
function imgerror(that,src) {
|
|
that.src = src;
|
|
that.onerror=null;
|
|
}
|
|
$(".left_item").click(function(){
|
|
$(".left_item").css("background","");
|
|
$(this).css("background","rgba(255,255,255,0.2)");
|
|
if($(this).next(".item_next").css('display')=='none'){
|
|
$(".item_next").slideUp('fast');
|
|
$(this).next(".item_next").slideToggle('fast');
|
|
}else{
|
|
$(this).next(".item_next").slideToggle('fast');
|
|
}
|
|
})
|
|
$('.in_inners').click(function () {
|
|
$('.left_item').css('background', 'none');
|
|
var src = $(this).attr('data-src');
|
|
$(this).parent('.item_next').prev('.left_item').css("background", "rgba(255, 255, 255,0.2)");
|
|
if ($(this).parent('.item_next').length) {
|
|
$('.item_next>a').css('color', 'white');
|
|
$(this).css('color', '#eb4a57');
|
|
}
|
|
$('#myiframe').attr('src', src);
|
|
})
|
|
|
|
$('.left_item').click(function () {
|
|
var src = $(this).attr('data-src');
|
|
$('#myiframe').attr('src',src);
|
|
})
|
|
layui.use(['layer','form'],function () {
|
|
var layer = layui.layer;
|
|
var form = layui.form;
|
|
$('#toclose').click(function () {
|
|
layer.confirm('确定退出',function (index) {
|
|
top.window.location.href="{:U('AloneGuide/loginOut')}";
|
|
})
|
|
})
|
|
var ll=0;
|
|
$('#tochangepass').click(function () {
|
|
ll = layer.open({
|
|
type: 1,
|
|
content: $('#changepassalert'),
|
|
title: "修改密码",
|
|
area: '500px',
|
|
success:function () {
|
|
$('#oldpass').focus();
|
|
}
|
|
})
|
|
})
|
|
$('#cancelchangepass').click(function () {
|
|
$('#changepassform')[0].reset();
|
|
layer.close(ll);
|
|
})
|
|
$('#dotochangepass').click(function () {
|
|
var oldpass = $('#oldpass').val();
|
|
var newpass = $('#newpass').val();
|
|
var newpass1 = $('#newpass1').val();
|
|
if(!checkPwd(oldpass)){
|
|
layer.msg('旧密码含有非法字符,只能是数字和字母',{time:1000});
|
|
return false;
|
|
}
|
|
if(!checkPwd(newpass)){
|
|
layer.msg('新密码含有非法字符,只能是数字和字母',{time:1000});
|
|
return false;
|
|
}
|
|
if(!checkPwd(newpass1)){
|
|
layer.msg('新密码含有非法字符,只能是数字和字母',{time:1000});
|
|
return false;
|
|
}
|
|
if(newpass!=newpass1){
|
|
layer.msg('新密码输入不一致',{time:1000});
|
|
return false;
|
|
}
|
|
$.ajax({
|
|
url:"{:U('AloneGuide/dochangepwd')}",
|
|
data:{
|
|
oldpass:oldpass,
|
|
newpass:newpass,
|
|
},
|
|
type:'post',
|
|
success:function (res) {
|
|
if(res.status==1){
|
|
layer.msg(res.msg,{time:2000},function () {
|
|
$('#changepassform')[0].reset();
|
|
layer.close(ll);
|
|
// window.location.href = "http://csls.mobzhifu.com/Retail/login/index/code/1.html";
|
|
})
|
|
}else{
|
|
layer.msg(res.msg,{time:1000});
|
|
}
|
|
},
|
|
error:function (error) {
|
|
console.log(error);
|
|
}
|
|
})
|
|
})
|
|
});
|
|
function checkPwd(pwd){
|
|
var reg=/^[a-zA-Z0-9]{1,}$/;
|
|
if(reg.test(pwd)==false){
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function empty(str) {
|
|
console.log(typeof str);
|
|
if(typeof str=='string'){
|
|
str = str.trim();
|
|
if(!str){
|
|
return false;
|
|
}else{
|
|
return true;
|
|
}
|
|
}else if(typeof str=='array'){
|
|
if(str.length==0){
|
|
return false;
|
|
}else{
|
|
return true;
|
|
}
|
|
}else if(!str){
|
|
return false;
|
|
}else{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/* 微信操作 */
|
|
function get_openid_type() {
|
|
$.ajax({
|
|
url: "{:U('get_openid_type')}",
|
|
type: "post",
|
|
success: function (res) {
|
|
if (res == 1) {
|
|
$('.relieve').show();
|
|
$('.binding').hide();
|
|
} else {
|
|
$('.relieve').hide();
|
|
$('.binding').show();
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
/* 合伙人是否开启微信扫码 */
|
|
function get_scan_type(){
|
|
$.ajax({
|
|
url:"{:U('get_scan_type')}",
|
|
type:"post",
|
|
success:function(res){
|
|
if(res == 1){
|
|
get_openid_type();
|
|
}else{
|
|
$('.relieve').hide();
|
|
$('.binding').hide();
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
get_scan_type();
|
|
|
|
/* 判断二维码过期时间 */
|
|
function check(token, time) {
|
|
if (time >= 30) {
|
|
//显示刷新按钮
|
|
app.isTimeOut = true;
|
|
clearTimeout(check_scan);
|
|
return false;
|
|
} else {
|
|
check_scan = setTimeout(function () {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "{:U('check')}",
|
|
data: {token: token},
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
//显示扫面成功
|
|
clearTimeout(check_scan);
|
|
app.isScanCode = true;
|
|
auth(token, 0); // 调起授权计时器
|
|
} else {
|
|
time++;
|
|
check(token, time);
|
|
}
|
|
}
|
|
})
|
|
}, 1000)
|
|
}
|
|
}
|
|
|
|
function getTokenUrl() {
|
|
$.ajax({
|
|
url: "{:U('random')}",
|
|
type: "post",
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
app.code = res.url;
|
|
check(res.token,0);
|
|
app.showUserAuthCode = true;
|
|
app.isTimeOut = false;
|
|
app.isScanCode = false;
|
|
} else {
|
|
layer.msg(res.msg, {time: 1200, icon: 7});
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
/* 判断授权过期时间 */
|
|
function auth(token, time) {
|
|
if (time >= 30) {
|
|
//显示刷新二维码按钮
|
|
clearTimeout(check_auth);
|
|
app.isTimeOut = true;
|
|
app.isScanCode = false;
|
|
return false;
|
|
} else {
|
|
check_auth = setTimeout(function () {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "{:U('auth')}",
|
|
data: {token: token},
|
|
success: function (res) {
|
|
if (res.status == 1) { // 授权
|
|
//用户授权成功
|
|
clearTimeout(check_scan);
|
|
layer.msg(res.msg, {time: 1200, icon: 1}, function () {
|
|
app.showUserAuthCode = false;
|
|
get_openid_type();
|
|
})
|
|
} else if (res.status == 2) { // 取消
|
|
layer.msg(res.msg, {time: 1200, icon: 1})
|
|
} else {
|
|
time++;
|
|
auth(token, time);
|
|
}
|
|
}
|
|
})
|
|
}, 1000)
|
|
}
|
|
}
|
|
|
|
layui.use(['laydate','upload'],function(){
|
|
var upload = layui.upload;
|
|
var layer = layui.layer
|
|
|
|
/* 绑定微信 */
|
|
$('#binding_wx').click(function () {
|
|
getTokenUrl();
|
|
});
|
|
|
|
/* 解绑微信 */
|
|
$('#relieve_wx').click(function () {
|
|
$.ajax({
|
|
url: "{:U('relieve_wx')}",
|
|
type: "post",
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
layer.msg(res.msg, {time: 800, icon: 1}, function () {
|
|
get_openid_type();
|
|
})
|
|
} else {
|
|
layer.msg(res.msg, {time: 1000, icon: 7});
|
|
}
|
|
}
|
|
});
|
|
})
|
|
})
|
|
</script>
|
|
</html>
|