Authored by lea guo

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

... ... @@ -134,7 +134,7 @@ export default {
},
beforeRouteEnter (to, from, next) {
beforeRouteEnter(to, from, next) {
next(vm => {
// 通过 `vm` 访问组件实例
... ... @@ -161,12 +161,12 @@ export default {
this.showToast();
}
},
isShowDialog(val) {
if (val) {
this.showDialog();
}
},
// isShowDialog(val) {
// if (val) {
// this.showDialog();
// }
// },
addressInfo(val) {
... ... @@ -174,6 +174,10 @@ export default {
this.computePrice();
}
},
inputPrice(val) {
console.log(val);
}
},
... ... @@ -245,6 +249,7 @@ export default {
showDialog() {
this.BUYER_ASK_SET_SHOWDIALOG(false);
let that = this;
if (this.preTip) {
this.$createDialog({
... ... @@ -265,7 +270,7 @@ export default {
},
onConfirm: () => {
this.publishProduct();
that.publishProduct();
},
onCancel: () => {
... ... @@ -274,13 +279,16 @@ export default {
}).show();
} else {
this.publishProduct();
that.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})
.then(() => {
this.showDialog();
});
},
publishProduct() {
... ... @@ -291,7 +299,7 @@ export default {
computePrice() {
if (!this.inputPrice) {
console.log('inputPrice is null')
console.log('inputPrice is null');
return;
}
this.buyerCompute({price: this.inputPrice, storage_id: this.storageId, address_id: this.addressInfo.address_id || '' });
... ...
... ... @@ -27,7 +27,8 @@ export default {
},
data() {
return {
desc: '有货买家协议'
desc: '有货买家协议',
url: 'https://activity.yoho.cn/feature/3189.html?share_id=5853&title=ufo-%E4%B9%B0%E5%AE%B6%E5%8D%8F%E8%AE%AE'
};
},
computed: {
... ...
... ... @@ -31,6 +31,7 @@ export default {
<style lang="scss" scoped>
.product-wrapper {
height: 240px;
overflow: hidden;
}
.product-price {
... ...
... ... @@ -8,7 +8,7 @@
<AddressInfo :data="address" class="order-item"></AddressInfo>
</div>
<div class="footer">
<OrderAgree :value="agree" @input="changeAgree" class="agree-wrapper" :desc="agreeDesc"></OrderAgree>
<OrderAgree :value="agree" @input="changeAgree" class="agree-wrapper" :desc="agreeDesc" :url="url"></OrderAgree>
<div class="btn-wrapper">
<YohoButton :txt="txt" class="submit-btn" @click="onClick" :disable="!agree"></YohoButton>
</div>
... ... @@ -49,7 +49,8 @@ export default {
txt: '提交',
error: false,
num: 1,
agreeDesc: '有货卖家协议'
agreeDesc: '有货卖家协议',
url: 'https://activity.yoho.cn/feature/3187.html?share_id=5851&title=ufo-%E5%8D%96%E5%AE%B6%E5%8D%8F%E8%AE%AE'
};
},
mounted() {
... ...
... ... @@ -366,20 +366,24 @@ export default function() {
buyerPrePublish({commit, dispatch}, {price = 0, storage_id = 0, uid, address_id = ''} = {}) {
commit(BUYER_ASK_PREPUBLISH_REQUEST);
this.$api.get('/api/order/buyeraskprepublish', {
return this.$api.get('/api/order/buyeraskprepublish', {
price,
storage_id,
uid,
address_id,
}).then(result => {
if (result.code === 200) {
commit(BUYER_ASK_PREPUBLISH_SUCCESS, get(result, ['data', 'dialog'], null));
let payload = get(result, ['data', 'dialog'], null)
commit(BUYER_ASK_PREPUBLISH_SUCCESS, payload);
return payload;
} else {
commit(BUYER_ASK_PREPUBLISH_FAILURE, result.message);
return null;
}
}, error => {
console.log(error);
commit(BUYER_ASK_PREPUBLISH_FAILURE, TIP);
return null;
});
},
... ...
... ... @@ -55,6 +55,7 @@ export default function() {
computeTip: null,
addressInfo: null,
publishinfo: null,
toastMessage: '',
},
getter: {
... ...