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
fa63fdb9
Commit
fa63fdb9
authored
Feb 05, 2018
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺编辑暂存
parent
99a74b39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
125 additions
and
30 deletions
+125
-30
edit.js
public/resource/js/edit.js
+125
-30
No files found.
public/resource/js/edit.js
View file @
fa63fdb9
...
...
@@ -7,6 +7,7 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
event
:
function
()
{
var
_id
=
getUrlParam
(
'id'
),
//地址栏获取的商铺或者街铺id
_doc
=
$
(
document
),
_urlCut
=
location
.
origin
+
'/resource/lib/Attachments/'
;
//要截取的部分url
_shangpuTypeObj
=
$
(
'#shangpuType'
),
//商铺类型
_showCdObj
=
$
(
'#showCd'
),
//显示给C端用户看
_exclusiveTypeObj
=
$
(
'#exclusiveType'
),
//是否独家
...
...
@@ -55,6 +56,16 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
_exclusiveTelObj
=
$
(
'#exclusiveTel'
),
//独家方电话
_imgUploadDujia
=
$
(
'#dujia_pic_ul'
),
//独家合同ul
_imgMaskObj
=
$
(
'#img_mask_area'
);
//预览大图的mask
//处理文件名,长度过长时处理
function
dealFileName
(
str
){
//如果文件超过30的长度,则用*代替
if
(
str
.
length
>
26
){
return
str
.
slice
(
0
,
23
)
+
'***'
+
str
.
slice
(
-
4
);
}
else
{
return
str
;
};
};
if
(
_id
!=
null
){
$
.
ajax
({
...
...
@@ -68,39 +79,129 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
var
_data
=
data
[
'data'
];
if
(
data
.
code
==
200
)
{
_shangpuTypeObj
.
val
(
data
[
'data'
]
[
'shop_type'
]).
change
().
attr
({
_shangpuTypeObj
.
val
(
_data
[
'shop_type'
]).
change
().
attr
({
'disabled'
:
'disabled'
,
'title'
:
'商铺类型暂不支持修改'
});
_showCdObj
.
val
(
data
[
'data'
]
[
'is_show'
]).
change
();
_exclusiveTypeObj
.
val
(
data
[
'data'
]
[
'is_exclusive_type'
]).
change
();
if
(
data
[
'data'
]
[
'shop_type'
]
==
'0'
){
_showCdObj
.
val
(
_data
[
'is_show'
]).
change
();
_exclusiveTypeObj
.
val
(
_data
[
'is_exclusive_type'
]).
change
();
if
(
_data
[
'shop_type'
]
==
'0'
){
//如果是商场
_roomArea2Obj
.
val
(
data
[
'data'
]
[
'shop_area_end'
]);
_roomArea2Obj
.
val
(
_data
[
'shop_area_end'
]);
};
if
(
data
[
'data'
]
[
'is_show'
]
==
'0'
){
if
(
_data
[
'is_show'
]
==
'0'
){
//如果是显示给C端用户看(对商户公开)
_foreignNameObj
.
val
(
data
[
'data'
]
[
'external_title'
]);
_addressExternalObj
.
val
(
data
[
'data'
]
[
'external_address'
]);
_foreignYoushiObj
.
val
(
data
[
'data'
]
[
'external_item_advantage'
]);
_foreignNameObj
.
val
(
_data
[
'external_title'
]);
_addressExternalObj
.
val
(
_data
[
'external_address'
]);
_foreignYoushiObj
.
val
(
_data
[
'external_item_advantage'
]);
};
if
(
data
[
'data'
]
[
'is_exclusive_type'
]
==
'1'
){
if
(
_data
[
'is_exclusive_type'
]
==
'1'
){
//如果是独家
// _exclusiveDate1Obj.val(data['data']['external_title']);
// _addressExternalObj.val(data['data']['external_address']);
// _foreignYoushiObj.val(data['data']['external_item_advantage']);
// _exclusiveDate1Obj.val(_data['external_title']);
// _addressExternalObj.val(_data['external_address']);
// _foreignYoushiObj.val(_data['external_item_advantage']);
};
//案场人电话
var
_phoneNum
=
0
;
for
(
var
i
in
_data
[
'phone'
]){
if
(
_phoneNum
==
0
){
$
(
'#acr_tel_jia'
).
prev
().
find
(
'input'
).
val
(
i
+
'-'
+
_data
[
'phone'
][
i
]);
}
else
{
$
(
'#acr_tel_jia'
).
before
(
'<div class="form-group phone-list-container"><input type="tel" class="form-control phone_jia" placeholder="请输入" value="{0}"><ul></ul><img src="/resource/image/search_gb.png" class="input-cancel-pic"></div>'
.
stringFormatObj
({
'0'
:
i
+
'-'
+
_data
[
'phone'
][
i
]
}));
};
_phoneNum
++
;
};
//盘方
var
_panfangNum
=
0
;
for
(
var
i
in
_data
[
'dish_name'
]){
if
(
_panfangNum
==
0
){
$
(
'#pf_tel_jia'
).
prev
().
find
(
'input'
).
val
(
_data
[
'dish_name'
][
i
]).
attr
(
'data-id'
,
_data
[
'dish_name'
][
i
].
split
(
'-'
)[
0
]);
}
else
{
$
(
'#pf_tel_jia'
).
before
(
'<div class="form-group phone-list-container"><input type="tel" class="form-control phone_jia" placeholder="请输入" value="{0}" data-id="{1}"><ul></ul><img src="/resource/image/search_gb.png" class="input-cancel-pic"></div>'
.
stringFormatObj
({
'0'
:
_data
[
'dish_name'
][
i
],
'1'
:
_data
[
'dish_name'
][
i
].
split
(
'-'
)[
0
]
}));
};
_panfangNum
++
;
};
//案场权限人
var
_acqxNum
=
0
;
for
(
var
i
in
_data
[
'agents_name'
]){
if
(
_acqxNum
==
0
){
$
(
'#acqx_tel_jia'
).
prev
().
find
(
'input'
).
val
(
_data
[
'agents_name'
][
i
]).
attr
(
'data-id'
,
_data
[
'agents_name'
][
i
].
split
(
'-'
)[
0
]);
}
else
{
$
(
'#acqx_tel_jia'
).
before
(
'<div class="form-group phone-list-container"><input type="tel" class="form-control phone_jia" placeholder="请输入" value="{0}" data-id="{1}"><ul></ul><img src="/resource/image/search_gb.png" class="input-cancel-pic"></div>'
.
stringFormatObj
({
'0'
:
_data
[
'agents_name'
][
i
],
'1'
:
_data
[
'agents_name'
][
i
].
split
(
'-'
)[
0
]
}));
};
_acqxNum
++
;
};
$
.
each
(
_yetaiObj
,
function
(
i
,
item
)
{
~
data
[
'data'
]
[
'industry_type'
].
indexOf
(
item
.
value
)
&&
(
item
.
checked
=
'checked'
);
~
_data
[
'industry_type'
].
indexOf
(
item
.
value
)
&&
(
item
.
checked
=
'checked'
);
});
$
.
each
(
_roomTagObj
,
function
(
i
,
item
)
{
~
data
[
'data'
]
[
'shop_sign'
].
indexOf
(
item
.
value
)
&&
(
item
.
checked
=
'checked'
);
~
_data
[
'shop_sign'
].
indexOf
(
item
.
value
)
&&
(
item
.
checked
=
'checked'
);
});
_landlordPhoneObj
.
val
(
data
[
'data'
][
'landlord_phone'
]);
_internalNameObj
.
val
(
data
[
'data'
][
'internal_title'
]);
_zujinTypeObj
.
val
(
data
[
'data'
][
'rent_type'
]);
_moonPriceObj
.
val
(
data
[
'data'
][
'rent_price'
]);
_landlordPhoneObj
.
val
(
_data
[
'landlord_phone'
]);
//房东手机号
_internalNameObj
.
val
(
_data
[
'internal_title'
]);
//对内商铺名称
_zujinTypeObj
.
val
(
_data
[
'rent_type'
]);
//租金模式
_moonPriceObj
.
val
(
_data
[
'rent_price'
]);
//月租均价
_wuyePriceObj
.
val
(
_data
[
'management_fee'
]);
//物业管理费
_jinchangPriceObj
.
val
(
_data
[
'slotting_fee'
]);
//进场费(转让费)
_roomShengyuNumObj
.
val
(
_data
[
'residue_num'
]);
//剩余铺数
_roomAllNumObj
.
val
(
_data
[
'total'
]);
//总铺数
_roomArea1Obj
.
val
(
_data
[
'shop_area_start'
]);
//商铺面积起始值
_businessAreaObj
.
val
(
_data
[
'market_area'
]);
//商业面积
_trafficObj
.
val
(
_data
[
'traffic'
]);
//交通
_hasMovedObj
.
val
(
_data
[
'enter_num'
]);
//已入住
_yingyeTimeObj
.
val
(
_data
[
'do_business_date'
]);
//营业时间
_kaipanTimeObj
.
val
(
_data
[
'opening_date'
].
split
(
' '
)[
0
]);
//开盘时间
_kaiyeTimeObj
.
val
(
_data
[
'start_business_date'
].
split
(
' '
)[
0
]);
//开业时间
_hasGasObj
.
val
(
_data
[
'is_has_gas'
]);
//是否有燃气
_yongjinRuleObj
.
val
(
_data
[
'fee_rule'
]);
//佣金规则
_internalYoushiObj
.
val
(
_data
[
'internal_item_advantage'
]);
//对内项目优势
_qianyueRuleObj
.
val
(
_data
[
'singn_rule'
]);
//签约规则
_weilouLinkObj
.
val
(
_data
[
'tiny_brochure_url'
]);
//微楼书
_dajiangtangObj
.
find
(
'iframe'
).
contents
().
find
(
'body'
).
html
(
_data
[
'auditorium'
]);
//大讲堂
// _imgUploadLiebiao = $('#liebiao_pic_ul'),//列表页封面图ul
// _imgUploadLunbo = $('#xiangqing_pic_ul'),//详情页轮播图ul
// _imgUploadLouceng = $('#louceng_pic_ul'),//楼层平面图ul
// _pdfUploadFujian = $('#fujian_ul')//附件ul
//列表页封面图
_imgUploadLiebiao
.
html
(
'<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
_urlCut
+
_data
[
'cover'
]
}));
//详情页轮播图
for
(
var
i
in
_data
[
'slide_show'
]){
_imgUploadLunbo
.
append
(
'<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
_urlCut
+
_data
[
'slide_show'
][
i
]
}));
};
//楼层平面图
for
(
var
i
in
_data
[
'plan'
]){
_imgUploadLouceng
.
append
(
'<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
_urlCut
+
_data
[
'plan'
][
i
]
}));
};
//附件
_pdfUploadFujian
.
html
(
'<li class="pdf-pre-li"><a class="pdf-pre-a" href="{0}" target="_blank" title="点击查看">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
_urlCut
+
_data
[
'file_path'
],
'1'
:
dealFileName
(
decodeURI
(
_data
[
'file_path'
].
slice
(
_data
[
'file_path'
].
lastIndexOf
(
'/'
)
+
1
)))
}));
}
else
{
alert
(
data
[
'msg'
]);
};
...
...
@@ -129,20 +230,13 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
_spFile
=
_this
.
data
(
'spfile'
),
_limitTop
=
_this
.
data
(
'limittop'
),
_fileNum
=
_this
.
parent
().
next
().
find
(
'.delet-pic-btn'
).
length
;
//根据删除按钮的个数,确定文件的个数
function
dealFileName
(
str
){
//如果文件超过30的长度,则用*代替
if
(
str
.
length
>
26
){
return
str
.
slice
(
0
,
23
)
+
'***'
+
str
.
slice
(
-
4
);
}
else
{
return
str
;
};
};
if
(
_limitTop
&&
(
_fileNum
<
_limitTop
)){
BrowseServer
(
_this
.
prev
().
attr
(
'id'
),
function
(
url
){
console
.
log
(
url
);
if
(
_spFile
==
'pdf'
){
if
(
/
(\.
pdf
)
$/i
.
test
(
url
)){
_this
.
parent
().
next
().
prepend
(
'<li class="pdf-pre-li"><a class="pdf-pre-a" href="{0}">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
_this
.
parent
().
next
().
prepend
(
'<li class="pdf-pre-li"><a class="pdf-pre-a" href="{0}"
target="_blank" title="点击查看"
>{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
url
,
'1'
:
dealFileName
(
decodeURI
(
url
.
slice
(
url
.
lastIndexOf
(
'/'
)
+
1
)))
}));
...
...
@@ -168,7 +262,7 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
});
//图片上传删除键事件
_doc
.
on
(
'click'
,
'.
img-pre-ul>li>a
'
,
function
(
e
){
_doc
.
on
(
'click'
,
'.
delet-pic-btn
'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
confirm
(
'确定删除该文件吗?'
)
&&
$
(
this
).
parent
().
hide
();
...
...
@@ -543,6 +637,7 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
};
});
//保存按钮点击事件
$
(
'#saveBtn'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
...
...
@@ -783,7 +878,7 @@ define (['ckfinder','ckfinderStart', 'bootstrapJs'], function () {
_data
[
'exclusive_img['
+
i
+
']'
]
=
item
.
src
.
replace
(
_urlCut
,
''
);
});
};
var
_urlCut
=
location
.
origin
+
'/resource/lib/Attachments/'
;
//要截取的部分url
$
.
each
(
_acrPhoneArr
,
function
(
i
,
item
)
{
_data
[
'phone['
+
i
+
']'
]
=
item
;
});
...
...
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