Authored by 沈志敏

merge

... ... @@ -6,7 +6,6 @@
*/
'use strict';
const api = global.yoho.API;
const brandApi = require('./brand-api');
const logger = global.yoho.logger;
const _ = require('lodash');
... ... @@ -55,9 +54,9 @@ const handleBrandList = origin => {
const getBrandListData = params => {
let finalResult = {};
return api.all([brandApi.getBrandListOriginData(params)]).then(result => {
if (result[0].code === 200 && result[0].data) {
Object.assign(finalResult, handleBrandList(result[0].data.all_list));
return brandApi.getBrandListOriginData(params).then(result => {
if (result.code === 200 && result.data) {
Object.assign(finalResult, handleBrandList(result.data.all_list));
} else {
logger.error('getBrandListOriginData api code no 200 or data is null');
}
... ...
... ... @@ -6,7 +6,6 @@
*/
'use strict';
const logger = global.yoho.logger;
const api = global.yoho.API;
const shopApi = require('./shop-api');
const processProductList = require(`${global.utils}/beautify/product`);
const camelCase = global.yoho.camelCase;
... ... @@ -21,50 +20,44 @@ const prettyFilter = require(`${global.utils}/beautify/filters`);
const getShopData = params => {
let finalResult = {};
return api.all([
shopApi.getBrandInfoByDomain({domain: params.domain})
]).then(result => {
return shopApi.getBrandInfoByDomain({domain: params.domain}).then(result => {
if (result[0].code === 200) {
if (result.code === 200) {
/* 品牌名称 */
Object.assign(finalResult, {
brandName: result[0].data.brand_name
brandName: result.data.brand_name
});
/* 品牌是否有店铺 */
if (result[0].data.shop_id) {
if (result.data.shop_id) {
/* 是 BLK 的店铺 */
Object.assign(finalResult, {
isBlkShop: true,
shopId: result[0].data.shop_id
shopId: result.data.shop_id
});
return api.all([
shopApi.getShopInfoData({
shopId: result[0].data.shop_id,
uid: params.uid
return shopApi.getShopInfoData({
shopId: result.data.shop_id,
uid: params.uid
// uid: '8050882'
})
]).then(subResult => {
if (subResult[0].code === 200) {
// uid: '8050882'
}).then(subResult => {
if (subResult.code === 200) {
/* 取店铺的基本信息 */
Object.assign(finalResult, {
shopLogo: subResult[0].data.shop_logo,
shopName: subResult[0].data.shop_name,
shopIntro: subResult[0].data.shop_intro,
isFav: subResult[0].data.is_favorite === 'Y'
shopLogo: subResult.data.shop_logo,
shopName: subResult.data.shop_name,
shopIntro: subResult.data.shop_intro,
isFav: subResult.data.is_favorite === 'Y'
});
/* 取资源位店铺背景图 */
return api.all([
shopApi.getShopsDecoratorList({shopId: result[0].data.shop_id})
]).then(thResult => {
if (thResult[0].code === 200) {
_.forEach(thResult[0].data.list, value => {
return shopApi.getShopsDecoratorList({shopId: result.data.shop_id}).then(thResult => {
if (thResult.code === 200) {
_.forEach(thResult.data.list, value => {
if (value.resource_name === 'shopTopBanner_app') {
Object.assign(finalResult, {
... ... @@ -110,24 +103,20 @@ const getShopData = params => {
const getBrandShopGoodsData = params => {
let finalResult = {};
return api.all([
shopApi.getBrandInfoByDomain({ domain: params.domain })
]).then(result => {
if (result[0].code === 200) {
return api.all([
shopApi.getBrandShopGoodsOriginData(Object.assign(params, {
brand: result[0].data.id,
shopId: result[0].data.shop_id
}))
]).then(subResult => {
if (subResult[0].code === 200 && subResult[0].data) {
prettyFilter(subResult[0].data.filter);
return shopApi.getBrandInfoByDomain({ domain: params.domain }).then(result => {
if (result.code === 200) {
return shopApi.getBrandShopGoodsOriginData(Object.assign(params, {
brand: result.data.id,
shopId: result.data.shop_id
})).then(subResult => {
if (subResult.code === 200 && subResult.data) {
prettyFilter(subResult.data.filter);
finalResult = {
data: {
productList: processProductList(subResult[0].data.product_list),
filter: subResult[0].data.filter,
page: subResult[0].data.page,
pageTotal: subResult[0].data.page_total
productList: processProductList(subResult.data.product_list),
filter: subResult.data.filter,
page: subResult.data.page,
pageTotal: subResult.data.page_total
},
code: 200
};
... ... @@ -151,8 +140,8 @@ const getBrandShopGoodsData = params => {
* @returns {*|Promise.<TResult>}
*/
const collectShopData = params => {
return api.all([shopApi.collectShopOriginData(params)]).then(result => {
return result[0];
return shopApi.collectShopOriginData(params).then(result => {
return result;
});
};
... ...
... ... @@ -18,10 +18,8 @@ module.exports = {
app_type: 1
},
domains: {
// api: 'http://192.168.102.202:8080/gateway/',
// service: 'http://192.168.102.202:8080/gateway/',
// api: 'http://testapi.yoho.cn:28078/',
// service: 'http://testservice.yoho.cn:28077/'
// api: 'http://api-test1.yohops.com:9999/',
// service: 'http://service-test1.yohops.com:9999/'
api: 'http://dev-api.yohops.com:9999/',
service: 'http://dev-service.yohops.com:9999/'
... ...
<div class="modal">
<div class="modal {{styleClass}}">
<h2>{{title}}</h2>
<p>{{text}}</p>
<hr>
... ...
... ... @@ -22,6 +22,7 @@ class Modal {
this.defaults = {
isModal: true,
template: template,
styleClass: '',
title: '',
text: '',
buttons: [
... ... @@ -37,6 +38,7 @@ class Modal {
// 初始化参数
this.settings = Object.assign({}, this.defaults, opts);
const tpl = this.settings.template({
styleClass: this.settings.styleClass,
title: this.settings.title,
text: this.settings.text,
buttons: this.settings.buttons
... ...
... ... @@ -15,6 +15,7 @@ console.log(vm);
/* eslint-disable */
// 私有包测试
var $ = require('jquery');
var qs = require('yoho-qs');
console.log(qs);
... ...
const $ = require('jquery');
const yoho = require('yoho');
const interceptClick = require('common/intercept-click');
const Modal = require('common/modal');
// 退换货 申请 成功, 打开 modal
exports.applySuccuss = function(type, applyId) {
let config = {
exchange: {
name: '换货',
detailUrl: `/me/return/exchange/detail/${applyId}`
},
refund: {
name: '退货',
detailUrl: `/me/return/refund/detail/${applyId}`
}
};
let kind = config[type];
let goStatusPage = function() {
let header = $.extend({}, interceptClick.defaultTitleMap[1]);
header.left.action = location.origin + '/me/return';
header.title.des = `${kind.name}状态`;
return yoho.goNewPage({
header: header,
url: location.origin + kind.detailUrl
});
};
const modal = new Modal({
styleClass: 'return-success-modal',
text: `${kind.name}申请已提交,请等待审核.....`,
buttons: [{
text: '返回订单',
handler: function() {
this.hide();
yoho.goBack();
}
}, {
text: '查看进度',
handler: function() {
this.hide();
goStatusPage();
}
}]
});
modal.show();
};
... ...
... ... @@ -17,8 +17,7 @@
p {
font-size: 21px;
text-align: center;
margin-top: 20px;
margin-bottom: 48px;
margin: 20px 40px 48px;
}
hr {
... ...
.return-success-modal {
p {
font-size: 30px;
}
.button-group .modal-button:first-of-type {
color: #b0b0b0;
}
}
... ...
... ... @@ -71,13 +71,15 @@
.channel-tab {
position: fixed;
top: 0;
left: 0;
left: 50%;
z-index: 1;
width: 100%;
max-width: 750px;
height: 90px;
font-size: 24px;
text-align: center;
background: #fff;
transform: translate(-50%, 0);
.channel {
display: inline-block;
... ...
... ... @@ -37,9 +37,9 @@
const qs = require('yoho-qs');
const tip = require('common/tip');
const bus = require('common/vue-bus');
const modal = require('common/modal');
const interceptClick = require('common/intercept-click');
const Modal = require('common/modal');
const yoho = require('yoho');
const returnUtil = require('me/return/util');
const productList = require('me/return/list.vue');
const featureSelector = require('component/product/feature-selector.vue');
... ... @@ -245,22 +245,15 @@
data
}).then(result => {
if (result.code === 200) {
let header = $.extend({}, interceptClick.defaultTitleMap[1]);
header.left.action = location.origin + '/me/return'
header.title.des = '换货状态';;
return yoho.goNewPage({
header: header,
url: location.origin + `/me/return/exchange/detail/${result.data.applyId}`
});
returnUtil.applySuccuss(self.page, result.data.applyId);
} else {
modal.alert(result.message);
Modal.alert(result.message);
}
}).always(()=>{
self.processing = false;
});
} else {
modal.alert(msg);
Modal.alert(msg);
}
}
},
... ... @@ -302,6 +295,8 @@
</script>
<style>
@import "../../scss/me/_return.css";
body {
background-color: #f6f6f6;
}
... ...
... ... @@ -52,14 +52,15 @@
const $ = require('jquery');
const qs = require('yoho-qs');
const modal = require('common/modal');
const interceptClick = require('common/intercept-click');
const yoho = require('yoho');
const productList = require('me/return/list.vue');
const reasonConfig = require('me/return/reason');
const returnUtil = require('me/return/util');
module.exports = {
data() {
return {
page: 'refund',
list: [],
amount: {},
refundData: {}
... ... @@ -150,6 +151,8 @@
return true;
},
submit() {
const self = this;
if (!this.checkSubmitData()) {
modal.alert('请填写完整退换货信息');
}
... ... @@ -159,14 +162,7 @@
data: this.submitData
}).then(result => {
if (result.code === 200) {
let header = $.extend({}, interceptClick.defaultTitleMap[1]);
header.left.action = location.origin + '/me/return'
header.title.des = '退货状态';;
return yoho.goNewPage({
header: header,
url: location.origin + `/me/return/refund/detail/${result.data.applyId}`
});
returnUtil.applySuccuss(self.page, result.data.applyId);
} else {
modal.alert(result.message);
}
... ... @@ -180,6 +176,8 @@
</script>
<style>
@import "../../scss/me/_return.css";
.main-wrap {
background: #f6f6f6;
}
... ...
... ... @@ -115,8 +115,7 @@
self.page = result.data.page;
self.totalPage = result.data.pageTotal;
self.$set('productList', self.productList.concat(result.data.productList));
if (!self.filterConfig) {
if ($.isEmptyObject(self.filterConfig)) {
self.$set('filterConfig', result.data.filter);
}
}
... ...