Authored by lea guo

Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop

... ... @@ -62,6 +62,7 @@ export default {
hiddenIcon: true,
agreeDesc: '有货卖家协议',
url: `http://m.yohobuy.com/activity/student/detail/renzhen?openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"url\":\"https://activity.yoho.cn/feature/3187.html?title=卖家协议\"}}`,
isEntry: false,
};
},
... ... @@ -83,6 +84,14 @@ export default {
},
mounted() {
this.isEntry = false
this.fetchSellerEntryStatus({})
.then((res)=> {
console.log(res)
if (res) {
this.isEntry = get(res, 'entrySellerType', 0) !== 0
}
})
this.fetchSellerOrderCount({tabType: 'sell'});// 19268
this.sellerCompute({price: this.price, skup: this.skup});
... ... @@ -105,13 +114,51 @@ export default {
'fetchSellerOrderCount',
'sellerCompute',
'sellerPublish',
'fetchSellerEntryStatus',
]),
submitClick() {
this.sellerPublish({price: this.price, skup: this.skup, address_id: this.addressInfo.address_id})
.then(() => {
this.payOrder();
});
if (this.isEntry) {
this.$createDialog({
type: 'confirm',
title: '',
content: `确定以${this.price}出售此商品`,
confirmBtn: {
text: '确定出售',
active: true,
disabled: false,
href: 'javascript:;',
},
cancelBtn: {
text: '我再想想',
active: false,
disabled: false,
href: 'javascript:;'
},
onConfirm: () => {
this.sellerPublish({price: this.price, skup: this.skup, address_id: this.addressInfo.address_id})
.then(() => {
this.$createToast({
time: 1000,
type: 'txt',
txt: '出售成功'
}).show();
this.$router.go(-1);
});
},
onCancel: () => {
this.computePrice();
}
}).show();
} else {
this.sellerPublish({price: this.price, skup: this.skup, address_id: this.addressInfo.address_id})
.then(() => {
this.payOrder();
});
}
},
payOrder() {
... ...
... ... @@ -189,8 +189,6 @@ export default {
this.$yoho.auth()
.then(() => {
console.log(this.selectedSize);
this.$store.commit('order/sellerAskOrder/SELLER_ASK_SET_PRODUCTINFO', {
goodImg: get(this.product, 'goods_list[0].image_list[0].image_url', ''),
colorName: get(this.product, 'goods_list[0].color_name', ''),
... ...
... ... @@ -67,7 +67,7 @@ export default function() {
mutations: {
[SELLER_ASK_SET_IS_SHOWTOAST](state, payload) {
state.isShowTip = payload
state.isShowTip = payload;
},
[SELLER_ASK_SET_PRODUCTINFO](state, payload) {
... ... @@ -124,6 +124,20 @@ export default function() {
actions: {
fetchSellerEntryStatus({commit}, {} = {}) {
return this.$api.get('/api/ufo/sellerOrder/entryStatus')
.then(result => {
if (result.code === 200) {
return result.data;
} else {
return null;
}
}, error => {
return null;
});
},
fetchSellerOrderCount({commit, dispatch}, {tabType = 'sell', uid} = {}) {
this.$api.get('/api/order/ordercount', {
tabType,
... ...