Toggle navigation
This project
Loading...
Sign in
najixian
/
xt_dc_admin
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Download as
Email Patches
Plain Diff
Browse Files
Commit
0833a6659ff4d666eec850a2f25d79a1d5cf927c
Authored by
pengye
2019-12-19 16:02:17 +0800
1 parent
a7019fcc
build: skipped
no message
Changes
2
Builds
0
Inline
Side-by-side
Showing
2 changed files
with
288 additions
and
1 deletions
application/admin/controller/Area.php
application/admin/view/area/agent.html
application/admin/controller/Area.php
View file @
0833a66
...
...
@@ -24,7 +24,7 @@ class Area extends Common
$city
=
@
$key
[
'city'
]
?
@
$key
[
'city'
]
:
''
;
$area
=
@
$key
[
'area'
]
?
@
$key
[
'area'
]
:
''
;
$limit
=
'&x='
.
$data
[
"page"
]
.
'&y='
.
$data
[
"limit"
]
.
'&
keywords
='
.@
$key
[
'id'
]
.
'&channel='
.
$channel
.
'&address='
.
$address
.
'&prov='
.
$prov
.
'&city='
.
$city
.
'&area='
.
$area
;
$limit
=
'&x='
.
$data
[
"page"
]
.
'&y='
.
$data
[
"limit"
]
.
'&
areaid
='
.@
$key
[
'id'
]
.
'&channel='
.
$channel
.
'&address='
.
$address
.
'&prov='
.
$prov
.
'&city='
.
$city
.
'&area='
.
$area
;
//获取运营人员列表
$list
=
file_get_contents
(
ON_LINE
.
'App.Seller.GetSellerList'
.
$limit
);
...
...
@@ -59,6 +59,35 @@ class Area extends Common
$this
->
assign
(
'title'
,
'商户基本信息维护'
);
return
$this
->
fetch
();
}
/**
* 商家list
*/
public
function
agent
(){
if
(
Request
::
isAjax
()){
$data
=
Request
::
except
(
'file'
);
$key
=
input
(
'post.key'
)
?
input
(
'post.key'
)
:
""
;
$channel
=
@
$key
[
'channel'
]
?
@
$key
[
'channel'
]
:
1
;
$address
=
@
$key
[
'address'
]
?
@
$key
[
'address'
]
:
''
;
$prov
=
@
$key
[
'prov'
]
?
@
$key
[
'prov'
]
:
''
;
$city
=
@
$key
[
'city'
]
?
@
$key
[
'city'
]
:
''
;
$area
=
@
$key
[
'area'
]
?
@
$key
[
'area'
]
:
''
;
$limit
=
'&x='
.
$data
[
"page"
]
.
'&y='
.
$data
[
"limit"
];
//获取运营人员列表
$list
=
file_get_contents
(
ON_LINE
.
'App.Seller.getAgentList'
.
$limit
);
$array
=
json_decode
(
$list
,
TRUE
);
/*foreach ($array['data'][0]['data'] as $key => $value) {
$array['data'][0]['data'][$key]['cdate'] = date("Y-m-d H:i:s",$value['cdate']);
}*/
return
$result
=
[
'code'
=>
0
,
'msg'
=>
'获取成功!'
,
'data'
=>
$array
[
'data'
][
0
][
'data'
],
'count'
=>
$array
[
'data'
][
0
][
'total'
],
'rel'
=>
1
];
}
$this
->
assign
(
'title'
,
'商户基本信息维护'
);
return
$this
->
fetch
();
}
/**
* 停用商家
...
...
application/admin/view/area/agent.html
0 → 100644
View file @
0833a66
{include file="common/head"/}
<div
class=
"admin-main layui-anim layui-anim-upbit"
>
<fieldset
class=
"layui-elem-field layui-field-title"
>
<legend>
{:$title}
</legend>
</fieldset>
<blockquote
class=
"layui-elem-quote"
>
<a
href=
"{:url('Seller/sellerList')}"
class=
"layui-btn layui-btn-sm layui-btn-danger"
>
<i
class=
"fa fa-file-image-o"
></i>
代理商区域列表
</a>
</blockquote>
<div
class=
"demoTable"
>
商家名称:
<div
class=
"layui-inline"
>
<input
class=
"layui-input"
name=
"key"
id=
"key"
placeholder=
"{:lang('pleaseEnter')}店铺名称"
autocomplete=
"off"
>
</div>
商家地址:
<div
class=
"layui-inline"
>
<input
class=
"layui-input"
name=
"address"
id=
"address"
placeholder=
"{:lang('pleaseEnter')}店铺地址"
autocomplete=
"off"
>
</div>
商家来源:
<div
class=
"layui-input-inline layui-form"
>
<div
class=
"layui-input-8"
>
<select
name=
"class"
id=
"channel"
lay-filter=
"myselect"
>
<option
value=
"4"
>
全部
</option>
<option
value=
"1"
selected
>
合作
</option>
<option
value=
"2"
>
推广
</option>
<option
value=
"3"
>
测试
</option>
</select>
</div>
</div>
选择地区:
<div
class=
"layui-input-inline"
>
<form
class=
"layui-form"
>
<div
class=
"layui-input-inline"
>
<select
name=
"provid"
id=
"provid"
lay-filter=
"provid"
>
<option
value=
""
>
请选择省
</option>
</select>
</div>
<div
class=
"layui-input-inline"
>
<select
name=
"cityid"
id=
"cityid"
lay-filter=
"cityid"
>
<option
value=
""
>
请选择市
</option>
</select>
</div>
<div
class=
"layui-input-inline"
>
<select
name=
"areaid"
id=
"areaid"
lay-filter=
"areaid"
>
<option
value=
""
>
请选择县/区
</option>
</select>
</div>
</form>
</div>
<button
class=
"layui-btn"
id=
"search"
data-type=
"reload"
>
搜索
</button>
<!-- 备注: 人均消费(130)、店铺评分(4.9,最高5分)、停车场(0/1 无/有)开启单元格编辑 -->
</div>
<table
class=
"layui-table"
id=
"list"
lay-filter=
"list"
></table>
</div>
{include file="common/foot"/}
<script
src=
"/static/common/js/jquery.2.1.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"/static/city/data.js"
></script>
<script
type=
"text/javascript"
src=
"/static/city/province.js"
></script>
<script
type=
"text/javascript"
>
var
defaults
=
{
s1
:
'provid'
,
s2
:
'cityid'
,
s3
:
'areaid'
,
v1
:
null
,
v2
:
null
,
v3
:
null
};
</script>
<script
type=
"text/html"
id=
"action"
>
<
a
class
=
"layui-btn {{ 0==d.status?'':'layui-btn-danger'}} layui-btn-xs"
lay
-
event
=
"stop"
>
{{
0
==
d
.
status
?
'启用'
:
'停用'
}}
<
/a
>
<
a
href
=
"{:url('Seller/sellerconfig')}?id={{d.id}}&name={{d.sellername}}"
class
=
"layui-btn layui-btn-xs"
>
配置
<
/a
>
<!--
<
a
href
=
"{:url('Template/configMer')}?id={{d.id}}&name={{d.sellername}}"
class
=
"layui-btn layui-btn-xs"
>
配置菜品
<
/a>--
>
<
a
href
=
"{:url('Basicinfo/smsRecharge')}?id={{d.id}}&name={{d.sellername}}"
class
=
"layui-btn layui-btn-xs"
>
短信充值
<
/a
>
</script>
<script>
layui
.
use
([
'table'
,
'form'
],
function
()
{
var
table
=
layui
.
table
,
$
=
layui
.
jquery
;
var
tableIn
=
table
.
render
({
elem
:
'#list'
,
url
:
'{:url("agent")}'
,
method
:
'post'
,
title
:
'代理商区域列表'
,
toolbar
:
'#toolbarDemo'
,
page
:
true
,
cols
:
[[
{
field
:
'id'
,
title
:
'{:lang("id")}'
,
width
:
60
,
fixed
:
true
},
{
field
:
'areaname'
,
edit
:
'text'
,
title
:
'区域名称'
},
{
field
:
'agentname'
,
edit
:
'text'
,
title
:
'代理商名称'
},
{
field
:
'last_num'
,
align
:
'center'
,
title
:
'代理商联系人'
},
{
field
:
'average'
,
align
:
'center'
,
edit
:
'text'
,
title
:
'人均消费'
},
{
field
:
'score'
,
align
:
'center'
,
edit
:
'text'
,
title
:
'店铺评分'
}
{
align
:
'center'
,
width
:
200
,
title
:
'操作'
,
toolbar
:
'#action'
}
]]
,
id
:
'testReload'
,
page
:
true
});
//监听单元格编辑
table
.
on
(
'edit(list)'
,
function
(
obj
){
var
value
=
obj
.
value
,
//得到修改后的值
data
=
obj
.
data
,
//得到所在行所有键值
field
=
obj
.
field
;
//得到字段
switch
(
field
){
case
'average'
:
var
new_field
=
'人均消费'
;
break
;
case
'is_parking'
:
var
new_field
=
'停车场'
;
break
;
case
'score'
:
var
new_field
=
'店铺评分'
;
break
;
case
'slogan'
:
var
new_field
=
'标语'
;
break
;
case
'selleralias'
:
var
new_field
=
'短店名'
;
break
;
case
'is_meal_fee'
:
var
new_field
=
'有无餐位费'
;
break
;
case
'is_unsubscribe'
:
var
new_field
=
'是否可随时退'
;
break
;
case
'is_minimum_consumption'
:
var
new_field
=
'有无最低消费'
;
break
;
case
'is_belt_wine'
:
var
new_field
=
'是否自带酒水'
;
break
;
case
'scale'
:
var
new_field
=
'比例尺'
;
break
;
case
'sellername'
:
var
new_field
=
'商家名字'
;
case
'is_auth'
:
var
new_field
=
'是否开始订座读写权限'
;
}
if
(
field
==
'slogan'
&&
value
.
length
>
15
){
layer
.
msg
(
'标语不能超过15个字符!'
,{
time
:
1500
,
icon
:
2
});
return
;
}
if
(
field
==
'scale'
&&
value
>
20
){
layer
.
msg
(
'比例尺最高可设置为20'
,{
time
:
1500
,
icon
:
2
});
return
;
}
if
(
field
==
'scale'
&&
value
<
3
){
layer
.
msg
(
'比例尺最低可设置为3'
,{
time
:
1500
,
icon
:
2
});
return
;
}
if
(
field
==
'is_auth'
&&
value
>
1
||
value
<
0
){
layer
.
msg
(
'请输入正确的参数,0为只读,1为读写'
,{
time
:
1500
,
icon
:
2
});
return
;
}
//layer.msg('[ID: '+ data.id +'] ' + field + ' 字段更改为:'+ value);
layer
.
confirm
(
'请确认将 '
+
data
.
sellername
+
'商家的 '
+
new_field
+
' 更改为:'
+
value
,
function
(
index
){
$
.
post
(
"{:url('setsellerconfig')}"
,{
sellerid
:
data
.
id
,
field
:
field
,
value
:
value
},
function
(
res
){
if
(
res
.
code
==
1
){
layer
.
msg
(
res
.
msg
,{
time
:
1500
,
icon
:
1
});
}
else
{
layer
.
msg
(
res
.
msg
,{
time
:
1500
,
icon
:
2
});
}
});
layer
.
close
(
index
);
});
});
//监听行双击事件
table
.
on
(
'rowDouble(list)'
,
function
(
obj
){
//table.on('row(list)', function(obj){ 双击事件
//console.log(obj.tr) //得到当前行元素对象
console
.
log
(
obj
.
data
)
//得到当前行数据
layer
.
open
({
type
:
2
,
title
:
obj
.
data
.
sellername
,
shadeClose
:
true
,
shade
:
0.8
,
area
:
[
'90%'
,
'90%'
],
content
:
'{:url("sellerdetail")}?sid='
+
obj
.
data
.
id
//iframe的url
/*success:function(dom){
let $iframeDom=$(dom[0]).find("iframe").eq(0).contents();
$iframeDom.find("#test").html("我是从父级传来的值哟……")
}*/
});
});
//搜索
$
(
'#search'
).
on
(
'click'
,
function
()
{
var
key
=
$
(
'#key'
).
val
();
/*if($.trim(key)==='') {
layer.msg('{:lang("pleaseEnter")}店铺名称!',{icon:0});
return;
}*/
tableIn
.
reload
({
page
:{
page
:
1
},
where
:{
key
:
key
,
address
:
$
(
'#address'
).
val
(),
channel
:
$
(
'#channel'
).
val
(),
prov
:
$
(
"#provid"
).
find
(
"option:selected"
).
text
(),
city
:
$
(
"#cityid"
).
find
(
"option:selected"
).
text
(),
area
:
$
(
"#areaid"
).
find
(
"option:selected"
).
text
()
}
});
});
var
$
=
layui
.
$
,
active
=
{
reload
:
function
(){
var
key
=
$
(
'#key'
);
var
channel
=
$
(
'#channel'
);
var
address
=
$
(
'#address'
);
var
prov
=
$
(
"#provid"
).
find
(
"option:selected"
).
text
();
var
city
=
$
(
"#cityid"
).
find
(
"option:selected"
).
text
();
var
area
=
$
(
"#areaid"
).
find
(
"option:selected"
).
text
()
//执行重载
table
.
reload
(
'testReload'
,
{
page
:
{
curr
:
1
//重新从第 1 页开始
}
,
where
:
{
key
:
{
id
:
key
.
val
(),
channel
:
channel
.
val
(),
address
:
address
.
val
(),
prov
:
prov
,
city
:
city
,
area
:
area
}
}
});
}
};
$
(
'.demoTable .layui-btn'
).
on
(
'click'
,
function
(){
var
type
=
$
(
this
).
data
(
'type'
);
active
[
type
]
?
active
[
type
].
call
(
this
)
:
''
;
});
//启用、停用
table
.
on
(
'tool(list)'
,
function
(
obj
){
var
data
=
obj
.
data
;
if
(
obj
.
event
===
'stop'
){
var
statusVal
=
data
.
status
==
1
?
'停用'
:
'启用'
;
layer
.
confirm
(
'请确定要 '
+
statusVal
+
" 该商家!"
,
function
(
index
){
$
.
post
(
"{:url('configStop')}"
,{
sellerid
:
data
.
id
,
status
:
data
.
status
},
function
(
res
){
if
(
res
.
code
==
1
){
layer
.
msg
(
res
.
msg
,{
time
:
1000
,
icon
:
1
});
location
.
reload
();
}
else
{
layer
.
msg
(
res
.
msg
,{
time
:
1000
,
icon
:
2
});
}
});
layer
.
close
(
index
);
});
}
});
})
</script>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment