909 行
37 KiB
HTML
可执行文件
909 行
37 KiB
HTML
可执行文件
<!DOCTYPE html>
|
|
<html>
|
|
<!--[1.4.13]-->
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<title>{$logoinfo.name}后台管理系统</title>
|
|
<link href="{$logoinfo['icourl']}" type="image/x-icon" rel="shortcut icon">
|
|
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.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"/>
|
|
<script type="text/javascript" src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
|
|
<link rel="stylesheet" href="__PUBLIC__/css/common-upload.css">
|
|
<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 > img {
|
|
width: 20px;
|
|
height: auto;
|
|
}
|
|
|
|
.changepassbox {
|
|
position: absolute;
|
|
width: 300px;
|
|
top: 65px;
|
|
right: 0;
|
|
background-color: white;
|
|
box-shadow: 1px 1px 10px #333;
|
|
border-bottom-left-radius: 8px;
|
|
border-bottom-right-radius: 8px;
|
|
box-sizing: border-box;
|
|
overflow: hidden;
|
|
height: 0px;
|
|
}
|
|
|
|
.layui-form-label {
|
|
float: left;
|
|
display: block;
|
|
padding: 9px 15px 9px 0px;
|
|
width: 45px;
|
|
font-weight: 400;
|
|
line-height: 20px;
|
|
text-align: right;
|
|
}
|
|
|
|
.layui-input-block2 {
|
|
display: flex;
|
|
justify-content: space-around;
|
|
align-items: center;
|
|
}
|
|
|
|
.fa {
|
|
color: white;
|
|
margin-right: 5px;
|
|
font-size: 20px;
|
|
width: 30px;
|
|
}
|
|
|
|
.layui-form-label {
|
|
float: left;
|
|
display: block;
|
|
padding: 9px 15px 9px 0px;
|
|
width: 74px;
|
|
font-weight: 400;
|
|
line-height: 20px;
|
|
text-align: right;
|
|
}
|
|
|
|
.rowflex {
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.in_inner {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.in_inners {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.tips {
|
|
text-align: center;
|
|
font-size: 12px;
|
|
color: #999;
|
|
line-height: 30px;
|
|
}
|
|
|
|
.left_name {
|
|
width: 109px;
|
|
text-align: right;
|
|
font-size: 14px;
|
|
line-height: 56px;
|
|
color: #666;
|
|
margin-right: 20px;
|
|
}
|
|
|
|
.binding {
|
|
color: white;
|
|
line-height: 12px;
|
|
margin-right: 20px;
|
|
font-size: 12px;
|
|
display: flex;
|
|
align-items: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.center {
|
|
text-align: center;
|
|
}
|
|
|
|
.list {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
margin: 10px 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<include file="./Application/Admin/View/Upload/index.html"/>
|
|
<div id="app">
|
|
<div class="box">
|
|
<div class="left">
|
|
<div class="left_logo" style="height: auto;padding: 10px;">
|
|
<img src="{$logoinfo['stageurl']}"
|
|
onerror="this.onerror=null,this.src='__PUBLIC__/Retail/images/zhihuilogo4.png'"
|
|
style="margin-left: 0px;margin-right: 0px"/>
|
|
</div>
|
|
<div class="left_item" data-src="{:U('Retail/Store/index')}"
|
|
style="background-color: rgba(255, 255, 255,0.2);">
|
|
<i class="fa fa-home"></i>
|
|
<span>首页</span>
|
|
</div>
|
|
<div class="left_item" data-src="">
|
|
<i class="fa fa-building"></i>
|
|
<span>门店</span>
|
|
</div>
|
|
<div class="item_next">
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Store/store')}">
|
|
门店管理
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Store/statistics')}">
|
|
销售统计
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/statistics/index')}">
|
|
统计报表
|
|
</a>
|
|
</div>
|
|
|
|
<div class="left_item" data-src="">
|
|
<i class="fa fa-bars"></i>
|
|
<span>商品</span>
|
|
</div>
|
|
<div class="item_next">
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/MerCate/index')}">
|
|
商品分类
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Attributes/mIndex')}">
|
|
商品规格
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Mgoods/index')}">
|
|
商品档案
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Mgoodsimport/index')}">
|
|
商品导入
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Supplier/index')}">
|
|
供货商
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/GoodsCode/index')}">
|
|
商品云库
|
|
</a>
|
|
</div>
|
|
<div class="left_item">
|
|
<i class="fa fa-truck"></i>
|
|
<span>货流</span>
|
|
</div>
|
|
<div class="item_next">
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Aallocatmerchant/index')}">
|
|
新建出货单
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Aallocatmerchant/shipmentlist')}">
|
|
出货列表
|
|
</a>
|
|
</div>
|
|
<div class="left_item" data-src="">
|
|
<i class="fa fa-address-card" style="font-size: 16px;"></i>
|
|
<span>会员</span>
|
|
</div>
|
|
<div class="item_next">
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Vip/xcxvip')}">
|
|
普通成员
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Vip/index')}">
|
|
常规会员
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Plus/plusvip')}">
|
|
Plus会员
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Plus/index')}">
|
|
Plus会员设置
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Plus/administration')}">
|
|
Plus会员管理
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/VipImport/index')}">
|
|
会员导入
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Vipbalance/index')}">
|
|
余额记录
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Viprecharge/recharge')}">
|
|
充值记录
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Vip/editRecord')}">
|
|
变更记录
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Viprecharge/index')}">
|
|
充值管理
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/VipBackstageRecharge/index')}">
|
|
会员充值
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Vip/groups')}">
|
|
会员等级
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/VipCard/index')}">
|
|
微信会员卡
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/VipShare/index')}">
|
|
会员卡分享
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Card/cardNotice')}">
|
|
会员卡通知
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Card/template')}">
|
|
会员卡模板
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Vipconfig/index')}">
|
|
基本设置
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/VipCardMenuBar/index')}">
|
|
会员菜单
|
|
</a>
|
|
</div>
|
|
|
|
<div class="left_item" data-src="">
|
|
<i class="fa fa-motorcycle"></i>
|
|
<span>配送</span>
|
|
</div>
|
|
<div class="item_next">
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Delivery/configure')}">
|
|
达达商户
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Delivery/deliveryrecord')}">
|
|
达达配送记录
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Uuerrands/index')}">
|
|
UU跑腿
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Uuerrands/deliveryrecord_uu')}">
|
|
UU跑腿记录
|
|
</a>
|
|
</div>
|
|
|
|
<div class="left_item" data-src="">
|
|
<i class="fa fa-user-circle-o"></i>
|
|
<span>角色</span>
|
|
</div>
|
|
<div class="item_next">
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Manager/manager')}">
|
|
店长
|
|
</a>
|
|
</div>
|
|
|
|
<div class="left_item" data-src="">
|
|
<i class="fa fa-gear"></i>
|
|
<span>设置</span>
|
|
</div>
|
|
<div class="item_next">
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Wxconfig/wxconfig')}">
|
|
公众号配置
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/XcxConfig/wxconfig')}">
|
|
小程序授权
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Wxconfig/menu')}">
|
|
自定义菜单
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Mark/index')}">
|
|
模板消息
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/XcxConfig/setNearby')}">
|
|
小程序设置
|
|
</a>
|
|
<if condition="($pay_pattern_merchant['general_pay'] eq 1) OR ($pay_pattern_merchant['service_pay'] eq 1) OR ($pay_pattern_merchant['new_continent_pay'] eq 1)">
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Payset/paySet')}">
|
|
支付设置
|
|
</a>
|
|
</if>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/BaseSet/index')}">
|
|
支付基本设置
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/DeleteData/index')}">
|
|
清空数据
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Notice/index')}">
|
|
公告
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/Sms/index')}">
|
|
短信设置
|
|
</a>
|
|
<a href="javascript:;" class="in_inner" data-src="{:U('Retail/MerchantImage/index')}">
|
|
图片管理
|
|
</a>
|
|
</div>
|
|
|
|
<div class="left_item" class="in_inner" data-src="{:U('Retail/Plug/index')}">
|
|
<i class="fa fa-cogs"></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>{$merchantname}</span>
|
|
</div>
|
|
<div class="binding">
|
|
<img src="__PUBLIC__/user/images/p1.png" width="16px">
|
|
<span><a href="javascript:;" class="in_inners" data-src="{:U('Super/App/index')}"
|
|
style="color:white;text-decoration: none">软件下载</a></span>
|
|
</div>
|
|
<div class="binding">
|
|
<i class="fa fa-question-circle" style="width: 15px"></i> <span><a
|
|
href="{:U('Super/Helps/MetInfo')}?types=1" target="_blank"
|
|
style="color:white;text-decoration: none">帮助中心</a></span>
|
|
</div>
|
|
<div class="binding">
|
|
<i class="fa fa-thermometer-full" style="width: 20px"></i>
|
|
<span style="margin-left: -10px">
|
|
<a @click="showResetPassword=true" style="color:white;text-decoration: none">修改密码</a>
|
|
</span>
|
|
</div>
|
|
<if condition="$openScan eq 1">
|
|
<div class="binding" :style="isBinding?'':'display:none;'">
|
|
<i class="fa fa-comments" style="width: 20px"></i>
|
|
<span>
|
|
<a @click="relieveWx" style="color:white;">解绑微信</a>
|
|
</span>
|
|
</div>
|
|
<div class="binding" :style="isBinding?'display:none;':''">
|
|
<i class="fa fa-comments" style="width: 20px"></i>
|
|
<span>
|
|
<a @click="bindingWx" style="color:white;">绑定微信</a>
|
|
</span>
|
|
</div>
|
|
</if>
|
|
<div class="right_title_nickname" @click="showSetUserAvatar=true">
|
|
<img id="user_avatar" src="{$user['headimg']}"
|
|
onerror="this.onerror=null,this.src='__PUBLIC__/Retail/images/s11.png'"/>
|
|
<span>{$user['name']}</span>
|
|
</div>
|
|
<div class="right_title_quit" @click="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('Store/index')}"
|
|
frameborder="0"
|
|
data-id="/Home/Index" scrolling="auto"></iframe>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<el-dialog title="修改密码" :visible.sync="showResetPassword" :width="'400px'" :close-on-click-modal="false">
|
|
<div style="padding: 0 20px">
|
|
<el-form :model="passwordForm" :rules="rules" ref="passwordForm" label-width="68px">
|
|
<el-form-item label="旧密码" prop="oldPass">
|
|
<el-input type="password" v-model="passwordForm.oldPass" auto-complete="off"
|
|
placeholder="请输入旧密码"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="新密码" prop="newPass">
|
|
<el-input type="password" v-model="passwordForm.newPass" auto-complete="off"
|
|
placeholder="请输入新密码"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="新密码" prop="newPass1">
|
|
<el-input type="password" v-model="passwordForm.newPass1" auto-complete="off"
|
|
placeholder="再次输入新密码"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="showResetPassword = false">取 消</el-button>
|
|
<el-button type="primary" @click="sureResetPassword('passwordForm')">确 定</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
<el-dialog title="设置头像" :visible.sync="showSetUserAvatar" :width="'400px'">
|
|
<form id="avatar">
|
|
<div class="list">
|
|
<label class="left_name">头像图片
|
|
<el-tooltip class="item" effect="dark" content="点击图片选择本地图片,点击按钮选择图库图片" placement="top-start">
|
|
<i class="el-icon-question"></i>
|
|
</el-tooltip>
|
|
</label>
|
|
<label class="file_label">
|
|
<input type="hidden" name="logo_id"/>
|
|
<input type="file" @change="changeImage" name="logo" placeholder="选择图片"
|
|
accept="image/png,image/jpeg"/>
|
|
<img id="head_url" style="max-width: 200px" :src="avatar"
|
|
onerror="this.onerror=null;this.src='__PUBLIC__/paper/images/wx_add.png'">
|
|
</label>
|
|
</div>
|
|
<div class="center">
|
|
<el-button plain size="small" @click="selectImage('logo')"
|
|
icon="el-icon-upload el-icon--right">图库图片
|
|
</el-button>
|
|
</div>
|
|
<p class="tips">建议大小100*100</p>
|
|
</form>
|
|
<div class="center" style="margin-top: 50px">
|
|
<el-button type="primary" size="medium" @click="setUserAvatar">保存</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
<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>
|
|
<el-dialog title="选择图片" :visible.sync="showSelectImage" custom-class="select-image-el-dialog"
|
|
:top="'10px'">
|
|
<template-select-image :can-select-num="1" @selectfile="selectFile"></template-select-image>
|
|
</el-dialog>
|
|
</div>
|
|
</body>
|
|
<script type="text/javascript" src="__PUBLIC__/receipt/Qrcode.js"></script>
|
|
<script type="text/javascript">
|
|
layui.use('layer', function () {
|
|
var layer = layui.layer;
|
|
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 app = new Vue({
|
|
el: "#app",
|
|
data: {
|
|
avatar: "{$user['headimg']}",
|
|
showUserAuthCode: false,
|
|
code: '',
|
|
isTimeOut: false,
|
|
isScanCode: false,
|
|
scan_type: false,
|
|
showSetUserAvatar: false,
|
|
showSelectImage: false,
|
|
actFileName: '',
|
|
isBinding: "{$user['openid_type']}" == 1 ? true : false,
|
|
check_scan: null,
|
|
check_auth: null,
|
|
showResetPassword: false,
|
|
passwordForm: {
|
|
oldPass: '',
|
|
newPass: '',
|
|
newPass1: '',
|
|
},
|
|
rules: {
|
|
oldPass: [{message: '请输入原密码', required: true, trigger: 'blur'}],
|
|
newPass: [{message: '请输入新密码', required: true, trigger: 'blur'}],
|
|
newPass1: [{message: '再次输入新密码', required: true, trigger: 'blur'}],
|
|
}
|
|
},
|
|
methods: {
|
|
newCheckPwd: function (pwd) {
|
|
var reg = /^[a-zA-Z0-9.+*-/<>?!@#$%^&*():''"";]{1,}$/;
|
|
if (!reg.test(pwd)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
sureResetPassword: function (formName) {
|
|
var that = this;
|
|
this.$refs[formName].validate((valid) => {
|
|
if (valid) {
|
|
if (that.passwordForm.newPass != that.passwordForm.newPass) {
|
|
that.$message({
|
|
type: 'error',
|
|
message: '新密码不一致',
|
|
duration: 1000
|
|
});
|
|
return;
|
|
} else if (!that.newCheckPwd(that.passwordForm.newPass)) {
|
|
that.$message({
|
|
type: 'error',
|
|
message: '只支持数字字母及字符.+*-/<>?!@#$%^&*():\'\'"";',
|
|
duration: 3000
|
|
});
|
|
return;
|
|
}
|
|
$.post("{:U('doChangePwd')}", {
|
|
oldPass: this.passwordForm.oldPass,
|
|
newPass: this.passwordForm.newPass,
|
|
newPass1: this.passwordForm.newPass1
|
|
}, function (res) {
|
|
if (res.status == 1) {
|
|
that.$message({
|
|
type: 'success',
|
|
message: res.msg,
|
|
duration: 1000,
|
|
onClose: function () {
|
|
that.showResetPassword = false;
|
|
that.passwordForm = {
|
|
oldPass: '',
|
|
newPass: '',
|
|
newPass1: '',
|
|
};
|
|
}
|
|
});
|
|
} else {
|
|
that.$message({
|
|
type: 'error',
|
|
message: res.msg,
|
|
duration: 1000
|
|
});
|
|
}
|
|
})
|
|
} else {
|
|
return false;
|
|
}
|
|
});
|
|
},
|
|
closeAvatar: function () {
|
|
this.showSetUserAvatar = false;
|
|
},
|
|
refresh: function () {
|
|
//刷新token
|
|
this.getTokenUrl();
|
|
},
|
|
closeCode: function () {
|
|
//关闭授权
|
|
clearTimeout(this.check_scan);
|
|
clearTimeout(this.check_auth);
|
|
this.showUserAuthCode = false;
|
|
},
|
|
selectFile: function (item) {
|
|
//选择文件
|
|
console.log(item);
|
|
this.showSelectImage = false;
|
|
if (item.length) {
|
|
$("input[name='" + this.actFileName + "']").val('');
|
|
$("input[name='" + this.actFileName + "_id']").val(item[0].id);
|
|
this.avatar = item[0].path;
|
|
}
|
|
},
|
|
selectImage: function (actName) {
|
|
//将选择图片
|
|
this.actFileName = actName;
|
|
this.showSelectImage = true;
|
|
},
|
|
changeImage: function () {
|
|
var that = this;
|
|
if (window.event.target.files.length) {
|
|
var imgObj = window.event.target.files[0];
|
|
var imgType = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'];
|
|
if (jQuery.inArray(imgObj.type, imgType) != -1) {
|
|
var reader = new FileReader();
|
|
reader.readAsDataURL(imgObj);
|
|
reader.onload = function () {
|
|
that.avatar = this.result;
|
|
}
|
|
}
|
|
}
|
|
},
|
|
setUserAvatar: function () {
|
|
//设置头像
|
|
if (!$("input[name='logo']").val() && !$("input[name='logo_id']").val()) {
|
|
this.$message({
|
|
type: 'warning',
|
|
message: '您未修改头像',
|
|
duration: 1000
|
|
});
|
|
return;
|
|
}
|
|
var fd = new FormData(document.getElementById('avatar'));
|
|
var that = this;
|
|
$.ajax({
|
|
url: "{:U('setUserImage')}",
|
|
type: "post",
|
|
data: fd,
|
|
processData: false, // jQuery不要去处理发送的数据
|
|
contentType: false, // jQuery不要去设置Content-Type请求头
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
$('#user_avatar').attr('src', $('#head_url').attr('src'));
|
|
that.$message({
|
|
type: 'success',
|
|
message: res.msg,
|
|
duration: 1000,
|
|
onClose: function () {
|
|
$("input[name='logo']").val('');
|
|
that.showSetUserAvatar = false;
|
|
}
|
|
});
|
|
} else {
|
|
that.$message({
|
|
type: 'error',
|
|
message: res.msg,
|
|
duration: 1000
|
|
});
|
|
}
|
|
}
|
|
})
|
|
},
|
|
relieveWx: function () {
|
|
var that = this;
|
|
$.post("{:U('relieve_wx')}", {}, function (res) {
|
|
if (res.status == 1) {
|
|
that.isBinding = false;
|
|
that.$message({
|
|
type: 'success',
|
|
message: res.msg,
|
|
duration: 1000
|
|
});
|
|
} else {
|
|
that.$message({
|
|
type: 'error',
|
|
message: res.msg,
|
|
duration: 1000
|
|
});
|
|
}
|
|
});
|
|
},
|
|
bindingWx: function () {
|
|
this.getTokenUrl();
|
|
},
|
|
getTokenUrl: function () {
|
|
var that = this;
|
|
$.post("{:U('random')}", {}, function (res) {
|
|
if (res.status == 1) {
|
|
that.code = res.url;
|
|
that.check(res.token, 0);
|
|
that.showUserAuthCode = true;
|
|
that.isTimeOut = false;
|
|
that.isScanCode = false;
|
|
} else {
|
|
that.$message({
|
|
type: 'error',
|
|
message: res.msg,
|
|
duration: 1000
|
|
});
|
|
}
|
|
})
|
|
},
|
|
check: function (token, time) {
|
|
/* 判断二维码过期时间 */
|
|
if (time >= 30) {
|
|
//显示刷新按钮
|
|
this.isTimeOut = true;
|
|
clearTimeout(this.check_scan);
|
|
return false;
|
|
} else {
|
|
var that = this;
|
|
this.check_scan = setTimeout(function () {
|
|
$.post("{:U('check')}", {token: token}, function (res) {
|
|
if (res.status == 1) {
|
|
//显示扫面成功
|
|
clearTimeout(that.check_scan);
|
|
that.isScanCode = true;
|
|
that.auth(token, 0); // 调起授权计时器
|
|
} else {
|
|
time++;
|
|
that.check(token, time);
|
|
}
|
|
})
|
|
}, 1000)
|
|
}
|
|
},
|
|
auth: function (token, time) {
|
|
/* 判断授权过期时间 */
|
|
if (time >= 30) {
|
|
//显示刷新二维码按钮
|
|
clearTimeout(check_auth);
|
|
this.isTimeOut = true;
|
|
this.isScanCode = false;
|
|
return false;
|
|
} else {
|
|
var that = this;
|
|
this.check_auth = setTimeout(function () {
|
|
$.post("{:U('auth')}", {token: token}, function (res) {
|
|
if (res.status == 1) { // 授权
|
|
//用户授权成功
|
|
clearTimeout(that.check_scan);
|
|
that.showUserAuthCode = false;
|
|
that.isBinding = true;
|
|
that.$message({
|
|
message: res.msg,
|
|
type: 'success',
|
|
center: true
|
|
});
|
|
} else if (res.status == 2) { // 取消授权
|
|
that.$message({
|
|
message: res.msg,
|
|
type: 'error',
|
|
center: true
|
|
});
|
|
} else {
|
|
time++;
|
|
that.auth(token, time);
|
|
}
|
|
})
|
|
}, 1000)
|
|
}
|
|
},
|
|
toClose: function () {
|
|
this.$confirm('确定退出登录?', '温馨提示', {
|
|
confirmButtonText: '退出',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
window.location.href = "{:U('loginOut')}";
|
|
}).catch(() => {
|
|
});
|
|
}
|
|
}
|
|
})
|
|
|
|
$('.left_item').click(function () {
|
|
var src = $(this).attr('data-src');
|
|
$('.left_item').css('background', 'none');
|
|
$(this).css('background', 'rgba(255, 255, 255,0.2)');
|
|
$(this).prevAll(".item_next").slideUp();
|
|
$(this).next().nextAll(".item_next").slideUp();
|
|
$('.item_next>a').css('color', 'white');
|
|
var str2 = $(this).attr('data-src2')
|
|
if (!src && !str2) {
|
|
$(".left_item").css("background", "");
|
|
$(this).css("background", "rgba(255, 255, 255,0.2)");
|
|
$(this).next('.item_next').slideToggle('fast');
|
|
} else {
|
|
if (src) {
|
|
$('#myiframe').attr('src', src);
|
|
} else {
|
|
shop($(this).attr('data-src2'));
|
|
}
|
|
}
|
|
})
|
|
|
|
$('.in_inner').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');
|
|
}
|
|
if (src) {
|
|
$('#myiframe').attr('src', src);
|
|
} else {
|
|
shop($(this).attr('data-src2'));
|
|
}
|
|
})
|
|
|
|
function shop(src) {
|
|
// console.log(src);
|
|
$.ajax({
|
|
url: "{:U('Wxconfig/tosetvip')}",
|
|
type: 'post',
|
|
data: {},
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
$.ajax({
|
|
url: "{:U('Retail/Login/selltoshop')}?id=" + res.id + "&code=" + res.code,
|
|
dataType: 'jsonp',
|
|
crossDomain: true,
|
|
success: function (data) {
|
|
// console.log(data);
|
|
if (data.status == 1) {
|
|
$('#myiframe').attr('src', src);
|
|
} else {
|
|
layer.alert('网络错误,无法设置小程序授权')
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
$('.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);
|
|
})
|
|
})
|
|
|
|
</script>
|
|
</html>
|