Authored by 沈志敏

fix bug

... ... @@ -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>
... ...
... ... @@ -202,7 +202,7 @@
}
}).then(result => {
if (result.code === 200) {
yohoAPI.goBack(true);
yohoAPI.goBack();
return false;
} 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) {
location.reload();
_this.reload();
} else {
tip(data.message);
}
... ... @@ -157,39 +190,11 @@
}
},
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.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('数据获取失败');
}
}).fail(() => {
tip('网络错误');
});
this.reload();
document.addEventListener('visibilitychange', function() {
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
location.reload();
this.reload();
}
});
}
... ...
... ... @@ -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;
... ...