Authored by zhangwenxue

fix(商品详情): fix #6176

6176	【前端ufo】【闲鱼合作】商品详情页面,出售弹窗,没有前端添加出售尺码的功能

调整接口
... ... @@ -34,8 +34,7 @@ export default {
name: 'size-list',
props: {
list: {
type: [Array, null],
required: true,
type: Array,
},
addSize: {
type: Boolean,
... ...
... ... @@ -37,6 +37,11 @@ const { mapActions } = createNamespacedHelpers('product');
export default {
name: 'SizeRequest',
mixins: [stateShortCutsMixins],
props: {
productId: {
type: Number,
},
},
components: {
LayoutApp,
SizeList,
... ... @@ -78,9 +83,10 @@ export default {
}
},
_requestSize() {
const sizeIds = this.selected.map(item => item.size_id).join(',');
const size_ids = this.selected.map(item => item.size_id).join(',');
const goods_id = this.productDetail.goods_list[0].goods_id;
this.requestSize({sizeIds}).then(() => {
this.requestSize({ product_id: this.productId, goods_id, size_ids }).then(() => {
this.$createDialog({
type: 'alert',
content: '您的尺码添加申请已提交,我们会尽快审核并通知您,请耐心等待',
... ...
... ... @@ -80,7 +80,7 @@
@hidden="onSizeSelectSheetHidden"
@select="onSelectTradeProduct"
@add="onRequestSize"/>
<size-request-sheet v-if="showSizeRequestSheet" @hidden="onSizeRequestHidden"/>
<size-request-sheet v-if="showSizeRequestSheet" @hidden="onSizeRequestHidden" :productId="productId"/>
<buy-sheet v-if="showBuySheet" @hidden="onBuyHidden" :productId="productId"/>
</div>
</template>
... ... @@ -381,9 +381,6 @@ export default {
qiugou() {
this.showBuySheet = true;
},
onBuyHidden() {
this.showBuySheet = false;
},
},
};
</script>
... ...
... ... @@ -103,13 +103,13 @@ export default {
resetSelectedSize({commit}) {
commit(Types.RESET_SELECTED_PRODUCT_SIZE);
},
async requestSize({ state }, { sizeIds }) {
async requestSize({ state }, { product_id, goods_id, size_ids }) {
const selectedProduct = state.selectedProductInfo;
await this.$api.get('/api/ufo/product/addsize', {
product_id: selectedProduct.productId,
goods_id: get(selectedProduct.product, 'goods_list[0].goods_id'),
size_ids: sizeIds
product_id,
goods_id,
size_ids,
});
// 忽略错误
... ...
... ... @@ -68,6 +68,19 @@ module.exports = {
},
},
// 建议尺码
'/api/ufo/product/addsize': {
ufo: true,
auth: true,
path: '/ufo-gateway/ufoLive',
api: 'ufo.product.addSize',
params: {
product_id: {type: Number}, // 商品id
goods_id: {type: Number}, // 商品id
size_ids: {type: String}, // 建议尺码id
},
},
// 推荐
'/api/ufo/product/recommend': {
ufo: true,
... ...