Authored by 陈峰

Merge branch 'feature/ufo-price' into 'master'

Feature/ufo price



See merge request !5
... ... @@ -10,8 +10,8 @@
</div>
<div class="modal-footer">
<slot name="footer">
<Button class="btn" type="button" @click="onCancel">{{cancelText}}</Button>
<Button class="btn" :class="{active: loading}" type="button" @click="onSure">{{sureText}}</Button>
<Button class="btn" type="button" @click="onCancel">{{cancelText}}</Button>
</slot>
</div>
</div>
... ...
... ... @@ -4,6 +4,7 @@
sure-text="调整售价"
cancel-text="取消"
:loading="postLoading"
class="modal"
:transfer="true"
@on-sure="onSure">
<div class="change-price-modal">
... ... @@ -109,7 +110,8 @@ export default {
storage_id: this.skc.storageId,
new_price: price,
old_price: this.skc.price,
num: this.skc.storageNum
num: this.skc.storageNum,
skupType: this.skc.isAdvance === 'Y' ? 4 : 1
});
if (result && result.code === 200) {
... ... @@ -211,4 +213,10 @@ export default {
text-align: center;
}
}
.modal {
/deep/ .modal-footer button:first-child {
color: inherit;
}
}
</style>
... ...
... ... @@ -2,6 +2,7 @@
<div class="product-item">
<div class="item-content" :style="itemStyle" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd">
<div class="tip" v-if="showTip">超出建议售价将被限制展示,建议下调至合理价格区间</div>
<i class="pre-sale" v-if="isPreSale"></i>
<div class="info">
<div class="left">
<span class="size ufo-font">{{value.goodsInfo.sizeName}}</span>
... ... @@ -45,6 +46,9 @@ export default {
showTip() {
return this.value.goodsInfo.price > this.value.goodsInfo.suggestMaxPrice;
},
isPreSale() {
return this.value.isAdvance === 'Y';
},
itemStyle() {
return {
transition: this.transition ? void 0 : 'none 0s ease 0s',
... ... @@ -67,10 +71,14 @@ export default {
},
methods: {
onNoSale() {
this.$emit('on-no-sale', this.value.goodsInfo);
this.$emit('on-no-sale', Object.assign({
isAdvance: this.value.isAdvance
}, this.value.goodsInfo));
},
onChgPrice() {
this.$emit('on-change-price', this.value.goodsInfo);
this.$emit('on-change-price', Object.assign({
isAdvance: this.value.isAdvance
}, this.value.goodsInfo));
},
onTouchStart(evt) {
const {clientX, clientY} = evt.touches[0];
... ... @@ -145,6 +153,16 @@ export default {
transition: transform 0.5s cubic-bezier(0.36, 0.66, 0.04, 1);
}
.pre-sale {
position: absolute;
top: 16px;
left: 10px;
width: 52px;
height: 24px;
background-image: url(~statics/image/order/pre-sale@3x.png);
background-size: cover;
}
.item-options {
position: absolute;
top: 0;
... ... @@ -180,6 +198,7 @@ export default {
width: 160px;
display: flex;
height: 56px;
margin-top: 10px;
align-items: flex-end;
.size {
... ...
... ... @@ -124,16 +124,16 @@ export default {
type: 'confirm',
content: '您确定不卖此商品吗?',
confirmBtn: {
text: '确定',
text: '取消',
active: true,
disabled: false,
},
cancelBtn: {
text: '取消',
text: '确定',
active: false,
disabled: false,
},
onConfirm: () => {
onCancel: () => {
this.onNoSaleSure({skc, num: 1});
},
}).show();
... ... @@ -159,7 +159,8 @@ export default {
storage_id: skc.storageId,
new_price: price,
old_price: skc.price,
num: skc.storageNum
num: skc.storageNum,
skupType: skc.isAdvance === 'Y' ? 4 : 1
});
if (result && result.code === 200) {
... ... @@ -181,7 +182,8 @@ export default {
product_id: this.productInfo.productId,
storage_id: skc.storageId,
old_price: skc.price,
num: num
num: num,
skupType: skc.isAdvance === 'Y' ? 4 : 1
});
if (result.code === 200) {
... ...