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
39ce28b031885717c55c113f784daef3308cebf9
1 parent
57bfa682
fix bug
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
45 additions
and
54 deletions
apps/me/controllers/order.js
apps/me/controllers/refund.js
apps/me/models/order.js
apps/me/models/refund.js
apps/me/views/action/status.hbs
public/js/common/intercept-click.js
public/scss/me/_order.css
public/vue/me/exchange.vue
public/vue/me/fav-brand-list.vue
public/vue/me/fav-product-list.vue
public/vue/me/order.vue
public/vue/me/refund-order.vue
public/vue/me/refund-status.vue
public/vue/me/refund.vue
apps/me/controllers/order.js
View file @
39ce28b
...
...
@@ -36,10 +36,7 @@ const order = {
});
},
getOrderData
:
(
req
,
res
)
=>
{
let
uid
=
req
.
user
.
uid
;
let
page
=
req
.
query
.
page
;
let
type
=
req
.
query
.
type
;
let
limit
=
req
.
query
.
limit
;
const
uid
=
req
.
user
.
uid
;
if
(
!
uid
&&
req
.
xhr
)
{
return
res
.
json
({
...
...
@@ -47,11 +44,11 @@ const order = {
message
:
notLoginTip
});
}
le
t
param
=
{
cons
t
param
=
{
uid
:
uid
,
page
:
page
,
type
:
type
,
limit
:
limit
page
:
req
.
query
.
page
,
type
:
req
.
query
.
type
,
limit
:
req
.
query
.
limit
};
orderModel
.
getOrders
(
param
).
then
(
result
=>
{
...
...
apps/me/controllers/refund.js
View file @
39ce28b
...
...
@@ -7,7 +7,6 @@ const refundModel = require('../models/refund');
const
notLoginCode
=
400
;
const
notLoginTip
=
'抱歉,您暂未登录!'
;
const
testUid
=
8039837
;
// 测试uid
const
isBLK
=
1
;
const
refund
=
{
refund
(
req
,
res
)
{
...
...
@@ -118,8 +117,7 @@ const refund = {
let
param
=
{
uid
:
uid
,
page
:
page
,
limit
:
limit
,
app_type
:
isBLK
limit
:
limit
};
refundModel
.
getRefundOrders
(
param
).
then
(
result
=>
{
...
...
apps/me/models/order.js
View file @
39ce28b
...
...
@@ -6,8 +6,6 @@
'use strict'
;
const
api
=
global
.
yoho
.
API
;
// const serviceAPI = global.yoho.ServiceAPI;
const
camelCase
=
global
.
yoho
.
camelCase
;
const
_
=
require
(
'lodash'
);
...
...
@@ -65,7 +63,6 @@ exports.cancelOrder = (orderCode, reasonId, reason) => {
* @returns {Promise.<T>|*}
*/
exports
.
confirmOrder
=
(
orderCode
)
=>
{
return
api
.
post
(
''
,
{
method
:
'app.SpaceOrders.confirm'
,
order_code
:
orderCode
...
...
@@ -101,7 +98,7 @@ exports.getOrderLogisticdate = (params) => {
let
method
;
if
(
_
.
isEmpty
(
params
.
order_code
))
{
return
[]
;
return
Promise
.
resolve
([])
;
}
// getNewExpress:退换货物流,li:订单物流
...
...
apps/me/models/refund.js
View file @
39ce28b
...
...
@@ -77,7 +77,6 @@ const refund = {
},
param
);
return
api
.
get
(
''
,
param
,
{
cache
:
true
,
code
:
200
}).
then
(
global
.
yoho
.
camelCase
);
},
...
...
apps/me/views/action/status.hbs
View file @
39ce28b
<div
class=
"status"
id=
"status"
>
<status
:applyid=
"
{{
applyId
}}
"
:type=
"
{{
type
}}
"
></status>
<status
type=
'
{{
type
}}
'
applyid=
"
{{
applyId
}}
"
></status>
</div>
...
...
public/js/common/intercept-click.js
View file @
39ce28b
...
...
@@ -2,6 +2,7 @@
* 拦截跳转, 在这里给将要打开的页面设置一下 header 样式
* @return {[type]}
*/
const
$
=
require
(
'jquery'
);
const
yoho
=
require
(
'yoho'
);
const
parse
=
require
(
'yoho-qs/parse'
);
// 提供解析函数
...
...
@@ -17,7 +18,7 @@ const origin = location.origin;
* 文档 http://git.yoho.cn/mobile/AppJSBridge/blob/master/HeaderType.md
* @type {Object}
*/
const
t
itleMap
=
{
const
defaultT
itleMap
=
{
1
:
{
headerid
:
'1'
,
left
:
{
...
...
@@ -95,7 +96,7 @@ const titleMap = {
}
};
const
matchHeader
=
(
url
)
=>
{
const
matchHeader
=
(
url
,
titleMap
)
=>
{
let
header
=
{
headerid
:
'-1'
};
...
...
@@ -217,6 +218,7 @@ const matchHeader = (url) => {
const
intercept
=
(
url
)
=>
{
if
(
yoho
.
isApp
)
{
let
titleMap
=
$
.
extend
({},
defaultTitleMap
);
let
[
path
,
qs
]
=
url
.
split
(
'?'
);
qs
=
parse
(
qs
);
...
...
@@ -265,7 +267,7 @@ const intercept = (url) => {
}
yoho
.
goNewPage
({
header
:
matchHeader
(
url
),
header
:
matchHeader
(
url
,
titleMap
),
url
:
/^
(
https
?
:
)?\/\/
/i
.
test
(
url
)
?
url
:
origin
+
url
});
}
else
{
...
...
@@ -274,6 +276,6 @@ const intercept = (url) => {
};
module
.
exports
=
{
titleMap
:
t
itleMap
,
defaultTitleMap
:
defaultT
itleMap
,
intercept
:
intercept
};
...
...
public/scss/me/_order.css
View file @
39ce28b
...
...
@@ -228,7 +228,7 @@ $white: #fff;
background-size
:
100%
;
}
p
{
p
{
color
:
#b0b0b0
;
}
...
...
public/vue/me/exchange.vue
View file @
39ce28b
...
...
@@ -245,7 +245,7 @@
data
}).then(result => {
if (result.code === 200) {
let header =
interceptClick.titleMap[1]
;
let header =
$.extend({}, interceptClick.defaultTitleMap[1])
;
header.left.action = location.origin + '/me/return'
header.title.des = '换货状态';;
...
...
public/vue/me/fav-brand-list.vue
View file @
39ce28b
...
...
@@ -206,7 +206,7 @@
this.hideDelBth();
this.editmodel = !this.editmodel;
let header =
interceptClick.titleMap[5]
;
let header =
$.extend({}, interceptClick.defaultTitleMap[5])
;
header.defaultSelectedIndex = '1';
header.right.des = this.editmodel ? '完成' : '编辑';
...
...
public/vue/me/fav-product-list.vue
View file @
39ce28b
...
...
@@ -224,7 +224,7 @@
this.hideDelBth();
this.editmodel = !this.editmodel;
let header =
interceptClick.titleMap[5]
;
let header =
$.extend({}, interceptClick.defaultTitleMap[5])
;
header.defaultSelectedIndex = '0';
header.right.des = this.editmodel ? '完成' : '编辑';
...
...
public/vue/me/order.vue
View file @
39ce28b
...
...
@@ -98,10 +98,10 @@
}
}).then(result => {
if (result.code === 200) {
this.busy = false;
if (result.data.orderList.length > 0) {
if (result.data && result.data.orderList.length > 0) {
this.$set('orderList', this.orderList.concat(result.data.orderList));
this.pageTotal = result.data.pageTotal;
this.busy = false;
}
}
...
...
@@ -130,7 +130,7 @@
$.ajax({
url: '/me/getCancelOrderReason',
}).then(result => {
if (result
.data.length > 0
) {
if (result
&& result.data
) {
this.options = result.data;
}
}).fail(() => {
...
...
public/vue/me/refund-order.vue
View file @
39ce28b
<template>
<ul v-infinite-scroll="get
Order
Data()" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
<ul v-infinite-scroll="get
Refund
Data()" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
<li class="order-item" v-for="(index, order) in orderList">
<div class="order-detail">
<div class="order-code">
...
...
@@ -12,8 +12,7 @@
<div class="order-goods">
<div class="goods-info" v-for="product in order.goods">
<div class="img-box">
<img v-bind:src="product.goodsImage | resize 49 65" alt="{{product.productName}}">
<label v-if="product.goodsType == 'gift'">赠品</label>
<img v-bind:src="product.goodsImage | resize 49 65">
</div>
<div class="goods-detail">
<p class="name">{{product.productName}}</p>
...
...
@@ -26,12 +25,14 @@
<p>¥{{product.salesPrice}}</p>
<p>×1</p>
</div>
<a v-if="order.refundType === 1" href="/me/return/refund/detail/{{order.id}}"></a>
<a v-if="order.refundType === 2" href="/me/return/exchange/detail/{{order.id}}"></a>
</div>
</div>
<div class="order-option" v-show="order.canCancel == 'Y'">
<div class="goods-total"></div>
<div class="options" v-show="order.canCancel == 'Y'">
<button v-if="order.canCancel == 'Y'" class="normal" @click="cancelApply(order.id, order.refundType)">取消申请</button>
<div class="options">
<button class="normal" @click="cancelApply(order.id, order.refundType)">取消申请</button>
</div>
</div>
</div>
...
...
@@ -59,13 +60,11 @@
emptybox: 'hide'
};
},
ready() {
this.get
Order
Data();
this.get
Refund
Data();
},
methods: {
get
Order
Data() {
get
Refund
Data() {
this.busy = true;
if (this.page >= this.pageTotal) {
return;
...
...
@@ -77,10 +76,12 @@
limit: this.limit
}
}).then(result => {
this.busy = false;
if (result.data.list.length > 0) {
this.$set('orderList', this.orderList.concat(result.data.list));
this.pageTotal = result.data.totalPage;
if (result.code === 200) {
if (result.data && result.data.list.length > 0) {
this.$set('orderList', this.orderList.concat(result.data.list));
this.pageTotal = result.data.totalPage;
this.busy = false;
}
}
if (this.orderList.length === 0) {
...
...
@@ -97,7 +98,7 @@
*/
cancelApply(id, type) {
$.ajax({
url: '/me/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',
url: '/me/
return/
' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',
type: 'post',
data: {
id: id
...
...
public/vue/me/refund-status.vue
View file @
39ce28b
...
...
@@ -15,7 +15,7 @@
<div v-if="detail.status == 20"
class="logistics-detail">
<template v-if="detail.notice">
<a href="/me/logistic?order_code={{
o
rderCode}}&type=refund">
<a href="/me/logistic?order_code={{
sourceO
rderCode}}&type=refund">
<h2>{{detail.notice.title}}</h2>
<p>物流公司: {{detail.notice.expressCompany}}<br>快递单号: {{detail.notice.expressNumber}}</p>
<span class="right"><span class="icon icon-right"></span></span>
...
...
@@ -96,7 +96,7 @@
</div>
</div>
<div class="exchange-order">
<a class="primary" href="/me/order/detail?orderCode={{
o
rderCode}}">原订单详情
<a class="primary" href="/me/order/detail?orderCode={{
sourceO
rderCode}}">原订单详情
<span class="right"><span class="icon icon-right"></span></span>
</a>
</div>
...
...
@@ -116,13 +116,14 @@
props: ['applyid', 'type'],
data() {
return {
orderCode: '',
id: '',
sourceOrderCode: '',
detail: {}
};
},
methods: {
cancel() {
if (!this.
detail || !this.orderCode
) {
if (!this.
id
) {
return false;
}
...
...
@@ -138,7 +139,7 @@
method: 'POST',
url: url,
data: {
id: this.
orderCode
,
id: this.
id
,
}
}).then(data => {
if (data.code === 200) {
...
...
@@ -165,12 +166,8 @@
return;
}
if (this.type === 'refund') {
this.orderCode = this.detail.sourceOrderCode;
} else if (this.type === 'exchange') {
this.orderCode = this.detail.orderCode;
}
this.id = this.detail.id;
this.sourceOrderCode = this.detail.sourceOrderCode;
this.detail.goodsList.forEach(d => {
d.evidenceImages = d.evidenceImages.map(p => {
return util.getImgHost(p) + '?imageView2/2/w/154/h/154';
...
...
public/vue/me/refund.vue
View file @
39ce28b
...
...
@@ -159,7 +159,7 @@
data: this.submitData
}).then(result => {
if (result.code === 200) {
let header =
interceptClick.titleMap[1]
;
let header =
$.extend({}, interceptClick.defaultTitleMap[1])
;
header.left.action = location.origin + '/me/return'
header.title.des = '退货状态';;
...
...
Please
register
or
login
to post a comment