Authored by hongyong.zhao

展示最高求购价

... ... @@ -14,8 +14,14 @@
<div class="productPrice">
<span class="size">{{sizeInfo}}</span>
<div class="pricedetail">
<span class="priceTitle">最低售价: </span>
<span class="price">{{originProductData.least_price || '-'}}</span>
<div>
<span class="priceTitle">最低售价: </span>
<span class="price">{{originProductData.least_price || '-'}}</span>
</div>
<div>
<span class="priceTitle">最高求购价: </span>
<span class="price">{{originProductData.bid_moster_price || '-'}}</span>
</div>
</div>
</div>
</div>
... ... @@ -97,7 +103,7 @@ export default {
return {
inputPrice: '',
isAgreeTerms: false,
url: `http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3189.html?title=买家协议&promiseV="}}`,
url: 'http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3189.html?title=买家协议&promiseV="}}',
agreeDesc: '有货买家协议'
};
},
... ... @@ -123,19 +129,29 @@ export default {
sizeInfo: {
get() {
return this.originProductData.colorName + ', ' + this.originProductData.sizeName + '码';// '黑色, 48码';
}
}
},
},
beforeRouteEnter (to, from, next) {
next(vm => {
// 通过 `vm` 访问组件实例
vm.inputPrice = '';
vm.BUYER_ASK_RESET_DATA();
});
},
mounted() {
this.BUYER_ASK_RESET_DATA();
this.BUYER_ASK_SET_STORAGEID(this.storageId);
this.fetchBuyerOrderCount({ tabType: 'buy'});
this.fetchConfig();
this.$on("addressinfo", function (address) {
console.log(address)
})
this.$on('addressinfo', function(address) {
console.log(address);
});
},
watch: {
... ... @@ -150,6 +166,14 @@ export default {
if (val) {
this.showDialog();
}
},
addressInfo(val) {
if (this.inputPrice && val) {
this.computePrice();
}
}
},
... ... @@ -173,7 +197,7 @@ export default {
if (this.originProductData.least_price && this.originProductData.skup && this.originProductData.least_price <= this.inputPrice) {
this.showBuyDialog();
} else {
this.buyerCompute({price: this.inputPrice, storage_id: this.storageId });
this.computePrice();
}
}, 500, {leading: false, trailing: true}),
... ... @@ -214,7 +238,7 @@ export default {
});
},
onCancel: () => {
this.buyerCompute({price: this.inputPrice, storage_id: this.storageId });
this.computePrice();
}
}).show();
},
... ... @@ -241,7 +265,7 @@ export default {
},
onConfirm: () => {
this.publishProduct()
this.publishProduct();
},
onCancel: () => {
... ... @@ -250,23 +274,32 @@ export default {
}).show();
} else {
this.publishProduct()
this.publishProduct();
}
},
submitClick() {
this.buyerPrePublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id});
this.buyerPrePublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id});
},
publishProduct() {
this.buyerPublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id, time_limit_id: this.chooseDayId}).then(() => {
this.buyerPublish({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id, time_limit_id: this.chooseDayId}).then(() => {
this.payOrder();
});
},
computePrice() {
if (!this.inputPrice) {
console.log('inputPrice is null')
return;
}
this.buyerCompute({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id || '' });
},
payOrder() {
let vm = this;
this.$createOrderPayType({
price: get(this.publishresult, 'depositAmount', ''),
desc: '保证金',
... ... @@ -372,11 +405,8 @@ export default {
}
.pricedetail {
display: flex;
flex-direction: row;
height: 30*2px;
margin-top: 5*2px;
align-items: flex-end;
}
.priceTitle {
... ...
... ... @@ -5,7 +5,7 @@
<div class="product-price">
<div class="product-price-wrapper">
<div class="price">{{data.colorName}},{{data.sizeName}}</div>
<div class="tip">最低售价:<span class="price2">¥{{data.goodPrice}}</span></div>
<div class="tip">{{ priceType || '最低售价:'}} <span class="price2">¥{{data.goodPrice}}</span></div>
</div>
</div>
</div>
... ... @@ -20,6 +20,9 @@ export default {
default() {
return {};
}
},
priceType: {
type: String,
}
}
};
... ...
... ... @@ -55,6 +55,7 @@
v-for="(imgUrl, i) in miniFaultConfirm.imageUrls"
:key="i"
>
<ImageFormat
:data-secc="imgUrl"
:src="imgUrl"
... ...
... ... @@ -3,7 +3,7 @@
<LayoutApp :show-back="true">
<div class="body">
<TitleComp txt="变现"></TitleComp>
<ProductInfo :data="originProductData" class="product-info"></ProductInfo>
<ProductInfo :data="originProductData" class="product-info" :priceType="'最高求购价'"></ProductInfo>
<div class="inputView">
<span class="inputViewIcon">
¥
... ...
... ... @@ -74,6 +74,7 @@ export default {
available: info.storage_num > 0 && price !== '-',
skup: info.skup,
least_price: info.least_price,
bid_moster_price: info.bid_moster_price,
};
});
},
... ... @@ -111,6 +112,7 @@ export default {
* storageId: number
*/
this.$store.commit('order/buyerAskOrder/BUYER_ASK_SET_PRODUCTINFO', {
bid_moster_price: get(product, 'bid_moster_price', '-'),
least_price: get(product, 'least_price', '-'),
sizeName: product.name,
sizeId: get(data, 'sizeId', ''),
... ...
... ... @@ -186,8 +186,9 @@ export default {
goodImg: get(this.product, 'goods_list[0].image_list[0].image_url', ''),
colorName: get(this.product, 'goods_list[0].color_name', ''),
sizeName: this.sizeName,
goodPrice: get(this.productDetail, 'least_price', 0),
productId: this.product.product_id
goodPrice: get(this.selectedSize, 'bid_moster_price', ''),
productId: this.product.product_id,
bid_moster_price: get(this.selectedSize, 'bid_moster_price', ''),
});
// 跳转变现
this.$router.push({
... ...
... ... @@ -339,12 +339,13 @@ export default function() {
});
},
buyerCompute({commit}, {price = 0, storage_id = 0, uid} = {}) {
buyerCompute({commit}, {price = 0, storage_id = 0, uid, address_id = ''} = {}) {
commit(BUYER_ASK_COMPUTE_REQUEST);
this.$api.get('/api/order/buyeraskcompute', {
uid,
price,
storage_id,
address_id,
}).then(result => {
if (result.code === 200) {
... ...