Authored by Tao

modify news

<template><!--求购用调价对话框-->
<div class="dialog-wrapper" :class="[visible ? 'show' : '']">
<div class="change-bid-price-wrapper">
<div class="change-bid-price-container">
<p class="price-item">
<span>我的求购价:</span>
<span>¥{{ goodsInfo.goodPrice }}</span>
</p>
<p class="price-item">
<span>当前最高求购价:</span>
<span>¥{{ goodsInfo.bidHighestPrice }}</span>
</p>
<p v-if="goodsInfo.leastPrice" class="price-item">
<span>最低现货价:</span>
<span>¥{{ goodsInfo.leastPrice }}</span>
</p>
<InputUfo
type="number"
placeholder="定价需以9结尾 例如1999"
:maxlength="8"
:class="[errorTip ? 'ipt-number show-error' : 'ipt-number', 'ufo-font']"
v-model="chgPrice"
>
<span class="prepend" slot="prepend">¥</span>
</InputUfo>
<p class="error-tip">{{ errorTip }}</p>
<p
:class="
i === computePriceList.length - 1
? 'promotion-list-item last'
: 'promotion-list-item'
"
v-for="(priceInfo, i) in computePriceList"
:key="i"
>
<span>{{ priceInfo.promotion }}:</span>
<span>{{ priceInfo.promotionAmount }}</span>
</p>
<p class="tip">Tip: 调整求购价成功后,当前的求购将被关闭</p>
</div>
<div class="buttons-container">
<button class="btn-cancel" @click="closeAction">取消</button>
<button class="btn-confirm" @click="confirmAction">调整求购价</button>
</div>
</div>
</div>
</template>
<script>
import { createNamespacedHelpers } from 'vuex';
import InputUfo from './input-ufo';
import { debounce } from 'lodash';
const { mapActions } = createNamespacedHelpers('order/orderList');
export default {
name: 'change-bid-price-dialog',
components: { InputUfo },
props: {
computePriceInfo: {
type: Object,
default: () => ({})
},
goodsInfo: {
type: Object,
default: () => ({})
},
orderCode: {
type: Number,
default: 0
}
},
data() {
return {
visible: false,
chgPrice: '',
errorTip: '',
computePrice: null,
calced: false
};
},
computed: {
computePriceList() {
const priceInfo = this.computePrice || this.computePriceInfo;
return priceInfo.promotionFormulaList.filter(
({ promotion }) => promotion === "运费" || promotion === "实付金额"
);
}
},
mounted() {
// debounce防抖动,输入数字后延迟500毫秒提交
this.inputChange = debounce(this.onChange.bind(this), 500);
},
methods: {
...mapActions(["computeChangePrice"]),
async onChange(price) { // 预先算费
if (this.checkPrice(price)) {
const res = await this.computeChangePrice({
price,
orderCode: this.orderCode
});
if (typeof res === "string") {
this.errorTip = res;
this.calced = false;
} else {
this.computePrice = res;
this.calced = true;
}
}
},
show() {
this.clearData();
this.visible = true;
},
hide() {
this.visible = false;
},
checkPrice(price) {
let valid = false;
if (!price) {
this.errorTip = '没有价格';
return false;
} else if (!/^\d+$/.test(price)) {
this.errorTip = '价格只能为正整数';
} else if (!/9$/.test(price)) {
this.errorTip = '出售价格必须以9结尾';
} else if (+price === +this.goodsInfo.goodPrice) {
this.errorTip = '前后价格没有变化';
} else {
this.errorTip = '';
valid = true;
}
return valid;
},
closeAction() {
this.hide();
this.clearData();
this.$emit('closeAction');
},
confirmAction() {
if (this.calced) {
let price = this.chgPrice;
this.hide();
this.clearData();
this.$emit('confirmAction', price);
}
},
clearData() {
this.chgPrice = '';
this.errorTip = '',
this.computePrice = null;
this.calced = false;
}
},
watch: {
chgPrice(newVal) {
this.calced = false;
this.inputChange(newVal);
}
}
};
</script>
<style lang="scss" scoped>
.dialog-wrapper {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 99;
display: none;
align-items: center;
justify-content: center;
&.show {
display: flex;
}
}
.change-bid-price-wrapper {
position: absolute;
width: 600px;
background-color: #fff;
}
.change-bid-price-container {
background-color: #fff;
font-size: 12px;
color: #000;
padding: 60px 38px 0 38px;
letter-spacing: 0;
.price-item {
font-size: 24px;
line-height: 34px;
margin-bottom: 10px;
}
.ipt-number {
margin: 30px 0;
/deep/ .prepend {
width: 40px;
margin-left: 20px;
text-align: left;
}
&.show-error {
margin-bottom: 0;
}
}
.error-tip {
color: #d0021b;
margin-bottom: 10px;
}
.promotion-list-item {
display: flex;
justify-content: space-between;
align-items: center;
color: #999;
margin-bottom: 10px;
&.last {
color: #000;
}
}
.tip {
color: #999;
margin: 40px auto;
}
}
.buttons-container {
width: 100%;
height: 100px;
display: flex;
border-top: 1px solid #f0f0f0;
button {
width: 100%;
text-align: center;
line-height: 100px;
font-size: 32px;
}
}
</style>
... ...
import ChangeBidPriceDialog from './change-bid-price-dialog';
import createApi from 'utils/create-api';
ChangeBidPriceDialog.install = function(Vue) {
Vue.component(ChangeBidPriceDialog.name, ChangeBidPriceDialog);
createApi(
Vue,
ChangeBidPriceDialog,
['closeAction', 'confirmAction'],
true
);
};
export default ChangeBidPriceDialog;
... ...
<template>
<CubeInput v-bind="$attrs" v-bind:value="value" v-on="inputListeners" :maxlength="8" class="input-number">
<span slot="prepend">
<slot name="prepend"></slot>
</span>
<span slot="append">
<slot name="append"></slot>
</span>
</CubeInput>
</template>
<script>
import {Input} from 'cube-ui';
export default {
name: 'InputUfo',
props: ['value'],
computed: {
inputListeners() {
return Object.assign({},
this.$listeners,
{
input: (value) => {
this.$emit('input', value);
},
blur: () => {
this.$emit('blur', this.value);
}
}
);
}
},
methods: {
},
components: {CubeInput: Input}
};
</script>
<style lang="scss" scoped>
.input-number {
margin-bottom: 15px;
background-color: #f5f5f5;
border-radius: 10px;
font-size: 36px;
&:after {
border-radius: 20px;
border-color: #f5f5f5;
}
/deep/ .cube-input-field {
color: #000;
}
}
</style>
... ...
... ... @@ -38,10 +38,14 @@ export default {
if (!setTitle) {
return this.title;
}
if (this.title) {
setTitle(this.title);
this.$xianyu.setXianyuTitle({ title: this.title });
}
setTimeout(() => {
if (this.title) {
setTitle(this.title);
this.$xianyu.setXianyuTitle({ title: this.title });
}
}, 100);
this.setTitle = setTitle;
},
computed: {
... ...
... ... @@ -25,6 +25,7 @@ import xianyu from 'common/xianyu';
import OrderPayType from 'components/order-pay-type';
import OrderCouponList from 'components/order-coupon-list';
import OrderPromotionList from 'components/order-promotion-list';
import ChangeBidPriceDialog from 'components/change-bid-price-dialog';
import Bind from 'components/bind';
import ConfirmDialog from 'components/confirm-dialog';
import 'video.js/dist/video-js.css';
... ... @@ -71,6 +72,7 @@ Vue.use(OrderCouponList);
Vue.use(OrderPromotionList);
Vue.use(Bind);
Vue.use(ConfirmDialog);
Vue.use(ChangeBidPriceDialog);
initClient(store);
... ...
... ... @@ -68,7 +68,7 @@
checked="model.is_default"
v-model="model.is_default"
></Radio>
<div v-if="isUpdate && !isSeller" class="del-address" @click="delAddress">删除地址</div>
<div v-if="isUpdate && !isBuyerOrSeller" class="del-address" @click="delAddress">删除地址</div>
</div>
</div>
<div :class="submitClass" @touchend="onSubmit">确 认</div>
... ... @@ -116,7 +116,7 @@ export default {
},
isShowProvince: false,
isUpdate: false,
isSeller: false,
isBuyerOrSeller: false,
updateMobileNum: '',
isMobileNumEdit: false,
title: '',
... ... @@ -319,7 +319,7 @@ export default {
let addressInfo = this.updateAddressInfo;
//判断是否是出售订单,出售订单不显示“删除地址”
this.isSeller = this.$route.query.fromPage === 'OrderSellConfirm' ? true : false;
this.isBuyerOrSeller = this.$route.query.fromPage === 'OrderSellConfirm' || this.$route.query.fromPage === 'OrderBuyConfirm' ? true : false;
this.isUpdate = addressInfo.isUpdate;
this.orderCode = addressInfo.orderCode;
... ...
... ... @@ -56,9 +56,10 @@ export default {
beforeRouteEnter (to, from, next) {
// 从我的绑定支付宝后进入交易明细
next(vm => {
if(from.name === 'bindAccount') {
let isbind = vm.$store.state.home.bindAccount.validStatus === 1
if(isbind && from.name === 'bindAccount') {
vm.$router.push({name: 'tradeIncome'})
}
}
})
},
methods: {
... ...
<template>
<template functional>
<div class="income-detail-header">
<p class="total-income">收入明细</p>
<slot><div class="no-data">暂无收入明细</div></slot>
</div>
</template>
<script>
export default {
name: 'income-detail',
props: {
},
methods: {
},
};
</script>
<style lang="scss" scoped>
.income-detail-header {
margin-top: 15px;
... ...
<template>
<template functional>
<div class="assets-record-container">
<div class='assets-record-info-detail-view'>
<div class='assets-record-left-view'>
<div class='assets-record-middle-view'>
<span class='assets-record-code-txt'>{{data.productName}}<span class="size">(尺码:{{data.sizeName}})</span></span>
<span class='assets-record-time-txt'>{{data.time}}</span>
<span class='assets-record-code-txt'>{{props.data.productName}}<span class="size">(尺码:{{props.data.sizeName}})</span></span>
<span class='assets-record-time-txt'>{{props.data.time}}</span>
</div>
</div>
<div class='assets-record-right-view'>
<span class='assets-record-income-txt'>{{data.price}}</span>
<span class='assets-record-income-tip-txt'>{{data.normalFlag ? '' : '打款失败'}}</span>
<span class='assets-record-income-desc'>{{data.tradeTypeDesc}}</span>
<span class='assets-record-income-txt'>{{props.data.price}}</span>
<span class='assets-record-income-tip-txt'>{{props.data.normalFlag ? '' : '打款失败'}}</span>
<span class='assets-record-income-desc'>{{props.data.tradeTypeDesc}}</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'income-item',
props: {
data: {
type: Object,
default: {}
}
},
data() {
return {
};
},
};
</script>
<style lang="scss" scoped>
.assets-record-container {
display: flex;
... ...
... ... @@ -132,7 +132,7 @@ export default {
<style lang="scss" scoped>
.change-bid-price-wrapper {
font-size: 12px;
font-size: 12*2px;
color: #000;
padding: 0 38px;
letter-spacing: 0;
... ... @@ -165,4 +165,4 @@ export default {
margin-top: 40px;
}
}
</style>
\ No newline at end of file
</style>
... ...
... ... @@ -190,67 +190,39 @@ export default {
}).show();
return;
}
let that = this;
this.$createDialog(
{
type: 'prompt',
confirmBtn: { text: '调整求购价' },
cancelBtn: { active: true },
onConfirm: async () => {
if (!this.changePrice) {
return;
}
const { isOk, errMsg = '', bidData} = await this.confirmChangePrice({
price: this.changePrice,
orderCode,
});
this.$createChangeBidPriceDialog({
computePriceInfo,
goodsInfo,
orderCode,
onCloseAction() {
},
onConfirmAction: async(price) => {
const { isOk, errMsg = '' } = await that.confirmChangePrice({
price: price,
orderCode,
});
if (isOk) {
// 重新支付保证金
let forwardType = isDetail ? 'buyOrderDetail' : 'OrderList'
console.log('---------->', forwardType)
this.$createOrderPayType({
orderCode: bidData.orderCode,
price: parseFloat(bidData.depositAmount),
desc: '支付定金',
extra: JSON.stringify({
forward: {
name: forwardType,
params: this.$route.params,
},
}),
}).show();
// if (isDetail) {
// this.fetchOrderDetail(this.$route.params);
// } else {
// this.resetData();
// this.fetchData(this.$route.params);
// }
if (isOk) {
if (isDetail) {
that.$router.back();
// that.fetchOrderDetail(this.$route.params);
} else {
if (errMsg) {
this.$createToast({
type: 'alert',
txt: errMsg,
});
}
that.resetData();
that.fetchData(this.$route.params);
}
},
},
createElement => {
return [
createElement(DialogChangeBidPrice, {
props: {
computePriceInfo,
goodsInfo,
orderCode,
onChangePrice: v => (this.changePrice = v),
},
slot: 'content',
}),
];
},
).show();
} else {
if (errMsg) {
that.$createToast({
type: 'alert',
txt: errMsg,
});
}
}
}
}).show();
break;
}
default:
... ...
... ... @@ -7,7 +7,6 @@
:options="options"
:data="orderList"
class="order-list-scroll-wrap"
v-show="!isShowEmpty"
>
<ul class="list-wrapper">
<li v-for="(order, i) in orderList" :key="i">
... ... @@ -23,12 +22,13 @@
</div>
</li>
</ul>
<empty-list
class="empty-wrapper"
tip="这里什么都没有..."
v-show="isShowEmpty"
/>
</scroll>
<empty-list
class="empty-wrapper"
tip="这里什么都没有..."
v-show="isShowEmpty"
/>
</div>
</layout-app>
</template>
... ... @@ -71,7 +71,12 @@ export default {
options: function() {
return {
pullUpLoad: this.pullUpLoad,
pullDownRefresh: true
pullDownRefresh: this.isShowEmpty
? false
: {
txt: "更新成功"
},
bounce: this.isShowEmpty ? false : true
};
},
isFetchEntryOrder() {
... ... @@ -106,16 +111,13 @@ export default {
</script>
<style lang="scss" scoped>
.content-wrapper {
height: calc(100vh - 100px);
height: 100%;
overflow-x: hidden;
overflow-y: auto;
-webkit-box-orient: vertical;
.empty-wrapper {
margin: auto 0;
position: absolute;
top: 0;
bottom: 0;
margin: 20vh 0;
}
.footer-wrapper {
... ...
... ... @@ -8,7 +8,6 @@
:options="options"
:data="orderList"
class="order-list-scroll-wrap"
v-show="!isShowEmpty"
>
<ul class="list-wrapper">
<li v-for="order in orderList" :key="order.orderCode">
... ... @@ -39,14 +38,14 @@
</div>
</li>
</ul>
</scroll>
<empty-list
@touch.prevent
class="empty-wrapper"
tip="这里什么都没有..."
v-show="isShowEmpty"
/>
<empty-list
@touch.prevent
class="empty-wrapper"
tip="这里什么都没有..."
v-show="isShowEmpty"
/>
</scroll>
</div>
</layout-app>
</template>
... ... @@ -99,6 +98,7 @@ export default {
options: function() {
return {
pullUpLoad: this.pullUpLoad,
bounce: this.isShowEmpty ? false : true,
pullDownRefresh: this.isShowEmpty
? false
: {
... ... @@ -154,10 +154,7 @@ export default {
}
.empty-wrapper {
margin: auto 0;
position: absolute;
top: 0;
bottom: 0;
margin: 20vh 0;
}
.order-list-scroll-wrap {
... ...
... ... @@ -286,13 +286,7 @@ export default {
onSizeSelectSheetHidden() {
this.showSizeSelectSheet = false;
},
async buy() {
const userInfo = await this.auth();
if (!userInfo) {
return;
}
buy() {
this.resetSelectedSize();
this.selectSizeConfig = {
dest: 'OrderBuyConfirm',
... ...
... ... @@ -165,6 +165,7 @@ export default function() {
orderCode: `${orderCode}`,
price: +price,
});
console.log(res);
if (res.code === 200) {
return { errMsg: '', isOk: true , bidData: res.data};
... ...
{
"name": "xianyu-ufo-app-web",
"version": "0.0.2-beta-26",
"version": "0.0.2-beta-27",
"private": true,
"description": "Xianyu Project With Express",
"repository": {
... ...