...
|
...
|
@@ -12,7 +12,7 @@ |
|
|
<OrderMargin class="order-item order-margin" :data="fee" :super-sell="superSell" :url="tipUrl"></OrderMargin>
|
|
|
<OrderFee class="order-item" :data="fee"></OrderFee>
|
|
|
<AddressInfo :data="address" class="order-item"></AddressInfo>
|
|
|
<!-- </Scroll>-->
|
|
|
<!-- </Scroll>-->
|
|
|
</div>
|
|
|
<div class="footer">
|
|
|
<OrderAgree
|
...
|
...
|
@@ -35,28 +35,28 @@ |
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import ProductInfo from "./components/confirm/product";
|
|
|
import InputPrice from "./components/confirm/input-price";
|
|
|
import AddressInfo from "./components/confirm/address";
|
|
|
import TitleComp from "./components/confirm/title";
|
|
|
import OrderMargin from "./components/confirm/order-margin";
|
|
|
import OrderFee from "./components/confirm/order-fee";
|
|
|
import OrderAgree from "./components/confirm/agree";
|
|
|
import { Types, UserType } from "store/order/order-confirm";
|
|
|
import { Scroll } from "cube-ui";
|
|
|
import { get } from "lodash";
|
|
|
|
|
|
import { createNamespacedHelpers, mapState } from "vuex";
|
|
|
import ProductInfo from './components/confirm/product';
|
|
|
import InputPrice from './components/confirm/input-price';
|
|
|
import AddressInfo from './components/confirm/address';
|
|
|
import TitleComp from './components/confirm/title';
|
|
|
import OrderMargin from './components/confirm/order-margin';
|
|
|
import OrderFee from './components/confirm/order-fee';
|
|
|
import OrderAgree from './components/confirm/agree';
|
|
|
import { Types, UserType } from 'store/order/order-confirm';
|
|
|
import { Scroll } from 'cube-ui';
|
|
|
import { get } from 'lodash';
|
|
|
|
|
|
import { createNamespacedHelpers, mapState } from 'vuex';
|
|
|
|
|
|
const {
|
|
|
mapState: mapOrderState,
|
|
|
mapActions: mapOrderAction,
|
|
|
mapMutations: mapOrderMutations
|
|
|
} = createNamespacedHelpers("order/orderConfirm");
|
|
|
} = createNamespacedHelpers('order/orderConfirm');
|
|
|
|
|
|
export default {
|
|
|
name: "SellOrderConfirm",
|
|
|
props: ["productId", "storageId"],
|
|
|
name: 'SellOrderConfirm',
|
|
|
props: ['productId', 'storageId'],
|
|
|
components: {
|
|
|
Scroll,
|
|
|
ProductInfo,
|
...
|
...
|
@@ -69,11 +69,11 @@ export default { |
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
txt: "提交",
|
|
|
txt: '提交',
|
|
|
error: false,
|
|
|
agreeDesc: "有货卖家协议",
|
|
|
agreeDesc: '有货卖家协议',
|
|
|
url:
|
|
|
"https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE",
|
|
|
'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE',
|
|
|
superSell: false,
|
|
|
addNumError: false,
|
|
|
scrollOption: {
|
...
|
...
|
@@ -81,66 +81,66 @@ export default { |
|
|
click: true
|
|
|
},
|
|
|
tipUrl:
|
|
|
"https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE"
|
|
|
'https://activity.yoho.cn/feature/6773.html?share_id=9479&title=%E9%97%B2%E9%B1%BC%E6%BD%AE%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE'
|
|
|
};
|
|
|
},
|
|
|
activated() {
|
|
|
this.fetchUserStatus().then(result => {
|
|
|
this.superSell = get(result, "data.entrySellerType", 0) !== 0;
|
|
|
this.superSell = get(result, 'data.entrySellerType', 0) !== 0;
|
|
|
});
|
|
|
this.fetchOrderAddress({ tabType: UserType.sell });
|
|
|
this.$store.dispatch("product/getSelectedTradeProduct", {
|
|
|
this.$store.dispatch('product/getSelectedTradeProduct', {
|
|
|
productId: this.productId,
|
|
|
storageId: this.storageId
|
|
|
});
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
if (to.name !== "address") {
|
|
|
if (to.name !== 'address') {
|
|
|
this[Types.CLEAR_SELL_STATUS]();
|
|
|
}
|
|
|
next();
|
|
|
},
|
|
|
computed: {
|
|
|
...mapOrderState(["address", "fee", "price", "agree", "num"]),
|
|
|
...mapOrderState(['address', 'fee', 'price', 'agree', 'num']),
|
|
|
...mapState({
|
|
|
productDetail: state => {
|
|
|
const leastPrice = get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"size.least_price",
|
|
|
'size.least_price',
|
|
|
0
|
|
|
);
|
|
|
const storageNum = get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"size.storage_num",
|
|
|
'size.storage_num',
|
|
|
0
|
|
|
);
|
|
|
const suggestHighPrice = get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"size.suggest_high_price",
|
|
|
'size.suggest_high_price',
|
|
|
0
|
|
|
);
|
|
|
const suggestLowPrice = get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"size.suggest_low_price",
|
|
|
'size.suggest_low_price',
|
|
|
0
|
|
|
);
|
|
|
const bidPrice = get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"size.bid_moster_price",
|
|
|
'size.bid_moster_price',
|
|
|
0
|
|
|
);
|
|
|
|
|
|
let priceType = "最低现货价:";
|
|
|
let goodPrice = "";
|
|
|
let priceBidType = "最高求购价:";
|
|
|
let goodBidPrice = "¥-";
|
|
|
let priceType = '最低现货价:';
|
|
|
let goodPrice = '';
|
|
|
let priceBidType = '最高求购价:';
|
|
|
let goodBidPrice = '¥-';
|
|
|
|
|
|
if (!storageNum) {
|
|
|
if (suggestHighPrice && suggestLowPrice) {
|
|
|
priceType = "建议售价:";
|
|
|
priceType = '建议售价:';
|
|
|
goodPrice = `¥${suggestLowPrice}-¥${suggestHighPrice}`;
|
|
|
} else {
|
|
|
goodPrice = "¥-";
|
|
|
goodPrice = '¥-';
|
|
|
}
|
|
|
} else {
|
|
|
goodPrice = `¥${leastPrice}`;
|
...
|
...
|
@@ -155,31 +155,31 @@ export default { |
|
|
return {
|
|
|
goodImg: get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"product.goods_list[0].image_list[0].image_url",
|
|
|
""
|
|
|
'product.goods_list[0].image_list[0].image_url',
|
|
|
''
|
|
|
),
|
|
|
productName: get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"product.product_name",
|
|
|
""
|
|
|
'product.product_name',
|
|
|
''
|
|
|
),
|
|
|
productId: get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"product.product_id",
|
|
|
""
|
|
|
'product.product_id',
|
|
|
''
|
|
|
),
|
|
|
colorName: get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"product.goods_list[0].color_name",
|
|
|
""
|
|
|
'product.goods_list[0].color_name',
|
|
|
''
|
|
|
),
|
|
|
sizeName: get(
|
|
|
state.product.selectedProductInfo,
|
|
|
"size.size_name",
|
|
|
""
|
|
|
'size.size_name',
|
|
|
''
|
|
|
),
|
|
|
skup: get(state.product.selectedProductInfo, "size.skup", ""),
|
|
|
bidSkup: get(state.product.selectedProductInfo, "size.bid_skup", ""),
|
|
|
skup: get(state.product.selectedProductInfo, 'size.skup', ''),
|
|
|
bidSkup: get(state.product.selectedProductInfo, 'size.bid_skup', ''),
|
|
|
goodPrice,
|
|
|
priceType,
|
|
|
goodBidPrice,
|
...
|
...
|
@@ -194,11 +194,11 @@ export default { |
|
|
},
|
|
|
methods: {
|
|
|
...mapOrderAction([
|
|
|
"fetchOrderAddress",
|
|
|
"fetchUserStatus",
|
|
|
"fetchOrderPrice",
|
|
|
"submitOrder",
|
|
|
"fetchPayList"
|
|
|
'fetchOrderAddress',
|
|
|
'fetchUserStatus',
|
|
|
'fetchOrderPrice',
|
|
|
'submitOrder',
|
|
|
'fetchPayList'
|
|
|
]),
|
|
|
...mapOrderMutations([
|
|
|
Types.CHANGE_PRICE,
|
...
|
...
|
@@ -211,50 +211,6 @@ export default { |
|
|
this.submit();
|
|
|
},
|
|
|
compute() {
|
|
|
if (
|
|
|
this.productDetail.bidPrice &&
|
|
|
Number(this.price) > 0 &&
|
|
|
Number(this.price) <= this.productDetail.bidPrice
|
|
|
) {
|
|
|
this.$createDialog({
|
|
|
type: "confirm",
|
|
|
title: `最高求购价${this.productDetail.bidPrice}`,
|
|
|
content: "已有求购高于您的出价,可直接变现",
|
|
|
confirmBtn: {
|
|
|
text: "我再想想",
|
|
|
active: true,
|
|
|
disabled: false
|
|
|
},
|
|
|
cancelBtn: {
|
|
|
text: "确定变现",
|
|
|
active: false,
|
|
|
disabled: false
|
|
|
},
|
|
|
onCancel: () => {
|
|
|
this.$store.commit(
|
|
|
"order/sellerAskOrder/SELLER_ASK_SET_PRODUCTINFO",
|
|
|
{
|
|
|
goodImg: this.productDetail.goodImg,
|
|
|
colorName: this.productDetail.colorName,
|
|
|
sizeName: this.productDetail.sizeName,
|
|
|
goodPrice: this.productDetail.bidPrice,
|
|
|
productId: this.productDetail.productId,
|
|
|
bid_moster_price: this.productDetail.bidPrice
|
|
|
}
|
|
|
);
|
|
|
|
|
|
// 跳转变现
|
|
|
this.$router.push({
|
|
|
name: "sellAskOrder",
|
|
|
query: {
|
|
|
skup: this.productDetail.bidSkup,
|
|
|
price: this.productDetail.bidPrice
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}).show();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
return this.fetchOrderPrice({
|
|
|
address_id: this.address?.address_id,
|
...
|
...
|
@@ -268,7 +224,7 @@ export default { |
|
|
this.$createToast({
|
|
|
time: 1500,
|
|
|
txt: result.error,
|
|
|
type: "txt"
|
|
|
type: 'txt'
|
|
|
}).show();
|
|
|
|
|
|
if (result.code === 438) {
|
...
|
...
|
@@ -288,8 +244,8 @@ export default { |
|
|
if (!this.address) {
|
|
|
this.$createToast({
|
|
|
time: 1500,
|
|
|
txt: "请选择地址",
|
|
|
type: "txt"
|
|
|
txt: '请选择地址',
|
|
|
type: 'txt'
|
|
|
}).show();
|
|
|
return false;
|
|
|
}
|
...
|
...
|
@@ -300,18 +256,68 @@ export default { |
|
|
this[Types.CHANGE_AGREE](val);
|
|
|
},
|
|
|
submit() {
|
|
|
|
|
|
//低于变现价格强制出售
|
|
|
if (
|
|
|
this.productDetail.bidPrice &&
|
|
|
Number(this.price) > 0 &&
|
|
|
Number(this.price) <= this.productDetail.bidPrice
|
|
|
) {
|
|
|
this.$createDialog({
|
|
|
type: 'confirm',
|
|
|
title: `最高求购价${this.productDetail.bidPrice}`,
|
|
|
content: '已有求购高于您的出价,可直接变现',
|
|
|
confirmBtn: {
|
|
|
text: '我再想想',
|
|
|
active: true,
|
|
|
disabled: false
|
|
|
},
|
|
|
cancelBtn: {
|
|
|
text: '确定变现',
|
|
|
active: false,
|
|
|
disabled: false
|
|
|
},
|
|
|
onConfirm: () => {
|
|
|
|
|
|
},
|
|
|
onCancel: () => {
|
|
|
this.$store.commit(
|
|
|
'order/sellerAskOrder/SELLER_ASK_SET_PRODUCTINFO',
|
|
|
{
|
|
|
goodImg: this.productDetail.goodImg,
|
|
|
colorName: this.productDetail.colorName,
|
|
|
sizeName: this.productDetail.sizeName,
|
|
|
goodPrice: this.productDetail.bidPrice,
|
|
|
productId: this.productDetail.productId,
|
|
|
bid_moster_price: this.productDetail.bidPrice
|
|
|
}
|
|
|
);
|
|
|
|
|
|
// 跳转变现
|
|
|
this.$router.push({
|
|
|
name: 'sellAskOrder',
|
|
|
query: {
|
|
|
skup: this.productDetail.bidSkup,
|
|
|
price: this.productDetail.bidPrice
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}).show();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (this.productDetail.isSuggest) {
|
|
|
if (Number(this.price) > this.productDetail.suggestHighPrice) {
|
|
|
this.$createDialog({
|
|
|
type: "confirm",
|
|
|
content: "超出建议售价将被限制展示,建议下调至合理价格区间",
|
|
|
type: 'confirm',
|
|
|
content: '超出建议售价将被限制展示,建议下调至合理价格区间',
|
|
|
confirmBtn: {
|
|
|
text: "修改价格",
|
|
|
text: '修改价格',
|
|
|
active: true,
|
|
|
disabled: false
|
|
|
},
|
|
|
cancelBtn: {
|
|
|
text: "仍要上架",
|
|
|
text: '仍要上架',
|
|
|
active: false,
|
|
|
disabled: false
|
|
|
},
|
...
|
...
|
@@ -350,24 +356,30 @@ export default { |
|
|
this.$createToast({
|
|
|
time: 1500,
|
|
|
txt: orderResult.message,
|
|
|
type: "txt"
|
|
|
type: 'txt'
|
|
|
}).show();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.reportYas('XY_UFO_SALE_ORD', {
|
|
|
ORD_NUM: orderResult.code.orderCode,
|
|
|
PRD_ID: this.productDetail.productId,
|
|
|
PRD_SKU: this.productDetail.skup
|
|
|
});
|
|
|
|
|
|
// 从定金中走了钱,不用支付宝
|
|
|
if (orderResult.data.orderCode === 0) {
|
|
|
this.$createToast({
|
|
|
time: 1500,
|
|
|
txt: orderResult.message,
|
|
|
mask: true,
|
|
|
type: "txt"
|
|
|
type: 'txt'
|
|
|
}).show();
|
|
|
|
|
|
await this.delay(1500);
|
|
|
|
|
|
this.$router.replace({
|
|
|
name: "ProductDetail",
|
|
|
name: 'ProductDetail',
|
|
|
params: {
|
|
|
productId: this.productId
|
|
|
}
|
...
|
...
|
@@ -377,18 +389,19 @@ export default { |
|
|
|
|
|
this.$createOrderPayType({
|
|
|
price: parseFloat(`${this.fee.earnestMoney}`).toFixed(2),
|
|
|
desc: "保证金",
|
|
|
desc: '保证金',
|
|
|
orderCode: orderResult.data.orderCode,
|
|
|
extra: JSON.stringify({
|
|
|
type: UserType.sell,
|
|
|
reportType: 'sell',
|
|
|
back: {
|
|
|
name: "ProductDetail",
|
|
|
name: 'ProductDetail',
|
|
|
params: {
|
|
|
productId: this.productId
|
|
|
}
|
|
|
},
|
|
|
forward: {
|
|
|
name: "SellPayOk",
|
|
|
name: 'SellPayOk',
|
|
|
query: {
|
|
|
orderCode: orderResult.data.orderCode
|
|
|
}
|
...
|
...
|
@@ -401,7 +414,7 @@ export default { |
|
|
},
|
|
|
onClose(orderCode) {
|
|
|
this.$router.replace({
|
|
|
name: "sellOrderDetail",
|
|
|
name: 'sellOrderDetail',
|
|
|
params: {
|
|
|
owner: UserType.sell,
|
|
|
code: orderCode
|
...
|
...
|
@@ -409,8 +422,7 @@ export default { |
|
|
});
|
|
|
},
|
|
|
onNumChange({ count, type }) {
|
|
|
console.log(count, type, this.addNumError);
|
|
|
if (type === "add" && this.addNumError) {
|
|
|
if (type === 'add' && this.addNumError) {
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -424,11 +436,19 @@ export default { |
|
|
},
|
|
|
backAction() {
|
|
|
this.$router.replace({
|
|
|
name: "ProductDetail",
|
|
|
name: 'ProductDetail',
|
|
|
params: {
|
|
|
productId: this.productId
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
reportYas(name, params) {
|
|
|
this.$store.dispatch('reportYas', {
|
|
|
params: {
|
|
|
appop: name,
|
|
|
param: params
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
};
|
...
|
...
|
|