Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
沈志敏
9 years ago
Commit
38baf889072a96c490edaa8cd1a23ebf1554beb1
1 parent
79af6a9c
添加物流信息
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
226 additions
and
47 deletions
apps/home/controllers/favorite.js
apps/home/controllers/index.js
apps/home/controllers/refund.js
apps/home/models/refund.js
apps/home/router.js
apps/home/views/action/index.hbs
apps/home/views/action/logistics.hbs
public/js/home/favorite-brand.page.js
public/js/home/favorite.page.js
public/js/home/logistics.page.js
public/scss/home/_logistics.css
public/vue/home/fav-brand-list.vue
public/vue/home/fav-product-list.vue
public/vue/home/refund/logistics-company.vue
public/vue/home/refund/logistics.vue
apps/home/controllers/favorite.js
View file @
38baf88
...
...
@@ -72,8 +72,8 @@ const fav = {
link
:
link
,
imgUrl
:
d
.
image
?
helpers
.
image
(
d
.
image
)
:
''
,
title
:
d
.
product_name
,
price
:
'¥'
+
Number
(
d
.
market_price
).
toFixed
(
2
),
discountPrice
:
(
Number
(
d
.
market_price
)
-
Number
(
d
.
sales_price
)
>
0
)
?
'¥'
+
Number
(
d
.
sales_price
).
toFixed
(
2
)
:
false
,
price
:
'¥'
+
Number
(
Math
.
max
(
d
.
market_price
,
0
)).
toFixed
(
2
),
discountPrice
:
(
Number
(
d
.
market_price
)
-
Number
(
d
.
sales_price
)
>
0
)
?
'¥'
+
Number
(
Math
.
max
(
d
.
sales_price
,
0
)).
toFixed
(
2
)
:
false
,
sellOut
:
d
.
storage
<
0
,
invalidGoods
:
d
.
status
==
0
});
...
...
@@ -90,7 +90,7 @@ const fav = {
}).
catch
(
next
);
}
},
favdel
:
(
req
,
res
,
next
)
=>
{
deletefav
:
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
;
uid
=
20000134
;
// 测试uid
...
...
apps/home/controllers/index.js
View file @
38baf88
...
...
@@ -30,8 +30,8 @@ const component = {
let
result
=
{
module
:
'home'
,
page
:
'index'
,
head_ico
:
proData
.
head_ico
?
helpers
.
image
(
proData
.
head_ico
,
200
,
200
)
:
''
,
profile_name
:
uid
?
proData
.
profile_name
:
'登录/注册'
,
head_ico
:
proData
&&
proData
.
head_ico
?
helpers
.
image
(
proData
.
head_ico
,
200
,
200
)
:
''
,
profile_name
:
uid
&&
proData
?
proData
.
profile_name
:
'登录/注册'
,
userinfourl
:
uid
?
'/home/mydetails'
:
helpers
.
urlFormat
(
'/signin.html'
,
{
refer
:
req
.
originalUrl
}),
...
...
apps/home/controllers/refund.js
View file @
38baf88
...
...
@@ -2,6 +2,7 @@
* 退换货
* @type {Object}
*/
'use strict'
;
const
refundModel
=
require
(
'../models/refund'
);
const
refund
=
{
...
...
@@ -32,6 +33,19 @@ const refund = {
module
:
'home'
,
page
:
'logistics'
});
},
companylist
(
req
,
res
,
next
)
{
refundModel
.
getExpressCompany
().
then
(
result
=>
{
res
.
json
(
result
);
}).
catch
(
next
);
},
saveLogistics
(
req
,
res
,
next
)
{
const
company
=
req
.
body
.
company
;
const
num
=
req
.
body
.
num
;
res
.
json
({
code
:
200
});
}
};
...
...
apps/home/models/refund.js
View file @
38baf88
...
...
@@ -24,7 +24,12 @@ const refund = {
method
:
'app.refund.submit'
,
uid
:
uid
,
},
params
)).
then
(
global
.
yoho
.
camelCase
);
},
getExpressCompany
()
{
return
api
.
get
(
''
,
{
method
:
'app.express.getExpressCompany'
});
}
};
module
.
exports
=
refund
;
module
.
exports
=
refund
;
\ No newline at end of file
...
...
apps/home/router.js
View file @
38baf88
...
...
@@ -27,12 +27,14 @@ router.post('/save-feedback', home.saveFeedback); // 个人中心-提交意见
router
.
get
(
'/favorite'
,
favorite
.
favorite
);
// 个人中心 - 收藏
router
.
get
(
'/favorite/favpaging'
,
favorite
.
favpaging
);
// 个人中心 - 收藏商品/品牌(翻页)
router
.
post
(
'/
favorite/favdel'
,
favorite
.
favdel
);
// 个人中心 - 收藏商品/品牌(刪除)
router
.
post
(
'/
del-favdel'
,
favorite
.
deletefav
);
// 个人中心 - 收藏商品/品牌(刪除)
router
.
get
(
'/refund'
,
refund
.
refund
);
// 退换货
router
.
get
(
'/refund/order'
,
refund
.
order
);
// 查询订单数据
router
.
post
(
'/refund/submit'
,
refund
.
submit
);
// 提交信息
router
.
get
(
'/refund/logistics'
,
refund
.
logistics
);
// 退换货 - 商品寄回信息
router
.
get
(
'/refund/companylist'
,
refund
.
companylist
);
// 退换货 - 物流公司列表信息
router
.
post
(
'/save-logistics'
,
refund
.
saveLogistics
);
// 退换货 - 添加寄回物流信息
router
.
get
(
'/about-us'
,
home
.
aboutUs
);
// 个人中心 - 关于我们
...
...
apps/home/views/action/index.hbs
View file @
38baf88
<div
class=
"my-page"
>
<div
class=
"my-header"
>
<a
class=
"user-info"
href=
{{
userinfourl
}}
>
<span
class=
"user-avatar"
data-avatar=
"
{{
head_ico
}}
"
></span>
<span
class=
"user-avatar"
{{#if
head_ico
}}
style=
"background-image: url('
{{
head_ico
}}
');"
{{/if}}
></span>
<br><span
class=
"username"
>
{{
profile_name
}}
</span>
</a>
</div>
...
...
apps/home/views/action/logistics.hbs
View file @
38baf88
<div
class=
"logistics-page"
>
<div
class=
"edit-logistics-page"
>
<form
class=
"edit-logistics"
>
<label
class=
"company"
>
选择快递公司
<input
type=
"text"
name=
"company"
value=
"
{{
company
}}
"
readonly
>
<span
class=
"icon icon-right"
></span>
</label>
<label
class=
"num"
>
快递单号
<input
type=
"text"
name=
"num"
value=
"
{{
num
}}
"
>
</label>
</form>
<div
class=
"submit"
>
确认
</div>
</div>
<div
class=
"logistics-page"
id=
"logistics"
>
<components
:is=
"currentView"
:company=
"company"
keep-alive
></components>
</div>
\ No newline at end of file
...
...
public/js/home/favorite-brand.page.js
View file @
38baf88
...
...
@@ -7,6 +7,6 @@ Vue.use(infiniteScroll);
new
Vue
({
el
:
'#fav-content'
,
components
:
{
'fav
-brand-l
ist'
:
BrandList
'fav
BrandL
ist'
:
BrandList
}
});
});
\ No newline at end of file
...
...
public/js/home/favorite.page.js
View file @
38baf88
...
...
@@ -7,6 +7,6 @@ Vue.use(infiniteScroll);
new
Vue
({
el
:
'#fav-content'
,
components
:
{
'fav
-product-l
ist'
:
ProductList
'fav
ProductL
ist'
:
ProductList
}
});
});
\ No newline at end of file
...
...
public/js/home/logistics.page.js
View file @
38baf88
const
Vue
=
require
(
'yoho-vue'
);
const
infiniteScroll
=
require
(
'yoho-vue-infinite-scroll'
);
const
Logistics
=
require
(
'home/refund/logistics.vue'
);
const
LogisticsCompany
=
require
(
'home/refund/logistics-company.vue'
);
Vue
.
use
(
infiniteScroll
);
new
Vue
({
el
:
'#logistics'
,
data
:
{
company
:
''
,
currentView
:
'logistics'
,
},
components
:
{
logistics
:
Logistics
,
logisticsCompany
:
LogisticsCompany
},
events
:
{
changeView
:
function
(
obj
)
{
this
.
currentView
=
obj
.
view
;
this
.
company
=
obj
.
company
;
}
}
});
\ No newline at end of file
...
...
public/scss/home/_logistics.css
View file @
38baf88
...
...
@@ -5,15 +5,17 @@
.edit-logistics-page
{
width
:
100%
;
color
:
#d0d0d0
;
background
:
#f0f0f0
;
.edit-logistics
{
display
:
inline-block
;
margin-top
:
20px
;
padding
:
0
30px
;
width
:
100%
;
background
:
#fff
;
font-size
:
30px
;
line-height
:
88px
;
border-bottom
:
1px
solid
#e0e0e0
;
label
{
display
:
block
;
position
:
relative
;
...
...
@@ -25,9 +27,15 @@
content
:
none
;
}
input
{
.company-val
{
direction
:
rtl
;
}
margin-right
:
10px
;
}
.icon
{
margin-top
:
27px
;
margin-right
:
10px
;
float
:
right
;
}
}
input
{
...
...
@@ -42,32 +50,57 @@
-webkit-appearance
:
none
;
}
p
{
position
:
absolute
;
top
:
0
;
right
:
40px
;
width
:
360px
;
height
:
88px
;
color
:
#444
;
padding
:
0
;
border
:
none
;
.num
{
width
:
440px
;
text-align
:
right
;
}
}
.submit
{
margin
:
auto
30px
;
width
:
100%
;
position
:
fixed
;
bottom
:
20px
;
width
:
92%
;
margin
:
0
4%
;
height
:
100px
;
color
:
#fff
;
background
:
#000
;
text-align
:
center
;
font-size
:
28px
;
line-height
:
88
px
;
line-height
:
100
px
;
&.highlight
{
background
:
rgba
(
0
,
0
,
0
,
0.6
);
}
}
}
.companylist-page
{
width
:
100%
;
color
:
#d0d0d0
;
.search-input
{
position
:
relative
;
padding
:
14px
22px
;
background
:
#f8f8f8
;
.icon
{
position
:
absolute
;
font-size
:
24px
;
top
:
26px
;
left
:
36px
;
color
:
#b2b2b2
;
}
input
{
height
:
56px
;
width
:
378px
;
border-radius
:
28px
;
padding
:
0
52px
;
font-size
:
24px
;
background
:
#fff
;
border
:
none
;
}
}
}
}
...
...
public/vue/home/fav-brand-list.vue
View file @
38baf88
...
...
@@ -73,8 +73,8 @@
delItem(index, id) {
let _this = this;
$.ajax({
method: 'post',
url: '/home/favorite/favdel',
method: 'POST',
url: '/home/del-favdel',
data: {
favId: id,
type: 'brand'
...
...
public/vue/home/fav-product-list.vue
View file @
38baf88
...
...
@@ -80,8 +80,8 @@
delItem(index, id) {
let _this = this;
$.ajax({
method: 'post',
url: '/home/favorite/favdel',
method: 'POST',
url: '/home/del-favdel',
data: {
favId: id,
type: 'product'
...
...
public/vue/home/refund/logistics-company.vue
0 → 100644
View file @
38baf88
<template>
<div class="companylist-page">
<div class="search-input">
<input class="buriedpoint icon" type="text" placeholder="搜索快递公司">
</div>
<ul class="search-associate"></ul>
</div>
</template>
<script>
module.exports = {
data() {
return {
companyData: {},
};
},
methods: {
submit: function(){
console.log(this.num);
this.$dispatch('changeView', {
view: 'logistics',
company: "aaaf啊啊啊"
});
}
},
activate: function(done) {
$.ajax({
url: '/home/refund/companylist'
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code === 200) {
}
done();
}).fail(function() {
tip('网络错误');
done();
});
}
};
</script>
\ No newline at end of file
...
...
public/vue/home/refund/logistics.vue
0 → 100644
View file @
38baf88
<template>
<div class="edit-logistics-page">
<form class="edit-logistics">
<label @click="companylist">
选择快递公司<input class="company-val" type="text" name="company" value="{{company}}" readonly>
<span class="icon icon-right"></span>
</label>
<label>
快递单号
<input class="num" type="number" name="num" v-model='num'>
</label>
</form>
<div class="submit" @click="submit">确认</div>
</div>
</template>
<script>
const $ = require('yoho-jquery');
const tip = require('common/tip');
module.exports = {
props: ['company'],
data() {
return {
num: '',
};
},
methods: {
companylist: function(){
this.$dispatch('changeView', {
view: 'logisticsCompany'
});
},
submit: function(){
if (!this.company) {
tip("请选择快递公司");
return false;
}
if (!/^[0-9]*$/.test(this.num)) {
tip("请输入正确的快递单号");
return false;
}
$.ajax({
method: 'POST',
url: '/home/save-logistics',
data: {
company: company,
num: num
}
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip(res.message || '网络出了点问题~');
} else {
// todo 跳转到什么页面呢?
// window.location.href
}
}).fail(function() {
tip('网络错误');
});
return false;
}
}
};
</script>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment