Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
2645456cd156386a304d20159a4ab83cf49ef5aa
1 parent
e5573a58
地址管理三级菜单
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
83 additions
and
102 deletions
static/js/me/address.js
static/sass/me/_address.scss
template/m.yohobuy.com/actions/index/home/address.phtml
template/m.yohobuy.com/actions/index/home/edit_address.phtml
template/m.yohobuy.com/actions/index/home/online_service.phtml
template/m.yohobuy.com/actions/index/home/online_service_detail.phtml
template/m.yohobuy.com/partials/layout/use.phtml
template/m.yohobuy.com/partials/me/address/address-list.phtml
template/m.yohobuy.com/partials/me/address/edit-address.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
static/js/me/address.js
View file @
2645456
...
...
@@ -12,7 +12,11 @@ var $action = $('.action'),
$submit
=
$
(
'.submit'
),
$addAddress
=
$
(
'.add-address'
),
$editAddressPage
=
$
(
'.my-edit-address-page'
),
isSubmiting
;
$addressListPage
=
$
(
'.my-address-list-page'
),
$area
=
$
(
'.area'
),
$footer
=
$
(
'#yoho-footer'
),
isSubmiting
,
newArea
=
[];
function
editAddress
(
data
)
{
data
=
data
||
{};
...
...
@@ -71,3 +75,30 @@ $addressForm.on('submit', function() {
});
return
false
;
});
// 省市区
$area
.
on
(
'touchend'
,
function
()
{
$footer
.
hide
();
$addressListPage
.
show
();
});
$addressListPage
.
on
(
'touchend'
,
'.address'
,
function
()
{
newArea
.
push
(
$
(
this
).
children
(
'.caption'
).
text
());
$
(
this
).
siblings
().
hide
();
$
(
this
).
children
(
'ul'
).
show
();
return
false
;
}).
on
(
'touchend'
,
'.address-last'
,
function
()
{
// 填结果到 html
newArea
.
push
(
$
(
this
).
children
(
'.caption'
).
text
());
$
(
'[name="area"]'
).
val
(
newArea
.
join
(
' '
));
$
(
'[name="area_code"]'
).
val
(
$
(
this
).
data
(
'id'
));
// 恢复默认的三级选择
$addressListPage
.
hide
();
$addressListPage
.
find
(
'ul'
).
hide
();
$addressListPage
.
children
(
'ul'
).
show
().
children
(
'li'
).
show
();
$footer
.
show
();
newArea
=
[];
return
false
;
});
...
...
static/sass/me/_address.scss
View file @
2645456
...
...
@@ -102,7 +102,7 @@
.my-edit-address-page
{
position
:
absolute
;
bottom
:
0
;
top
:
pxToRem
(
90px
)
;
top
:
0
;
width
:
100%
;
color
:
#d0d0d0
;
background
:
#f0f0f0
;
...
...
@@ -157,7 +157,7 @@
textarea
{
height
:
pxToRem
(
58px
)
*
2
;
padding
:
pxToRem
(
20px
)
pxToRem
(
10px
)
;
padding
:
pxToRem
(
20px
)
0
;
}
}
...
...
@@ -171,4 +171,32 @@
font-size
:
pxToRem
(
32px
);
line-height
:
pxToRem
(
88px
);
}
}
\ No newline at end of file
}
.my-address-list-page
{
position
:
absolute
;
bottom
:
0
;
top
:
0
;
width
:
100%
;
color
:
#444
;
background
:
#fff
;
li
{
padding
:
0
pxToRem
(
30px
);
font-size
:
pxToRem
(
32px
);
line-height
:
pxToRem
(
88px
);
border-bottom
:
1px
solid
#e0e0e0
;
.iconfont
{
float
:
right
;
color
:
#d0d0d0
;
}
ul
{
display
:
none
;
position
:
absolute
;
top
:
0
;
left
:
0
;
background
:
#fff
;
width
:
100%
;
}
}
}
...
...
template/m.yohobuy.com/actions/index/home/address.phtml
View file @
2645456
...
...
@@ -6,7 +6,7 @@
<span
class=
"tel"
>
{
{mobile
}
}</span>
<p
class=
"address-info"
>
{
{area
}
}
{
{address
}
}</p>
<div
class=
"action iconfont"
>
<
a
href=
"/home/address/edit?id={{address_id}}"
class=
"edit"
>
61
e;</a
>
<
span
class=
"edit"
data-id=
"{{address_id}}"
data-consignee=
"{{consignee}}"
data-mobile=
"{{mobile}}"
data-area-code=
"{{area_code}}"
data-area=
"{{area}}"
data-address=
"{{address}}"
>
61
e;</span
>
<span
class=
"del"
data-id=
"{{address_id}}"
>
621
;</span>
</div>
</div>
...
...
@@ -30,5 +30,7 @@
</div>
</div>
</div>
{
{>
me/address/edit-address
}
}
{
{>
me/address/address-list
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/edit_address.phtml
deleted
100644 → 0
View file @
e5573a5
{
{>
layout/header
}
}
<div
class=
"my-edit-address-page yoho-page"
>
<form
class=
"edit-address"
>
<label
class=
"username"
>
用户名
<input
type=
"text"
name=
"name"
value=
"张三"
>
</label>
<label
class=
"mobile"
>
手机号码
<input
type=
"text"
name=
"mobile"
value=
"18911110110"
>
</label>
<label
class=
"area"
>
省市区
<input
type=
"text"
name=
"area"
value=
"江苏省南京市栖霞区"
>
<span
class=
"iconfont"
>
604
;</span>
</label>
<label
class=
"address"
>
详细地址
<textarea
name=
"address"
>东大街西大
66
号茶馆东大街西大
66
号茶馆东大街西大
66
号茶馆</textarea>
</label>
</form>
<div
class=
"submit"
>
确认
</div>
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
template/m.yohobuy.com/actions/index/home/online_service.phtml
deleted
100644 → 0
View file @
e5573a5
{
{>
layout/header
}
}
<div
class=
"online-service-page yoho-page"
>
{
{#
service
}
}
<div
class=
"question"
>
<div
class=
"question-title"
>问题查询</div>
<div
class=
"question-tab"
>
{
{#tab
}
}
<span
class=
"tab-item {{#current}}current{{/current}}"
data-tab=
"{{tabid}}"
>
{
{tabname
}
}</span>
{
{#iscut
}
}<span
class=
"line"
></span>
{
{/iscut
}
}
{
{/tab
}
}
</div>
{
{#question
}
}
<ul
class=
"question-list {{#current}}current{{/current}}"
data-tab-name=
"{{name}}"
>
{
{#list
}
}
<li
class=
"question-item"
>
<a
href=
"{{link}}"
title=
"{{title}}"
>
{
{title
}
}
<span
class=
"iconfont icon-yoho-enter"
>
604
;</span>
</a>
</li>
{
{/list
}
}
</ul>
{
{/question
}
}
</div>
{
{/
service
}
}
<div
class=
"connect-info"
>
<div
class=
"connect-item connect-online"
>
<a
href=
"http://chat80.live800.com/live800/chatClient/chatbox.jsp?companyID=493979&configID=123576&jid=9277320930"
target=
"_blank"
title=
"在线客服"
>
<span
class=
"icon iconfont icon-chat"
>
63
c;</span>
在线客服
<span
class=
"iconfont icon-yoho-enter"
>
604
;</span>
</a>
</div>
<div
class=
"connect-item connect-tel"
>
<a
href=
"tel:400-889-9649"
title=
"电话客服"
>
<span
class=
"icon iconfont icon-tel"
>
63
e;</span>
电话客服
<p>
400-889-9649
09
:
00
-
22
:
30
(周一至周日)
</p>
</a>
</div>
</div>
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
template/m.yohobuy.com/actions/index/home/online_service_detail.phtml
deleted
100644 → 0
View file @
e5573a5
{
{>
layout/header
}
}
<div
class=
"online-service-detail-page yoho-page"
>
<div
class=
"qa-list"
>
{
{#
list
}
}
<div
class=
"question-item"
>
<div
class=
"question"
>Q:
{
{q
}
}</div>
<div
class=
"answer"
>
{
{a
}
}</div>
</div>
{
{/
list
}
}
</div>
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
template/m.yohobuy.com/partials/layout/use.phtml
View file @
2645456
...
...
@@ -230,4 +230,9 @@
<script>
seajs.use('js/me/online-service');
</script>
{{/if}}
{{#if addressPage}}
<script>
seajs.use('js/me/address');
</script>
{{/if}}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/me/address/address-list.phtml
View file @
2645456
<div class="my-address-list-page hide">
{{# addressList}}
<ul class="address-list">
{{# addressList}}
<li class="address">
{{caption}}
<span class="caption">{{caption}}</span>
<span class="iconfont"></span>
<ul>
{{# sub}}
<li class="address">
{{caption}}
<span class="caption">{{caption}}</span>
<span class="iconfont"></span>
<ul class="address-list">
{{# sub}}
<li class="address-last" data-id="{{code}}">
{{caption}}, {{code}}
<span class="caption">{{caption}}</span>
</li>
{{/ sub}}
</ul>
...
...
@@ -19,6 +20,6 @@
{{/ sub}}
</ul>
</li>
{{/ addressList}}
</ul>
{{/ addressList}}
</div>
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/me/address/edit-address.phtml
View file @
2645456
...
...
@@ -12,7 +12,7 @@
<label class="area">
省市区
<input type="hidden" name="area_code" value="">
<input type="text" name="area" value="">
<input type="text" name="area" value=""
readonly
>
<span class="iconfont"></span>
</label>
<label class="address">
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
2645456
...
...
@@ -207,7 +207,7 @@ class HomeController extends AbstractAction
$address
=
\Index\UserModel
::
getAddressData
(
$uid
);
$addressList
=
\Index\UserModel
::
getAddressListData
(
$uid
);
// print_r($address);
// print_r($address
List
);
$this
->
_view
->
display
(
'address'
,
array
(
'addressPage'
=>
true
,
...
...
@@ -277,7 +277,7 @@ class HomeController extends AbstractAction
$service
=
home\OnlineModel
::
getOnlineServiceInfo
();
$this
->
_view
->
display
(
'online
_
service'
,
array
(
$this
->
_view
->
display
(
'online
-
service'
,
array
(
'onlineServicePage'
=>
true
,
// 'pageFooter' => true,
'service'
=>
$service
...
...
@@ -295,7 +295,7 @@ class HomeController extends AbstractAction
}
$this
->
setTitle
(
'在线客服'
);
$this
->
setNavHeader
(
$cateName
,
true
,
''
);
$this
->
_view
->
display
(
'online
_service_
detail'
,
$service
);
$this
->
_view
->
display
(
'online
-service-
detail'
,
$service
);
}
/**
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
2645456
...
...
@@ -296,10 +296,10 @@ class UserModel
}
else
if
(
empty
(
$consignee
))
{
$result
[
'code'
]
=
403
;
$result
[
'message'
]
=
'请输入收件人姓名'
;
}
else
if
(
!
empty
(
$email
)
&&
Helpers
::
verifyEmail
(
$email
))
{
}
else
if
(
!
empty
(
$email
)
&&
!
Helpers
::
verifyEmail
(
$email
))
{
$result
[
'code'
]
=
404
;
$result
[
'message'
]
=
'输入的邮箱地址格式不正确'
;
}
else
if
(
!
empty
(
$mobile
)
&&
Helpers
::
verifyMobile
(
$mobile
))
{
}
else
if
(
!
empty
(
$mobile
)
&&
!
Helpers
::
verifyMobile
(
$mobile
))
{
$result
[
'code'
]
=
404
;
$result
[
'message'
]
=
'输入的手机号码格式不正确'
;
}
else
{
...
...
Please
register
or
login
to post a comment