Authored by 郭成尧

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

 the commit.
... ... @@ -34,13 +34,12 @@ const refund = {
}).catch(next);
},
logistics(req, res, next) {
const applyid = req.query.applyid;
refundModel.getExpressCompany().then(result => {
res.render('logistics', {
module: 'me',
page: 'logistics',
applyid: applyid,
applyid: req.query.applyid,
type: req.query.type,
company_list: result ? JSON.stringify(result.data) : ''
});
}).catch(next);
... ... @@ -48,11 +47,13 @@ const refund = {
saveLogistics(req, res, next) {
const uid = req.user.uid;
const applyid = req.body.applyid;
const expressCompany = req.body.expressCompany;
const expressId = req.body.expressId;
const expressNumber = req.body.expressNumber;
refundModel.setexpress(applyid, uid, expressCompany, expressId, expressNumber).then(data => {
refundModel.setexpress(applyid, uid, {
type: req.body.type,
expressCompany: req.body.expressCompany,
expressNumber: req.body.expressNumber,
expressId: req.body.expressId
}).then(data => {
return res.json(data);
}).catch(next);
},
... ...
... ... @@ -32,14 +32,16 @@ const refund = {
code: 200
});
},
setexpress(applyid, uid, expressCompany, expressId, expressNumber) {
setexpress(applyid, uid, data) {
const method = data.type === 'refund' ? 'app.refund.setexpress' : 'app.change.setexpress';
return api.get('', {
method: 'app.refund.setexpress',
method: method,
id: applyid,
uid: uid,
express_company: expressCompany,
express_number: expressNumber,
express_id: expressId
express_company: data.expressCompany,
express_number: data.expressNumber,
express_id: data.expressId
});
},
getChangeDetail(id, uid) {
... ...
<div class="logistics-page" id="logistics">
<components :is="currentView" :company_id="company_id" :company_name="company_name" applyid='{{applyid}}' company_list='{{company_list}}' keep-alive></components>
<components :is="currentView" :company_id="company_id" :company_name="company_name" applyid='{{applyid}}' type='{{type}}' company_list='{{company_list}}' keep-alive></components>
</div>
... ...
... ... @@ -244,7 +244,7 @@
});
if (yoho.isApp) {
bus.$on('app.favourite.tabChange', this.updateNavBar);
bus.$on('app.favourite.tabChange', this.updateNavBar);
}
}
};
... ...
... ... @@ -81,6 +81,7 @@
};
},
created() {
this.updateNavBar();
this.getOrderData();
yohoAPI.addNativeMethod('goToService', () => {
... ... @@ -89,6 +90,14 @@
});
},
methods: {
updateNavBar() {
const header = $.extend({}, interceptClick.defaultTitleMap[2]);
header.title.des = '订单详情';
yoho.updateNavigationBar({
header: header
});
},
getOrderData() {
$.ajax({
url: '/me/get-order',
... ... @@ -139,7 +148,10 @@
reason: this.selected.reason || this.options[0].reason
}, (result) => {
if (result.code === 200) {
location.reload();
tip('取消成功');
setTimeout(() => {
location.reload();
}, 1000);
} else if (result.code !== 500) {
tip(result.message);
}
... ... @@ -202,7 +214,7 @@
}
}).then(result => {
if (result.code === 200) {
yohoAPI.goBack(true);
yohoAPI.goBack();
return false;
} else if (result.code !== 500) {
tip(result.message);
... ...
... ... @@ -127,7 +127,10 @@
reason: this.selected.reason || this.options[0].reason
}, (result) => {
if (result.code === 200) {
location.reload();
tip('取消成功');
setTimeout(() => {
location.reload();
}, 1000);
} else if (result.code !== 500) {
tip(result.message);
}
... ...
... ... @@ -31,7 +31,7 @@
</div>
<div v-if="(detail.deliveryTpye === '10' || type ==='refund') && detail.status == 10"
class="logistics">
<a href="/me/return/logistics?applyid={{applyid}}">填写商品寄回的快递信息</a>
<a href="/me/return/logistics?applyid={{applyid}}&type={{type}}">填写商品寄回的快递信息</a>
</div>
</div>
<div class="exchange-details">
... ... @@ -125,9 +125,41 @@
};
},
methods: {
reload() {
this.id = '';
this.sourceOrderCode = '';
this.show = false;
this.detail = {};
$.ajax({
url: '/me/return/status-detail',
data: {
applyid: this.applyid,
type: this.type
}
}).then(res => {
if (res.code === 200) {
this.show = true;
this.detail = res.data;
if (!this.detail.goodsList) {
return;
}
this.id = this.detail.id;
this.sourceOrderCode = this.detail.sourceOrderCode;
} else if (result.code !== 500) {
tip(result.message);
} else {
tip('数据获取失败');
}
}).fail(() => {
tip('网络错误');
});
},
cancel() {
let id = this.id;
let url = '';
let _this = this;
if (!id) {
return false;
... ... @@ -138,6 +170,7 @@
url = '/me/return/exchange/cancel-apply';
}
Modal.confirm('', '确认取消吗?', function() {
this.hide();
$.ajax({
... ... @@ -148,7 +181,7 @@
}
}).then(data => {
if (data.code === 200) {
interceptClick.intercept('/me/return');
_this.reload();
} else {
tip(data.message);
}
... ... @@ -157,35 +190,13 @@
}
},
created() {
$.ajax({
url: '/me/return/status-detail',
data: {
applyid: this.applyid,
type: this.type
}
}).then(res => {
if (res.code === 200) {
this.show = true;
this.detail = res.data;
if (!this.detail.goodsList) {
return;
}
this.reload();
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';
// })
});
} else if (result.code !== 500) {
tip(result.message);
} else {
tip('数据获取失败');
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
this.reload();
}
}).fail(() => {
tip('网络错误');
});;
});
}
};
</script>
... ...
... ... @@ -20,7 +20,7 @@
const yoho = require('yoho');
module.exports = {
props: ['applyid', 'company_id', 'company_name'],
props: ['applyid', 'type', 'company_id', 'company_name'],
data() {
return {
num: '',
... ... @@ -47,6 +47,7 @@
url: '/me/return/save-logistics',
data: {
applyid: this.applyid,
type: this.type,
expressId: this.company_id,
expressCompany: this.company_name,
expressNumber: this.num
... ... @@ -58,7 +59,7 @@
if (res.code !== 200) {
tip(res.message || '网络错误');
} else {
yoho.goBack(true);
yoho.goBack();
}
});
return false;
... ...