Merge branch 'release' into feature/ylw-06-17
commit
c8924779c4
@ -0,0 +1,233 @@
|
||||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
|
||||
use User\Api\UserApi as UserApi;
|
||||
use Base\Service\PresidentDepositService;
|
||||
|
||||
/**
|
||||
* 推广限制
|
||||
*/
|
||||
class PromoteLimitRuleController extends ThinkController
|
||||
{
|
||||
public function records()
|
||||
{
|
||||
$page = I('p', 1);
|
||||
$row = I('row', 10);
|
||||
$companyId = I('company_id', 0);
|
||||
$promoteId = I('promote_id', 0);
|
||||
|
||||
$conditions = [];
|
||||
$promoteIds = [];
|
||||
if ($promoteId !== 0) {
|
||||
$promoteIds = [$promoteId];
|
||||
}
|
||||
if ($companyId !== 0) {
|
||||
$companyPromoteIds = M('promote', 'tab_')->field(['id'])->where(['company_id' => $companyId, 'level' => 1])->getField('id', true);
|
||||
if (count($companyPromoteIds) > 0) {
|
||||
$promoteIds = count($promoteIds) ? array_intersect($companyPromoteIds, $promoteIds) : $companyPromoteIds;
|
||||
$promoteIds[] = 0;
|
||||
} else {
|
||||
$promoteIds = [0];
|
||||
}
|
||||
}
|
||||
if (count($promoteIds)) {
|
||||
$conditions['promote_id'] = ['in', $promoteIds];
|
||||
}
|
||||
$query = M('promote_limit_rules', 'tab_')->where($conditions);
|
||||
|
||||
$countQuery = clone $query;
|
||||
$rules = $query->page($page, $row)->select();
|
||||
$count = $countQuery->count();
|
||||
|
||||
$recordPromotes = [];
|
||||
$recordCompanys = [];
|
||||
if (count($rules) > 0) {
|
||||
$recordPromotes = M('promote', 'tab_')->field(['id', 'account', 'company_id'])->where(['id' => ['in', array_column($rules, 'promote_id')]])->select();
|
||||
$recordCompanyIds = array_column($recordPromotes, 'company_id');
|
||||
if (count($recordCompanyIds) > 0) {
|
||||
$recordCompanys = M('promote_company', 'tab_')->field(['id', 'company_name', 'company_belong'])->where(['id' => ['in', $recordCompanyIds]])->select();
|
||||
}
|
||||
$recordPromotes = index_by_column('id', $recordPromotes);
|
||||
$recordCompanys = index_by_column('id', $recordCompanys);
|
||||
}
|
||||
|
||||
$companyTypes = [
|
||||
0 => '内团',
|
||||
1 => '外团',
|
||||
2 => '外团-分发联盟',
|
||||
3 => '无'
|
||||
];
|
||||
|
||||
$records = [];
|
||||
foreach ($rules as $rule) {
|
||||
$records[] = [
|
||||
'id' => $rule['id'],
|
||||
'promote_account' => $recordPromotes[$rule['promote_id']]['account'],
|
||||
'company_name' => $recordCompanys[$recordPromotes[$rule['promote_id']]['company_id']]['company_name'],
|
||||
'company_belong' => $companyTypes[$recordCompanys[$recordPromotes[$rule['promote_id']]['company_id']]['company_belong']],
|
||||
'limit_rule' => $this->getDisplayRule($rule),
|
||||
];
|
||||
}
|
||||
$companys = M('promote_company', 'tab_')->field(['id', 'company_name'])->select();
|
||||
|
||||
$page = set_pagination($count, $row);
|
||||
if($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
$this->assign('records', $records);
|
||||
$this->assign('companys', $companys);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
private function getDisplayRule($rule)
|
||||
{
|
||||
if ($rule['started_at'] === null && $rule['ended_at'] === null) {
|
||||
return '永久';
|
||||
} elseif ($rule['started_at'] === null && $rule['ended_at'] !== null) {
|
||||
return '从前 至 '.$rule['ended_at'];
|
||||
} elseif ($rule['started_at'] !== null && $rule['ended_at'] === null) {
|
||||
return $rule['started_at'] . ' 至 永久';
|
||||
} else {
|
||||
return $rule['started_at'] . ' ~ ' . $rule['ended_at'];
|
||||
}
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$this->meta_title = '编辑推广限制';
|
||||
$id = I('id', 0);
|
||||
$companys = M('promote_company', 'tab_')->field(['id', 'company_name'])->select();
|
||||
$record = M('promote_limit_rules', 'tab_')->where(['id' => $id])->find();
|
||||
$promote = null;
|
||||
$company = null;
|
||||
if ($record) {
|
||||
$promote = M('promote', 'tab_')->where(['id' => $record['promote_id']])->field(['id', 'company_id', 'account'])->find();
|
||||
$company = M('promote_company', 'tab_')->where(['id' => $promote['company_id']])->field(['id', 'company_name'])->find();
|
||||
}
|
||||
$this->assign('promote', $promote);
|
||||
$this->assign('company', $company);
|
||||
$this->assign('companys', $companys);
|
||||
$this->assign('record', $record);
|
||||
$this->display('form');
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
$id = I('id', 0);
|
||||
$promoteId = I('promote_id', 0);
|
||||
$startedAt = I('started_at', '');
|
||||
$endedAt = I('ended_at', '');
|
||||
|
||||
$startedAt = $startedAt === '' ? null : $startedAt;
|
||||
$endedAt = $endedAt === '' ? null : $endedAt;
|
||||
|
||||
if ($startedAt && $endedAt && strtotime($startedAt) > strtotime($endedAt)) {
|
||||
return $this->error('开始时间不能大于结束时间');
|
||||
}
|
||||
|
||||
$record = null;
|
||||
if ($id > 0) {
|
||||
$record = M('promote_limit_rules', 'tab_')->where(['id' => $id])->find();
|
||||
if (!$record) {
|
||||
return $this->error('修改记录不存在');
|
||||
}
|
||||
} else {
|
||||
if (empty($promoteId)) {
|
||||
return $this->error('请选择会长');
|
||||
}
|
||||
$promoteRecord = M('promote_limit_rules', 'tab_')->where(['promote_id' => $promoteId])->find();
|
||||
if ($promoteRecord) {
|
||||
return $this->error('该会长已经设定限制规则,请前往更新');
|
||||
}
|
||||
}
|
||||
|
||||
if ($record) {
|
||||
$data = [];
|
||||
$data['started_at'] = $startedAt;
|
||||
$data['ended_at'] = $endedAt;
|
||||
$data['update_time'] = time();
|
||||
M('promote_limit_rules', 'tab_')->where(['id' => $id])->save($data);
|
||||
addOperationLog([
|
||||
'op_type' => 1,
|
||||
'key'=> $promoteId . '/' . $startedAt . '/' . $endedAt,
|
||||
'op_name' => '修改推广限制',
|
||||
'url' => U('PresidentDeposit/edit', ['id'=>$id]), 'menu'=>'推广员-推广员管理-推广限制-修改推广限制'
|
||||
]);
|
||||
} else {
|
||||
$data = [];
|
||||
$data['promote_id'] = $promoteId;
|
||||
$data['started_at'] = $startedAt;
|
||||
$data['ended_at'] = $endedAt;
|
||||
$data['create_time'] = time();
|
||||
$data['update_time'] = time();
|
||||
M('promote_limit_rules', 'tab_')->add($data);
|
||||
addOperationLog([
|
||||
'op_type' => 0,
|
||||
'key'=> $promoteId . '/' . $startedAt . '/' . $endedAt,
|
||||
'op_name' => '新增推广限制',
|
||||
'url' => U('PresidentDeposit/edit', ['promote_id'=>$promoteId]), 'menu'=>'推广员-推广员管理-推广限制-新增推广限制'
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->success('保存成功', U('records'));
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$id = I('id', 0);
|
||||
M('promote_limit_rules', 'tab_')->where(['id' => $id])->delete();
|
||||
|
||||
addOperationLog([
|
||||
'op_type' => 2,
|
||||
'key' => $id,
|
||||
'op_name' => '删除会长推广限制',
|
||||
'url' => U('PresidentDeposit/delete', ['id' => $id]),
|
||||
'menu' => '推广员-推广员管理-推广限制-删除推广限制'
|
||||
]);
|
||||
|
||||
$this->ajaxReturn([
|
||||
'status' => 1,
|
||||
'message' => '删除成功'
|
||||
]);
|
||||
}
|
||||
|
||||
public function batchDelete()
|
||||
{
|
||||
$ids = I('ids', []);
|
||||
if (count($ids) == 0) {
|
||||
$this->ajaxReturn([
|
||||
'status' => 0,
|
||||
'message' => '无选中项'
|
||||
]);
|
||||
}
|
||||
M('promote_limit_rules', 'tab_')->where(['id' => ['in', $ids]])->delete();
|
||||
|
||||
addOperationLog([
|
||||
'op_type' => 2,
|
||||
'key' => implode(',', $ids),
|
||||
'op_name' => '批量删除会长推广限制',
|
||||
'url' => U('PresidentDeposit/batchDelete', ['ids' => implode(',', $ids)]),
|
||||
'menu' => '推广员-推广员管理-推广限制-批量删除推广限制'
|
||||
]);
|
||||
|
||||
$this->ajaxReturn([
|
||||
'status' => 1,
|
||||
'message' => '删除成功'
|
||||
]);
|
||||
}
|
||||
|
||||
public function getPromotesByCompany()
|
||||
{
|
||||
$companyId = I('company_id', 0);
|
||||
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where(['level' => 1, 'company_id' => $companyId])->select();
|
||||
|
||||
$this->ajaxReturn([
|
||||
'status' => 1,
|
||||
'message' => '获取成功',
|
||||
'data' => [
|
||||
'promotes' => $promotes
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,241 @@
|
||||
<extend name="Public/base" />
|
||||
|
||||
<block name="body">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
|
||||
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
|
||||
<style>
|
||||
.tabcon1711 input.time {
|
||||
width: 150px;
|
||||
}
|
||||
#form .txt_area {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
}
|
||||
.tabcon1711 .form_unit {
|
||||
margin-left: 2px;
|
||||
}
|
||||
.tabcon1711 .mustmark {
|
||||
margin-left:-7px;
|
||||
}
|
||||
.list-ratio {
|
||||
display: table;
|
||||
}
|
||||
.list-ratio .li-ratio {
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
align-items: center;
|
||||
}
|
||||
.list-ratio .li-ratio .turnover, .list-ratio .li-ratio .turnover-ratio {
|
||||
position: relative;
|
||||
}
|
||||
.list-ratio .li-ratio .turnover span, .list-ratio .li-ratio .turnover-ratio .error-message {
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 30px;
|
||||
white-space: nowrap;
|
||||
display: none;
|
||||
}
|
||||
.iconfont-btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
.iconfont-style {
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
border-radius: 4px;
|
||||
border: 0;
|
||||
padding: 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.iconfont-selected {
|
||||
background-color: #0A9AF2;
|
||||
}
|
||||
.iconfont-selected:hover {
|
||||
background-color: #03a9f4;
|
||||
}
|
||||
.iconfont-unselected {
|
||||
background-color: #999;
|
||||
}
|
||||
.iconfont-unselected:hover {
|
||||
background-color: #ababab;
|
||||
}
|
||||
</style>
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">{$meta_title}</h3>
|
||||
<!-- <p class="description_text">说明:此功是创建推广员时所需填写信息</p>-->
|
||||
</div>
|
||||
|
||||
<!-- 标签页导航 -->
|
||||
<div class="tab-wrap">
|
||||
<div class="tab-content tabcon1711">
|
||||
<!-- 表单 -->
|
||||
<form id="form" action="{:U('save')}" method="post" class="form-horizontal">
|
||||
<!-- 基础文档模型 -->
|
||||
<div id="tab1" class="tab-pane in tab1">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="l"><i class="mustmark">*</i>推广公司:</td>
|
||||
<td class="r">
|
||||
<?php if($record):?>
|
||||
<span class="form_radio table_btn" style="color: red;">{$company.company_name}</span>
|
||||
<?php else:?>
|
||||
<select name="company_id" id="company-select" class="select_gallery">
|
||||
<option value="">请选择推广公司</option>
|
||||
<?php foreach($companys as $company):?>
|
||||
<option value="<?=$company['id']?>" <?php if($company['id'] == $promote['company_id']):?>selected<?php endif;?>><?=$company['company_name']?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l"><i class="mustmark">*</i>会长:</td>
|
||||
<td class="r">
|
||||
<?php if($record):?>
|
||||
<span class="form_radio table_btn" style="color: red;">{$promote.account}</span>
|
||||
<?php else:?>
|
||||
<select name="promote_id" id="promote-select" class="select_gallery">
|
||||
<option value="">请选择会长</option>
|
||||
</select>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">开始时间:</td>
|
||||
<td class="r">
|
||||
<input type="text" name="started_at" class="time" value="<?=$record['started_at']?>" placeholder="请选择开始时间" style="width: 200px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">结束时间:</td>
|
||||
<td class="r">
|
||||
<input type="text" name="ended_at" class="time" value="<?=$record['ended_at']?>" placeholder="请选择结束时间" style="width: 200px" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<input type="hidden" name="id" id="id" value="{$record.id}" />
|
||||
<div class="form-item cf">
|
||||
<button class="submit_btn mlspacing" id="submit" type="submit" target-form="form-horizontal">
|
||||
确认
|
||||
</button>
|
||||
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="Promote/lists/type/1">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav("{:U('PromoteLimitRule/records')}");
|
||||
$(".select_gallery").select2();
|
||||
|
||||
$(function(){
|
||||
$('.time').datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
language: "zh-CN",
|
||||
autoclose: true,
|
||||
scrollMonth: false,
|
||||
scrollTime: false,
|
||||
scrollInput: false,
|
||||
startView: 'month',
|
||||
minView:'month',
|
||||
maxView:'month',
|
||||
});
|
||||
showTab();
|
||||
$('#company-select').on({
|
||||
change: function() {
|
||||
var companyId = $(this).val()
|
||||
getPromotesByCompany(companyId, function(promotes) {
|
||||
var html = '<option value="">请选择会长</option>'
|
||||
for (var key in promotes) {
|
||||
html += '<option value="' + promotes[key].id + '">' + promotes[key].account + '</option>'
|
||||
}
|
||||
$('#promote-select').html(html)
|
||||
$('#promote-select').select2()
|
||||
})
|
||||
}
|
||||
})
|
||||
function getPromotesByCompany(companyId, callback) {
|
||||
$.ajax({
|
||||
url: '{:U("getPromotesByCompany")}',
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
data: {company_id: companyId},
|
||||
success: function(result) {
|
||||
if (result.status == 1) {
|
||||
callback(result.data.promotes)
|
||||
} else {
|
||||
layer.msg(result.message)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$('#submit').click(function (e) {
|
||||
var target = $('form').get(0).action;
|
||||
var query = $('form').serialize();
|
||||
var that = this;
|
||||
$(that).addClass('disabled').attr('autocomplete','off').prop('disabled',true);
|
||||
$.post(target,query).success(function(data){
|
||||
if(layer) {layer.closeAll('loading');}
|
||||
if (data.status==1) {
|
||||
if (data.url) {
|
||||
updateAlert(data.info + ' 页面即将自动跳转~');
|
||||
}else{
|
||||
updateAlert(data.info);
|
||||
}
|
||||
setTimeout(function(){
|
||||
$(that).removeClass('disabled').prop('disabled',false);
|
||||
if (data.url) {
|
||||
location.href=data.url;
|
||||
} else if( $(that).hasClass('no-refresh')) {
|
||||
$('#tip').find('.tipclose').click();
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
}, 1500);
|
||||
}else{
|
||||
updateAlert(data.info,'tip_error');
|
||||
setTimeout(function(){
|
||||
$(that).removeClass('disabled').prop('disabled',false);
|
||||
if (data.url) {
|
||||
location.href=data.url;
|
||||
}else{
|
||||
$('#tip').find('.tipclose').click();
|
||||
}
|
||||
},3000);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,238 @@
|
||||
<extend name="Public/base"/>
|
||||
<block name="css">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="__CSS__/promote.css" type="text/css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
color: #000;
|
||||
resize: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
|
||||
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
|
||||
height:28px;border-radius:3px;font-size:12px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height:35px;
|
||||
line-height:28px;
|
||||
}
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height:26px;
|
||||
}
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
height:26px;line-height:26px;font-size:12px;
|
||||
}
|
||||
.select2-results__option[aria-selected] {font-size:12px;}
|
||||
.textarea-style {
|
||||
width: 200px;
|
||||
height: 80px;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
}
|
||||
.mustmark {
|
||||
color: #FF0000;
|
||||
font-style: normal;
|
||||
margin: 0 3px;
|
||||
}
|
||||
</style>
|
||||
</block>
|
||||
<block name="body">
|
||||
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/jquery.form.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
|
||||
|
||||
<script src="__STATIC__/md5.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.js"></script>
|
||||
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<h3 class="page_title">推广限制</h3>
|
||||
</div>
|
||||
<div class="cf top_nav_list">
|
||||
<!-- 高级搜索 -->
|
||||
<div class="jssearch fl cf search_list">
|
||||
<div class="input-list search-title-box">
|
||||
<label>搜索:</label>
|
||||
</div>
|
||||
<div class="input-list input-list-promote search_label_rehab">
|
||||
<select id="company_select" name="company_id" class="select_gallery" style="width:200px;">
|
||||
<option value="">请选择公司</option>
|
||||
<?php foreach($companys as $company):?>
|
||||
<option value="<?=$company['id']?>"><?=$company['company_name']?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list input-list-promote search_label_rehab">
|
||||
<select id="promote-select" name="promote_id" class="select_gallery" style="width:120px;">
|
||||
<option value="">请选择会长</option>
|
||||
<volist name=":get_promote_list_by_id()" id="vo">
|
||||
<option value="{$vo.id}">{$vo.account}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-list">
|
||||
<a class="sch-btn" href="javascript:;" id="search" url="{:U('PromoteLimitRule/records')}">搜索</a>
|
||||
<a class="sch-btn" href="{:U('PromoteLimitRule/edit')}">添加</a>
|
||||
<a class="sch-btn" href="javascript:;" id="batch-delete-btn">删除</a>
|
||||
</div>
|
||||
<!-- <div class="input-list">
|
||||
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>12,),I('get.')))}">导出</a>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表 -->
|
||||
<div class="data_list">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input class="check-all" type="checkbox">
|
||||
</th>
|
||||
<th>推广公司</th>
|
||||
<th>会长账号</th>
|
||||
<th>内外团</th>
|
||||
<th>限制时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- 列表 -->
|
||||
<tbody>
|
||||
<empty name ="records">
|
||||
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
<else />
|
||||
<volist name="records" id="data">
|
||||
<tr data-id="<?=$data['id']?>">
|
||||
<td>
|
||||
<input class="ids" type="checkbox" value="{$data['id']}" name="ids[]">
|
||||
</td>
|
||||
<td>{$data.company_name}</td>
|
||||
<td>{$data.promote_account}</td>
|
||||
<td>{$data.company_belong}</td>
|
||||
<td>{$data.limit_rule}</td>
|
||||
<td>
|
||||
<div class="partakebtn">
|
||||
<a href="<?=U('edit', ['id' => $data['id']])?>">编辑</a>
|
||||
<a class="delete-btn">删除</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</volist>
|
||||
</empty>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page">
|
||||
<if condition="$role_export_check eq true ">
|
||||
<!-- <a class="sch-btn export-btn"
|
||||
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a> -->
|
||||
</if>
|
||||
{$_page|default=''}
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="Query/withdraw">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script>
|
||||
<script src="__STATIC__/jquery.cookie.js" charset="utf-8"></script>
|
||||
<script>
|
||||
<volist name=":I('get.')" id="vo">
|
||||
Think.setValue('{$key}',"{$vo}");
|
||||
</volist>
|
||||
$(".select_gallery").select2();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav("{:U('PromoteLimitRule/records')}");
|
||||
$(function(){
|
||||
//搜索功能
|
||||
$("#search").click(function(){
|
||||
var url = $(this).attr('url');
|
||||
var query = $('.jssearch').find('input').serialize();
|
||||
query += "&"+$('.jssearch').find('select').serialize();
|
||||
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
|
||||
query = query.replace(/^&/g,'');
|
||||
if( url.indexOf('?')>0 ){
|
||||
url += '&' + query;
|
||||
}else{
|
||||
url += '?' + query;
|
||||
}
|
||||
window.location.href = url;
|
||||
});
|
||||
//回车自动提交
|
||||
$('.jssearch').find('input').keyup(function(event){
|
||||
if(event.keyCode===13){
|
||||
$("#search").click();
|
||||
}
|
||||
})
|
||||
$('#batch-delete-btn').on({
|
||||
click: function() {
|
||||
var ids = getIds();
|
||||
$.ajax({
|
||||
url: '{:U("batchDelete")}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {ids: ids},
|
||||
success: function(result) {
|
||||
if (result.status == 1) {
|
||||
layer.msg(result.message)
|
||||
setTimeout(function() {
|
||||
window.location.href = window.location.href
|
||||
}, 200)
|
||||
} else {
|
||||
layer.msg(result.message)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
function getIds() {
|
||||
var ids = [];
|
||||
$('.ids:checked').each(function() {
|
||||
ids.push($(this).val());
|
||||
})
|
||||
return ids;
|
||||
}
|
||||
$('.delete-btn').on({
|
||||
click: function() {
|
||||
var id = $(this).parents('tr').eq(0).attr('data-id');
|
||||
$.ajax({
|
||||
url: '{:U("delete")}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {id: id},
|
||||
success: function(result) {
|
||||
if (result.status == 1) {
|
||||
layer.msg(result.message)
|
||||
setTimeout(function() {
|
||||
window.location.href = window.location.href
|
||||
}, 200)
|
||||
} else {
|
||||
layer.msg(result.message)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
/* $(".export-btn").on("click",function(e){
|
||||
e.preventDefault();
|
||||
window.location.href=$(this).attr("href")
|
||||
}) */
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,264 @@
|
||||
<extend name="Public/bases" />
|
||||
<block name="css">
|
||||
<link href="__CSS__/20170913/index.css" rel="stylesheet" >
|
||||
</block>
|
||||
<block name="body">
|
||||
<div class="banner">
|
||||
<div class="inner clearfix">
|
||||
<!--<a href="http://wpa.qq.com/msgrd?v=3&uin={:C('CH_SET_SERVER_QQ')}&site=qq&menu=yes" class="qqbtn" target="_blank"><img src="__IMG__/20170913/qq.png">QQ咨询</a>-->
|
||||
<div class="lrwrapper clearfix">
|
||||
<div class="lrbox clearfix">
|
||||
<div class="lrpane tab-pane fade active in" id="lr-login">
|
||||
<h4 class="title"><span class="titletext">欢迎回来!</span></h4>
|
||||
<form id="loginForm" class="form-horizontal" method="post" novalidate="novalidate">
|
||||
|
||||
<div class="form-group clearfix">
|
||||
<div class="input-group input-format">
|
||||
<span class="input-group-addon"><i class="input_icon input_icon_user" ></i></span>
|
||||
<input type="text" name="login_phone" id="login_phone" class="account form-control" placeholder="手机号码" aria-describedby="basic-addon1">
|
||||
</div>
|
||||
<div class="input-status"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group clearfix">
|
||||
<div class="captchabox input-group input-format">
|
||||
<span class="input-group-addon"><i class="input_icon input_icon_barcode"></i></span>
|
||||
<input class="form-control" name="code" id="code" placeholder="短信验证码" autocomplete="off" maxlength="6">
|
||||
</div>
|
||||
<div class="f-wsn"><button id="sendtelCode" class="btn btn_primary" style="width:140px;" target-form="paw_info">发送验证码</button></div>
|
||||
<div class="input-status"></div>
|
||||
</div>
|
||||
<div class="form-group ff clearfix">
|
||||
<label class="tabbtn"><input type="checkbox" name="remm" id="remember" ><i></i><span>记住账号</span></label>
|
||||
<label class="tabbtn" style="margin-left:10px"><a href="{:U('index/index')}" style="color:rgb(8, 85, 185);text-decoration:underline;">普通登陆</a></label>
|
||||
<!-- <a target="_blank" href="{:U('forget')}" class="forget_password right" ><span>忘记密码?</span></a> -->
|
||||
</div>
|
||||
<div >
|
||||
<input id="loginButton" type="submit" class="btn btn_primary" value="登 录">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<notempty name="gg">
|
||||
<div class="news">
|
||||
<div class="inner clearfix txtScroll">
|
||||
<span><i class="icon icon-voice"></i></span>
|
||||
<a class="next" href="javascript:;"><i class="icon icon-angle_right"></i></a>
|
||||
<div class="bd">
|
||||
<ul>
|
||||
<volist name="gg" id="vo">
|
||||
<li>
|
||||
<a href="{:U('Article/detail',array('id'=>$vo['id']))}" target="_blank" title="{$vo['title']}"><i>公告</i>{:msubstr2($vo['title'],0,70)}</a>
|
||||
</li>
|
||||
</volist>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</notempty>
|
||||
<div class="advantage page-aside">
|
||||
<!-- <div class="inner">
|
||||
<h2 class="aside-title"><span>平台优势</span></h2>
|
||||
<div class="aside-content clearfix">
|
||||
<ul>
|
||||
<li><div class="item"><i class="icon icon1"></i><span class="contitle">收入丰厚</span><p class="context"><span>CPS+CPA双模式计费方式</span><span>可持续获得收益</span></p></div></li>
|
||||
<li><div class="item"><i class="icon icon2"></i><span class="contitle">统计精准</span><p class="context"><span>每一笔收入都有迹可循</span><span>精准无误,永不扣量</span></p></div></li>
|
||||
<li><div class="item"><i class="icon icon3"></i><span class="contitle">海量资源</span><p class="context"><span>优质内容,海量资源开放合作</span><span>提供最佳合作方式</span></p></div></li>
|
||||
<li><div class="item"><i class="icon icon4"></i><span class="contitle">结算及时</span><p class="context"><span>结算快速,结算金额准确无误</span><span>绝不拖欠分成</span></p></div></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
|
||||
<!--<div class="app page-aside">
|
||||
<div class="inner">
|
||||
<h2 class="aside-title"><span>精品应用推荐</span></h2>
|
||||
<div class="aside-content slideColumn clearfix">
|
||||
<div class="bd">
|
||||
<div class="ulWrap">
|
||||
<ul>
|
||||
<volist name="rec_data" id="rec" mod="12">
|
||||
<li>
|
||||
<div class="pic"><a href="javascript:;"><span class="placeholder-graphic placeholder-graphic_icon"><img src="{$rec['icon']|get_cover='path'}"></span></a></div>
|
||||
<div class="title" style="width:67%;"><a style="cursor:default" href="javascript:;" title="{$rec['game_name']}">{:msubstr2($rec['game_name'],0,10)}</a></div>
|
||||
</li>
|
||||
<eq name="mod" value="11"></ul><ul></eq>
|
||||
</volist>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hd"><ul>
|
||||
<volist name="rec_data" id="rec" mod="12">
|
||||
<eq name="mod" value="11"><li></li></eq>
|
||||
</volist></ul>
|
||||
</div>
|
||||
<if condition="count($rec_data) gt 12">
|
||||
<a class="prev" href="javascript:void(0)"></a>
|
||||
<a class="next" href="javascript:void(0)"></a>
|
||||
</if>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="join page-aside">
|
||||
<!-- <div class="inner">
|
||||
<h2 class="aside-title"><span>如何加入我们</span></h2>
|
||||
<div class="aside-content clearfix">
|
||||
<ul class="clearfix">
|
||||
<li><div class="item"><img class="icon" src="__IMG__/20170913/step1.png"><h5 class="contitle">注册账号</h5><p class="context"><span>注册账号,通过审核,加入联盟</span></p></div><div class="angle"><i class="iconangle"></i></div></li>
|
||||
<li><div class="item"><img class="icon" src="__IMG__/20170913/step2.png"><h5 class="contitle">选择游戏资源</h5><p class="context"><span>选择推广的产品,游戏信息</span></p></div><div class="angle"><i class="iconangle"></i></div></li>
|
||||
<li><div class="item"><img class="icon" src="__IMG__/20170913/step3.png"><h5 class="contitle">申请渠道分包</h5><p class="context"><span>获得自有渠道的游戏资源包</span></p></div><div class="angle"><i class="iconangle"></i></div></li>
|
||||
<li><div class="item"><img class="icon" src="__IMG__/20170913/step4.png"><h5 class="contitle">推广分成</h5><p class="context"><span>每笔充值,后台申请结算的分成</span></p></div></li>
|
||||
</ul>
|
||||
<a href="{:U('register')}" class="joinbtn" >开始加入</a>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
|
||||
<div class="gotop"><img src="/Public/Home/images/index/gotop.png"></div>
|
||||
</block>
|
||||
<block name="script">
|
||||
<script src="__JS__/20170913/jquery.SuperSlide.2.1.1.js"></script>
|
||||
<script>
|
||||
highlight_subnav('{:U("Index/index")}');
|
||||
var regLogin = "";
|
||||
// 如果登录有错误
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$(".slideColumn").slide({titCell:".hd ul",mainCell:".bd .ulWrap",autoPage:true,effect:"leftLoop",autoPlay:true,vis:1});
|
||||
|
||||
$(".txtScroll").slide({mainCell:".bd ul",autoPage:true,effect:"leftLoop",autoPlay:true});
|
||||
|
||||
$('#remember').change(function() {
|
||||
var that = $(this);
|
||||
if (that.prop('checked')) {
|
||||
that.siblings('i').addClass('on');
|
||||
} else {
|
||||
that.siblings('i').removeClass('on');
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增验证方法
|
||||
*/
|
||||
$.validator.addMethod("numOrLetter", function(value, element) {
|
||||
return this.optional(element) || /^[a-zA-Z0-9_\.]+$/.test(value);
|
||||
}, '只能是字母或数字或下划线');
|
||||
|
||||
// 登录验证
|
||||
$("#loginForm").validate({
|
||||
//定义规则
|
||||
rules:{
|
||||
account:{
|
||||
required:true,
|
||||
rangelength:[6,100],
|
||||
numOrLetter:true,
|
||||
},
|
||||
password:{
|
||||
required:true,
|
||||
minlength:6
|
||||
},
|
||||
yzm:{
|
||||
required:true,
|
||||
rangelength:[4,4]
|
||||
}
|
||||
},
|
||||
//定义错误消息
|
||||
messages:{
|
||||
account:{
|
||||
required:"请输入登录账号",
|
||||
rangelength:"账号必须是6-15位字符串",
|
||||
},
|
||||
password:{
|
||||
required:"请输入登录密码",
|
||||
minlength:'密码错误,请重新输入',
|
||||
},
|
||||
yzm:{
|
||||
required:"请输入验证码",
|
||||
rangelength:"验证码必须是4位字符串"
|
||||
}
|
||||
},
|
||||
submitHandler:function(form){
|
||||
data = $('#loginForm').serialize();
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:"{:U('doPhoneLogin')}",
|
||||
data:data,
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg(data.msg, {icon: 1});
|
||||
window.location.href=data.url;
|
||||
}else{
|
||||
//if(data.code==0){}
|
||||
$('img[name="changeCaptcha"]').click();
|
||||
layer.msg(data.msg, {icon: 2});
|
||||
}
|
||||
},error:function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
var ThinkPHP = window.Think = {
|
||||
"ROOT" : "", //当前网站地址
|
||||
"APP" : "/index.php?s=", //当前项目地址
|
||||
"PUBLIC" : "/Public", //项目公共目录地址
|
||||
"DEEP" : "/", //PATHINFO分割符
|
||||
"MODEL" : ["3", "", "html"],
|
||||
"VAR" : ["m", "c", "a"]
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
$('#sendtelCode').on('click',function() {
|
||||
if ($(this).hasClass('g-btntn')) {
|
||||
return false;
|
||||
}
|
||||
var phone = $.trim($('#login_phone').val());
|
||||
if (phone == '') {
|
||||
alert("手机号不能为空");
|
||||
return false;
|
||||
}
|
||||
if (phone.length !== 11 || !(/^[1][35789][0-9]{9}$/.test(phone))) {
|
||||
pmsg.msg("格式不正确");
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
data:'phone='+phone,
|
||||
url:'{:U("telsafecode")}',
|
||||
success:function(data) {
|
||||
if (data.status ==1) {
|
||||
r(1);
|
||||
} else {
|
||||
alert(data.msg);
|
||||
}
|
||||
},
|
||||
error:function() {
|
||||
alert('服务器开小差了,请稍后再试。');
|
||||
}
|
||||
});
|
||||
var r = function(i, t) {
|
||||
var e = $('#sendtelCode');
|
||||
var t = 60;
|
||||
e.attr('disabled', true).text(t+'秒');
|
||||
var a = setInterval(function() {
|
||||
t--;
|
||||
e.text(t+'秒');
|
||||
t>0 || (clearInterval(a),e.attr('disabled', false).text('重新发送'));
|
||||
},1000);
|
||||
};
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
</block>
|
@ -0,0 +1,261 @@
|
||||
<extend name="Public/promote_base"/>
|
||||
<block name="css">
|
||||
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
|
||||
<style>.notice_tip {padding-left:20px;color:#999;font-size:12px;}
|
||||
.formtxt{display:inline-block;width:232px;}
|
||||
.trunk-list .table2 .r .qrcodeboxwrap {padding-left:0;padding-right:20px;padding-bottom:20px;}
|
||||
.qrcodebox img {width:100px;height:100px;}
|
||||
.qrcodebox p {font-size:12px;margin:0;color:#666;}
|
||||
.qrcodebox p span{color:red;}
|
||||
.qrcodeboxwrap~.notice_tip{vertical-align:top;display:inline-block;margin-top:20px;}
|
||||
|
||||
.mail_suffix {position: absolute;
|
||||
top: 43px;
|
||||
border: 1px solid rgb(229,229,229);
|
||||
border-radius: 2px;
|
||||
color: #666;
|
||||
font-size: 11px;
|
||||
width: 230px;
|
||||
padding: 0 10px;
|
||||
line-height: 1.4;
|
||||
z-index: 1;
|
||||
background: #FFF;
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;}
|
||||
.mail_suffix li {
|
||||
padding: 2px 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.mail_suffix li:first-child {padding-top:4px;}
|
||||
.mail_suffix li:last-child{padding-bottom:4px;}
|
||||
</style>
|
||||
</block>
|
||||
|
||||
<block name="body">
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/area1.js" ></script>
|
||||
<div class="page-list normal_list promote-base_info-form">
|
||||
<div class="trunk-title">
|
||||
|
||||
<span class="title_main">手机号绑定</span>
|
||||
</div>
|
||||
<div class="trunk-content article">
|
||||
<div class="trunk-list baseInfo">
|
||||
|
||||
<form action="{:U('Safe/addLoginMobile')}" novalidate="novalidate" method="post" class="paw_info">
|
||||
<table class="table2" style="margin-top:50px;margin-left:50px">
|
||||
<tr>
|
||||
<td class="l"><span style="color:red">*</span>手机号码</td>
|
||||
<td class="r">
|
||||
<!-- <input type="text" class="input txt" name="login_phone" id="login_phone" style="width:430px" placeholder="请输入手机号码"> -->
|
||||
<if condition="$login_phone neq null">
|
||||
<input type="text" class="input txt" name="login_phone" id="login_phone" style="width:430px" value="{$login_phone}">
|
||||
<else />
|
||||
<input type="text" class="input txt" name="login_phone" id="login_phone" style="width:430px" placeholder="请输入手机号码">
|
||||
</if>
|
||||
<span id="confirm_password_tip"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l"><span style="color:red">*</span>短信验证码</td>
|
||||
<td class="r"><input type="text" class="input txt" name="code" id="code" style="width:230px" placeholder="请输入短信验证码">
|
||||
<span id="confirm_password_tip"></span>
|
||||
<button id="sendtelCode" class="tj btn" target-form="paw_info">发送验证码</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="l"></td>
|
||||
<td class="r">
|
||||
<input type="hidden" name="id" value="{$data.id}">
|
||||
<input type="submit" class="tj btn ajax-post" value="保存" style="width:200px" title="" target-form="paw_info">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</block>
|
||||
<block name="script">
|
||||
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/mail_suffix.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/bank.js"></script>
|
||||
<script type="text/javascript">
|
||||
var ajaxurl="{:U('Account/getArea')}";
|
||||
function loadArea(areaId,areaType) {
|
||||
$.post(ajaxurl,{'areaId':areaId},function(data){
|
||||
if(areaType=='city'){
|
||||
$('#'+areaType).html('<option value="-1">市/县</option>');
|
||||
$('#district').html('<option value="-1">镇/区</option>');
|
||||
}else if(areaType=='district'){
|
||||
$('#'+areaType).html('<option value="-1">镇/区</option>');
|
||||
}
|
||||
if(areaType!='null'){
|
||||
$.each(data,function(no,items){
|
||||
$('#'+areaType).append('<option value="'+items.area_id+'">'+items.area_name+'</option>');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
var tot="";
|
||||
$("#province").change(function() {
|
||||
tot+=$("#province").val();
|
||||
});
|
||||
$("#city").change(function() {
|
||||
tot+=","+$("#city").val()
|
||||
});
|
||||
$("#district").change(function() {
|
||||
tot+=","+$("#district").val()
|
||||
});
|
||||
$(".btn").click(function() {
|
||||
$("#town").val(tot);
|
||||
});
|
||||
|
||||
function add_mail_suffix(that) {
|
||||
var suffix = $(that).data('suffix');
|
||||
var input = $(that).closest('.mail_suffix').prev();
|
||||
if(input.attr('data-mail').length>0) {
|
||||
input.val(input.attr('data-mail')+suffix);
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('.tab td').on('click',function() {
|
||||
var that = $(this);
|
||||
$('.tabpan').removeClass('current');
|
||||
that.siblings().removeClass('current');
|
||||
that.addClass('current');
|
||||
$('.tabpan').eq(that.index()).addClass('current');
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".select_gallery").select2();
|
||||
|
||||
$('#email').focus(function () {
|
||||
var val = $.trim($(this).val());
|
||||
if(val) {
|
||||
var index = val.indexOf('@');
|
||||
if(index>-1){
|
||||
var suffix = val.substring(index);
|
||||
val = val.substring(0,index);
|
||||
$(this).val(val).attr('data-suffix',suffix).attr('data-mail',val);
|
||||
}
|
||||
}
|
||||
var html = '<ul class="mail_suffix">';
|
||||
for(var item in mail_suffix) {
|
||||
html += '<li onclick="add_mail_suffix(this)" data-suffix="'+mail_suffix[item]+'">'+mail_suffix[item]+'</li>';
|
||||
}
|
||||
|
||||
html += '</ul>';
|
||||
$(this).after(html);
|
||||
$('body').click(function (event) {
|
||||
var e = event || window.event;
|
||||
var target = e.target || e.srcElement;
|
||||
|
||||
if($(target).attr('id') != 'email' && $(target).attr('class') != 'mail_suffix') {
|
||||
$('.mail_suffix').remove();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return false;
|
||||
}).blur(function (event) {
|
||||
var e = event || window.event;
|
||||
var target = e.target || e.srcElement;
|
||||
var that = $(this);
|
||||
if($(target).attr('id') == 'email' && $(target).attr('class') == 'mail_suffix') {
|
||||
$('.mail_suffix').remove();
|
||||
}
|
||||
if(that.attr('data-mail')) {
|
||||
var data_mail_index = that.attr('data-mail').indexOf('@');
|
||||
if(data_mail_index>-1){
|
||||
var data_mail = that.attr('data-mail');
|
||||
that.val(data_mail);
|
||||
that.attr('data-mail',data_mail.substring(0,data_mail_index));
|
||||
that.attr('data-suffix',data_mail.substring(data_mail_index));
|
||||
} else {
|
||||
that.val(that.attr('data-mail')+that.attr('data-suffix'));
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}).keyup(function () {
|
||||
var val = $.trim($(this).val());
|
||||
if(val.length>64) {val = val.substr(0,64);$(this).val(val);}
|
||||
$(this).attr('data-mail',val);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
var data_bank_name = '{$data.bank_name}';
|
||||
var bank_name = '<option value="">请选择收款银行</option>';console.log(bank);
|
||||
for(var bn in bank) {
|
||||
if(data_bank_name == bank[bn]) {
|
||||
bank_name += '<option value="'+bank[bn]+'" selected>'+bank[bn]+'</option>';
|
||||
} else {
|
||||
bank_name += '<option value="'+bank[bn]+'">'+bank[bn]+'</option>';
|
||||
}
|
||||
}
|
||||
$('#bank_name').html(bank_name).select2();
|
||||
|
||||
|
||||
|
||||
|
||||
// AF.users.account_edit(1429);
|
||||
// AF.users.account_content_edit(1429);
|
||||
_init_area();
|
||||
_reset_area('','','');
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$('#sendtelCode').on('click',function() {
|
||||
if ($(this).hasClass('g-btntn')) {
|
||||
return false;
|
||||
}
|
||||
var phone = $.trim($('#login_phone').val());
|
||||
if (phone == '') {
|
||||
alert("手机号不能为空");
|
||||
return false;
|
||||
}
|
||||
if (phone.length !== 11 || !(/^[1][35789][0-9]{9}$/.test(phone))) {
|
||||
pmsg.msg("格式不正确");
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
data:'phone='+phone,
|
||||
url:'{:U("telsafecode")}',
|
||||
success:function(data) {
|
||||
if (data.status ==1) {
|
||||
r(1);
|
||||
} else {
|
||||
alert(data.msg);
|
||||
}
|
||||
},
|
||||
error:function() {
|
||||
alert('服务器开小差了,请稍后再试。');
|
||||
}
|
||||
});
|
||||
var r = function(i, t) {
|
||||
var e = $('#sendtelCode');
|
||||
var t = 60;
|
||||
e.addClass('disabled').attr('disabled', true).text(t+'秒');
|
||||
var a = setInterval(function() {
|
||||
t--;
|
||||
e.text(t+'秒');
|
||||
t>0 || (clearInterval(a),e.removeClass('disabled').attr('disabled', false).text('重新发送'));
|
||||
},1000);
|
||||
};
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
</block>
|
||||
|
Loading…
Reference in New Issue