Authored by htoooth

Merge remote-tracking branch 'origin/release/1.0' into release/1.0

... ... @@ -68,7 +68,7 @@ const DIRECTION_H = 'horizontal';
const DIRECTION_V = 'vertical';
export default {
name: 'ScrollView',
name: 'ScrollUfo',
props: {
data: {
type: Array,
... ...
... ... @@ -120,6 +120,7 @@ export default {
this.errorTip = '前后价格没有变化';
} else if (this.skc.suggestMaxPrice && price > this.skc.suggestMaxPrice) {
this.errorTip = '超出建议价将被限制展示,建议下调至合理价格区间';
valid = true;
} else {
this.errorTip = '';
valid = true;
... ...
... ... @@ -42,7 +42,7 @@ import ModalPrice from './components/modal-price';
import ModalUnstock from './components/modal-unstock';
import ImgSize from 'components/img-size';
import {Button} from 'cube-ui';
import ScrollView from 'components/scroll-view';
import ScrollView from '../../components/layout/scroll-ufo';
import ProductList from './components/product-list';
import {createNamespacedHelpers} from 'vuex';
... ... @@ -92,12 +92,12 @@ export default {
onNoSale(skc) {
this.$refs.modalUnstock.show({skc});
},
refreshProduct(skc, mergeData) {
this.MERGE_CHANGEPRICE_DATA({skc, mergeData}); //eslint-disable-line
refreshProduct() {
this.fetchProduct({
productId: this.$route.params.orderId,
page: 1,
onlyProduct: true
page: this.page,
pageSize: this.pageSize,
refresh: true
});
},
async onChangePriceSure({skc, price}) {
... ... @@ -115,9 +115,7 @@ export default {
txt: '调价成功',
type: 'success',
}).show();
this.refreshProduct(skc, {
price
});
this.refreshProduct();
} else {
this.$createToast({
txt: result.message || '调价失败',
... ... @@ -140,9 +138,7 @@ export default {
txt: '下架成功',
type: 'correct'
}).show();
this.refreshProduct(skc, {
storageNum: skc.storageNum - num
});
this.refreshProduct();
} else {
this.$createToast({
txt: result.message || '下架失败',
... ...
import * as Types from './types';
import {first, get, flatten} from 'lodash';
export default {
async fetchProduct({commit}, {productId, page = 1, refresh = false, onlyProduct = false}) {
async fetchProduct({commit}, {productId, page = 1, refresh = false}) {
commit(Types.FETCH_ORDER_PRODUCT_REQUEST);
const result = await this.$api.get('/api/ufo/seller/entryGoodsSizeList', {
productId,
page
});
let result;
if (refresh) {
const results = await Promise.all(Array.from(new Array(page)).map((v, i) => {
return this.$api.get('/api/ufo/seller/entryGoodsSizeList', {
productId,
page: i + 1
});
}));
result = {
code: 200,
data: {
productInfo: get(first(results), 'data.productInfo'),
data: flatten(results.map(r => get(r, 'data.data')))
}
};
} else {
result = await this.$api.get('/api/ufo/seller/entryGoodsSizeList', {
productId,
page
});
}
if (result && result.code === 200) {
commit(Types.FETCH_ORDER_PRODUCT_SUCCESS, {
order: result.data,
refresh,
onlyProduct
});
} else {
commit(Types.FETCH_ORDER_PRODUCT_FAILD);
... ...
... ... @@ -8,19 +8,16 @@ export default {
[Types.FETCH_ORDER_PRODUCT_FAILD](state) {
state.fetchingPro = false;
},
[Types.FETCH_ORDER_PRODUCT_SUCCESS](state, {order, refresh, onlyProduct}) {
[Types.FETCH_ORDER_PRODUCT_SUCCESS](state, {order, refresh}) {
state.fetchingPro = false;
if (onlyProduct) {
if (order.productInfo && state.productInfo.productId !== order.productInfo.productId || refresh) {
state.productInfo = order.productInfo;
} else {
if (order.productInfo && state.productInfo.productId !== order.productInfo.productId) {
state.productInfo = order.productInfo;
}
if (refresh) {
state.skcs = order.data;
} else if (order.data) {
state.skcs = state.skcs.concat(order.data);
}
}
if (refresh) {
state.skcs = order.data;
} else if (order.data) {
state.skcs = state.skcs.concat(order.data);
}
},
[Types.MERGE_CHANGEPRICE_DATA](state, {skc, mergeData}) {
... ...
const shelljs = require('shelljs');
const path = require('path');
const distDir = path.join(__dirname, '../public/dist/node');
const distDir = path.join(__dirname, '../dist/node');
shelljs.rm('-rf', distDir);
shelljs.mkdir('-p', distDir);
... ... @@ -19,8 +19,8 @@ const cpPaths = [
'doraemon',
'utils',
'apps/index.html',
'public/dist/manifest.json',
'public/dist/manifest.server.json'
'dist/manifest.json',
'dist/manifest.server.json'
];
new Promise(resolve => { // 加载manifest.json文件
... ...
... ... @@ -6,7 +6,7 @@ var TransformModulesPlugin = require('webpack-transform-modules-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const pkg = require('../package.json');
const isProd = process.env.NODE_ENV === 'production';
const distDir = path.join(__dirname, `../public/dist/statics/${pkg.name}`);
const distDir = path.join(__dirname, `../dist/statics/${pkg.name}`);
function resolve(dir) {
return path.join(__dirname, '..', dir);
... ...
... ... @@ -43,6 +43,7 @@
"express-session": "^1.15.6",
"fastclick": "^1.0.6",
"lodash": "^4.17.11",
"lottie-web": "^5.4.2",
"request-promise": "^4.2.2",
"serve-favicon": "^2.5.0",
"source-map": "^0.7.3",
... ...
... ... @@ -4245,6 +4245,10 @@ loose-envify@^1.0.0:
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
lottie-web@^5.4.2:
version "5.4.2"
resolved "http://npm.yohops.com/lottie-web/-/lottie-web-5.4.2.tgz#efe727ce20170946969929b50f30bfef3ec7ae55"
loud-rejection@^1.0.0:
version "1.6.0"
resolved "http://npm.yohops.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
... ...