Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
ddda474a
Commit
ddda474a
authored
Jun 07, 2018
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增商铺修改
parent
9b99d169
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
17 deletions
+41
-17
edit.html
application/index/view/houses/edit.html
+5
-4
main.js
public/resource/js/main.js
+5
-0
shop_edit.js
public/resource/js/shop_edit.js
+31
-13
jquery.validate.min.js
public/resource/lib/js/jquery.validate.min.js
+0
-0
No files found.
application/index/view/houses/edit.html
View file @
ddda474a
...
...
@@ -9,7 +9,7 @@
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
新增商铺
</div>
<div
class=
"panel-body"
>
<form
class=
"form-inline"
>
<form
class=
"form-inline"
id=
"main_form"
>
<ul
class=
"list-group"
>
<li
class=
"list-group-item"
>
<div
class=
"form-group"
>
...
...
@@ -145,7 +145,7 @@
<li
class=
"list-group-item"
>
<div
class=
"form-group"
id=
"li_landlord_phone_input"
>
<label>
房东手机号
</label>
<label>
房东
称呼和
手机号
</label>
<div
class=
"landlord-form-group"
>
<div
class=
"form-group phone-list-container"
>
<input
type=
"text"
class=
"form-control landlord-name-input"
placeholder=
"请输入房东称呼"
/>
...
...
@@ -441,8 +441,8 @@
<script
id=
"my_tpl_landlord_phone1"
type=
"text/template"
>
<
div
class
=
"form-group phone-list-container"
>
<
input
type
=
"text"
class
=
"form-control landlord-name-input"
placeholder
=
"请输入房东称呼"
/>
<
input
type
=
"tel"
class
=
"form-control landlord-phone-input"
placeholder
=
"请输入房东手机号"
name
=
"landlordPhone"
data
-
alert
=
"请填写房东手机号!"
>
<
input
type
=
"text"
class
=
"form-control landlord-name-input"
value
=
"{name}"
placeholder
=
"请输入房东称呼"
/>
<
input
type
=
"tel"
class
=
"form-control landlord-phone-input"
value
=
"{phone}"
placeholder
=
"请输入房东手机号"
name
=
"landlordPhone"
data
-
alert
=
"请填写房东手机号!"
>
<
img
src
=
"/resource/image/search_gb.png"
class
=
"input-cancel-pic"
><
/div
>
<
/div
>
</script>
\ No newline at end of file
public/resource/js/main.js
View file @
ddda474a
...
...
@@ -8,6 +8,7 @@ require.config ({
'jquery'
:
'lib/js/jquery-2.0.3.min'
,
'axios'
:
'lib/js/axios.min'
,
'layer'
:
'lib/js/layer'
,
'validate'
:
'lib/js/jquery.validate.min'
,
'temp'
:
(
location
.
origin
||
location
.
protocol
+
'//'
+
location
.
hostname
+
(
location
.
port
==
80
?
''
:
':'
+
location
.
port
))
+
'/resource/template'
,
'style'
:
'css'
,
'doT'
:
'lib/js/doT'
,
...
...
@@ -55,6 +56,10 @@ require.config ({
'deps'
:
[
'css!lib/js/need/layer.css'
],
'exports'
:
'layer'
},
'validate'
:
{
'deps'
:
[
'jquery'
],
'exports'
:
'validate'
}
},
'map'
:
{
...
...
public/resource/js/shop_edit.js
View file @
ddda474a
define
([
'doT'
,
'css!style/shop_edit.css'
,
'ckfinder'
,
'ckfinderStart'
,
'
bootstrapJs
'
],
function
(
doT
)
{
define
([
'doT'
,
'css!style/shop_edit.css'
,
'ckfinder'
,
'ckfinderStart'
,
'
validate
'
],
function
(
doT
)
{
var
user
=
{
init
:
function
()
{
//初始化dot
...
...
@@ -13,7 +13,7 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart', 'bootstra
_source
=
getUrlParam
(
'source'
),
_sublet_id
=
getUrlParam
(
'sublet_id'
),
_doc
=
$
(
document
),
_tpl_landlord_phone1
=
$
(
'#my_tpl_landlord_phone1'
).
html
(),
_tpl_landlord_phone1
=
$
(
'#my_tpl_landlord_phone1'
).
html
(),
//手机号码添加的位置模板
_urlCut
=
location
.
origin
+
'/resource/lib/Attachments/images/'
,
//要截取的部分url
_loadMainItem
=
$
(
'#main_loading_pic'
),
//整个页面的加载图标
_shangpuTypeObj
=
$
(
'#shangpuType'
),
//商铺类型
...
...
@@ -236,16 +236,28 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart', 'bootstra
});
//房东手机号
var
_landlordNum
=
0
;
$
.
each
(
_data
[
'landlord_phone'
].
split
(
','
),
function
(
i
,
item
)
{
if
(
_landlordNum
===
0
)
{
$
(
'#landlord_tel_jia'
).
prev
().
find
(
'input'
).
val
(
item
);
// var _landlordNum = 0;
// $.each(_data['landlord_phone'].split(','), function(i, item) {
// if(_landlordNum === 0) {
// $('#landlord_tel_jia').prev().find('input').val(item);
// } else {
// $('#landlord_tel_jia').before('<div class="form-group phone-list-container landlord-form-group"><input type="tel" class="form-control phone_jia" placeholder="请输入" value="{0}"><img src="/resource/image/search_gb.png" class="input-cancel-pic"></div>'.stringFormatObj({
// '0': item
// }));
// };
// _landlordNum++;
// });
//房东手机号
_data
[
'landlord_phone_array'
]
&&
$
.
each
(
_data
[
'landlord_phone_array'
],
function
(
i
,
item
)
{
if
(
i
===
0
)
{
$
(
'#landlordPhone'
).
val
(
item
.
phone
).
prev
().
val
(
item
.
name
);
}
else
{
$
(
'#landlord_tel_jia'
).
before
(
'<div class="form-group phone-list-container landlord-form-group"><input type="tel" class="form-control phone_jia" placeholder="请输入" value="{0}"><img src="/resource/image/search_gb.png" class="input-cancel-pic"></div>'
.
stringFormatObj
({
'0'
:
item
$
(
'#landlord_tel_jia'
).
prev
().
append
(
_tpl_landlord_phone1
.
stringFormatObj
({
'name'
:
item
.
name
,
'phone'
:
item
.
phone
}));
};
_landlordNum
++
;
});
_landlordPhoneObj
.
val
(
_data
[
'landlord_phone'
]);
//房东手机号
...
...
@@ -656,7 +668,10 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart', 'bootstra
var
_this
=
$
(
this
);
var
_maxLen
=
3
;
if
(
_this
.
prev
().
find
(
'.landlord-phone-input'
).
length
<
_maxLen
)
{
_this
.
prev
().
append
(
_tpl_landlord_phone1
);
_this
.
prev
().
append
(
_tpl_landlord_phone1
.
stringFormatObj
({
'name'
:
''
,
'phone'
:
''
}));
}
else
{
alert
(
'最多添加'
+
_maxLen
+
'个'
);
return
false
;
...
...
@@ -788,6 +803,8 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart', 'bootstra
$
(
'#saveBtn'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
'#main_form'
).
validate
();
return
false
;
//多个input输入框验证标记
var
_isBreakFlag
=
false
;
...
...
@@ -1055,8 +1072,9 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart', 'bootstra
// _data['phone['+i+']'] = item;
// });
$
.
each
(
_landlordPhoneArr
,
function
(
i
,
item
)
{
_data
[
'landlord_phone['
+
i
+
'][name]'
]
=
item
.
name
;
_data
[
'landlord_phone['
+
i
+
'][phone]'
]
=
item
.
phone
;
_data
[
'landlord_phone['
+
i
+
']'
]
=
item
;
//_data['landlord_phone['+i+'][name]'] = item.name;
//_data['landlord_phone['+i+'][phone]'] = item.phone;
});
$
.
each
(
_liebiaoPicObj
,
function
(
i
,
item
)
{
_data
[
'cover['
+
i
+
']'
]
=
item
.
src
.
replace
(
_urlCut
,
''
);
...
...
@@ -1081,7 +1099,7 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart', 'bootstra
url
:
'/index/houseEdit'
,
data
:
_data
,
timeout
:
30000
,
traditional
:
true
,
//
traditional: true,
dataType
:
'json'
,
beforeSend
:
function
()
{
_loadMainItem
.
show
();
...
...
public/resource/lib/js/jquery.validate.min.js
0 → 100644
View file @
ddda474a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment