...
|
...
|
@@ -42,6 +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 {get} from 'lodash';
|
|
|
import ScrollView from '../../components/layout/scroll-ufo';
|
|
|
import ProductList from './components/product-list';
|
|
|
import {createNamespacedHelpers} from 'vuex';
|
...
|
...
|
@@ -74,7 +75,7 @@ export default { |
|
|
async onPullingUp() {
|
|
|
const beginCount = this.skcs.length;
|
|
|
|
|
|
await this.fetchProduct({
|
|
|
const result = await this.fetchProduct({
|
|
|
productId: this.$route.params.orderId,
|
|
|
page: this.page + 1,
|
|
|
pageSize: this.pageSize
|
...
|
...
|
@@ -84,18 +85,29 @@ export default { |
|
|
if (afterCount > beginCount) {
|
|
|
this.page++;
|
|
|
}
|
|
|
this.$refs.scroll.forceUpdate();
|
|
|
const noMore = get(result, 'data.data', []).length;
|
|
|
|
|
|
this.$refs.scroll.forceUpdate(noMore > 0);
|
|
|
},
|
|
|
onPullingDown() {
|
|
|
setTimeout(() => {
|
|
|
this.fetchProduct({
|
|
|
productId: this.$route.params.orderId,
|
|
|
page: 1,
|
|
|
pageSize: this.pageSize,
|
|
|
refresh: true
|
|
|
}).then(() => {
|
|
|
this.$refs.scroll.forceUpdate();
|
|
|
}, 2000);
|
|
|
});
|
|
|
},
|
|
|
onChangePrice(skc) {
|
|
|
this.$refs.modalPrice.show({skc, product: this.productInfo});
|
|
|
},
|
|
|
onNoSale(skc) {
|
|
|
this.$refs.modalUnstock.show({skc});
|
|
|
if (skc.storageNum <= 1) {
|
|
|
this.onNoSaleSure({skc, num: 1});
|
|
|
} else {
|
|
|
this.$refs.modalUnstock.show({skc});
|
|
|
}
|
|
|
},
|
|
|
refreshProduct() {
|
|
|
this.fetchProduct({
|
...
|
...
|
@@ -129,6 +141,29 @@ export default { |
|
|
}
|
|
|
},
|
|
|
async onNoSaleSure({skc, num}) {
|
|
|
if (skc.storageNum <= num) {
|
|
|
this.$createDialog({
|
|
|
type: 'confirm',
|
|
|
content: '您确定不卖此商品吗?',
|
|
|
confirmBtn: {
|
|
|
text: '确定',
|
|
|
active: true,
|
|
|
disabled: false,
|
|
|
},
|
|
|
cancelBtn: {
|
|
|
text: '取消',
|
|
|
active: false,
|
|
|
disabled: false,
|
|
|
},
|
|
|
onConfirm: () => {
|
|
|
this.postNoSaleSure({skc, num});
|
|
|
},
|
|
|
}).show();
|
|
|
} else {
|
|
|
this.postNoSaleSure({skc, num});
|
|
|
}
|
|
|
},
|
|
|
async postNoSaleSure({skc, num}) {
|
|
|
const result = await this.postNoSale({
|
|
|
product_id: this.productInfo.productId,
|
|
|
storage_id: skc.storageId,
|
...
|
...
|
@@ -151,7 +186,7 @@ export default { |
|
|
}).show();
|
|
|
}
|
|
|
this.slideSkc = {};
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
components: {Button, ScrollView, ProductList, ImgSize, ModalPrice, ModalUnstock}
|
|
|
};
|
...
|
...
|
|