Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cdd32c01
authored
Aug 06, 2021
by
李长胜
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/h5/account
2 parents
2b22df0d
5cf398ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
30 deletions
html/merchant/edit.html
html/merchant/index.html
html/merchant/edit.html
View file @
cdd32c0
...
...
@@ -193,8 +193,7 @@
<label
class=
"layui-form-label"
></label>
<div>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input business-scope-cust"
name=
"businessScopeCustomize"
placeholder=
"请自定义营业范围,建议不超过10个"
>
<input
id=
"scopeCus"
class=
"layui-input business-scope-cust"
placeholder=
"请自定义营业范围,建议不超过10个"
>
</div>
<div
class=
"layui-input-inline option-btns"
>
<button
type=
"button"
class=
"layui-btn btn-no-border"
data-type=
"handleAddScope"
>
...
...
@@ -298,7 +297,6 @@
var
$
=
layui
.
$
var
helper
=
layui
.
helper
var
editData
=
{}
var
scopeIdx
=
1
var
treeObj
=
null
var
all_nodes
=
[]
// 1-创建新商户;2-创建子商户;3-修改
...
...
@@ -450,7 +448,7 @@
}
else
{
params
.
status
=
1
}
// console.log(merchantForm
)
console
.
log
(
editLevel
)
console
.
log
(
params
)
request
(
params
,
function
(
res
)
{
console
.
log
(
res
)
...
...
@@ -512,14 +510,13 @@
})
},
// 添加范围
handleAddScope
()
{
scopeIdx
=
scopeIdx
+
1
handleAddScope
(
txt
)
{
var
parent
=
$
(
'#custom-scope'
)
var
subParent
=
$
(
'<div class="layui-form-item"><label class="layui-form-label"></label></div>'
)
var
child1
=
$
(
'<div class="layui-input-inline"><input class="layui-input business-scope-cust" name="businessScopeCustomize'
+
scopeIdx
+
'" placeholder="请自定义营业范围,建议不超过10个"></div>'
'<div class="layui-input-inline"></div>'
)
var
inputEl
=
$
(
'<input class="layui-input business-scope-cust" placeholder="请自定义营业范围,建议不超过10个">'
)
var
child2
=
$
(
'<div class="layui-input-inline"></div>'
)
...
...
@@ -530,6 +527,9 @@
var
deleteBtn
=
$
(
'<button type="button" class="layui-btn btn-no-border"><i class="layui-icon layui-icon-reduce-circle"></i></button>'
)
if
(
txt
)
{
inputEl
.
val
(
txt
)
}
addBtn
.
bind
(
'click'
,
function
(
e
)
{
btnHandle
.
handleAddScope
()
})
...
...
@@ -537,6 +537,7 @@
var
el
=
$
(
this
).
parent
().
parent
()
el
.
remove
()
})
child1
.
append
(
inputEl
)
child2
.
append
(
addBtn
)
child2
.
append
(
deleteBtn
)
subParent
.
append
(
child1
)
...
...
@@ -605,18 +606,20 @@
getPeriod
()
bindEvent
()
}
function
bindEvent
(){
$
(
'#brand'
).
on
(
'input'
,
helper
.
debounce
(
function
(){
function
bindEvent
()
{
$
(
'#brand'
).
on
(
'input'
,
helper
.
debounce
(
function
()
{
var
txt
=
$
(
this
).
val
()
if
(
!
txt
)
{
if
(
!
txt
)
{
treeObj
.
showNodes
(
all_nodes
)
}
else
{
var
show_nodes
=
treeObj
.
getNodesByParamFuzzy
(
'label'
,
txt
)
}
else
{
var
show_nodes
=
treeObj
.
getNodesByParamFuzzy
(
'label'
,
txt
)
treeObj
.
hideNodes
(
all_nodes
)
treeObj
.
showNodes
(
show_nodes
)
}
},
500
))
},
500
))
}
function
setCheckbox
(
checkedStr
,
attr
)
{
if
(
!
checkedStr
||
!
checkedStr
.
length
)
{
return
false
...
...
@@ -627,7 +630,7 @@
}
else
{
list
=
checkedStr
.
split
(
','
)
}
console
.
log
(
list
)
//
console.log(list)
$
.
each
(
list
,
function
(
index
,
item
)
{
$
(
'input[class='
+
attr
+
']'
).
attr
(
"checked"
,
true
)
})
...
...
@@ -645,6 +648,8 @@
getBusiScope
()
getCarBrandTree
()
getAccountType
()
recoveryBusiScopeCus
()
recoveryFile
()
})
}
...
...
@@ -661,24 +666,17 @@
request
({
method
:
'cn.com.glsx.merchants.merchantCommon.getCarbrandTree'
},
function
(
res
)
{
// console.log(res.data)
baseData
.
carBrandTreeList
=
res
.
data
treeObj
=
tree
.
create
(
'carBrandTree'
,
res
.
data
)
all_nodes
=
treeObj
.
getNodes
()
var
checkedList
=
[]
if
(
editLevel
==
3
)
{
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrand
)
{
checkedList
=
merchantForm
.
merchantBrand
.
split
(
','
)
$
.
each
(
checkedList
,
function
(
index
,
item
)
{
checkedList
[
index
]
=
parseInt
(
item
)
})
}
treeObj
=
tree
.
create
(
'carBrandTree'
,
res
.
data
,
{
checkedList
:
checkedList
})
// 修改-回显
// if (editLevel == 3) {
// checkedList = merchantForm.merchantBrand.split(',')
// for (var i = 0; i <= checkedList.length; i++) {
// treeObj.checkNode(treeObj.getNodeByParam("id", checkedList[i]), true)
// }
// }
})
}
// 获取字典数据
...
...
@@ -726,7 +724,7 @@
getDictData
(
'business_scope'
,
function
(
res
)
{
baseData
.
busiScopeList
=
res
.
data
var
checkedList
=
[]
if
(
editLevel
==
3
)
{
if
(
editLevel
==
3
&&
merchantForm
.
businessScope
)
{
checkedList
=
merchantForm
.
businessScope
.
split
(
','
)
}
var
el
=
$
(
'#busiScopeEl'
)
...
...
@@ -749,13 +747,48 @@
})
}
// 恢复自定义营业范围
function
recoveryBusiScopeCus
()
{
// console.log(merchantForm.businessScopeCustomize)
if
(
merchantForm
.
businessScopeCustomize
)
{
var
scopeCusList
=
merchantForm
.
businessScopeCustomize
.
split
(
','
)
$
.
each
(
scopeCusList
,
function
(
index
,
item
)
{
if
(
index
!=
0
)
{
btnHandle
.
handleAddScope
(
item
)
}
else
{
$
(
'#scopeCus'
).
val
(
item
)
}
})
}
}
// 恢复图片
function
recoveryFile
()
{
console
.
log
(
merchantForm
.
merchantFileResponses
)
merchantForm
.
merchantFiles
=
[]
$
.
each
(
merchantForm
.
merchantFileResponses
,
function
(
index
,
item
)
{
var
imgEl
=
$
(
'#img'
+
index
)
var
el
=
$
(
'#upload'
+
index
)
var
addEl
=
$
(
'.img-add'
+
index
)
merchantForm
.
merchantFiles
[
index
]
=
{
fileUrl
:
item
.
fileUrl
,
fileName
:
item
.
fileName
}
imgEl
.
attr
(
'src'
,
item
.
fileUrl
)
imgEl
.
removeClass
(
'hide'
)
imgEl
.
addClass
(
'show'
)
addEl
.
removeClass
(
'show'
)
addEl
.
addClass
(
'hide'
)
})
}
// 账户类型
function
getAccountType
()
{
getDictData
(
'account_type'
,
function
(
res
)
{
// console.log(res.data)
baseData
.
accountTypeList
=
res
.
data
var
checkedList
=
[]
if
(
editLevel
==
3
)
{
if
(
editLevel
==
3
&&
merchantForm
.
accountType
)
{
checkedList
=
merchantForm
.
accountType
.
split
(
','
)
}
var
el
=
$
(
'#accountTypeEl'
)
...
...
html/merchant/index.html
View file @
cdd32c0
...
...
@@ -440,8 +440,7 @@
function
init
()
{
// 运营系统
// if (!isDxternal) {
if
(
isDxternal
)
{
if
(
!
isDxternal
)
{
getChannel
()
getAccountLevel
()
getAccountType
()
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment