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
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
bdc243741fdf654dec161d7f03f06983f4a354ff
2 parents
9c1c2847
9f74515d
Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
91 additions
and
33 deletions
apps/channel/models/brand.js
apps/product/models/detail.js
public/js/me/index.page.js
public/vue/me/fav-product-list.vue
public/vue/me/order-detail.vue
public/vue/me/order.vue
public/vue/me/refund-order.vue
public/vue/product/shop/shop-box.vue
apps/channel/models/brand.js
View file @
bdc2437
...
...
@@ -21,13 +21,16 @@ const handleBrandList = origin => {
indexList
:
[]
};
_
.
sortBy
(
origin
,
(
o
)
=>
{
return
o
.
key
;
});
_
.
forEach
(
origin
,
(
value
,
key
)
=>
{
let
brands
=
[];
_
.
forEach
(
value
,
(
subValue
)
=>
{
brands
.
push
({
name
:
subValue
.
brand_name
,
link
:
'/brand/'
+
subValue
.
brand_domain
,
logo
:
subValue
.
brand_ico
,
domain
:
subValue
.
brand_domain
});
...
...
@@ -69,9 +72,7 @@ const getBrandListData = params => {
* @returns {*|Promise.<TResult>}
*/
const
getCateListData
=
params
=>
{
return
brandApi
.
getCateListData
(
params
).
then
(
result
=>
{
return
camelCase
(
result
);
});
return
brandApi
.
getCateListData
(
params
).
then
(
camelCase
);
};
module
.
exports
=
{
...
...
apps/product/models/detail.js
View file @
bdc2437
...
...
@@ -5,11 +5,7 @@
*/
'use strict'
;
// const _ = require('lodash');
// const helpers = global.yoho.helpers;
const
api
=
global
.
yoho
.
API
;
const
camelCase
=
global
.
yoho
.
camelCase
;
/**
* 商品详情
...
...
public/js/me/index.page.js
View file @
bdc2437
...
...
@@ -5,12 +5,13 @@ var util = require('common/util');
$
(()
=>
{
window
.
addEventListener
(
'touchmove'
,
function
()
{
var
topHeight
=
document
.
body
.
scrollTop
;
if
(
topHeight
>
50
)
{
$
(
'#header'
).
addClass
(
'top-change'
);
}
else
{
$
(
'#header'
).
removeClass
(
'top-change'
);
}
})
})
;
if
(
!
yoho
.
isLogin
)
{
$
(
'.auth'
).
addClass
(
'no-intercept'
);
...
...
public/vue/me/fav-product-list.vue
View file @
bdc2437
...
...
@@ -244,7 +244,7 @@
});
if (yoho.isApp) {
bus.$on('app.favourite.tabChange', this.updateNavBar);
bus.$on('app.favourite.tabChange', this.updateNavBar);
}
}
};
...
...
public/vue/me/order-detail.vue
View file @
bdc2437
...
...
@@ -81,14 +81,37 @@
};
},
created() {
this.updateNavBar();
this.getOrderData();
yohoAPI.addNativeMethod('goToService', () => {
interceptClick.intercept('/me/service');
return false;
});
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
this.reload();
}
});
},
methods: {
updateNavBar() {
const header = $.extend({}, interceptClick.defaultTitleMap[2]);
header.title.des = '订单详情';
yoho.updateNavigationBar({
header: header
});
},
reload() {
this.show = false;
this.order = {};
this.selected = {};
this.cancelbusy = false;
this.getOrderData();
},
getOrderData() {
$.ajax({
url: '/me/get-order',
...
...
@@ -141,7 +164,7 @@
if (result.code === 200) {
tip('取消成功');
setTimeout(() => {
location
.reload();
this
.reload();
}, 1000);
} else if (result.code !== 500) {
tip(result.message);
...
...
@@ -181,7 +204,7 @@
reason: this.options.length ? this.options[0].reason : null
}, (result) => {
if (result.code === 200) {
location
.reload();
this
.reload();
}
});
};
...
...
@@ -216,7 +239,9 @@
});
},
confirmGoods(code) {
Modal.confirm('', '确认收货', function() {
let _this = this;
Modal.confirm('', '确认收货吗?', function() {
this.hide();
$.ajax({
url: '/me/confirmReceive',
...
...
@@ -226,7 +251,7 @@
}
}).then(result => {
if (result.code === 200) {
location
.reload();
_this
.reload();
} else if (result.code !== 500) {
tip(result.message);
}
...
...
public/vue/me/order.vue
View file @
bdc2437
...
...
@@ -73,22 +73,38 @@
limit: 10,
pageTotal: 1,
type: this.$parent.$data.type,
orderList: [],
busy: false,
cancelbusy: false,
emptybox: 'hide',
currentCode: '',
selected: {},
options: [],
currentCode: '',
cancelbusy: false
orderList: []
};
},
ready() {
created() {
this.getOrderData();
this.getCancelReason();
},
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
this.reload();
}
});
},
methods: {
reload() {
this.page = 0;
this.pageTotal = 1;
this.busy = false;
this.cancelbusy = false;
this.emptybox = 'hide';
this.currentCode = '';
this.selected = {};
this.orderList = [];
this.getOrderData();
},
getOrderData() {
this.busy = true;
if (this.page >= this.pageTotal) {
...
...
@@ -129,7 +145,7 @@
if (result.code === 200) {
tip('取消成功');
setTimeout(() => {
location
.reload();
this
.reload();
}, 1000);
} else if (result.code !== 500) {
tip(result.message);
...
...
@@ -158,7 +174,7 @@
reason: this.options.length ? this.options[0].reason : null
}, (result) => {
if (result.code === 200) {
location
.reload();
this
.reload();
}
});
};
...
...
@@ -209,7 +225,9 @@
});
},
confirmGoods(code) {
Modal.confirm('', '确认收货', function() {
let _this = this;
Modal.confirm('', '确认收货吗?', function() {
this.hide();
$.ajax({
url: '/me/confirmReceive',
...
...
@@ -219,7 +237,7 @@
}
}).then(result => {
if (result.code === 200) {
location
.reload();
_this
.reload();
} else if (result.code !== 500) {
tip(result.message);
}
...
...
public/vue/me/refund-order.vue
View file @
bdc2437
...
...
@@ -65,10 +65,25 @@
emptybox: 'hide'
};
},
ready() {
this.getRefundData();
created() {
this.reload();
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
this.reload();
}
});
},
methods: {
reload() {
this.page= 0;
this.pageTotal = 1;
this.orderList= [];
this.busy= false;
this.emptybox= 'hide';
this.getRefundData();
},
getRefundData() {
this.busy = true;
if (this.page >= this.pageTotal) {
...
...
@@ -94,14 +109,13 @@
tip('网络错误');
});
},
/**
* 取消申请
* @param id
* @param type refundType 1为退货,2为换货
*/
cancelApply(id, type) {
let _this = this;
Modal.confirm('', '确认取消吗?', function() {
this.hide();
// type refundType 1为退货,2为换货
$.ajax({
url: '/me/return/' + (Number(type) === 2 ? 'exchange' : 'refund') + '/cancel-apply',
type: 'post',
...
...
@@ -110,7 +124,10 @@
}
}).then(result => {
if (result.code === 200) {
location.reload();
tip('取消成功');
setTimeout(() => {
_this.reload();
}, 1000);
} else {
tip(result.message);
}
...
...
public/vue/product/shop/shop-box.vue
View file @
bdc2437
...
...
@@ -90,7 +90,7 @@
title: result.shopName,
des: shareSubTitle,
url: shareUrl,
img: result.shop
Bg
,
img: result.shop
Logo ? result.shopLogo : ''
,
isBlkShop: result.isBlkShop,
domain: locationQuery.domain,
brandName: result.brandName,
...
...
Please
register
or
login
to post a comment